Class: Google::Apis::WalletobjectsV1::LoyaltyObject

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ LoyaltyObject

Returns a new instance of LoyaltyObject.



5430
5431
5432
# File 'lib/google/apis/walletobjects_v1/classes.rb', line 5430

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

Instance Attribute Details

#account_idString

The loyalty account identifier. Recommended maximum length is 20 characters. Corresponds to the JSON property accountId

Returns:

  • (String)


5217
5218
5219
# File 'lib/google/apis/walletobjects_v1/classes.rb', line 5217

def 
  @account_id
end

#account_nameString

The loyalty account holder name, such as "John Smith." Recommended maximum length is 20 characters to ensure full string is displayed on smaller screens. Corresponds to the JSON property accountName

Returns:

  • (String)


5223
5224
5225
# File 'lib/google/apis/walletobjects_v1/classes.rb', line 5223

def 
  @account_name
end

Optional app or website link that will be displayed as a button on the front of the pass. If AppLinkData is provided for the corresponding class only object AppLinkData will be displayed. Corresponds to the JSON property appLinkData



5230
5231
5232
# File 'lib/google/apis/walletobjects_v1/classes.rb', line 5230

def app_link_data
  @app_link_data
end

#barcodeGoogle::Apis::WalletobjectsV1::Barcode

The barcode type and value. Corresponds to the JSON property barcode



5235
5236
5237
# File 'lib/google/apis/walletobjects_v1/classes.rb', line 5235

def barcode
  @barcode
end

#class_idString

Required. The class associated with this object. The class must be of the same type as this object, must already exist, and must be approved. Class IDs should follow the format issuer ID.identifier where the former is issued by Google and latter is chosen by you. Corresponds to the JSON property classId

Returns:

  • (String)


5243
5244
5245
# File 'lib/google/apis/walletobjects_v1/classes.rb', line 5243

def class_id
  @class_id
end

#class_referenceGoogle::Apis::WalletobjectsV1::LoyaltyClass

A copy of the inherited fields of the parent class. These fields are retrieved during a GET. Corresponds to the JSON property classReference



5249
5250
5251
# File 'lib/google/apis/walletobjects_v1/classes.rb', line 5249

def class_reference
  @class_reference
end

#disable_expiration_notificationBoolean Also known as: disable_expiration_notification?

Indicates if notifications should explicitly be suppressed. If this field is set to true, regardless of the messages field, expiration notifications to the user will be suppressed. By default, this field is set to false. Currently, this can only be set for offers. Corresponds to the JSON property disableExpirationNotification

Returns:

  • (Boolean)


5257
5258
5259
# File 'lib/google/apis/walletobjects_v1/classes.rb', line 5257

def disable_expiration_notification
  @disable_expiration_notification
end

#grouping_infoGoogle::Apis::WalletobjectsV1::GroupingInfo

Information that controls how passes are grouped together. Corresponds to the JSON property groupingInfo



5263
5264
5265
# File 'lib/google/apis/walletobjects_v1/classes.rb', line 5263

def grouping_info
  @grouping_info
end

#has_linked_deviceBoolean Also known as: has_linked_device?

Whether this object is currently linked to a single device. This field is set by the platform when a user saves the object, linking it to their device. Intended for use by select partners. Contact support for additional information. Corresponds to the JSON property hasLinkedDevice

Returns:

  • (Boolean)


5271
5272
5273
# File 'lib/google/apis/walletobjects_v1/classes.rb', line 5271

def has_linked_device
  @has_linked_device
end

#has_usersBoolean Also known as: has_users?

Indicates if the object has users. This field is set by the platform. Corresponds to the JSON property hasUsers

Returns:

  • (Boolean)


5277
5278
5279
# File 'lib/google/apis/walletobjects_v1/classes.rb', line 5277

def has_users
  @has_users
end

#hero_imageGoogle::Apis::WalletobjectsV1::Image

Wrapping type for Google hosted images. Next ID: 7 Corresponds to the JSON property heroImage



5283
5284
5285
# File 'lib/google/apis/walletobjects_v1/classes.rb', line 5283

def hero_image
  @hero_image
end

#idString

Required. The unique identifier for an object. This ID must be unique across all objects from an issuer. This value should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. The unique identifier should only include alphanumeric characters, '.', '_', or '-'. Corresponds to the JSON property id

Returns:

  • (String)


5292
5293
5294
# File 'lib/google/apis/walletobjects_v1/classes.rb', line 5292

def id
  @id
end

#image_modules_dataArray<Google::Apis::WalletobjectsV1::ImageModuleData>

Image module data. The maximum number of these fields displayed is 1 from object level and 1 for class object level. Corresponds to the JSON property imageModulesData



5298
5299
5300
# File 'lib/google/apis/walletobjects_v1/classes.rb', line 5298

def image_modules_data
  @image_modules_data
end

#info_module_dataGoogle::Apis::WalletobjectsV1::InfoModuleData

Deprecated. Use textModulesData instead. Corresponds to the JSON property infoModuleData



