Class: WhatsAppCloudApi::UpdateBusinessProfileRequest

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/whats_app_cloud_api/models/update_business_profile_request.rb

Overview

UpdateBusinessProfileRequest Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(messaging_product = nil, address = nil, description = nil, vertical = nil, email = nil, websites = nil, profile_picture_url = nil) ⇒ UpdateBusinessProfileRequest

Returns a new instance of UpdateBusinessProfileRequest.



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/whats_app_cloud_api/models/update_business_profile_request.rb', line 75

def initialize(messaging_product = nil,
               address = nil,
               description = nil,
               vertical = nil,
               email = nil,
               websites = nil,
               profile_picture_url = nil)
  @messaging_product = messaging_product unless messaging_product == SKIP
  @address = address unless address == SKIP
  @description = description unless description == SKIP
  @vertical = vertical unless vertical == SKIP
  @email = email unless email == SKIP
  @websites = websites unless websites == SKIP
  @profile_picture_url = profile_picture_url unless profile_picture_url == SKIP
end

Instance Attribute Details

#addressString

Address of the business.

Returns:

  • (String)


19
20
21
# File 'lib/whats_app_cloud_api/models/update_business_profile_request.rb', line 19

def address
  @address
end

#descriptionString

Description of the business.

Returns:

  • (String)


23
24
25
# File 'lib/whats_app_cloud_api/models/update_business_profile_request.rb', line 23

def description
  @description
end

#emailString

The contact email address (in valid email format) of the business.

Returns:

  • (String)


32
33
34
# File 'lib/whats_app_cloud_api/models/update_business_profile_request.rb', line 32

def email
  @email
end

#messaging_productString

The messaging service used for the request. Always set it to “whatsapp” if you are using the WhatsApp Business API.

Returns:

  • (String)


15
16
17
# File 'lib/whats_app_cloud_api/models/update_business_profile_request.rb', line 15

def messaging_product
  @messaging_product
end

#profile_picture_urlString

URL of the profile picture generated from a call to the Resumable Upload API.

Returns:

  • (String)


43
44
45
# File 'lib/whats_app_cloud_api/models/update_business_profile_request.rb', line 43

def profile_picture_url
  @profile_picture_url
end

#verticalVerticalEnum

Industry of the business. This can be either an empty string or one of the accepted values.

Returns:



28
29
30
# File 'lib/whats_app_cloud_api/models/update_business_profile_request.rb', line 28

def vertical
  @vertical
end

#websitesList of String

The URLs associated with the business. For instance, a website, Facebook Page, or Instagram. You must include the http:// or https:// portion of the URL.

Returns:

  • (List of String)


38
39
40
# File 'lib/whats_app_cloud_api/models/update_business_profile_request.rb', line 38

def websites
  @websites
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/whats_app_cloud_api/models/update_business_profile_request.rb', line 92

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.

  messaging_product =
    hash.key?('messaging_product') ? hash['messaging_product'] : SKIP
  address = hash.key?('address') ? hash['address'] : SKIP
  description = hash.key?('description') ? hash['description'] : SKIP
  vertical = hash.key?('vertical') ? hash['vertical'] : SKIP
  email = hash.key?('email') ? hash['email'] : SKIP
  websites = hash.key?('websites') ? hash['websites'] : SKIP
  profile_picture_url =
    hash.key?('profile_picture_url') ? hash['profile_picture_url'] : SKIP

  # Create object from extracted values.

  UpdateBusinessProfileRequest.new(messaging_product,
                                   address,
                                   description,
                                   vertical,
                                   email,
                                   websites,
                                   profile_picture_url)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['messaging_product'] = 'messaging_product'
  @_hash['address'] = 'address'
  @_hash['description'] = 'description'
  @_hash['vertical'] = 'vertical'
  @_hash['email'] = 'email'
  @_hash['websites'] = 'websites'
  @_hash['profile_picture_url'] = 'profile_picture_url'
  @_hash
end

Instance Method Details

#nullablesObject

An array for nullable fields



71
72
73
# File 'lib/whats_app_cloud_api/models/update_business_profile_request.rb', line 71

def nullables
  []
end

#optionalsObject

An array for optional fields



59
60
61
62
63
64
65
66
67
68
# File 'lib/whats_app_cloud_api/models/update_business_profile_request.rb', line 59

def optionals
  %w[
    address
    description
    vertical
    email
    websites
    profile_picture_url
  ]
end