Class: Twilio::REST::Trusthub::V1::CustomerProfilesProvisionalCopyContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/trusthub/v1/customer_profiles_provisional_copy.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, customer_profile_sid) ⇒ CustomerProfilesProvisionalCopyContext

Initialize the CustomerProfilesProvisionalCopyContext

Parameters:

  • version (Version)

    Version that contains the resource

  • customer_profile_sid (String)

    The unique SID identifier of the Customer Profile.



50
51
52
53
54
55
56
57
58
59
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles_provisional_copy.rb', line 50

def initialize(version, customer_profile_sid)
    super(version)
    

    # Path Solution
    @solution = { customer_profile_sid: customer_profile_sid,  }
    @uri = "/CustomerProfiles/#{@solution[:customer_profile_sid]}/ProvisionalCopy"

    
end

Instance Method Details

#createCustomerProfilesProvisionalCopyInstance

Create the CustomerProfilesProvisionalCopyInstance

Returns:



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles_provisional_copy.rb', line 63

def create

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.create('POST', @uri, headers: headers)
    CustomerProfilesProvisionalCopyInstance.new(
        @version,
        payload,
        customer_profile_sid: @solution[:customer_profile_sid],
    )
end

#create_with_metadataCustomerProfilesProvisionalCopyInstance

Create the CustomerProfilesProvisionalCopyInstanceMetadata

Returns:



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles_provisional_copy.rb', line 82

def 

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    response = @version.('POST', @uri, headers: headers)
    customer_profiles_provisional_copy_instance = CustomerProfilesProvisionalCopyInstance.new(
        @version,
        response.body,
        customer_profile_sid: @solution[:customer_profile_sid],
    )
    CustomerProfilesProvisionalCopyInstanceMetadata.new(
        @version,
        customer_profiles_provisional_copy_instance,
        response.headers,
        response.status_code
    )
end

#fetchCustomerProfilesProvisionalCopyInstance

Fetch the CustomerProfilesProvisionalCopyInstance

Returns:



107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles_provisional_copy.rb', line 107

def fetch

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.fetch('GET', @uri, headers: headers)
    CustomerProfilesProvisionalCopyInstance.new(
        @version,
        payload,
        customer_profile_sid: @solution[:customer_profile_sid],
    )
end

#fetch_with_metadataCustomerProfilesProvisionalCopyInstance

Fetch the CustomerProfilesProvisionalCopyInstanceMetadata

Returns:



126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles_provisional_copy.rb', line 126

def 

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    response = @version.('GET', @uri, headers: headers)
    customer_profiles_provisional_copy_instance = CustomerProfilesProvisionalCopyInstance.new(
        @version,
        response.body,
        customer_profile_sid: @solution[:customer_profile_sid],
    )
    CustomerProfilesProvisionalCopyInstanceMetadata.new(
        @version,
        customer_profiles_provisional_copy_instance,
        response.headers,
        response.status_code
    )
end

#inspectObject

Provide a detailed, user friendly representation



158
159
160
161
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles_provisional_copy.rb', line 158

def inspect
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Trusthub.V1.CustomerProfilesProvisionalCopyContext #{context}>"
end

#to_sObject

Provide a user friendly representation



151
152
153
154
# File 'lib/twilio-ruby/rest/trusthub/v1/customer_profiles_provisional_copy.rb', line 151

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Trusthub.V1.CustomerProfilesProvisionalCopyContext #{context}>"
end