Class: ShellCardManagementApIs::PurchaseCategoryRequest

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/shell_card_management_ap_is/models/purchase_category_request.rb

Overview

PurchaseCategoryRequest Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(request_id = SKIP, col_co_code = SKIP, col_co_id = SKIP, card_type_id = SKIP, purchase_category_id = SKIP, language_code = SKIP) ⇒ PurchaseCategoryRequest

Returns a new instance of PurchaseCategoryRequest.



78
79
80
81
82
83
84
85
86
87
# File 'lib/shell_card_management_ap_is/models/purchase_category_request.rb', line 78

def initialize(request_id = SKIP, col_co_code = SKIP, col_co_id = SKIP,
               card_type_id = SKIP, purchase_category_id = SKIP,
               language_code = SKIP)
  @request_id = request_id unless request_id == SKIP
  @col_co_code = col_co_code unless col_co_code == SKIP
  @col_co_id = col_co_id unless col_co_id == SKIP
  @card_type_id = card_type_id unless card_type_id == SKIP
  @purchase_category_id = purchase_category_id unless purchase_category_id == SKIP
  @language_code = language_code unless language_code == SKIP
end

Instance Attribute Details

#card_type_idInteger

Card type Id

Returns:

  • (Integer)


27
28
29
# File 'lib/shell_card_management_ap_is/models/purchase_category_request.rb', line 27

def card_type_id
  @card_type_id
end

#col_co_codeInteger

Collecting Company Code (Shell Code).

Returns:

  • (Integer)


19
20
21
# File 'lib/shell_card_management_ap_is/models/purchase_category_request.rb', line 19

def col_co_code
  @col_co_code
end

#col_co_idInteger

Collecting Company Id (in Shell Cards Platform).

Returns:

  • (Integer)


23
24
25
# File 'lib/shell_card_management_ap_is/models/purchase_category_request.rb', line 23

def col_co_id
  @col_co_id
end

#language_codeString

Language code for the Title and Description. Language codes should be same as SFH supported language Optional. Default: en-GB Example: en-GB – English (UK) nl-NL – Dutch (Netherlands)

Returns:

  • (String)


43
44
45
# File 'lib/shell_card_management_ap_is/models/purchase_category_request.rb', line 43

def language_code
  @language_code
end

#purchase_category_idInteger

Purchase category Id Optional. Example: 123, 124, etc.,

Returns:

  • (Integer)


33
34
35
# File 'lib/shell_card_management_ap_is/models/purchase_category_request.rb', line 33

def purchase_category_id
  @purchase_category_id
end

#request_idString

Mandatory UUID (according to RFC 4122 standards) for requests and responses. This will be played back in the response from the request.

Returns:

  • (String)


15
16
17
# File 'lib/shell_card_management_ap_is/models/purchase_category_request.rb', line 15

def request_id
  @request_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/shell_card_management_ap_is/models/purchase_category_request.rb', line 90

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  request_id = hash.key?('RequestId') ? hash['RequestId'] : SKIP
  col_co_code = hash.key?('ColCoCode') ? hash['ColCoCode'] : SKIP
  col_co_id = hash.key?('ColCoId') ? hash['ColCoId'] : SKIP
  card_type_id = hash.key?('CardTypeId') ? hash['CardTypeId'] : SKIP
  purchase_category_id =
    hash.key?('PurchaseCategoryId') ? hash['PurchaseCategoryId'] : SKIP
  language_code = hash.key?('LanguageCode') ? hash['LanguageCode'] : SKIP

  # Create object from extracted values.
  PurchaseCategoryRequest.new(request_id,
                              col_co_code,
                              col_co_id,
                              card_type_id,
                              purchase_category_id,
                              language_code)
end

.namesObject

A mapping from model property names to API property names.



46
47
48
49
50
51
52
53
54
55
# File 'lib/shell_card_management_ap_is/models/purchase_category_request.rb', line 46

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['request_id'] = 'RequestId'
  @_hash['col_co_code'] = 'ColCoCode'
  @_hash['col_co_id'] = 'ColCoId'
  @_hash['card_type_id'] = 'CardTypeId'
  @_hash['purchase_category_id'] = 'PurchaseCategoryId'
  @_hash['language_code'] = 'LanguageCode'
  @_hash
end

.nullablesObject

An array for nullable fields



70
71
72
73
74
75
76
# File 'lib/shell_card_management_ap_is/models/purchase_category_request.rb', line 70

def self.nullables
  %w[
    col_co_code
    col_co_id
    card_type_id
  ]
end

.optionalsObject

An array for optional fields



58
59
60
61
62
63
64
65
66
67
# File 'lib/shell_card_management_ap_is/models/purchase_category_request.rb', line 58

def self.optionals
  %w[
    request_id
    col_co_code
    col_co_id
    card_type_id
    purchase_category_id
    language_code
  ]
end