Class: UspsApi::Campaign
- Defined in:
- lib/usps_api/models/campaign.rb
Overview
Campaign Model.
Instance Attribute Summary collapse
-
#add_barcode ⇒ TrueClass | FalseClass
Boolean that gives information on whether a campaign is eligible for having individual mailpieces added to it.
-
#barcode_count ⇒ Float
Number of mailpieces associated with the campaign.
-
#brand_display_name ⇒ String
User defined field that is placed on Informed Delivery’s UIs when campaign is displayed.
-
#campaign_code ⇒ String
User defined field that describes the campaign being created.
-
#campaign_id ⇒ String
TODO: Write general description for this method.
-
#campaign_source ⇒ String
Gives information on system that was originally used to create campaign (e.g. API, PO!, MCP, Admin Console).
-
#campaign_title ⇒ String
User defined field that describes the campaign being created.
-
#campaign_type ⇒ String
Identifier on how the campaign should be applied to mail pieces * A01 (Non-Sequential or NON-SEQ): Individual barcodes added to campaign after submission * A02 (Mailer ID or MID): All mailpieces with given Mailer ID added to campaign * A03 (Sequential or SEQ): All mailpieces with given Mailer ID and serial range added to campaign * A04 (Saturation or SAT): Mailpieces will be matched to saturation pieces.
-
#cancel ⇒ TrueClass | FalseClass
Boolean that gives information on whether a campaign is eligible for cancellation.
-
#created_datetime ⇒ DateTime
Timestamp of initial campaign creation.
-
#delete ⇒ TrueClass | FalseClass
Boolean that gives information on whether a campaign is eligible for cancellation.
-
#end_date ⇒ Date
Last day campaign will be displayed.
-
#end_serial ⇒ String
The upper limit of the serial range for SEQ type campaigns.
-
#full_edit ⇒ TrueClass | FalseClass
Boolean that gives information on whether a campaign is eligible for edit inclusive of the campaign’s MID.
-
#has_url_params ⇒ TrueClass | FalseClass
An indicator dictating whether a campaign is eligible for MID and Serial Number parameters to be appended to the end of the Target URL for tracking purposes.
-
#is_shareable ⇒ TrueClass | FalseClass
An indicator dictating whether a campaign is eligible for Social Sharing.
-
#last_modified_datetime ⇒ DateTime
Timestamp of last update made to campaign, inclusive of status changes that occur when a campaign activates or completes.
-
#last_modified_source ⇒ String
Gives information on system that was used to make last update to campaign (e.g. API, PO!, MCP, Admin Console).
-
#last_modified_username ⇒ String
Gives information on Cust Reg user name associated with last update to campaign.
-
#limited_edit ⇒ TrueClass | FalseClass
Boolean that gives information on whether a campaign is eligible for edit, not inclusive of the campaign’s MID.
-
#mail_owner_crid ⇒ String
Customer Registration ID (CRID) of the Mail Owner associated with the Informed Delivery campaign.
-
#mail_owner_name ⇒ String
Name of the Mail Owner associated with the Informed Delivery campaign.
-
#mailpiece_shape ⇒ String
Identifier on what types of mail pieces the campaign should be applied to * LT (Letter) * CD (Card) * FL (Flat).
-
#mid ⇒ String
The Mailer ID for the campaign - this field will be used to match IMBs to MID and SEQ type campaigns.
-
#no_edit ⇒ TrueClass | FalseClass
Boolean that gives information on whether a campaign is not eligible for edit.
-
#postal_one_saturation_job_id ⇒ String
A PostalOne! generated unique identifier for a saturation type campaign.
-
#replacement_image ⇒ String
The image that is displayed instead of the mailpiece image for mailpieces matched with a mail campaign.
-
#ride_along ⇒ String
The image that is displayed below the replacement or mailpiece image for mailpieces matched with a mail campaign.
-
#start_date ⇒ Date
First day campaign will be displayed.
-
#start_serial ⇒ String
The lower limit of the serial range for SEQ type campaigns.
-
#status ⇒ String
Status of campaign - possible values include Submitted, Active, Complete, Inactive, Draft, Cancelled, and Deleted.
-
#submitted_datetime ⇒ DateTime
Timestamp of initial campaign submission.
-
#submitter_crid ⇒ String
The campaign submitter’s Customer Registration ID (CRID).
-
#submitter_name ⇒ String
The campaign submitter’s Name.
-
#target_url ⇒ String
The URL that users are redirected to when clicking on the Ridealong image or Learn More link for a campaign.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(campaign_type:, mailpiece_shape:, mid:, submitter_name:, mail_owner_crid:, mail_owner_name:, campaign_code:, campaign_title:, brand_display_name:, start_date:, end_date:, target_url:, ride_along:, campaign_id: SKIP, submitter_crid: SKIP, start_serial: SKIP, end_serial: SKIP, campaign_source: SKIP, has_url_params: SKIP, is_shareable: SKIP, postal_one_saturation_job_id: SKIP, replacement_image: SKIP, add_barcode: SKIP, barcode_count: SKIP, cancel: SKIP, created_datetime: SKIP, delete: SKIP, full_edit: SKIP, last_modified_datetime: SKIP, last_modified_source: SKIP, last_modified_username: SKIP, limited_edit: SKIP, no_edit: SKIP, status: SKIP, submitted_datetime: SKIP) ⇒ Campaign
constructor
A new instance of Campaign.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_created_datetime ⇒ Object
- #to_custom_last_modified_datetime ⇒ Object
- #to_custom_submitted_datetime ⇒ Object
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(campaign_type:, mailpiece_shape:, mid:, submitter_name:, mail_owner_crid:, mail_owner_name:, campaign_code:, campaign_title:, brand_display_name:, start_date:, end_date:, target_url:, ride_along:, campaign_id: SKIP, submitter_crid: SKIP, start_serial: SKIP, end_serial: SKIP, campaign_source: SKIP, has_url_params: SKIP, is_shareable: SKIP, postal_one_saturation_job_id: SKIP, replacement_image: SKIP, add_barcode: SKIP, barcode_count: SKIP, cancel: SKIP, created_datetime: SKIP, delete: SKIP, full_edit: SKIP, last_modified_datetime: SKIP, last_modified_source: SKIP, last_modified_username: SKIP, limited_edit: SKIP, no_edit: SKIP, status: SKIP, submitted_datetime: SKIP) ⇒ Campaign
Returns a new instance of Campaign.
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 |
# File 'lib/usps_api/models/campaign.rb', line 290 def initialize(campaign_type:, mailpiece_shape:, mid:, submitter_name:, mail_owner_crid:, mail_owner_name:, campaign_code:, campaign_title:, brand_display_name:, start_date:, end_date:, target_url:, ride_along:, campaign_id: SKIP, submitter_crid: SKIP, start_serial: SKIP, end_serial: SKIP, campaign_source: SKIP, has_url_params: SKIP, is_shareable: SKIP, postal_one_saturation_job_id: SKIP, replacement_image: SKIP, add_barcode: SKIP, barcode_count: SKIP, cancel: SKIP, created_datetime: SKIP, delete: SKIP, full_edit: SKIP, last_modified_datetime: SKIP, last_modified_source: SKIP, last_modified_username: SKIP, limited_edit: SKIP, no_edit: SKIP, status: SKIP, submitted_datetime: SKIP) @campaign_id = campaign_id unless campaign_id == SKIP @campaign_type = campaign_type @mailpiece_shape = mailpiece_shape @mid = mid @submitter_name = submitter_name @submitter_crid = submitter_crid unless submitter_crid == SKIP @mail_owner_crid = mail_owner_crid @mail_owner_name = mail_owner_name @campaign_code = campaign_code @campaign_title = campaign_title @brand_display_name = brand_display_name @start_date = start_date @end_date = end_date @start_serial = start_serial unless start_serial == SKIP @end_serial = end_serial unless end_serial == SKIP @target_url = target_url @campaign_source = campaign_source unless campaign_source == SKIP @has_url_params = has_url_params unless has_url_params == SKIP @is_shareable = is_shareable unless is_shareable == SKIP unless postal_one_saturation_job_id == SKIP @postal_one_saturation_job_id = postal_one_saturation_job_id end @ride_along = ride_along @replacement_image = replacement_image unless replacement_image == SKIP @add_barcode = unless == SKIP @barcode_count = unless == SKIP @cancel = cancel unless cancel == SKIP @created_datetime = created_datetime unless created_datetime == SKIP @delete = delete unless delete == SKIP @full_edit = full_edit unless full_edit == SKIP @last_modified_datetime = last_modified_datetime unless last_modified_datetime == SKIP @last_modified_source = last_modified_source unless last_modified_source == SKIP @last_modified_username = last_modified_username unless last_modified_username == SKIP @limited_edit = limited_edit unless limited_edit == SKIP @no_edit = no_edit unless no_edit == SKIP @status = status unless status == SKIP @submitted_datetime = submitted_datetime unless submitted_datetime == SKIP end |
Instance Attribute Details
#add_barcode ⇒ TrueClass | FalseClass
Boolean that gives information on whether a campaign is eligible for having individual mailpieces added to it. This flag will be true only if the campaign has a NON-SEQ campaign type and an End Date in the future.
144 145 146 |
# File 'lib/usps_api/models/campaign.rb', line 144 def @add_barcode end |
#barcode_count ⇒ Float
Number of mailpieces associated with the campaign. The number will only get greater than 0 for NON-SEQ campaigns.
149 150 151 |
# File 'lib/usps_api/models/campaign.rb', line 149 def @barcode_count end |
#brand_display_name ⇒ String
User defined field that is placed on Informed Delivery’s UIs when campaign is displayed.
73 74 75 |
# File 'lib/usps_api/models/campaign.rb', line 73 def brand_display_name @brand_display_name end |
#campaign_code ⇒ String
User defined field that describes the campaign being created. This field is put into the campaign reports created for the campaign.
63 64 65 |
# File 'lib/usps_api/models/campaign.rb', line 63 def campaign_code @campaign_code end |
#campaign_id ⇒ String
TODO: Write general description for this method
15 16 17 |
# File 'lib/usps_api/models/campaign.rb', line 15 def campaign_id @campaign_id end |
#campaign_source ⇒ String
Gives information on system that was originally used to create campaign (e.g. API, PO!, MCP, Admin Console). This field will not update if campaign is subsequently edited or cancelled.
104 105 106 |
# File 'lib/usps_api/models/campaign.rb', line 104 def campaign_source @campaign_source end |
#campaign_title ⇒ String
User defined field that describes the campaign being created. This field is put into the campaign reports created for the campaign.
68 69 70 |
# File 'lib/usps_api/models/campaign.rb', line 68 def campaign_title @campaign_title end |
#campaign_type ⇒ String
Identifier on how the campaign should be applied to mail pieces
* A01 (Non-Sequential or NON-SEQ): Individual barcodes added to campaign
after submission
* A02 (Mailer ID or MID): All mailpieces with given Mailer ID added to
campaign
* A03 (Sequential or SEQ): All mailpieces with given Mailer ID and serial
range added to campaign
* A04 (Saturation or SAT): Mailpieces will be matched to saturation
pieces
27 28 29 |
# File 'lib/usps_api/models/campaign.rb', line 27 def campaign_type @campaign_type end |
#cancel ⇒ TrueClass | FalseClass
Boolean that gives information on whether a campaign is eligible for cancellation. This flag will be true only if the campaign is in an Active status.
155 156 157 |
# File 'lib/usps_api/models/campaign.rb', line 155 def cancel @cancel end |
#created_datetime ⇒ DateTime
Timestamp of initial campaign creation. This timestamp will be returned in UTC.
160 161 162 |
# File 'lib/usps_api/models/campaign.rb', line 160 def created_datetime @created_datetime end |
#delete ⇒ TrueClass | FalseClass
Boolean that gives information on whether a campaign is eligible for cancellation. This flag will be true only if the campaign is in a Submitted, Draft, or Inactive status.
166 167 168 |
# File 'lib/usps_api/models/campaign.rb', line 166 def delete @delete end |
#end_date ⇒ Date
Last day campaign will be displayed
81 82 83 |
# File 'lib/usps_api/models/campaign.rb', line 81 def end_date @end_date end |
#end_serial ⇒ String
The upper limit of the serial range for SEQ type campaigns. This field is required for SEQ campaigns only and is not allowed for submission for any other campaign types.
93 94 95 |
# File 'lib/usps_api/models/campaign.rb', line 93 def end_serial @end_serial end |
#full_edit ⇒ TrueClass | FalseClass
Boolean that gives information on whether a campaign is eligible for edit inclusive of the campaign’s MID. This flag will be true only if the campaign is in a Submitted and is not a NON-SEQ campaign with associated barcodes.
173 174 175 |
# File 'lib/usps_api/models/campaign.rb', line 173 def full_edit @full_edit end |
#has_url_params ⇒ TrueClass | FalseClass
An indicator dictating whether a campaign is eligible for MID and Serial Number parameters to be appended to the end of the Target URL for tracking purposes. By default, the MID and Serial Number parameters for a given mailpiece will be added to end of the Target URL that users are taken to upon clicking on a campaign. If a mailer opts out of this feature, then these MID and Serial Number fields will not be appended to the campaign’s Target URL.
114 115 116 |
# File 'lib/usps_api/models/campaign.rb', line 114 def has_url_params @has_url_params end |
#is_shareable ⇒ TrueClass | FalseClass
An indicator dictating whether a campaign is eligible for Social Sharing. By default, mail campaigns will be displayed alongside options to share the campaign to various social media platforms. If a mailer opts out of this feature, then these options will not be displayed with the campaign.
121 122 123 |
# File 'lib/usps_api/models/campaign.rb', line 121 def is_shareable @is_shareable end |
#last_modified_datetime ⇒ DateTime
Timestamp of last update made to campaign, inclusive of status changes that occur when a campaign activates or completes. This timestamp will be returned in UTC.
179 180 181 |
# File 'lib/usps_api/models/campaign.rb', line 179 def last_modified_datetime @last_modified_datetime end |
#last_modified_source ⇒ String
Gives information on system that was used to make last update to campaign (e.g. API, PO!, MCP, Admin Console). This field will update each time a campaign is created, edited, or cancelled.
185 186 187 |
# File 'lib/usps_api/models/campaign.rb', line 185 def last_modified_source @last_modified_source end |
#last_modified_username ⇒ String
Gives information on Cust Reg user name associated with last update to campaign. This field will update each time a campaign is created, edited, or cancelled.
191 192 193 |
# File 'lib/usps_api/models/campaign.rb', line 191 def last_modified_username @last_modified_username end |
#limited_edit ⇒ TrueClass | FalseClass
Boolean that gives information on whether a campaign is eligible for edit, not inclusive of the campaign’s MID. This flag will be true only if the campaign is in a Submitted status, is a NON-SEQ campaign, and already has associated barcodes.
198 199 200 |
# File 'lib/usps_api/models/campaign.rb', line 198 def limited_edit @limited_edit end |
#mail_owner_crid ⇒ String
Customer Registration ID (CRID) of the Mail Owner associated with the Informed Delivery campaign.
54 55 56 |
# File 'lib/usps_api/models/campaign.rb', line 54 def mail_owner_crid @mail_owner_crid end |
#mail_owner_name ⇒ String
Name of the Mail Owner associated with the Informed Delivery campaign.
58 59 60 |
# File 'lib/usps_api/models/campaign.rb', line 58 def mail_owner_name @mail_owner_name end |
#mailpiece_shape ⇒ String
Identifier on what types of mail pieces the campaign should be applied to
* LT (Letter)
* CD (Card)
* FL (Flat)
34 35 36 |
# File 'lib/usps_api/models/campaign.rb', line 34 def mailpiece_shape @mailpiece_shape end |
#mid ⇒ String
The Mailer ID for the campaign - this field will be used to match IMBs to MID and SEQ type campaigns. If an IMB has the Mailer ID (MID) associated with an active MID/SEQ campaign, it is eligible to be displayed with the campaign’s image and Target URL.
41 42 43 |
# File 'lib/usps_api/models/campaign.rb', line 41 def mid @mid end |
#no_edit ⇒ TrueClass | FalseClass
Boolean that gives information on whether a campaign is not eligible for edit. This flag will be true if the campaign has an Active, Complete, Cancelled, or Deleted status.
204 205 206 |
# File 'lib/usps_api/models/campaign.rb', line 204 def no_edit @no_edit end |
#postal_one_saturation_job_id ⇒ String
A PostalOne! generated unique identifier for a saturation type campaign. This field should not be used for NON-SEQ, MID, or SEQ campaigns.
126 127 128 |
# File 'lib/usps_api/models/campaign.rb', line 126 def postal_one_saturation_job_id @postal_one_saturation_job_id end |
#replacement_image ⇒ String
The image that is displayed instead of the mailpiece image for mailpieces matched with a mail campaign. This field is required if the Campaign Shape Type is ‘FL’, otherwise this field is optional.
138 139 140 |
# File 'lib/usps_api/models/campaign.rb', line 138 def replacement_image @replacement_image end |
#ride_along ⇒ String
The image that is displayed below the replacement or mailpiece image for mailpieces matched with a mail campaign. When clicked, this image will take users to the Target URL of the campaign. This field is required.
132 133 134 |
# File 'lib/usps_api/models/campaign.rb', line 132 def ride_along @ride_along end |
#start_date ⇒ Date
First day campaign will be displayed
77 78 79 |
# File 'lib/usps_api/models/campaign.rb', line 77 def start_date @start_date end |
#start_serial ⇒ String
The lower limit of the serial range for SEQ type campaigns. This field is required for SEQ campaigns only and is not allowed for submission for any other campaign types.
87 88 89 |
# File 'lib/usps_api/models/campaign.rb', line 87 def start_serial @start_serial end |
#status ⇒ String
Status of campaign - possible values include Submitted, Active, Complete, Inactive, Draft, Cancelled, and Deleted
209 210 211 |
# File 'lib/usps_api/models/campaign.rb', line 209 def status @status end |
#submitted_datetime ⇒ DateTime
Timestamp of initial campaign submission. This timestamp will be returned in UTC.
214 215 216 |
# File 'lib/usps_api/models/campaign.rb', line 214 def submitted_datetime @submitted_datetime end |
#submitter_crid ⇒ String
The campaign submitter’s Customer Registration ID (CRID).
49 50 51 |
# File 'lib/usps_api/models/campaign.rb', line 49 def submitter_crid @submitter_crid end |
#submitter_name ⇒ String
The campaign submitter’s Name.
45 46 47 |
# File 'lib/usps_api/models/campaign.rb', line 45 def submitter_name @submitter_name end |
#target_url ⇒ String
The URL that users are redirected to when clicking on the Ridealong image or Learn More link for a campaign. This field is required.
98 99 100 |
# File 'lib/usps_api/models/campaign.rb', line 98 def target_url @target_url end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 |
# File 'lib/usps_api/models/campaign.rb', line 344 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. campaign_type = hash.key?('campaignType') ? hash['campaignType'] : nil mailpiece_shape = hash.key?('mailpieceShape') ? hash['mailpieceShape'] : nil mid = hash.key?('MID') ? hash['MID'] : nil submitter_name = hash.key?('submitterName') ? hash['submitterName'] : nil mail_owner_crid = hash.key?('mailOwnerCRID') ? hash['mailOwnerCRID'] : nil mail_owner_name = hash.key?('mailOwnerName') ? hash['mailOwnerName'] : nil campaign_code = hash.key?('campaignCode') ? hash['campaignCode'] : nil campaign_title = hash.key?('campaignTitle') ? hash['campaignTitle'] : nil brand_display_name = hash.key?('brandDisplayName') ? hash['brandDisplayName'] : nil start_date = hash.key?('startDate') ? hash['startDate'] : nil end_date = hash.key?('endDate') ? hash['endDate'] : nil target_url = hash.key?('targetUrl') ? hash['targetUrl'] : nil ride_along = hash.key?('rideAlong') ? hash['rideAlong'] : nil campaign_id = hash.key?('campaignID') ? hash['campaignID'] : SKIP submitter_crid = hash.key?('submitterCRID') ? hash['submitterCRID'] : SKIP start_serial = hash.key?('startSerial') ? hash['startSerial'] : SKIP end_serial = hash.key?('endSerial') ? hash['endSerial'] : SKIP campaign_source = hash.key?('campaignSource') ? hash['campaignSource'] : SKIP has_url_params = hash.key?('hasUrlParams') ? hash['hasUrlParams'] : SKIP is_shareable = hash.key?('isShareable') ? hash['isShareable'] : SKIP postal_one_saturation_job_id = hash.key?('postalOneSaturationJobID') ? hash['postalOneSaturationJobID'] : SKIP replacement_image = hash.key?('replacementImage') ? hash['replacementImage'] : SKIP = hash.key?('addBarcode') ? hash['addBarcode'] : SKIP = hash.key?('barcodeCount') ? hash['barcodeCount'] : SKIP cancel = hash.key?('cancel') ? hash['cancel'] : SKIP created_datetime = if hash.key?('createdDatetime') (DateTimeHelper.from_rfc3339(hash['createdDatetime']) if hash['createdDatetime']) else SKIP end delete = hash.key?('delete') ? hash['delete'] : SKIP full_edit = hash.key?('fullEdit') ? hash['fullEdit'] : SKIP last_modified_datetime = if hash.key?('lastModifiedDatetime') (DateTimeHelper.from_rfc3339(hash['lastModifiedDatetime']) if hash['lastModifiedDatetime']) else SKIP end last_modified_source = hash.key?('lastModifiedSource') ? hash['lastModifiedSource'] : SKIP last_modified_username = hash.key?('lastModifiedUsername') ? hash['lastModifiedUsername'] : SKIP limited_edit = hash.key?('limitedEdit') ? hash['limitedEdit'] : SKIP no_edit = hash.key?('noEdit') ? hash['noEdit'] : SKIP status = hash.key?('status') ? hash['status'] : SKIP submitted_datetime = if hash.key?('submittedDatetime') (DateTimeHelper.from_rfc3339(hash['submittedDatetime']) if hash['submittedDatetime']) else SKIP end # Create object from extracted values. Campaign.new(campaign_type: campaign_type, mailpiece_shape: mailpiece_shape, mid: mid, submitter_name: submitter_name, mail_owner_crid: mail_owner_crid, mail_owner_name: mail_owner_name, campaign_code: campaign_code, campaign_title: campaign_title, brand_display_name: brand_display_name, start_date: start_date, end_date: end_date, target_url: target_url, ride_along: ride_along, campaign_id: campaign_id, submitter_crid: submitter_crid, start_serial: start_serial, end_serial: end_serial, campaign_source: campaign_source, has_url_params: has_url_params, is_shareable: is_shareable, postal_one_saturation_job_id: postal_one_saturation_job_id, replacement_image: replacement_image, add_barcode: , barcode_count: , cancel: cancel, created_datetime: created_datetime, delete: delete, full_edit: full_edit, last_modified_datetime: last_modified_datetime, last_modified_source: last_modified_source, last_modified_username: last_modified_username, limited_edit: limited_edit, no_edit: no_edit, status: status, submitted_datetime: submitted_datetime) end |
.names ⇒ Object
A mapping from model property names to API property names.
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 |
# File 'lib/usps_api/models/campaign.rb', line 217 def self.names @_hash = {} if @_hash.nil? @_hash['campaign_id'] = 'campaignID' @_hash['campaign_type'] = 'campaignType' @_hash['mailpiece_shape'] = 'mailpieceShape' @_hash['mid'] = 'MID' @_hash['submitter_name'] = 'submitterName' @_hash['submitter_crid'] = 'submitterCRID' @_hash['mail_owner_crid'] = 'mailOwnerCRID' @_hash['mail_owner_name'] = 'mailOwnerName' @_hash['campaign_code'] = 'campaignCode' @_hash['campaign_title'] = 'campaignTitle' @_hash['brand_display_name'] = 'brandDisplayName' @_hash['start_date'] = 'startDate' @_hash['end_date'] = 'endDate' @_hash['start_serial'] = 'startSerial' @_hash['end_serial'] = 'endSerial' @_hash['target_url'] = 'targetUrl' @_hash['campaign_source'] = 'campaignSource' @_hash['has_url_params'] = 'hasUrlParams' @_hash['is_shareable'] = 'isShareable' @_hash['postal_one_saturation_job_id'] = 'postalOneSaturationJobID' @_hash['ride_along'] = 'rideAlong' @_hash['replacement_image'] = 'replacementImage' @_hash['add_barcode'] = 'addBarcode' @_hash['barcode_count'] = 'barcodeCount' @_hash['cancel'] = 'cancel' @_hash['created_datetime'] = 'createdDatetime' @_hash['delete'] = 'delete' @_hash['full_edit'] = 'fullEdit' @_hash['last_modified_datetime'] = 'lastModifiedDatetime' @_hash['last_modified_source'] = 'lastModifiedSource' @_hash['last_modified_username'] = 'lastModifiedUsername' @_hash['limited_edit'] = 'limitedEdit' @_hash['no_edit'] = 'noEdit' @_hash['status'] = 'status' @_hash['submitted_datetime'] = 'submittedDatetime' @_hash end |
.nullables ⇒ Object
An array for nullable fields
286 287 288 |
# File 'lib/usps_api/models/campaign.rb', line 286 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 |
# File 'lib/usps_api/models/campaign.rb', line 258 def self.optionals %w[ campaign_id submitter_crid start_serial end_serial campaign_source has_url_params is_shareable postal_one_saturation_job_id replacement_image add_barcode barcode_count cancel created_datetime delete full_edit last_modified_datetime last_modified_source last_modified_username limited_edit no_edit status submitted_datetime ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 |
# File 'lib/usps_api/models/campaign.rb', line 474 def inspect class_name = self.class.name.split('::').last "<#{class_name} campaign_id: #{@campaign_id.inspect}, campaign_type:"\ " #{@campaign_type.inspect}, mailpiece_shape: #{@mailpiece_shape.inspect}, mid:"\ " #{@mid.inspect}, submitter_name: #{@submitter_name.inspect}, submitter_crid:"\ " #{@submitter_crid.inspect}, mail_owner_crid: #{@mail_owner_crid.inspect}, mail_owner_name:"\ " #{@mail_owner_name.inspect}, campaign_code: #{@campaign_code.inspect}, campaign_title:"\ " #{@campaign_title.inspect}, brand_display_name: #{@brand_display_name.inspect},"\ " start_date: #{@start_date.inspect}, end_date: #{@end_date.inspect}, start_serial:"\ " #{@start_serial.inspect}, end_serial: #{@end_serial.inspect}, target_url:"\ " #{@target_url.inspect}, campaign_source: #{@campaign_source.inspect}, has_url_params:"\ " #{@has_url_params.inspect}, is_shareable: #{@is_shareable.inspect},"\ " postal_one_saturation_job_id: #{@postal_one_saturation_job_id.inspect}, ride_along:"\ " #{@ride_along.inspect}, replacement_image: #{@replacement_image.inspect}, add_barcode:"\ " #{@add_barcode.inspect}, barcode_count: #{@barcode_count.inspect}, cancel:"\ " #{@cancel.inspect}, created_datetime: #{@created_datetime.inspect}, delete:"\ " #{@delete.inspect}, full_edit: #{@full_edit.inspect}, last_modified_datetime:"\ " #{@last_modified_datetime.inspect}, last_modified_source:"\ " #{@last_modified_source.inspect}, last_modified_username:"\ " #{@last_modified_username.inspect}, limited_edit: #{@limited_edit.inspect}, no_edit:"\ " #{@no_edit.inspect}, status: #{@status.inspect}, submitted_datetime:"\ " #{@submitted_datetime.inspect}>" end |
#to_custom_created_datetime ⇒ Object
441 442 443 |
# File 'lib/usps_api/models/campaign.rb', line 441 def to_custom_created_datetime DateTimeHelper.to_rfc3339(created_datetime) end |
#to_custom_last_modified_datetime ⇒ Object
445 446 447 |
# File 'lib/usps_api/models/campaign.rb', line 445 def to_custom_last_modified_datetime DateTimeHelper.to_rfc3339(last_modified_datetime) end |
#to_custom_submitted_datetime ⇒ Object
449 450 451 |
# File 'lib/usps_api/models/campaign.rb', line 449 def to_custom_submitted_datetime DateTimeHelper.to_rfc3339(submitted_datetime) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 |
# File 'lib/usps_api/models/campaign.rb', line 454 def to_s class_name = self.class.name.split('::').last "<#{class_name} campaign_id: #{@campaign_id}, campaign_type: #{@campaign_type},"\ " mailpiece_shape: #{@mailpiece_shape}, mid: #{@mid}, submitter_name: #{@submitter_name},"\ " submitter_crid: #{@submitter_crid}, mail_owner_crid: #{@mail_owner_crid}, mail_owner_name:"\ " #{@mail_owner_name}, campaign_code: #{@campaign_code}, campaign_title: #{@campaign_title},"\ " brand_display_name: #{@brand_display_name}, start_date: #{@start_date}, end_date:"\ " #{@end_date}, start_serial: #{@start_serial}, end_serial: #{@end_serial}, target_url:"\ " #{@target_url}, campaign_source: #{@campaign_source}, has_url_params: #{@has_url_params},"\ " is_shareable: #{@is_shareable}, postal_one_saturation_job_id:"\ " #{@postal_one_saturation_job_id}, ride_along: #{@ride_along}, replacement_image:"\ " #{@replacement_image}, add_barcode: #{@add_barcode}, barcode_count: #{@barcode_count},"\ " cancel: #{@cancel}, created_datetime: #{@created_datetime}, delete: #{@delete}, full_edit:"\ " #{@full_edit}, last_modified_datetime: #{@last_modified_datetime}, last_modified_source:"\ " #{@last_modified_source}, last_modified_username: #{@last_modified_username},"\ " limited_edit: #{@limited_edit}, no_edit: #{@no_edit}, status: #{@status},"\ " submitted_datetime: #{@submitted_datetime}>" end |