Class: ShopifyAPI::Redirect
- Inherits:
-
ShopifyAPI::Rest::Base
- Object
- ShopifyAPI::Rest::Base
- ShopifyAPI::Redirect
- Extended by:
- T::Sig
- Defined in:
- lib/shopify_api/rest/resources/2022_04/redirect.rb,
lib/shopify_api/rest/resources/2022_07/redirect.rb,
lib/shopify_api/rest/resources/2022_10/redirect.rb,
lib/shopify_api/rest/resources/2023_01/redirect.rb,
lib/shopify_api/rest/resources/2023_04/redirect.rb,
lib/shopify_api/rest/resources/2023_07/redirect.rb,
lib/shopify_api/rest/resources/2023_10/redirect.rb,
lib/shopify_api/rest/resources/2024_01/redirect.rb,
lib/shopify_api/rest/resources/2024_04/redirect.rb,
lib/shopify_api/rest/resources/2024_07/redirect.rb,
lib/shopify_api/rest/resources/2024_10/redirect.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Attributes inherited from ShopifyAPI::Rest::Base
Class Method Summary collapse
- .all(limit: nil, since_id: nil, path: nil, target: nil, fields: nil, session: ShopifyAPI::Context.active_session, **kwargs) ⇒ Object
- .count(path: nil, target: nil, session: ShopifyAPI::Context.active_session, **kwargs) ⇒ Object
- .delete(id:, session: ShopifyAPI::Context.active_session) ⇒ Object
- .find(id:, fields: nil, session: ShopifyAPI::Context.active_session) ⇒ Object
Instance Method Summary collapse
-
#initialize(session: ShopifyAPI::Context.active_session, from_hash: nil) ⇒ Redirect
constructor
A new instance of Redirect.
Methods inherited from ShopifyAPI::Rest::Base
api_call_limit, base_find, class_name, create_instance, create_instances_from_response, #delete, get_path, get_path_ids, has_many?, has_one?, inherited, json_body_name, json_response_body_names, #method_missing, next_page?, next_page_info, prev_page?, prev_page_info, primary_key, read_only_attributes, request, #respond_to_missing?, retry_request_after, #save, #save!, #to_hash
Constructor Details
#initialize(session: ShopifyAPI::Context.active_session, from_hash: nil) ⇒ Redirect
Returns a new instance of Redirect.
19 20 21 22 23 24 25 26 |
# File 'lib/shopify_api/rest/resources/2022_04/redirect.rb', line 19 def initialize(session: ShopifyAPI::Context.active_session, from_hash: nil) @id = T.let(nil, T.nilable(Integer)) @path = T.let(nil, T.nilable(String)) @target = T.let(nil, T.nilable(String)) super(session: session, from_hash: from_hash) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ShopifyAPI::Rest::Base
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
40 41 42 |
# File 'lib/shopify_api/rest/resources/2022_04/redirect.rb', line 40 def id @id end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
42 43 44 |
# File 'lib/shopify_api/rest/resources/2022_04/redirect.rb', line 42 def path @path end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
44 45 46 |
# File 'lib/shopify_api/rest/resources/2022_04/redirect.rb', line 44 def target @target end |
Class Method Details
.all(limit: nil, since_id: nil, path: nil, target: nil, fields: nil, session: ShopifyAPI::Context.active_session, **kwargs) ⇒ Object
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/shopify_api/rest/resources/2022_04/redirect.rb', line 97 def all( limit: nil, since_id: nil, path: nil, target: nil, fields: nil, session: ShopifyAPI::Context.active_session, **kwargs ) response = base_find( session: session, ids: {}, params: {limit: limit, since_id: since_id, path: path, target: target, fields: fields}.merge(kwargs).compact, ) T.cast(response, T::Array[Redirect]) end |
.count(path: nil, target: nil, session: ShopifyAPI::Context.active_session, **kwargs) ⇒ Object
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/shopify_api/rest/resources/2022_04/redirect.rb', line 123 def count( path: nil, target: nil, session: ShopifyAPI::Context.active_session, **kwargs ) request( http_method: :get, operation: :count, session: session, ids: {}, params: {path: path, target: target}.merge(kwargs).compact, body: {}, entity: nil, ) end |
.delete(id:, session: ShopifyAPI::Context.active_session) ⇒ Object
73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/shopify_api/rest/resources/2022_04/redirect.rb', line 73 def delete( id:, session: ShopifyAPI::Context.active_session ) request( http_method: :delete, operation: :delete, session: session, ids: {id: id}, params: {}, ) end |
.find(id:, fields: nil, session: ShopifyAPI::Context.active_session) ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/shopify_api/rest/resources/2022_04/redirect.rb', line 54 def find( id:, fields: nil, session: ShopifyAPI::Context.active_session ) result = base_find( session: session, ids: {id: id}, params: {fields: fields}, ) T.cast(result[0], T.nilable(Redirect)) end |