Class: UspsApi::CampaignEditResponse
- Defined in:
- lib/usps_api/models/campaign_edit_response.rb
Overview
CampaignEditResponse 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
Unique identifier for the campaign.
-
#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_id: SKIP, campaign_type: SKIP, mailpiece_shape: SKIP, mid: SKIP, submitter_name: SKIP, submitter_crid: SKIP, mail_owner_crid: SKIP, mail_owner_name: SKIP, campaign_code: SKIP, campaign_title: SKIP, brand_display_name: SKIP, start_date: SKIP, end_date: SKIP, start_serial: SKIP, end_serial: SKIP, target_url: SKIP, campaign_source: SKIP, postal_one_saturation_job_id: SKIP, ride_along: 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, is_shareable: SKIP, has_url_params: SKIP, additional_properties: nil) ⇒ CampaignEditResponse
constructor
A new instance of CampaignEditResponse.
-
#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_id: SKIP, campaign_type: SKIP, mailpiece_shape: SKIP, mid: SKIP, submitter_name: SKIP, submitter_crid: SKIP, mail_owner_crid: SKIP, mail_owner_name: SKIP, campaign_code: SKIP, campaign_title: SKIP, brand_display_name: SKIP, start_date: SKIP, end_date: SKIP, start_serial: SKIP, end_serial: SKIP, target_url: SKIP, campaign_source: SKIP, postal_one_saturation_job_id: SKIP, ride_along: 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, is_shareable: SKIP, has_url_params: SKIP, additional_properties: nil) ⇒ CampaignEditResponse
Returns a new instance of CampaignEditResponse.
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 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 |
# File 'lib/usps_api/models/campaign_edit_response.rb', line 303 def initialize(campaign_id: SKIP, campaign_type: SKIP, mailpiece_shape: SKIP, mid: SKIP, submitter_name: SKIP, submitter_crid: SKIP, mail_owner_crid: SKIP, mail_owner_name: SKIP, campaign_code: SKIP, campaign_title: SKIP, brand_display_name: SKIP, start_date: SKIP, end_date: SKIP, start_serial: SKIP, end_serial: SKIP, target_url: SKIP, campaign_source: SKIP, postal_one_saturation_job_id: SKIP, ride_along: 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, is_shareable: SKIP, has_url_params: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @campaign_id = campaign_id unless campaign_id == SKIP @campaign_type = campaign_type unless campaign_type == SKIP @mailpiece_shape = mailpiece_shape unless mailpiece_shape == SKIP @mid = mid unless mid == SKIP @submitter_name = submitter_name unless submitter_name == SKIP @submitter_crid = submitter_crid unless submitter_crid == SKIP @mail_owner_crid = mail_owner_crid unless mail_owner_crid == SKIP @mail_owner_name = mail_owner_name unless mail_owner_name == SKIP @campaign_code = campaign_code unless campaign_code == SKIP @campaign_title = campaign_title unless campaign_title == SKIP @brand_display_name = brand_display_name unless brand_display_name == SKIP @start_date = start_date unless start_date == SKIP @end_date = end_date unless end_date == SKIP @start_serial = start_serial unless start_serial == SKIP @end_serial = end_serial unless end_serial == SKIP @target_url = target_url unless target_url == SKIP @campaign_source = campaign_source unless campaign_source == SKIP unless postal_one_saturation_job_id == SKIP @postal_one_saturation_job_id = postal_one_saturation_job_id end @ride_along = ride_along unless ride_along == SKIP @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 @is_shareable = is_shareable unless is_shareable == SKIP @has_url_params = has_url_params unless has_url_params == SKIP @additional_properties = additional_properties 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.
127 128 129 |
# File 'lib/usps_api/models/campaign_edit_response.rb', line 127 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.
132 133 134 |
# File 'lib/usps_api/models/campaign_edit_response.rb', line 132 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_edit_response.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_edit_response.rb', line 63 def campaign_code @campaign_code end |
#campaign_id ⇒ String
Unique identifier for the campaign.
15 16 17 |
# File 'lib/usps_api/models/campaign_edit_response.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_edit_response.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_edit_response.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_edit_response.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.
138 139 140 |
# File 'lib/usps_api/models/campaign_edit_response.rb', line 138 def cancel @cancel end |
#created_datetime ⇒ DateTime
Timestamp of initial campaign creation. This timestamp will be returned in UTC.
143 144 145 |
# File 'lib/usps_api/models/campaign_edit_response.rb', line 143 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.
149 150 151 |
# File 'lib/usps_api/models/campaign_edit_response.rb', line 149 def delete @delete end |
#end_date ⇒ Date
Last day campaign will be displayed
81 82 83 |
# File 'lib/usps_api/models/campaign_edit_response.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_edit_response.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.
156 157 158 |
# File 'lib/usps_api/models/campaign_edit_response.rb', line 156 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.
214 215 216 |
# File 'lib/usps_api/models/campaign_edit_response.rb', line 214 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.
204 205 206 |
# File 'lib/usps_api/models/campaign_edit_response.rb', line 204 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.
162 163 164 |
# File 'lib/usps_api/models/campaign_edit_response.rb', line 162 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.
168 169 170 |
# File 'lib/usps_api/models/campaign_edit_response.rb', line 168 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.
174 175 176 |
# File 'lib/usps_api/models/campaign_edit_response.rb', line 174 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.
181 182 183 |
# File 'lib/usps_api/models/campaign_edit_response.rb', line 181 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_edit_response.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_edit_response.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_edit_response.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_edit_response.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.
187 188 189 |
# File 'lib/usps_api/models/campaign_edit_response.rb', line 187 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.
109 110 111 |
# File 'lib/usps_api/models/campaign_edit_response.rb', line 109 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.
121 122 123 |
# File 'lib/usps_api/models/campaign_edit_response.rb', line 121 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.
115 116 117 |
# File 'lib/usps_api/models/campaign_edit_response.rb', line 115 def ride_along @ride_along end |
#start_date ⇒ Date
First day campaign will be displayed
77 78 79 |
# File 'lib/usps_api/models/campaign_edit_response.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_edit_response.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
192 193 194 |
# File 'lib/usps_api/models/campaign_edit_response.rb', line 192 def status @status end |
#submitted_datetime ⇒ DateTime
Timestamp of initial campaign submission. This timestamp will be returned in UTC.
197 198 199 |
# File 'lib/usps_api/models/campaign_edit_response.rb', line 197 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_edit_response.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_edit_response.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_edit_response.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.
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 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 |
# File 'lib/usps_api/models/campaign_edit_response.rb', line 363 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. campaign_id = hash.key?('campaignID') ? hash['campaignID'] : SKIP campaign_type = hash.key?('campaignType') ? hash['campaignType'] : SKIP mailpiece_shape = hash.key?('mailpieceShape') ? hash['mailpieceShape'] : SKIP mid = hash.key?('MID') ? hash['MID'] : SKIP submitter_name = hash.key?('submitterName') ? hash['submitterName'] : SKIP submitter_crid = hash.key?('submitterCRID') ? hash['submitterCRID'] : SKIP mail_owner_crid = hash.key?('mailOwnerCRID') ? hash['mailOwnerCRID'] : SKIP mail_owner_name = hash.key?('mailOwnerName') ? hash['mailOwnerName'] : SKIP campaign_code = hash.key?('campaignCode') ? hash['campaignCode'] : SKIP campaign_title = hash.key?('campaignTitle') ? hash['campaignTitle'] : SKIP brand_display_name = hash.key?('brandDisplayName') ? hash['brandDisplayName'] : SKIP start_date = hash.key?('startDate') ? hash['startDate'] : SKIP end_date = hash.key?('endDate') ? hash['endDate'] : SKIP start_serial = hash.key?('startSerial') ? hash['startSerial'] : SKIP end_serial = hash.key?('endSerial') ? hash['endSerial'] : SKIP target_url = hash.key?('targetUrl') ? hash['targetUrl'] : SKIP campaign_source = hash.key?('campaignSource') ? hash['campaignSource'] : SKIP postal_one_saturation_job_id = hash.key?('postalOneSaturationJobID') ? hash['postalOneSaturationJobID'] : SKIP ride_along = hash.key?('rideAlong') ? hash['rideAlong'] : 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 is_shareable = hash.key?('isShareable') ? hash['isShareable'] : SKIP has_url_params = hash.key?('hasUrlParams') ? hash['hasUrlParams'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. CampaignEditResponse.new(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, postal_one_saturation_job_id: postal_one_saturation_job_id, ride_along: ride_along, 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, is_shareable: is_shareable, has_url_params: has_url_params, additional_properties: additional_properties) 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_edit_response.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['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['is_shareable'] = 'isShareable' @_hash['has_url_params'] = 'hasUrlParams' @_hash end |
.nullables ⇒ Object
An array for nullable fields
299 300 301 |
# File 'lib/usps_api/models/campaign_edit_response.rb', line 299 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 284 285 286 287 288 289 290 291 292 293 294 295 296 |
# File 'lib/usps_api/models/campaign_edit_response.rb', line 258 def self.optionals %w[ campaign_id campaign_type mailpiece_shape mid submitter_name submitter_crid mail_owner_crid mail_owner_name campaign_code campaign_title brand_display_name start_date end_date start_serial end_serial target_url campaign_source postal_one_saturation_job_id ride_along 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 is_shareable has_url_params ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 |
# File 'lib/usps_api/models/campaign_edit_response.rb', line 503 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},"\ " 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}, is_shareable: #{@is_shareable.inspect}, has_url_params:"\ " #{@has_url_params.inspect}, additional_properties: #{@additional_properties}>" end |
#to_custom_created_datetime ⇒ Object
470 471 472 |
# File 'lib/usps_api/models/campaign_edit_response.rb', line 470 def to_custom_created_datetime DateTimeHelper.to_rfc3339(created_datetime) end |
#to_custom_last_modified_datetime ⇒ Object
474 475 476 |
# File 'lib/usps_api/models/campaign_edit_response.rb', line 474 def to_custom_last_modified_datetime DateTimeHelper.to_rfc3339(last_modified_datetime) end |
#to_custom_submitted_datetime ⇒ Object
478 479 480 |
# File 'lib/usps_api/models/campaign_edit_response.rb', line 478 def to_custom_submitted_datetime DateTimeHelper.to_rfc3339(submitted_datetime) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 |
# File 'lib/usps_api/models/campaign_edit_response.rb', line 483 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}, 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}, is_shareable: #{@is_shareable},"\ " has_url_params: #{@has_url_params}, additional_properties: #{@additional_properties}>" end |