lib/twilio-ruby/rest/ip_messaging/v2/credential.rb in twilio-ruby-5.38.0 vs lib/twilio-ruby/rest/ip_messaging/v2/credential.rb in twilio-ruby-5.39.0
- old
+ new
@@ -82,15 +82,13 @@
params = Twilio::Values.of({
'PageToken' => page_token,
'Page' => page_number,
'PageSize' => page_size,
})
- response = @version.page(
- 'GET',
- @uri,
- params
- )
+
+ response = @version.page('GET', @uri, params)
+
CredentialPage.new(@version, response, @solution)
end
##
# Retrieve a single page of CredentialInstance records from the API.
@@ -104,12 +102,11 @@
)
CredentialPage.new(@version, response, @solution)
end
##
- # Retrieve a single page of CredentialInstance records from the API.
- # Request is executed immediately.
+ # Create the CredentialInstance
# @param [credential.PushService] type The type of push-notification service the
# credential is for. Can be: `gcm`, `fcm`, or `apn`.
# @param [String] friendly_name A descriptive string that you create to describe
# the new resource. It can be up to 64 characters long.
# @param [String] certificate [APN only] The URL encoded representation of the
@@ -126,11 +123,11 @@
# APNs. Can be `true` to send to sandbox APNs or `false` to send to production.
# @param [String] api_key [GCM only] The API key for the project that was obtained
# from the Google Developer console for your GCM Service application credential.
# @param [String] secret [FCM only] The **Server key** of your project from the
# Firebase console, found under Settings / Cloud messaging.
- # @return [CredentialInstance] Newly created CredentialInstance
+ # @return [CredentialInstance] Created CredentialInstance
def create(type: nil, friendly_name: :unset, certificate: :unset, private_key: :unset, sandbox: :unset, api_key: :unset, secret: :unset)
data = Twilio::Values.of({
'Type' => type,
'FriendlyName' => friendly_name,
'Certificate' => certificate,
@@ -138,15 +135,11 @@
'Sandbox' => sandbox,
'ApiKey' => api_key,
'Secret' => secret,
})
- payload = @version.create(
- 'POST',
- @uri,
- data: data
- )
+ payload = @version.create('POST', @uri, data: data)
CredentialInstance.new(@version, payload, )
end
##
@@ -198,21 +191,15 @@
@solution = {sid: sid, }
@uri = "/Credentials/#{@solution[:sid]}"
end
##
- # Fetch a CredentialInstance
+ # Fetch the CredentialInstance
# @return [CredentialInstance] Fetched CredentialInstance
def fetch
- params = Twilio::Values.of({})
+ payload = @version.fetch('GET', @uri)
- payload = @version.fetch(
- 'GET',
- @uri,
- params,
- )
-
CredentialInstance.new(@version, payload, sid: @solution[:sid], )
end
##
# Update the CredentialInstance
@@ -243,24 +230,20 @@
'Sandbox' => sandbox,
'ApiKey' => api_key,
'Secret' => secret,
})
- payload = @version.update(
- 'POST',
- @uri,
- data: data,
- )
+ payload = @version.update('POST', @uri, data: data)
CredentialInstance.new(@version, payload, sid: @solution[:sid], )
end
##
- # Deletes the CredentialInstance
+ # Delete the CredentialInstance
# @return [Boolean] true if delete succeeds, false otherwise
def delete
- @version.delete('delete', @uri)
+ @version.delete('DELETE', @uri)
end
##
# Provide a user friendly representation
def to_s
@@ -361,11 +344,11 @@
def url
@properties['url']
end
##
- # Fetch a CredentialInstance
+ # Fetch the CredentialInstance
# @return [CredentialInstance] Fetched CredentialInstance
def fetch
context.fetch
end
@@ -400,10 +383,10 @@
secret: secret,
)
end
##
- # Deletes the CredentialInstance
+ # Delete the CredentialInstance
# @return [Boolean] true if delete succeeds, false otherwise
def delete
context.delete
end
\ No newline at end of file