Class: Twilio::REST::Api::V2010::AccountContext::SipList::CredentialListContext::CredentialContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, account_sid, credential_list_sid, sid) ⇒ CredentialContext

Initialize the CredentialContext

Parameters:

  • version (Version)

    Version that contains the resource

  • account_sid (String)

    The unique id of the Account that is responsible for this resource.

  • credential_list_sid (String)

    The unique id that identifies the credential list that includes this credential.

  • sid (String)

    The unique id that identifies the resource to update.



162
163
164
165
166
167
168
169
170
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb', line 162

def initialize(version, , credential_list_sid, sid)
    super(version)

    # Path Solution
    @solution = { account_sid: , credential_list_sid: credential_list_sid, sid: sid,  }
    @uri = "/Accounts/#{@solution[:account_sid]}/SIP/CredentialLists/#{@solution[:credential_list_sid]}/Credentials/#{@solution[:sid]}.json"

    
end

Instance Method Details

#deleteBoolean

Delete the CredentialInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



174
175
176
177
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb', line 174

def delete

    @version.delete('DELETE', @uri)
end

#fetchCredentialInstance

Fetch the CredentialInstance

Returns:



182
183
184
185
186
187
188
189
190
191
192
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb', line 182

def fetch

    payload = @version.fetch('GET', @uri)
    CredentialInstance.new(
        @version,
        payload,
        account_sid: @solution[:account_sid],
        credential_list_sid: @solution[:credential_list_sid],
        sid: @solution[:sid],
    )
end

#inspectObject

Provide a detailed, user friendly representation



226
227
228
229
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb', line 226

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

#to_sObject

Provide a user friendly representation



219
220
221
222
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb', line 219

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

#update(password: :unset) ⇒ CredentialInstance

Update the CredentialInstance

Parameters:

  • password (String) (defaults to: :unset)

    The password that the username will use when authenticating SIP requests. The password must be a minimum of 12 characters, contain at least 1 digit, and have mixed case. (eg ‘IWasAtSignal2018`)

Returns:



198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb', line 198

def update(
    password: :unset
)

    data = Twilio::Values.of({
        'Password' => password,
    })

    payload = @version.update('POST', @uri, data: data)
    CredentialInstance.new(
        @version,
        payload,
        account_sid: @solution[:account_sid],
        credential_list_sid: @solution[:credential_list_sid],
        sid: @solution[:sid],
    )
end