Skip to content

Commit

Permalink
[Librarian] Regenerated @ 08245333f4a8c9235d547b189cd9c422f73e0e7e 7b…
Browse files Browse the repository at this point in the history
…b98153c25ebfee95e6e85bd4c57969e6d02435
  • Loading branch information
twilio-dx committed Sep 25, 2024
1 parent 4192192 commit 905f3f3
Show file tree
Hide file tree
Showing 15 changed files with 1,562 additions and 66 deletions.
11 changes: 11 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
twilio-ruby changelog
=====================

[2024-09-25] Version 7.3.2
--------------------------
**Accounts**
- Update docs and mounts.
- Change library visibility to public
- Enable consent and contact bulk upsert APIs in prod.

**Serverless**
- Add is_plugin parameter in deployments api to check if it is plugins deployment


[2024-09-18] Version 7.3.1
--------------------------
**Intelligence**
Expand Down
12 changes: 12 additions & 0 deletions lib/twilio-ruby/rest/accounts/v1.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ def initialize(domain)
super
@version = 'v1'
@auth_token_promotion = nil
@bulk_consents = nil
@bulk_contacts = nil
@credentials = nil
@safelist = nil
@secondary_auth_token = nil
Expand All @@ -33,6 +35,16 @@ def auth_token_promotion
@auth_token_promotion ||= AuthTokenPromotionContext.new self
end
##
# @return [Twilio::REST::Accounts::V1::BulkConsentsList]
def bulk_consents
@bulk_consents ||= BulkConsentsList.new self
end
##
# @return [Twilio::REST::Accounts::V1::BulkContactsList]
def bulk_contacts
@bulk_contacts ||= BulkContactsList.new self
end
##
# @return [Twilio::REST::Accounts::V1::CredentialList]
def credentials
@credentials ||= CredentialList.new self
Expand Down
133 changes: 133 additions & 0 deletions lib/twilio-ruby/rest/accounts/v1/bulk_consents.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
##
# This code was generated by
# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
#
# Twilio - Accounts
# This is the public Twilio REST API.
#
# NOTE: This class is auto generated by OpenAPI Generator.
# https://openapi-generator.tech
# Do not edit the class manually.
#


module Twilio
module REST
class Accounts < AccountsBase
class V1 < Version
class BulkConsentsList < ListResource

##
# Initialize the BulkConsentsList
# @param [Version] version Version that contains the resource
# @return [BulkConsentsList] BulkConsentsList
def initialize(version)
super(version)
# Path Solution
@solution = { }
@uri = "/Consents/Bulk"

end
##
# Create the BulkConsentsInstance
# @param [Array[Hash]] items This is a list of objects that describes a contact's opt-in status. Each object contains the following fields: `contact_id`, which must be a string representing phone number in [E.164 format](https://www.twilio.com/docs/glossary/what-e164); `correlation_id`, a unique 32-character UUID used to uniquely map the request item with the response item; `sender_id`, which can be either a valid messaging service SID or a from phone number; `status`, a string representing the consent status. Can be one of [`opt-in`, `opt-out`]; and `source`, a string indicating the medium through which the consent was collected. Can be one of [`website`, `offline`, `opt-in-message`, `opt-out-message`, `others`].
# @return [BulkConsentsInstance] Created BulkConsentsInstance
def create(
items: nil
)

data = Twilio::Values.of({
'Items' => Twilio.serialize_list(items) { |e| Twilio.serialize_object(e) },
})

headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })

payload = @version.create('POST', @uri, data: data, headers: headers)
BulkConsentsInstance.new(
@version,
payload,
)
end




# Provide a user friendly representation
def to_s
'#<Twilio.Accounts.V1.BulkConsentsList>'
end
end

class BulkConsentsPage < Page
##
# Initialize the BulkConsentsPage
# @param [Version] version Version that contains the resource
# @param [Response] response Response from the API
# @param [Hash] solution Path solution for the resource
# @return [BulkConsentsPage] BulkConsentsPage
def initialize(version, response, solution)
super(version, response)

# Path Solution
@solution = solution
end

##
# Build an instance of BulkConsentsInstance
# @param [Hash] payload Payload response from the API
# @return [BulkConsentsInstance] BulkConsentsInstance
def get_instance(payload)
BulkConsentsInstance.new(@version, payload)
end

##
# Provide a user friendly representation
def to_s
'<Twilio.Accounts.V1.BulkConsentsPage>'
end
end
class BulkConsentsInstance < InstanceResource
##
# Initialize the BulkConsentsInstance
# @param [Version] version Version that contains the resource
# @param [Hash] payload payload that contains response from Twilio
# @param [String] account_sid The SID of the
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this BulkConsents
# resource.
# @param [String] sid The SID of the Call resource to fetch.
# @return [BulkConsentsInstance] BulkConsentsInstance
def initialize(version, payload )
super(version)

