Class: ShopifyAPI::ShippingZone

Inherits:
Rest::Base show all
Extended by:
T::Sig
Defined in:
lib/shopify_api/rest/resources/2022_04/shipping_zone.rb,
lib/shopify_api/rest/resources/2022_07/shipping_zone.rb,
lib/shopify_api/rest/resources/2022_10/shipping_zone.rb,
lib/shopify_api/rest/resources/2023_01/shipping_zone.rb,
lib/shopify_api/rest/resources/2023_04/shipping_zone.rb,
lib/shopify_api/rest/resources/2023_07/shipping_zone.rb

Instance Attribute Summary collapse

Attributes inherited from Rest::Base

#errors, #original_state

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Rest::Base

base_find, class_name, create_instance, create_instances_from_response, #delete, get_path, has_many?, has_one?, 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?, #save, #save!, #to_hash

Constructor Details

#initialize(session: ShopifyAPI::Context.active_session) ⇒ ShippingZone

Returns a new instance of ShippingZone.



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/shopify_api/rest/resources/2022_04/shipping_zone.rb', line 16

def initialize(session: ShopifyAPI::Context.active_session)
  super(session: session)

  @carrier_shipping_rate_providers = T.let(nil, T.untyped)
  @countries = T.let(nil, T.nilable(T::Array[T.untyped]))
  @id = T.let(nil, T.nilable(Integer))
  @location_group_id = T.let(nil, T.nilable(String))
  @name = T.let(nil, T.nilable(String))
  @price_based_shipping_rates = T.let(nil, T.nilable(T::Array[T.untyped]))
  @profile_id = T.let(nil, T.nilable(String))
  @provinces = T.let(nil, T.nilable(T::Array[T.untyped]))
  @weight_based_shipping_rates = T.let(nil, T.nilable(T::Array[T.untyped]))
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ShopifyAPI::Rest::Base

Instance Attribute Details

#carrier_shipping_rate_providersObject (readonly)

Returns the value of attribute carrier_shipping_rate_providers.



40
41
42
# File 'lib/shopify_api/rest/resources/2022_04/shipping_zone.rb', line 40

def carrier_shipping_rate_providers
  @carrier_shipping_rate_providers
end

#countriesObject (readonly)

Returns the value of attribute countries.



42
43
44
# File 'lib/shopify_api/rest/resources/2022_04/shipping_zone.rb', line 42

def countries
  @countries
end

#idObject (readonly)

Returns the value of attribute id.



44
45
46
# File 'lib/shopify_api/rest/resources/2022_04/shipping_zone.rb', line 44

def id
  @id
end

#location_group_idObject (readonly)

Returns the value of attribute location_group_id.



46
47
48
# File 'lib/shopify_api/rest/resources/2022_04/shipping_zone.rb', line 46

def location_group_id
  @location_group_id
end

#nameObject (readonly)

Returns the value of attribute name.



48
49
50
# File 'lib/shopify_api/rest/resources/2022_04/shipping_zone.rb', line 48

def name
  @name
end

#price_based_shipping_ratesObject (readonly)

Returns the value of attribute price_based_shipping_rates.



50
51
52
# File 'lib/shopify_api/rest/resources/2022_04/shipping_zone.rb', line 50

def price_based_shipping_rates
  @price_based_shipping_rates
end

#profile_idObject (readonly)

Returns the value of attribute profile_id.



52
53
54
# File 'lib/shopify_api/rest/resources/2022_04/shipping_zone.rb', line 52

def profile_id
  @profile_id
end

#provincesObject (readonly)

Returns the value of attribute provinces.



54
55
56
# File 'lib/shopify_api/rest/resources/2022_04/shipping_zone.rb', line 54

def provinces
  @provinces
end

#weight_based_shipping_ratesObject (readonly)

Returns the value of attribute weight_based_shipping_rates.



56
57
58
# File 'lib/shopify_api/rest/resources/2022_04/shipping_zone.rb', line 56

def weight_based_shipping_rates
  @weight_based_shipping_rates
end

Class Method Details

.all(fields: nil, session: ShopifyAPI::Context.active_session, **kwargs) ⇒ Object



66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/shopify_api/rest/resources/2022_04/shipping_zone.rb', line 66

def all(
  fields: nil,
  session: ShopifyAPI::Context.active_session,
  **kwargs
)
  response = base_find(
    session: session,
    ids: {},
    params: {fields: fields}.merge(kwargs).compact,
  )

  T.cast(response, T::Array[ShippingZone])
end