Class: ShopifyAPI::CustomerAddress
- Inherits:
-
Rest::Base
- Object
- Rest::Base
- ShopifyAPI::CustomerAddress
- Extended by:
- T::Sig
- Defined in:
- lib/shopify_api/rest/resources/2022_04/customer_address.rb,
lib/shopify_api/rest/resources/2022_07/customer_address.rb,
lib/shopify_api/rest/resources/2022_10/customer_address.rb,
lib/shopify_api/rest/resources/2023_01/customer_address.rb,
lib/shopify_api/rest/resources/2023_04/customer_address.rb,
lib/shopify_api/rest/resources/2023_07/customer_address.rb
Instance Attribute Summary collapse
-
#address1 ⇒ Object
readonly
Returns the value of attribute address1.
-
#address2 ⇒ Object
readonly
Returns the value of attribute address2.
-
#city ⇒ Object
readonly
Returns the value of attribute city.
-
#company ⇒ Object
readonly
Returns the value of attribute company.
-
#country ⇒ Object
readonly
Returns the value of attribute country.
-
#country_code ⇒ Object
readonly
Returns the value of attribute country_code.
-
#country_name ⇒ Object
readonly
Returns the value of attribute country_name.
-
#customer_id ⇒ Object
readonly
Returns the value of attribute customer_id.
-
#first_name ⇒ Object
readonly
Returns the value of attribute first_name.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#last_name ⇒ Object
readonly
Returns the value of attribute last_name.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#phone ⇒ Object
readonly
Returns the value of attribute phone.
-
#province ⇒ Object
readonly
Returns the value of attribute province.
-
#province_code ⇒ Object
readonly
Returns the value of attribute province_code.
-
#zip ⇒ Object
readonly
Returns the value of attribute zip.
Attributes inherited from Rest::Base
Class Method Summary collapse
- .all(customer_id: nil, session: ShopifyAPI::Context.active_session, **kwargs) ⇒ Object
- .delete(id:, customer_id: nil, session: ShopifyAPI::Context.active_session) ⇒ Object
- .find(id:, customer_id: nil, session: ShopifyAPI::Context.active_session) ⇒ Object
- .json_body_name ⇒ Object
- .json_response_body_names ⇒ Object
Instance Method Summary collapse
- #default(body: nil, **kwargs) ⇒ Object
-
#initialize(session: ShopifyAPI::Context.active_session) ⇒ CustomerAddress
constructor
A new instance of CustomerAddress.
- #set(address_ids: nil, operation: nil, body: nil, **kwargs) ⇒ Object
Methods inherited from Rest::Base
base_find, class_name, create_instance, create_instances_from_response, #delete, get_path, has_many?, has_one?, #method_missing, next_page?, next_page_info, prev_page?, prev_page_info, primary_key, read_only_attributes, request, #respond_to_missing?, #save, #save!, #to_hash
Constructor Details
#initialize(session: ShopifyAPI::Context.active_session) ⇒ CustomerAddress
Returns a new instance of CustomerAddress.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/shopify_api/rest/resources/2022_04/customer_address.rb', line 16 def initialize(session: ShopifyAPI::Context.active_session) super(session: session) @address1 = T.let(nil, T.nilable(String)) @address2 = T.let(nil, T.nilable(String)) @city = T.let(nil, T.nilable(String)) @company = T.let(nil, T.nilable(String)) @country = T.let(nil, T.nilable(String)) @country_code = T.let(nil, T.nilable(String)) @country_name = T.let(nil, T.nilable(String)) @customer_id = T.let(nil, T.nilable(Integer)) @first_name = T.let(nil, T.nilable(String)) @id = T.let(nil, T.nilable(Integer)) @last_name = T.let(nil, T.nilable(String)) @name = T.let(nil, T.nilable(String)) @phone = T.let(nil, T.nilable(String)) @province = T.let(nil, T.nilable(String)) @province_code = T.let(nil, T.nilable(String)) @zip = T.let(nil, T.nilable(String)) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ShopifyAPI::Rest::Base
Instance Attribute Details
#address1 ⇒ Object (readonly)
Returns the value of attribute address1.
50 51 52 |
# File 'lib/shopify_api/rest/resources/2022_04/customer_address.rb', line 50 def address1 @address1 end |
#address2 ⇒ Object (readonly)
Returns the value of attribute address2.
52 53 54 |
# File 'lib/shopify_api/rest/resources/2022_04/customer_address.rb', line 52 def address2 @address2 end |
#city ⇒ Object (readonly)
Returns the value of attribute city.
54 55 56 |
# File 'lib/shopify_api/rest/resources/2022_04/customer_address.rb', line 54 def city @city end |
#company ⇒ Object (readonly)
Returns the value of attribute company.
56 57 58 |
# File 'lib/shopify_api/rest/resources/2022_04/customer_address.rb', line 56 def company @company end |
#country ⇒ Object (readonly)
Returns the value of attribute country.
58 59 60 |
# File 'lib/shopify_api/rest/resources/2022_04/customer_address.rb', line 58 def country @country end |
#country_code ⇒ Object (readonly)
Returns the value of attribute country_code.
60 61 62 |
# File 'lib/shopify_api/rest/resources/2022_04/customer_address.rb', line 60 def country_code @country_code end |
#country_name ⇒ Object (readonly)
Returns the value of attribute country_name.
62 63 64 |
# File 'lib/shopify_api/rest/resources/2022_04/customer_address.rb', line 62 def country_name @country_name end |
#customer_id ⇒ Object (readonly)
Returns the value of attribute customer_id.
64 65 66 |
# File 'lib/shopify_api/rest/resources/2022_04/customer_address.rb', line 64 def customer_id @customer_id end |
#first_name ⇒ Object (readonly)
Returns the value of attribute first_name.
66 67 68 |
# File 'lib/shopify_api/rest/resources/2022_04/customer_address.rb', line 66 def first_name @first_name end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
68 69 70 |
# File 'lib/shopify_api/rest/resources/2022_04/customer_address.rb', line 68 def id @id end |
#last_name ⇒ Object (readonly)
Returns the value of attribute last_name.
70 71 72 |
# File 'lib/shopify_api/rest/resources/2022_04/customer_address.rb', line 70 def last_name @last_name end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
72 73 74 |
# File 'lib/shopify_api/rest/resources/2022_04/customer_address.rb', line 72 def name @name end |
#phone ⇒ Object (readonly)
Returns the value of attribute phone.
74 75 76 |
# File 'lib/shopify_api/rest/resources/2022_04/customer_address.rb', line 74 def phone @phone end |
#province ⇒ Object (readonly)
Returns the value of attribute province.
76 77 78 |
# File 'lib/shopify_api/rest/resources/2022_04/customer_address.rb', line 76 def province @province end |
#province_code ⇒ Object (readonly)
Returns the value of attribute province_code.
78 79 80 |
# File 'lib/shopify_api/rest/resources/2022_04/customer_address.rb', line 78 def province_code @province_code end |
#zip ⇒ Object (readonly)
Returns the value of attribute zip.
80 81 82 |
# File 'lib/shopify_api/rest/resources/2022_04/customer_address.rb', line 80 def zip @zip end |
Class Method Details
.all(customer_id: nil, session: ShopifyAPI::Context.active_session, **kwargs) ⇒ Object
138 139 140 141 142 143 144 145 146 147 148 149 150 |
# File 'lib/shopify_api/rest/resources/2022_04/customer_address.rb', line 138 def all( customer_id: nil, session: ShopifyAPI::Context.active_session, **kwargs ) response = base_find( session: session, ids: {customer_id: customer_id}, params: {}.merge(kwargs).compact, ) T.cast(response, T::Array[CustomerAddress]) end |
.delete(id:, customer_id: nil, session: ShopifyAPI::Context.active_session) ⇒ Object
117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/shopify_api/rest/resources/2022_04/customer_address.rb', line 117 def delete( id:, customer_id: nil, session: ShopifyAPI::Context.active_session ) request( http_method: :delete, operation: :delete, session: session, ids: {id: id, customer_id: customer_id}, params: {}, ) end |
.find(id:, customer_id: nil, session: ShopifyAPI::Context.active_session) ⇒ Object
97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/shopify_api/rest/resources/2022_04/customer_address.rb', line 97 def find( id:, customer_id: nil, session: ShopifyAPI::Context.active_session ) result = base_find( session: session, ids: {id: id, customer_id: customer_id}, params: {}, ) T.cast(result[0], T.nilable(CustomerAddress)) end |
.json_body_name ⇒ Object
86 87 88 |
# File 'lib/shopify_api/rest/resources/2022_04/customer_address.rb', line 86 def json_body_name() "address" end |
.json_response_body_names ⇒ Object
93 94 95 96 97 98 |
# File 'lib/shopify_api/rest/resources/2022_10/customer_address.rb', line 93 def json_response_body_names() [ "customer_address", "address" ] end |
Instance Method Details
#default(body: nil, **kwargs) ⇒ Object
160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
# File 'lib/shopify_api/rest/resources/2022_04/customer_address.rb', line 160 def default( body: nil, **kwargs ) self.class.request( http_method: :put, operation: :default, session: @session, ids: {id: @id, customer_id: @customer_id}, params: {}.merge(kwargs).compact, body: body, entity: self, ) end |
#set(address_ids: nil, operation: nil, body: nil, **kwargs) ⇒ Object
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 |
# File 'lib/shopify_api/rest/resources/2022_04/customer_address.rb', line 183 def set( address_ids: nil, operation: nil, body: nil, **kwargs ) self.class.request( http_method: :put, operation: :set, session: @session, ids: {customer_id: @customer_id}, params: {address_ids: address_ids, operation: operation}.merge(kwargs).compact, body: body, entity: self, ) end |