# Marshaled Properties
@properties = {
'items' => payload['items'],
}
end


##
# @return [Hash] A list of objects where each object represents the result of processing a `correlation_id`. Each object contains the following fields: `correlation_id`, a unique 32-character UUID that maps the response to the original request; `error_code`, an integer where 0 indicates success and any non-zero value represents an error; and `error_messages`, an array of strings describing specific validation errors encountered. If the request is successful, the error_messages array will be empty.
def items
@properties['items']
end

##
# Provide a user friendly representation
def to_s
"<Twilio.Accounts.V1.BulkConsentsInstance>"
end

##
# Provide a detailed, user friendly representation
def inspect
"<Twilio.Accounts.V1.BulkConsentsInstance>"
end
end

end
end
end
end
133 changes: 133 additions & 0 deletions lib/twilio-ruby/rest/accounts/v1/bulk_contacts.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
##
# This code was generated by
# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
#
# Twilio - Accounts
# This is the public Twilio REST API.
#
# NOTE: This class is auto generated by OpenAPI Generator.
# https://openapi-generator.tech
# Do not edit the class manually.
#


module Twilio
module REST
class Accounts < AccountsBase
class V1 < Version
class BulkContactsList < ListResource

##
# Initialize the BulkContactsList
# @param [Version] version Version that contains the resource
# @return [BulkContactsList] BulkContactsList
def initialize(version)
super(version)
# Path Solution
@solution = { }
@uri = "/Contacts/Bulk"

end
##
# Create the BulkContactsInstance
# @param [Array[Hash]] items A list of objects where each object represents a contact's details. Each object includes the following fields: `contact_id`, which must be a string representing phone number in [E.164 format](https://www.twilio.com/docs/glossary/what-e164); `correlation_id`, a unique 32-character UUID that maps the response to the original request; `country_iso_code`, a string representing the country using the ISO format (e.g., US for the United States); and `zip_code`, a string representing the postal code.
# @return [BulkContactsInstance] Created BulkContactsInstance
def create(
items: nil
)

data = Twilio::Values.of({
'Items' => Twilio.serialize_list(items) { |e| Twilio.serialize_object(e) },
})

headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })

payload = @version.create('POST', @uri, data: data, headers: headers)
BulkContactsInstance.new(
@version,
payload,
)
end




# Provide a user friendly representation
def to_s
'#<Twilio.Accounts.V1.BulkContactsList>'
end
end

class BulkContactsPage < Page
##
# Initialize the BulkContactsPage
# @param [Version] version Version that contains the resource
# @param [Response] response Response from the API
# @param [Hash] solution Path solution for the resource
# @return [BulkContactsPage] BulkContactsPage
def initialize(version, response, solution)
super(version, response)

# Path Solution
@solution = solution
end

##
# Build an instance of BulkContactsInstance
# @param [Hash] payload Payload response from the API
# @return [BulkContactsInstance] BulkContactsInstance
def get_instance(payload)
BulkContactsInstance.new(@version, payload)
end

##
# Provide a user friendly representation
def to_s
'<Twilio.Accounts.V1.BulkContactsPage>'
end
end
class BulkContactsInstance < InstanceResource
##
# Initialize the BulkContactsInstance
# @param [Version] version Version that contains the resource
# @param [Hash] payload payload that contains response from Twilio
# @param [String] account_sid The SID of the
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this BulkContacts
# resource.
# @param [String] sid The SID of the Call resource to fetch.
# @return [BulkContactsInstance] BulkContactsInstance
def initialize(version, payload )
super(version)

# Marshaled Properties
@properties = {
'items' => payload['items'],
}
end


##
# @return [Hash] A list of objects where each object represents the result of processing a `correlation_id`. Each object contains the following fields: `correlation_id`, a unique 32-character UUID that maps the response to the original request; `error_code`, an integer where 0 indicates success and any non-zero value represents an error; and `error_messages`, an array of strings describing specific validation errors encountered. If the request is successful, the error_messages array will be empty.
def items
@properties['items']
end

##
# Provide a user friendly representation
def to_s
"<Twilio.Accounts.V1.BulkContactsInstance>"
end

##
# Provide a detailed, user friendly representation
def inspect
"<Twilio.Accounts.V1.BulkContactsInstance>"
end
end

end
end
end
end
Loading

0 comments on commit 905f3f3

Please sign in to comment.