5303
5304
5305
# File 'lib/google/apis/walletobjects_v1/classes.rb', line 5303

def info_module_data
  @info_module_data
end

#kindString

Identifies what kind of resource this is. Value: the fixed string " walletobjects#loyaltyObject". Corresponds to the JSON property kind

Returns:

  • (String)


5309
5310
5311
# File 'lib/google/apis/walletobjects_v1/classes.rb', line 5309

def kind
  @kind
end

#linked_object_idsArray<String>

linked_object_ids are a list of other objects such as event ticket, loyalty, offer, generic, giftcard, transit and boarding pass that should be automatically attached to this loyalty object. If a user had saved this loyalty card, then these linked_object_ids would be automatically pushed to the user's wallet (unless they turned off the setting to receive such linked passes). Make sure that objects present in linked_object_ids are already inserted - if not, calls would fail. Once linked, the linked objects cannot be unlinked. You cannot link objects belonging to another issuer. There is a limit to the number of objects that can be linked to a single object. After the limit is reached, new linked objects in the call will be ignored silently. Object IDs should follow the format issuer ID. identifier where the former is issued by Google and the latter is chosen by you. Corresponds to the JSON property linkedObjectIds

Returns:

  • (Array<String>)


5325
5326
5327
# File 'lib/google/apis/walletobjects_v1/classes.rb', line 5325

def linked_object_ids
  @linked_object_ids
end

#linked_offer_idsArray<String>

A list of offer objects linked to this loyalty card. The offer objects must already exist. Offer object IDs should follow the format issuer ID. identifier where the former is issued by Google and latter is chosen by you. Corresponds to the JSON property linkedOfferIds

Returns:

  • (Array<String>)


5332
5333
5334
# File 'lib/google/apis/walletobjects_v1/classes.rb', line 5332

def linked_offer_ids
  @linked_offer_ids
end

Links module data. If links module data is also defined on the class, both will be displayed. Corresponds to the JSON property linksModuleData



5338
5339
5340
# File 'lib/google/apis/walletobjects_v1/classes.rb', line 5338

def links_module_data
  @links_module_data
end

#locationsArray<Google::Apis::WalletobjectsV1::LatLongPoint>

Note: This field is currently not supported to trigger geo notifications. Corresponds to the JSON property locations



5343
5344
5345
# File 'lib/google/apis/walletobjects_v1/classes.rb', line 5343

def locations
  @locations
end

#loyalty_pointsGoogle::Apis::WalletobjectsV1::LoyaltyPoints

The loyalty reward points label, balance, and type. Corresponds to the JSON property loyaltyPoints



5348
5349
5350
# File 'lib/google/apis/walletobjects_v1/classes.rb', line 5348

def loyalty_points
  @loyalty_points
end

#messagesArray<Google::Apis::WalletobjectsV1::Message>

An array of messages displayed in the app. All users of this object will receive its associated messages. The maximum number of these fields is 10. Corresponds to the JSON property messages



5354
5355
5356
# File 'lib/google/apis/walletobjects_v1/classes.rb', line 5354

def messages
  @messages
end

#notify_preferenceString

Whether or not field updates to this object should trigger notifications. When set to NOTIFY, we will attempt to trigger a field update notification to users. These notifications will only be sent to users if the field is part of an allowlist. If set to DO_NOT_NOTIFY or NOTIFICATION_SETTINGS_UNSPECIFIED, no notification will be triggered. This setting is ephemeral and needs to be set with each PATCH or UPDATE request, otherwise a notification will not be triggered. Corresponds to the JSON property notifyPreference

Returns:

  • (String)


5365
5366
5367
# File 'lib/google/apis/walletobjects_v1/classes.rb', line 5365

def notify_preference
  @notify_preference
end

#pass_constraintsGoogle::Apis::WalletobjectsV1::PassConstraints

Container for any constraints that may be placed on passes. Corresponds to the JSON property passConstraints



5370
5371
5372
# File 'lib/google/apis/walletobjects_v1/classes.rb', line 5370

def pass_constraints
  @pass_constraints
end

#rotating_barcodeGoogle::Apis::WalletobjectsV1::RotatingBarcode

The rotating barcode type and value. Corresponds to the JSON property rotatingBarcode



5375
5376
5377
# File 'lib/google/apis/walletobjects_v1/classes.rb', line 5375

def rotating_barcode
  @rotating_barcode
end

#save_restrictionsGoogle::Apis::WalletobjectsV1::SaveRestrictions

Defines restrictions on the object that will be verified during save. Note: this is an advanced feature, please contact Google for implementation support. Corresponds to the JSON property saveRestrictions



5381
5382
5383
# File 'lib/google/apis/walletobjects_v1/classes.rb', line 5381

def save_restrictions
  @save_restrictions
end

#secondary_loyalty_pointsGoogle::Apis::WalletobjectsV1::LoyaltyPoints

The secondary loyalty reward points label, balance, and type. Shown in addition to the primary loyalty points. Corresponds to the JSON property secondaryLoyaltyPoints



5387
5388
5389
# File 'lib/google/apis/walletobjects_v1/classes.rb', line 5387

