Class: StarkInfra::IssuingEmbossingRequest
- Inherits:
-
StarkCore::Utils::Resource
- Object
- StarkCore::Utils::Resource
- StarkInfra::IssuingEmbossingRequest
- Defined in:
- lib/issuing_embossing_request/issuing_embossing_request.rb,
lib/issuing_embossing_request/log.rb
Overview
# IssuingEmbossingRequest object
The IssuingEmbossingRequest object displays the information of embossing requests in your Workspace.
## Parameters (required):
-
card_id [string]: id of the IssuingCard to be embossed. ex “5656565656565656”
-
kit_id [string]: card embossing kit id. ex “5656565656565656”
-
display_name_1 [string]: card displayed name. ex: “ANTHONY STARK”
-
shipping_city [string]: shipping city. ex: “NEW YORK”
-
shipping_country_code [string]: shipping country code. ex: “US”
-
shipping_district [string]: shipping district. ex: “NY”
-
shipping_state_code [string]: shipping state code. ex: “NY”
-
shipping_street_line_1 [string]: shipping main address. ex: “AVENUE OF THE AMERICAS”
-
shipping_street_line_2 [string]: shipping address complement. ex: “Apt. 6”
-
shipping_service [string]: shipping service. ex: “loggi”
-
shipping_tracking_number [string]: shipping tracking number. ex: “5656565656565656”
-
shipping_zip_code [string]: shipping zip code. ex: “12345-678”
## Parameters (optional):
-
embosser_id [string, default nil]: id of the card embosser. ex: “5656565656565656”
-
display_name_2 [string, default nil]: card displayed name. ex: “IT Services”
-
display_name_3 [string, default nil]: card displayed name. ex: “StarkBank S.A.”
-
shipping_phone [string, deafult nil]: shipping phone. ex: “+5511999999999”
-
tags [list of strings, default nil]: list of strings for tagging. ex: [“card”, “corporate”]
## Attributes (return-only):
-
id [string]: unique id returned when IssuingEmbossingRequest is created. ex: “5656565656565656”
-
fee [integer]: fee charged when IssuingEmbossingRequest is created. ex: 1000
-
status [string]: status of the IssuingEmbossingRequest. ex: “created”, “processing”, “success”, “failed”
-
updated [DateTime]: latest update datetime for the IssuingEmbossingRequest. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
-
created [DateTime]: creation datetime for the IssuingEmbossingRequest. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
Defined Under Namespace
Classes: Log
Instance Attribute Summary collapse
-
#card_id ⇒ Object
readonly
Returns the value of attribute card_id.
-
#created ⇒ Object
readonly
Returns the value of attribute created.
-
#display_name_1 ⇒ Object
readonly
Returns the value of attribute display_name_1.
-
#display_name_2 ⇒ Object
readonly
Returns the value of attribute display_name_2.
-
#display_name_3 ⇒ Object
readonly
Returns the value of attribute display_name_3.
-
#embosser_id ⇒ Object
readonly
Returns the value of attribute embosser_id.
-
#fee ⇒ Object
readonly
Returns the value of attribute fee.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#kit_id ⇒ Object
readonly
Returns the value of attribute kit_id.
-
#shipping_city ⇒ Object
readonly
Returns the value of attribute shipping_city.
-
#shipping_country_code ⇒ Object
readonly
Returns the value of attribute shipping_country_code.
-
#shipping_district ⇒ Object
readonly
Returns the value of attribute shipping_district.
-
#shipping_phone ⇒ Object
readonly
Returns the value of attribute shipping_phone.
-
#shipping_service ⇒ Object
readonly
Returns the value of attribute shipping_service.
-
#shipping_state_code ⇒ Object
readonly
Returns the value of attribute shipping_state_code.
-
#shipping_street_line_1 ⇒ Object
readonly
Returns the value of attribute shipping_street_line_1.
-
#shipping_street_line_2 ⇒ Object
readonly
Returns the value of attribute shipping_street_line_2.
-
#shipping_tracking_number ⇒ Object
readonly
Returns the value of attribute shipping_tracking_number.
-
#shipping_zip_code ⇒ Object
readonly
Returns the value of attribute shipping_zip_code.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#updated ⇒ Object
readonly
Returns the value of attribute updated.
Class Method Summary collapse
-
.create(requests:, user: nil) ⇒ Object
# Create IssuingEmbossingRequests.
-
.get(id, user: nil) ⇒ Object
# Retrieve a specific IssuingEmbossingRequest.
-
.page(cursor: nil, limit: nil, after: nil, before: nil, status: nil, card_ids: nil, ids: nil, tags: nil, user: nil) ⇒ Object
# Retrieve paged IssuingEmbossingRequests.
-
.query(limit: nil, after: nil, before: nil, status: nil, card_ids: nil, ids: nil, tags: nil, user: nil) ⇒ Object
# Retrieve IssuingEmbossingRequests.
- .resource ⇒ Object
Instance Method Summary collapse
-
#initialize(card_id:, kit_id:, display_name_1:, shipping_city:, shipping_country_code:, shipping_district:, shipping_state_code:, shipping_street_line_1:, shipping_street_line_2:, shipping_service:, shipping_tracking_number:, shipping_zip_code:, embosser_id: nil, display_name_2: nil, display_name_3: nil, shipping_phone: nil, tags: nil, id: nil, fee: nil, status: nil, updated: nil, created: nil) ⇒ IssuingEmbossingRequest
constructor
A new instance of IssuingEmbossingRequest.
Constructor Details
#initialize(card_id:, kit_id:, display_name_1:, shipping_city:, shipping_country_code:, shipping_district:, shipping_state_code:, shipping_street_line_1:, shipping_street_line_2:, shipping_service:, shipping_tracking_number:, shipping_zip_code:, embosser_id: nil, display_name_2: nil, display_name_3: nil, shipping_phone: nil, tags: nil, id: nil, fee: nil, status: nil, updated: nil, created: nil) ⇒ IssuingEmbossingRequest
Returns a new instance of IssuingEmbossingRequest.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/issuing_embossing_request/issuing_embossing_request.rb', line 43 def initialize( card_id:, kit_id:, display_name_1:, shipping_city:, shipping_country_code:, shipping_district:, shipping_state_code:, shipping_street_line_1:, shipping_street_line_2:, shipping_service:, shipping_tracking_number:, shipping_zip_code:, embosser_id: nil, display_name_2: nil, display_name_3: nil, shipping_phone: nil, tags: nil, id: nil, fee: nil, status: nil, updated: nil, created: nil ) super(id) @card_id = card_id @kit_id = kit_id @display_name_1 = display_name_1 @shipping_city = shipping_city @shipping_country_code = shipping_country_code @shipping_district = shipping_district @shipping_state_code = shipping_state_code @shipping_street_line_1 = shipping_street_line_1 @shipping_street_line_2 = shipping_street_line_2 @shipping_service = shipping_service @shipping_tracking_number = shipping_tracking_number @shipping_zip_code = shipping_zip_code @embosser_id = embosser_id @display_name_2 = display_name_2 @display_name_3 = display_name_3 @shipping_phone = shipping_phone = @fee = fee @status = status @created = StarkCore::Utils::Checks.check_datetime(created) @updated = StarkCore::Utils::Checks.check_datetime(updated) end |
Instance Attribute Details
#card_id ⇒ Object (readonly)
Returns the value of attribute card_id.
39 40 41 |
# File 'lib/issuing_embossing_request/issuing_embossing_request.rb', line 39 def card_id @card_id end |
#created ⇒ Object (readonly)
Returns the value of attribute created.
39 40 41 |
# File 'lib/issuing_embossing_request/issuing_embossing_request.rb', line 39 def created @created end |
#display_name_1 ⇒ Object (readonly)
Returns the value of attribute display_name_1.
39 40 41 |
# File 'lib/issuing_embossing_request/issuing_embossing_request.rb', line 39 def display_name_1 @display_name_1 end |
#display_name_2 ⇒ Object (readonly)
Returns the value of attribute display_name_2.
39 40 41 |
# File 'lib/issuing_embossing_request/issuing_embossing_request.rb', line 39 def display_name_2 @display_name_2 end |
#display_name_3 ⇒ Object (readonly)
Returns the value of attribute display_name_3.
39 40 41 |
# File 'lib/issuing_embossing_request/issuing_embossing_request.rb', line 39 def display_name_3 @display_name_3 end |
#embosser_id ⇒ Object (readonly)
Returns the value of attribute embosser_id.
39 40 41 |
# File 'lib/issuing_embossing_request/issuing_embossing_request.rb', line 39 def embosser_id @embosser_id end |
#fee ⇒ Object (readonly)
Returns the value of attribute fee.
39 40 41 |
# File 'lib/issuing_embossing_request/issuing_embossing_request.rb', line 39 def fee @fee end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
39 40 41 |
# File 'lib/issuing_embossing_request/issuing_embossing_request.rb', line 39 def id @id end |
#kit_id ⇒ Object (readonly)
Returns the value of attribute kit_id.
39 40 41 |
# File 'lib/issuing_embossing_request/issuing_embossing_request.rb', line 39 def kit_id @kit_id end |
#shipping_city ⇒ Object (readonly)
Returns the value of attribute shipping_city.
39 40 41 |
# File 'lib/issuing_embossing_request/issuing_embossing_request.rb', line 39 def shipping_city @shipping_city end |
#shipping_country_code ⇒ Object (readonly)
Returns the value of attribute shipping_country_code.
39 40 41 |
# File 'lib/issuing_embossing_request/issuing_embossing_request.rb', line 39 def shipping_country_code @shipping_country_code end |
#shipping_district ⇒ Object (readonly)
Returns the value of attribute shipping_district.
39 40 41 |
# File 'lib/issuing_embossing_request/issuing_embossing_request.rb', line 39 def shipping_district @shipping_district end |
#shipping_phone ⇒ Object (readonly)
Returns the value of attribute shipping_phone.
39 40 41 |
# File 'lib/issuing_embossing_request/issuing_embossing_request.rb', line 39 def shipping_phone @shipping_phone end |
#shipping_service ⇒ Object (readonly)
Returns the value of attribute shipping_service.
39 40 41 |
# File 'lib/issuing_embossing_request/issuing_embossing_request.rb', line 39 def shipping_service @shipping_service end |
#shipping_state_code ⇒ Object (readonly)
Returns the value of attribute shipping_state_code.
39 40 41 |
# File 'lib/issuing_embossing_request/issuing_embossing_request.rb', line 39 def shipping_state_code @shipping_state_code end |
#shipping_street_line_1 ⇒ Object (readonly)
Returns the value of attribute shipping_street_line_1.
39 40 41 |
# File 'lib/issuing_embossing_request/issuing_embossing_request.rb', line 39 def shipping_street_line_1 @shipping_street_line_1 end |
#shipping_street_line_2 ⇒ Object (readonly)
Returns the value of attribute shipping_street_line_2.
39 40 41 |
# File 'lib/issuing_embossing_request/issuing_embossing_request.rb', line 39 def shipping_street_line_2 @shipping_street_line_2 end |
#shipping_tracking_number ⇒ Object (readonly)
Returns the value of attribute shipping_tracking_number.
39 40 41 |
# File 'lib/issuing_embossing_request/issuing_embossing_request.rb', line 39 def shipping_tracking_number @shipping_tracking_number end |
#shipping_zip_code ⇒ Object (readonly)
Returns the value of attribute shipping_zip_code.
39 40 41 |
# File 'lib/issuing_embossing_request/issuing_embossing_request.rb', line 39 def shipping_zip_code @shipping_zip_code end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
39 40 41 |
# File 'lib/issuing_embossing_request/issuing_embossing_request.rb', line 39 def status @status end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
39 40 41 |
# File 'lib/issuing_embossing_request/issuing_embossing_request.rb', line 39 def end |
#updated ⇒ Object (readonly)
Returns the value of attribute updated.
39 40 41 |
# File 'lib/issuing_embossing_request/issuing_embossing_request.rb', line 39 def updated @updated end |
Class Method Details
.create(requests:, user: nil) ⇒ Object
# Create IssuingEmbossingRequests
Send a list of IssuingEmbossingRequest objects for creation in the Stark Infra API
## Parameters (required):
-
requests [list of IssuingEmbossingRequest objects]: list of IssuingEmbossingRequest objects to be created in the API
## Parameters (optional):
-
user [Organization/Project object, default nil]: Organization or Project object. Not necessary if StarkInfra.user was set before function call
## Return:
-
list of IssuingEmbossingRequest objects with updated attributes
86 87 88 |
# File 'lib/issuing_embossing_request/issuing_embossing_request.rb', line 86 def self.create(requests:, user: nil) StarkInfra::Utils::Rest.post(entities: requests, user: user, **resource) end |
.get(id, user: nil) ⇒ Object
# Retrieve a specific IssuingEmbossingRequest
Receive a single IssuingEmbossingRequest object previously created in the Stark Infra API by its id
## Parameters (required):
-
id [string]: object unique id. ex: ‘5656565656565656’
## Parameters (optional):
-
user [Organization/Project object, default nil]: Organization or Project object. Not necessary if StarkInfra.user was set before function call
## Return:
-
IssuingEmbossingRequest object with updated attributes
102 103 104 |
# File 'lib/issuing_embossing_request/issuing_embossing_request.rb', line 102 def self.get(id, user: nil) StarkInfra::Utils::Rest.get_id(id: id, user: user, **resource) end |
.page(cursor: nil, limit: nil, after: nil, before: nil, status: nil, card_ids: nil, ids: nil, tags: nil, user: nil) ⇒ Object
# Retrieve paged IssuingEmbossingRequests
Receive a list of up to 100 IssuingEmbossingRequest objects previously created in the Stark Infra API and the cursor to the next page. Use this function instead of query if you want to manually page your requests.
## Parameters (optional):
-
cursor [string, default nil]: cursor returned on the previous page function call.
-
limit [integer, default 100]: maximum number of objects to be retrieved. Max = 100. ex: 35
-
after [Date or string, default nil]: date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
-
before [Date or string, default nil]: date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
-
status [list of strings, default nil]: filter for status of retrieved objects. ex: [“created”, “processing”, “success”, “failed”]
-
card_ids [list of string, default nil]: list of card_ids to filter retrieved objects. ex: [“5656565656565656”, “4545454545454545”]
-
ids [list of strings, default nil]: list of ids to filter retrieved objects. ex: [“5656565656565656”, “4545454545454545”]
-
tags [list of strings, default nil]: tags to filter retrieved objects. ex: [“tony”, “stark”]
-
user [Organization/Project object, default nil]: Organization or Project object. Not necessary if StarkInfra.user was set before function call
## Return:
-
list of IssuingEmbossingRequests objects with updated attributes
-
cursor to retrieve the next page of IssuingEmbossingRequests objects
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
# File 'lib/issuing_embossing_request/issuing_embossing_request.rb', line 160 def self.page(cursor: nil, limit: nil, after: nil, before: nil, status: nil, card_ids: nil, ids: nil, tags: nil, user: nil) after = StarkCore::Utils::Checks.check_date(after) before = StarkCore::Utils::Checks.check_date(before) StarkInfra::Utils::Rest.get_page( cursor: cursor, limit: limit, after: after, before: before, status: status, card_ids: card_ids, ids: ids, tags: , user: user, **resource ) end |
.query(limit: nil, after: nil, before: nil, status: nil, card_ids: nil, ids: nil, tags: nil, user: nil) ⇒ Object
# Retrieve IssuingEmbossingRequests
Receive a generator of IssuingEmbossingRequests objects previously created in the Stark Infra API
## Parameters (optional):
-
limit [integer, default nil]: maximum number of objects to be retrieved. Unlimited if nil. ex: 35
-
after [Date or string, default nil]: date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
-
before [Date or string, default nil]: date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
-
status [list of strings, default nil]: filter for status of retrieved objects. ex: [“created”, “processing”, “success”, “failed”]
-
card_ids [list of string, default nil]: list of card_ids to filter retrieved objects. ex: [“5656565656565656”, “4545454545454545”]
-
ids [list of strings, default nil]: list of ids to filter retrieved objects. ex: [“5656565656565656”, “4545454545454545”]
-
tags [list of strings, default nil]: tags to filter retrieved objects. ex: [“tony”, “stark”]
-
user [Organization/Project object, default nil]: Organization or Project object. Not necessary if StarkInfra.user was set before function call
## Return:
-
generator of IssuingEmbossingRequests objects with updated attributes
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/issuing_embossing_request/issuing_embossing_request.rb', line 122 def self.query( limit: nil, after: nil, before: nil, status: nil, card_ids: nil, ids: nil, tags: nil, user: nil ) after = StarkCore::Utils::Checks.check_date(after) before = StarkCore::Utils::Checks.check_date(before) StarkInfra::Utils::Rest.get_stream( limit: limit, after: after, before: before, status: status, card_ids: card_ids, ids: ids, tags: , user: user, **resource ) end |
.resource ⇒ Object
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 |
# File 'lib/issuing_embossing_request/issuing_embossing_request.rb', line 177 def self.resource { resource_name: 'IssuingEmbossingRequest', resource_maker: proc { |json| IssuingEmbossingRequest.new( card_id: json['card_id'], kit_id: json['kit_id'], display_name_1: json['display_name_1'], shipping_city: json['shipping_city'], shipping_country_code: json['shipping_country_code'], shipping_district: json['shipping_district'], shipping_state_code: json['shipping_state_code'], shipping_street_line_1: json['shipping_street_line_1'], shipping_street_line_2: json['shipping_street_line_2'], shipping_service: json['shipping_service'], shipping_tracking_number: json['shipping_tracking_number'], shipping_zip_code: json['shipping_zip_code'], embosser_id: json['embosser_id'], display_name_2: json['display_name_2'], display_name_3: json['display_name_3'], shipping_phone: json['shipping_phone'], tags: json['tags'], id: json['id'], fee: json['fee'], status: json['status'], updated: json['updated'], created: json['created'] ) } } end |