lib/twilio-ruby/rest/chat/v1/credential.rb in twilio-ruby-5.22.3 vs lib/twilio-ruby/rest/chat/v1/credential.rb in twilio-ruby-5.23.0

- old
+ new

@@ -106,23 +106,30 @@ end ## # Retrieve a single page of CredentialInstance records from the API. # Request is executed immediately. - # @param [credential.PushService] type Credential type, one of "gcm" or "apn" - # @param [String] friendly_name Friendly name for stored credential - # @param [String] certificate [APN only] URL encoded representation of the - # certificate, e.g. `-----BEGIN - # CERTIFICATE-----MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A==-----END CERTIFICATE-----` - # @param [String] private_key [APN only] URL encoded representation of the private - # key, e.g. `-----BEGIN RSA PRIVATE - # KEY-----MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR\n.-----END RSA PRIVATE KEY-----` - # @param [Boolean] sandbox [APN only] use this credential for sending to - # production or sandbox APNs (string `true` or `false`) - # @param [String] api_key [GCM only] This is the "API key" for project from Google - # Developer console for your GCM Service application credential - # @param [String] secret The secret + # @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 + # certificate. For example, + # `-----BEGIN CERTIFICATE----- + # MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A== + # -----END CERTIFICATE-----` + # @param [String] private_key [APN only] The URL encoded representation of the + # private key. For example, + # `-----BEGIN RSA PRIVATE KEY----- + # MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR. + # -----END RSA PRIVATE KEY-----` + # @param [Boolean] sandbox [APN only] Whether to send the credential to sandbox + # 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 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, @@ -180,11 +187,12 @@ class CredentialContext < InstanceContext ## # Initialize the CredentialContext # @param [Version] version Version that contains the resource - # @param [String] sid The sid + # @param [String] sid The Twilio-provided string that uniquely identifies the + # Credential resource to fetch. # @return [CredentialContext] CredentialContext def initialize(version, sid) super(version) # Path Solution @@ -207,22 +215,28 @@ CredentialInstance.new(@version, payload, sid: @solution[:sid], ) end ## # Update the CredentialInstance - # @param [String] friendly_name Friendly name for stored credential - # @param [String] certificate [APN only] URL encoded representation of the - # certificate, e.g. `-----BEGIN - # CERTIFICATE-----MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A==-----END CERTIFICATE-----` - # @param [String] private_key [APN only] URL encoded representation of the private - # key, e.g. `-----BEGIN RSA PRIVATE - # KEY-----MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR\n.-----END RSA PRIVATE KEY-----` - # @param [Boolean] sandbox [APN only] use this credential for sending to - # production or sandbox APNs (string `true` or `false`) - # @param [String] api_key [GCM only] This is the "API key" for project from Google - # Developer console for your GCM Service application credential - # @param [String] secret The secret + # @param [String] friendly_name A descriptive string that you create to describe + # the resource. It can be up to 64 characters long. + # @param [String] certificate [APN only] The URL encoded representation of the + # certificate. For example, + # `-----BEGIN CERTIFICATE----- + # MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A== + # -----END CERTIFICATE-----` + # @param [String] private_key [APN only] The URL encoded representation of the + # private key. For example, + # `-----BEGIN RSA PRIVATE KEY----- + # MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR. + # -----END RSA PRIVATE KEY-----` + # @param [Boolean] sandbox [APN only] Whether to send the credential to sandbox + # 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] Updated CredentialInstance def update(friendly_name: :unset, certificate: :unset, private_key: :unset, sandbox: :unset, api_key: :unset, secret: :unset) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, 'Certificate' => certificate, @@ -266,11 +280,12 @@ class CredentialInstance < InstanceResource ## # Initialize the CredentialInstance # @param [Version] version Version that contains the resource # @param [Hash] payload payload that contains response from Twilio - # @param [String] sid The sid + # @param [String] sid The Twilio-provided string that uniquely identifies the + # Credential resource to fetch. # @return [CredentialInstance] CredentialInstance def initialize(version, payload, sid: nil) super(version) # Marshaled Properties @@ -300,53 +315,53 @@ end @instance_context end ## - # @return [String] A 34 character string that uniquely identifies this resource. + # @return [String] The unique string that identifies the resource def sid @properties['sid'] end ## - # @return [String] The unique id of the Account[/console] responsible for this resource. + # @return [String] The SID of the Account that created the resource def account_sid @properties['account_sid'] end ## - # @return [String] The human-readable name of this resource. + # @return [String] The string that you assigned to describe the resource def friendly_name @properties['friendly_name'] end ## - # @return [credential.PushService] Indicates which push notifications service this credential is for - either gcm or apn + # @return [credential.PushService] The type of push-notification service the credential is for def type @properties['type'] end ## - # @return [String] [APN only] true when this resource should use the sandbox APN service. + # @return [String] [APN only] Whether to send the credential to sandbox APNs def sandbox @properties['sandbox'] end ## - # @return [Time] The date that this resource was created. + # @return [Time] The RFC 2822 date and time in GMT when the resource was created def date_created @properties['date_created'] end ## - # @return [Time] The date that this resource was last updated. + # @return [Time] The RFC 2822 date and time in GMT when the resource was last updated def date_updated @properties['date_updated'] end ## - # @return [String] An absolute URL for this credential resource. + # @return [String] The absolute URL of the Credential resource def url @properties['url'] end ## @@ -356,21 +371,27 @@ context.fetch end ## # Update the CredentialInstance - # @param [String] friendly_name Friendly name for stored credential - # @param [String] certificate [APN only] URL encoded representation of the - # certificate, e.g. `-----BEGIN - # CERTIFICATE-----MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A==-----END CERTIFICATE-----` - # @param [String] private_key [APN only] URL encoded representation of the private - # key, e.g. `-----BEGIN RSA PRIVATE - # KEY-----MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR\n.-----END RSA PRIVATE KEY-----` - # @param [Boolean] sandbox [APN only] use this credential for sending to - # production or sandbox APNs (string `true` or `false`) - # @param [String] api_key [GCM only] This is the "API key" for project from Google - # Developer console for your GCM Service application credential - # @param [String] secret The secret + # @param [String] friendly_name A descriptive string that you create to describe + # the resource. It can be up to 64 characters long. + # @param [String] certificate [APN only] The URL encoded representation of the + # certificate. For example, + # `-----BEGIN CERTIFICATE----- + # MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A== + # -----END CERTIFICATE-----` + # @param [String] private_key [APN only] The URL encoded representation of the + # private key. For example, + # `-----BEGIN RSA PRIVATE KEY----- + # MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR. + # -----END RSA PRIVATE KEY-----` + # @param [Boolean] sandbox [APN only] Whether to send the credential to sandbox + # 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] Updated CredentialInstance def update(friendly_name: :unset, certificate: :unset, private_key: :unset, sandbox: :unset, api_key: :unset, secret: :unset) context.update( friendly_name: friendly_name, certificate: certificate, \ No newline at end of file