def secondary_loyalty_points
  @secondary_loyalty_points
end

#smart_tap_redemption_valueString

The value that will be transmitted to a Smart Tap certified terminal over NFC for this object. The class level fields enableSmartTap and redemptionIssuers must also be set up correctly in order for the pass to support Smart Tap. Only ASCII characters are supported. If this value is not set but the class level fields enableSmartTap and redemptionIssuers are set up correctly, the barcode.value or the accountId fields are used as fallback if present. Corresponds to the JSON property smartTapRedemptionValue

Returns:

  • (String)


5398
5399
5400
# File 'lib/google/apis/walletobjects_v1/classes.rb', line 5398

def smart_tap_redemption_value
  @smart_tap_redemption_value
end

#stateString

Required. The state of the object. This field is used to determine how an object is displayed in the app. For example, an inactive object is moved to the "Expired passes" section. Corresponds to the JSON property state

Returns:

  • (String)


5405
5406
5407
# File 'lib/google/apis/walletobjects_v1/classes.rb', line 5405

def state
  @state
end

#text_modules_dataArray<Google::Apis::WalletobjectsV1::TextModuleData>

Text module data. If text module data is also defined on the class, both will be displayed. The maximum number of these fields displayed is 10 from the object and 10 from the class. Corresponds to the JSON property textModulesData



5412
5413
5414
# File 'lib/google/apis/walletobjects_v1/classes.rb', line 5412

def text_modules_data
  @text_modules_data
end

#valid_time_intervalGoogle::Apis::WalletobjectsV1::TimeInterval

The time period this object will be active and object can be used. An object' s state will be changed to expired when this time period has passed. Corresponds to the JSON property validTimeInterval



5418
5419
5420
# File 'lib/google/apis/walletobjects_v1/classes.rb', line 5418

def valid_time_interval
  @valid_time_interval
end

#value_added_module_dataArray<Google::Apis::WalletobjectsV1::ValueAddedModuleData>

Optional value added module data. Maximum of ten on the object. Corresponds to the JSON property valueAddedModuleData



5423
5424
5425
# File 'lib/google/apis/walletobjects_v1/classes.rb', line 5423

def value_added_module_data
  @value_added_module_data
end

#versionFixnum

Deprecated Corresponds to the JSON property version

Returns:

  • (Fixnum)


5428
5429
5430
# File 'lib/google/apis/walletobjects_v1/classes.rb', line 5428

def version
  @version
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
# File 'lib/google/apis/walletobjects_v1/classes.rb', line 5435

def update!(**args)
  @account_id = args[:account_id] if args.key?(:account_id)
  @account_name = args[:account_name] if args.key?(:account_name)
  @app_link_data = args[:app_link_data] if args.key?(:app_link_data)
  @barcode = args[:barcode] if args.key?(:barcode)
  @class_id = args[:class_id] if args.key?(:class_id)
  @class_reference = args[:class_reference] if args.key?(:class_reference)
  @disable_expiration_notification = args[:disable_expiration_notification] if args.key?(:disable_expiration_notification)
  @grouping_info = args[:grouping_info] if args.key?(:grouping_info)
  @has_linked_device = args[:has_linked_device] if args.key?(:has_linked_device)
  @has_users = args[:has_users] if args.key?(:has_users)
  @hero_image = args[:hero_image] if args.key?(:hero_image)
  @id = args[:id] if args.key?(:id)
  @image_modules_data = args[:image_modules_data] if args.key?(:image_modules_data)
  @info_module_data = args[:info_module_data] if args.key?(:info_module_data)
  @kind = args[:kind] if args.key?(:kind)
  @linked_object_ids = args[:linked_object_ids] if args.key?(:linked_object_ids)
  @linked_offer_ids = args[:linked_offer_ids] if args.key?(:linked_offer_ids)
  @links_module_data = args[:links_module_data] if args.key?(:links_module_data)
  @locations = args[:locations] if args.key?(:locations)
  @loyalty_points = args[:loyalty_points] if args.key?(:loyalty_points)
  @messages = args[:messages] if args.key?(:messages)
  @notify_preference = args[:notify_preference] if args.key?(:notify_preference)
  @pass_constraints = args[:pass_constraints] if args.key?(:pass_constraints)
  @rotating_barcode = args[:rotating_barcode] if args.key?(:rotating_barcode)
  @save_restrictions = args[:save_restrictions] if args.key?(:save_restrictions)
  @secondary_loyalty_points = args[:secondary_loyalty_points] if args.key?(:secondary_loyalty_points)
  @smart_tap_redemption_value = args[:smart_tap_redemption_value] if args.key?(:smart_tap_redemption_value)
  @state = args[:state] if args.key?(:state)
  @text_modules_data = args[:text_modules_data] if args.key?(:text_modules_data)
  @valid_time_interval = args[:valid_time_interval] if args.key?(:valid_time_interval)
  @value_added_module_data = args[:value_added_module_data] if args.key?(:value_added_module_data)
  @version = args[:version] if args.key?(:version)
end