class ShopifyAPI::CustomerAddress

Attributes

address1[R]
address2[R]
city[R]
company[R]
country[R]
country_code[R]
country_name[R]
customer_id[R]
first_name[R]
id[R]
last_name[R]
name[R]
phone[R]
province[R]
province_code[R]
zip[R]

Public Class Methods

all( customer_id: nil, session: ShopifyAPI::Context.active_session, **kwargs ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/customer_address.rb, line 152
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 ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/customer_address.rb, line 131
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 ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/customer_address.rb, line 111
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() click to toggle source
# File lib/shopify_api/rest/resources/2022_04/customer_address.rb, line 90
def json_body_name()
  "address"
end
json_response_body_names() click to toggle source
# File lib/shopify_api/rest/resources/2022_04/customer_address.rb, line 97
def json_response_body_names()
  [
    "customer_address",
    "address"
  ]
end
new(session: ShopifyAPI::Context.active_session, from_hash: nil) click to toggle source
Calls superclass method ShopifyAPI::Rest::Base::new
# File lib/shopify_api/rest/resources/2022_04/customer_address.rb, line 19
def initialize(session: ShopifyAPI::Context.active_session, from_hash: nil)

  @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))

  super(session: session, from_hash: from_hash)
end

Public Instance Methods

default( body: nil, **kwargs ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/customer_address.rb, line 174
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 ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/customer_address.rb, line 197
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