Class: Raas::CreateCustomerRequestModel

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/raas/models/create_customer_request_model.rb

Overview

Represents the request to create a customer

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(customer_identifier = nil, display_name = nil) ⇒ CreateCustomerRequestModel

Returns a new instance of CreateCustomerRequestModel.



23
24
25
26
27
# File 'lib/raas/models/create_customer_request_model.rb', line 23

def initialize(customer_identifier = nil,
               display_name = nil)
  @customer_identifier = customer_identifier
  @display_name = display_name
end

Instance Attribute Details

#customer_identifierString

The customer identifier

Returns:



9
10
11
# File 'lib/raas/models/create_customer_request_model.rb', line 9

def customer_identifier
  @customer_identifier
end

#display_nameString

The display name

Returns:



13
14
15
# File 'lib/raas/models/create_customer_request_model.rb', line 13

def display_name
  @display_name
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



30
31
32
33
34
35
36
37
38
39
40
# File 'lib/raas/models/create_customer_request_model.rb', line 30

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  customer_identifier = hash['customerIdentifier']
  display_name = hash['displayName']

  # Create object from extracted values.
  CreateCustomerRequestModel.new(customer_identifier,
                                 display_name)
end

.namesObject

A mapping from model property names to API property names.



16
17
18
19
20
21
# File 'lib/raas/models/create_customer_request_model.rb', line 16

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['customer_identifier'] = 'customerIdentifier'
  @_hash['display_name'] = 'displayName'
  @_hash
end