Class: Google::Apis::ContentV2_1::DeliveryArea

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
lib/google/apis/content_v2_1/classes.rb,
lib/google/apis/content_v2_1/representations.rb,
lib/google/apis/content_v2_1/representations.rb

Overview

A delivery area for the product. Only one of countryCode or postalCodeRange must be set.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ DeliveryArea

Returns a new instance of DeliveryArea.



4515
4516
4517
# File 'lib/google/apis/content_v2_1/classes.rb', line 4515

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#country_codeString

Required. The country that the product can be delivered to. Submit a unicode CLDR region such as US or CH. Corresponds to the JSON property countryCode

Returns:

  • (String)


4498
4499
4500
# File 'lib/google/apis/content_v2_1/classes.rb', line 4498

def country_code
  @country_code
end

#postal_code_rangeGoogle::Apis::ContentV2_1::DeliveryAreaPostalCodeRange

A range of postal codes that defines the delivery area. Only set firstPostalCode when specifying a single postal code. Corresponds to the JSON property postalCodeRange



4504
4505
4506
# File 'lib/google/apis/content_v2_1/classes.rb', line 4504

def postal_code_range
  @postal_code_range
end

#region_codeString

A state, territory, or prefecture. This is supported for the United States, Australia, and Japan. Provide a subdivision code from the ISO 3166-2 code tables (US, AU, or JP) without country prefix (for example, "NY", "NSW", "03"). Corresponds to the JSON property regionCode

Returns:

  • (String)


4513
4514
4515
# File 'lib/google/apis/content_v2_1/classes.rb', line 4513

def region_code
  @region_code
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



4520
4521
4522
4523
4524
# File 'lib/google/apis/content_v2_1/classes.rb', line 4520

def update!(**args)
  @country_code = args[:country_code] if args.key?(:country_code)
  @postal_code_range = args[:postal_code_range] if args.key?(:postal_code_range)
  @region_code = args[:region_code] if args.key?(:region_code)
end