lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb in twilio-ruby-5.22.3 vs lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb in twilio-ruby-5.23.0
- old
+ new
@@ -13,13 +13,13 @@
class ServiceContext < InstanceContext
class RoleList < ListResource
##
# Initialize the RoleList
# @param [Version] version Version that contains the resource
- # @param [String] service_sid The unique id of the
- # [Service](https://www.twilio.com/docs/api/chat/rest/v1/services) this role
- # belongs to.
+ # @param [String] service_sid The SID of the
+ # [Service](https://www.twilio.com/docs/api/chat/rest/services) the resource is
+ # associated with.
# @return [RoleList] RoleList
def initialize(version, service_sid: nil)
super(version)
# Path Solution
@@ -28,17 +28,19 @@
end
##
# Retrieve a single page of RoleInstance records from the API.
# Request is executed immediately.
- # @param [String] friendly_name The human-readable name of this role.
- # @param [role.RoleType] type What kind of role this is. Either `channel` for
- # [Channel](https://www.twilio.com/docs/api/chat/rest/v1/channel) roles or
- # `deployment` for
- # [Service](https://www.twilio.com/docs/api/chat/rest/v1/services) roles.
- # @param [String] permission (multiple) A permission this role should have.
- # Consult the table above for the list of possible permissions.
+ # @param [String] friendly_name A descriptive string that you create to describe
+ # the new resource. It can be up to 64 characters long.
+ # @param [role.RoleType] type The type of role. Can be: `channel` for
+ # [Channel](https://www.twilio.com/docs/chat/api/channels) roles or `deployment`
+ # for [Service](https://www.twilio.com/docs/chat/api/services) roles.
+ # @param [String] permission A permission that you grant to the new role. Only one
+ # permission can be granted per parameter. To assign more than one permission,
+ # repeat this parameter for each permission value. The values for this parameter
+ # depend on the role's `type` and are described in the documentation.
# @return [RoleInstance] Newly created RoleInstance
def create(friendly_name: nil, type: nil, permission: nil)
data = Twilio::Values.of({
'FriendlyName' => friendly_name,
'Type' => type,
@@ -174,12 +176,15 @@
class RoleContext < InstanceContext
##
# Initialize the RoleContext
# @param [Version] version Version that contains the resource
- # @param [String] service_sid The service_sid
- # @param [String] sid The sid
+ # @param [String] service_sid The SID of the
+ # [Service](https://www.twilio.com/docs/api/chat/rest/services) to fetch the
+ # resource from.
+ # @param [String] sid The Twilio-provided string that uniquely identifies the Role
+ # resource to fetch.
# @return [RoleContext] RoleContext
def initialize(version, service_sid, sid)
super(version)
# Path Solution
@@ -209,12 +214,14 @@
@version.delete('delete', @uri)
end
##
# Update the RoleInstance
- # @param [String] permission (multiple) A permission this role should have.
- # Consult the table above for the list of possible permissions.
+ # @param [String] permission A permission that you grant to the role. Only one
+ # permission can be granted per parameter. To assign more than one permission,
+ # repeat this parameter for each permission value. The values for this parameter
+ # depend on the role's `type` and are described in the documentation.
# @return [RoleInstance] Updated RoleInstance
def update(permission: nil)
data = Twilio::Values.of({'Permission' => Twilio.serialize_list(permission) { |e| e }, })
payload = @version.update(
@@ -244,14 +251,15 @@
class RoleInstance < InstanceResource
##
# Initialize the RoleInstance
# @param [Version] version Version that contains the resource
# @param [Hash] payload payload that contains response from Twilio
- # @param [String] service_sid The unique id of the
- # [Service](https://www.twilio.com/docs/api/chat/rest/v1/services) this role
- # belongs to.
- # @param [String] sid The sid
+ # @param [String] service_sid The SID of the
+ # [Service](https://www.twilio.com/docs/api/chat/rest/services) the resource is
+ # associated with.
+ # @param [String] sid The Twilio-provided string that uniquely identifies the Role
+ # resource to fetch.
# @return [RoleInstance] RoleInstance
def initialize(version, payload, service_sid: nil, sid: nil)
super(version)
# Marshaled Properties
@@ -282,59 +290,59 @@
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 responsible for this role.
+ # @return [String] The SID of the Account that created the resource
def account_sid
@properties['account_sid']
end
##
- # @return [String] The unique id of the Service this role belongs to.
+ # @return [String] The SID of the Service that the resource is associated with
def service_sid
@properties['service_sid']
end
##
- # @return [String] The human-readable name of this role.
+ # @return [String] The string that you assigned to describe the resource
def friendly_name
@properties['friendly_name']
end
##
- # @return [role.RoleType] What kind of role this is.
+ # @return [role.RoleType] The type of role
def type
@properties['type']
end
##
- # @return [String] A JSON array of the permissions this role has.
+ # @return [String] An array of the permissions the role has been granted
def permissions
@properties['permissions']
end
##
- # @return [Time] The date that this resource was created in ISO 8601 format.
+ # @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 in ISO 8601 format.
+ # @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 role.
+ # @return [String] The absolute URL of the Role resource
def url
@properties['url']
end
##
@@ -351,11 +359,13 @@
context.delete
end
##
# Update the RoleInstance
- # @param [String] permission (multiple) A permission this role should have.
- # Consult the table above for the list of possible permissions.
+ # @param [String] permission A permission that you grant to the role. Only one
+ # permission can be granted per parameter. To assign more than one permission,
+ # repeat this parameter for each permission value. The values for this parameter
+ # depend on the role's `type` and are described in the documentation.
# @return [RoleInstance] Updated RoleInstance
def update(permission: nil)
context.update(permission: permission, )
end
\ No newline at end of file