lib/twilio-ruby/rest/api/v2010/account.rb in twilio-ruby-5.4.4 vs lib/twilio-ruby/rest/api/v2010/account.rb in twilio-ruby-5.4.5
- old
+ new
@@ -26,19 +26,19 @@
# Request is executed immediately.
# @param [String] friendly_name A human readable description of the account to
# create, defaults to `SubAccount Created at {YYYY-MM-DD HH:MM meridian}`
# @return [AccountInstance] Newly created AccountInstance
def create(friendly_name: :unset)
- data = Twilio::Values.of({'FriendlyName' => friendly_name,})
+ data = Twilio::Values.of({'FriendlyName' => friendly_name})
payload = @version.create(
'POST',
@uri,
data: data
)
- AccountInstance.new(@version, payload,)
+ AccountInstance.new(@version, payload)
end
##
# Lists AccountInstance records from the API as a list.
# Unlike stream(), this operation is eager and will load `limit` records into
@@ -72,11 +72,11 @@
# efficient page size, i.e. min(limit, 1000)
# @return [Enumerable] Enumerable that will yield up to limit results
def stream(friendly_name: :unset, status: :unset, limit: nil, page_size: nil)
limits = @version.read_limits(limit, page_size)
- page = self.page(friendly_name: friendly_name, status: status, page_size: limits[:page_size],)
+ page = self.page(friendly_name: friendly_name, status: status, page_size: limits[:page_size])
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
end
##
@@ -84,11 +84,11 @@
# This operation lazily loads records as efficiently as possible until the limit
# is reached.
def each
limits = @version.read_limits
- page = self.page(page_size: limits[:page_size],)
+ page = self.page(page_size: limits[:page_size])
@version.stream(page,
limit: limits[:limit],
page_limit: limits[:page_limit]).each {|x| yield x}
end
@@ -156,11 +156,11 @@
##
# Build an instance of AccountInstance
# @param [Hash] payload Payload response from the API
# @return [AccountInstance] AccountInstance
def get_instance(payload)
- AccountInstance.new(@version, payload,)
+ AccountInstance.new(@version, payload)
end
##
# Provide a user friendly representation
def to_s
@@ -177,11 +177,11 @@
# @return [AccountContext] AccountContext
def initialize(version, sid)
super(version)
# Path Solution
- @solution = {sid: sid,}
+ @solution = {sid: sid}
@uri = "/Accounts/#{@solution[:sid]}.json"
# Dependents
@addresses = nil
@applications = nil
@@ -218,45 +218,45 @@
'GET',
@uri,
params,
)
- AccountInstance.new(@version, payload, sid: @solution[:sid],)
+ AccountInstance.new(@version, payload, sid: @solution[:sid])
end
##
# Update the AccountInstance
# @param [String] friendly_name Update the human-readable description of this
# Account
# @param [account.Status] status Alter the status of this account with a given
# Status
# @return [AccountInstance] Updated AccountInstance
def update(friendly_name: :unset, status: :unset)
- data = Twilio::Values.of({'FriendlyName' => friendly_name, 'Status' => status,})
+ data = Twilio::Values.of({'FriendlyName' => friendly_name, 'Status' => status})
payload = @version.update(
'POST',
@uri,
data: data,
)
- AccountInstance.new(@version, payload, sid: @solution[:sid],)
+ AccountInstance.new(@version, payload, sid: @solution[:sid])
end
##
# Access the addresses
# @return [AddressList]
# @return [AddressContext] if sid was passed.
def addresses(sid=:unset)
raise ArgumentError, 'sid cannot be nil' if sid.nil?
if sid != :unset
- return AddressContext.new(@version, @solution[:sid], sid,)
+ return AddressContext.new(@version, @solution[:sid], sid)
end
unless @addresses
- @addresses = AddressList.new(@version, account_sid: @solution[:sid],)
+ @addresses = AddressList.new(@version, account_sid: @solution[:sid])
end
@addresses
end
@@ -266,15 +266,15 @@
# @return [ApplicationContext] if sid was passed.
def applications(sid=:unset)
raise ArgumentError, 'sid cannot be nil' if sid.nil?
if sid != :unset
- return ApplicationContext.new(@version, @solution[:sid], sid,)
+ return ApplicationContext.new(@version, @solution[:sid], sid)
end
unless @applications
- @applications = ApplicationList.new(@version, account_sid: @solution[:sid],)
+ @applications = ApplicationList.new(@version, account_sid: @solution[:sid])
end
@applications
end
@@ -284,15 +284,15 @@
# @return [AuthorizedConnectAppContext] if connect_app_sid was passed.
def authorized_connect_apps(connect_app_sid=:unset)
raise ArgumentError, 'connect_app_sid cannot be nil' if connect_app_sid.nil?
if connect_app_sid != :unset
- return AuthorizedConnectAppContext.new(@version, @solution[:sid], connect_app_sid,)
+ return AuthorizedConnectAppContext.new(@version, @solution[:sid], connect_app_sid)
end
unless @authorized_connect_apps
- @authorized_connect_apps = AuthorizedConnectAppList.new(@version, account_sid: @solution[:sid],)
+ @authorized_connect_apps = AuthorizedConnectAppList.new(@version, account_sid: @solution[:sid])
end
@authorized_connect_apps
end
@@ -302,11 +302,11 @@
# @return [AvailablePhoneNumberCountryContext] if country_code was passed.
def available_phone_numbers(country_code=:unset)
raise ArgumentError, 'country_code cannot be nil' if country_code.nil?
if country_code != :unset
- return AvailablePhoneNumberCountryContext.new(@version, @solution[:sid], country_code,)
+ return AvailablePhoneNumberCountryContext.new(@version, @solution[:sid], country_code)
end
unless @available_phone_numbers
@available_phone_numbers = AvailablePhoneNumberCountryList.new(
@version,
@@ -323,15 +323,15 @@
# @return [CallContext] if sid was passed.
def calls(sid=:unset)
raise ArgumentError, 'sid cannot be nil' if sid.nil?
if sid != :unset
- return CallContext.new(@version, @solution[:sid], sid,)
+ return CallContext.new(@version, @solution[:sid], sid)
end
unless @calls
- @calls = CallList.new(@version, account_sid: @solution[:sid],)
+ @calls = CallList.new(@version, account_sid: @solution[:sid])
end
@calls
end
@@ -341,15 +341,15 @@
# @return [ConferenceContext] if sid was passed.
def conferences(sid=:unset)
raise ArgumentError, 'sid cannot be nil' if sid.nil?
if sid != :unset
- return ConferenceContext.new(@version, @solution[:sid], sid,)
+ return ConferenceContext.new(@version, @solution[:sid], sid)
end
unless @conferences
- @conferences = ConferenceList.new(@version, account_sid: @solution[:sid],)
+ @conferences = ConferenceList.new(@version, account_sid: @solution[:sid])
end
@conferences
end
@@ -359,15 +359,15 @@
# @return [ConnectAppContext] if sid was passed.
def connect_apps(sid=:unset)
raise ArgumentError, 'sid cannot be nil' if sid.nil?
if sid != :unset
- return ConnectAppContext.new(@version, @solution[:sid], sid,)
+ return ConnectAppContext.new(@version, @solution[:sid], sid)
end
unless @connect_apps
- @connect_apps = ConnectAppList.new(@version, account_sid: @solution[:sid],)
+ @connect_apps = ConnectAppList.new(@version, account_sid: @solution[:sid])
end
@connect_apps
end
@@ -377,15 +377,15 @@
# @return [IncomingPhoneNumberContext] if sid was passed.
def incoming_phone_numbers(sid=:unset)
raise ArgumentError, 'sid cannot be nil' if sid.nil?
if sid != :unset
- return IncomingPhoneNumberContext.new(@version, @solution[:sid], sid,)
+ return IncomingPhoneNumberContext.new(@version, @solution[:sid], sid)
end
unless @incoming_phone_numbers
- @incoming_phone_numbers = IncomingPhoneNumberList.new(@version, account_sid: @solution[:sid],)
+ @incoming_phone_numbers = IncomingPhoneNumberList.new(@version, account_sid: @solution[:sid])
end
@incoming_phone_numbers
end
@@ -395,15 +395,15 @@
# @return [KeyContext] if sid was passed.
def keys(sid=:unset)
raise ArgumentError, 'sid cannot be nil' if sid.nil?
if sid != :unset
- return KeyContext.new(@version, @solution[:sid], sid,)
+ return KeyContext.new(@version, @solution[:sid], sid)
end
unless @keys
- @keys = KeyList.new(@version, account_sid: @solution[:sid],)
+ @keys = KeyList.new(@version, account_sid: @solution[:sid])
end
@keys
end
@@ -413,15 +413,15 @@
# @return [MessageContext] if sid was passed.
def messages(sid=:unset)
raise ArgumentError, 'sid cannot be nil' if sid.nil?
if sid != :unset
- return MessageContext.new(@version, @solution[:sid], sid,)
+ return MessageContext.new(@version, @solution[:sid], sid)
end
unless @messages
- @messages = MessageList.new(@version, account_sid: @solution[:sid],)
+ @messages = MessageList.new(@version, account_sid: @solution[:sid])
end
@messages
end
@@ -429,11 +429,11 @@
# Access the new_keys
# @return [NewKeyList]
# @return [NewKeyContext]
def new_keys
unless @new_keys
- @new_keys = NewKeyList.new(@version, account_sid: @solution[:sid],)
+ @new_keys = NewKeyList.new(@version, account_sid: @solution[:sid])
end
@new_keys
end
@@ -441,11 +441,11 @@
# Access the new_signing_keys
# @return [NewSigningKeyList]
# @return [NewSigningKeyContext]
def new_signing_keys
unless @new_signing_keys
- @new_signing_keys = NewSigningKeyList.new(@version, account_sid: @solution[:sid],)
+ @new_signing_keys = NewSigningKeyList.new(@version, account_sid: @solution[:sid])
end
@new_signing_keys
end
@@ -455,15 +455,15 @@
# @return [NotificationContext] if sid was passed.
def notifications(sid=:unset)
raise ArgumentError, 'sid cannot be nil' if sid.nil?
if sid != :unset
- return NotificationContext.new(@version, @solution[:sid], sid,)
+ return NotificationContext.new(@version, @solution[:sid], sid)
end
unless @notifications
- @notifications = NotificationList.new(@version, account_sid: @solution[:sid],)
+ @notifications = NotificationList.new(@version, account_sid: @solution[:sid])
end
@notifications
end
@@ -473,15 +473,15 @@
# @return [OutgoingCallerIdContext] if sid was passed.
def outgoing_caller_ids(sid=:unset)
raise ArgumentError, 'sid cannot be nil' if sid.nil?
if sid != :unset
- return OutgoingCallerIdContext.new(@version, @solution[:sid], sid,)
+ return OutgoingCallerIdContext.new(@version, @solution[:sid], sid)
end
unless @outgoing_caller_ids
- @outgoing_caller_ids = OutgoingCallerIdList.new(@version, account_sid: @solution[:sid],)
+ @outgoing_caller_ids = OutgoingCallerIdList.new(@version, account_sid: @solution[:sid])
end
@outgoing_caller_ids
end
@@ -491,15 +491,15 @@
# @return [QueueContext] if sid was passed.
def queues(sid=:unset)
raise ArgumentError, 'sid cannot be nil' if sid.nil?
if sid != :unset
- return QueueContext.new(@version, @solution[:sid], sid,)
+ return QueueContext.new(@version, @solution[:sid], sid)
end
unless @queues
- @queues = QueueList.new(@version, account_sid: @solution[:sid],)
+ @queues = QueueList.new(@version, account_sid: @solution[:sid])
end
@queues
end
@@ -509,15 +509,15 @@
# @return [RecordingContext] if sid was passed.
def recordings(sid=:unset)
raise ArgumentError, 'sid cannot be nil' if sid.nil?
if sid != :unset
- return RecordingContext.new(@version, @solution[:sid], sid,)
+ return RecordingContext.new(@version, @solution[:sid], sid)
end
unless @recordings
- @recordings = RecordingList.new(@version, account_sid: @solution[:sid],)
+ @recordings = RecordingList.new(@version, account_sid: @solution[:sid])
end
@recordings
end
@@ -527,15 +527,15 @@
# @return [SigningKeyContext] if sid was passed.
def signing_keys(sid=:unset)
raise ArgumentError, 'sid cannot be nil' if sid.nil?
if sid != :unset
- return SigningKeyContext.new(@version, @solution[:sid], sid,)
+ return SigningKeyContext.new(@version, @solution[:sid], sid)
end
unless @signing_keys
- @signing_keys = SigningKeyList.new(@version, account_sid: @solution[:sid],)
+ @signing_keys = SigningKeyList.new(@version, account_sid: @solution[:sid])
end
@signing_keys
end
@@ -543,11 +543,11 @@
# Access the sip
# @return [SipList]
# @return [SipContext]
def sip
unless @sip
- @sip = SipList.new(@version, account_sid: @solution[:sid],)
+ @sip = SipList.new(@version, account_sid: @solution[:sid])
end
@sip
end
@@ -557,15 +557,15 @@
# @return [ShortCodeContext] if sid was passed.
def short_codes(sid=:unset)
raise ArgumentError, 'sid cannot be nil' if sid.nil?
if sid != :unset
- return ShortCodeContext.new(@version, @solution[:sid], sid,)
+ return ShortCodeContext.new(@version, @solution[:sid], sid)
end
unless @short_codes
- @short_codes = ShortCodeList.new(@version, account_sid: @solution[:sid],)
+ @short_codes = ShortCodeList.new(@version, account_sid: @solution[:sid])
end
@short_codes
end
@@ -573,11 +573,11 @@
# Access the tokens
# @return [TokenList]
# @return [TokenContext]
def tokens
unless @tokens
- @tokens = TokenList.new(@version, account_sid: @solution[:sid],)
+ @tokens = TokenList.new(@version, account_sid: @solution[:sid])
end
@tokens
end
@@ -587,15 +587,15 @@
# @return [TranscriptionContext] if sid was passed.
def transcriptions(sid=:unset)
raise ArgumentError, 'sid cannot be nil' if sid.nil?
if sid != :unset
- return TranscriptionContext.new(@version, @solution[:sid], sid,)
+ return TranscriptionContext.new(@version, @solution[:sid], sid)
end
unless @transcriptions
- @transcriptions = TranscriptionList.new(@version, account_sid: @solution[:sid],)
+ @transcriptions = TranscriptionList.new(@version, account_sid: @solution[:sid])
end
@transcriptions
end
@@ -603,11 +603,11 @@
# Access the usage
# @return [UsageList]
# @return [UsageContext]
def usage
unless @usage
- @usage = UsageList.new(@version, account_sid: @solution[:sid],)
+ @usage = UsageList.new(@version, account_sid: @solution[:sid])
end
@usage
end
@@ -615,11 +615,11 @@
# Access the validation_requests
# @return [ValidationRequestList]
# @return [ValidationRequestContext]
def validation_requests
unless @validation_requests
- @validation_requests = ValidationRequestList.new(@version, account_sid: @solution[:sid],)
+ @validation_requests = ValidationRequestList.new(@version, account_sid: @solution[:sid])
end
@validation_requests
end
@@ -656,20 +656,20 @@
'uri' => payload['uri'],
}
# Context
@instance_context = nil
- @params = {'sid' => sid || @properties['sid'],}
+ @params = {'sid' => sid || @properties['sid']}
end
##
# Generate an instance context for the instance, the context is capable of
# performing various actions. All instance actions are proxied to the context
# @return [AccountContext] AccountContext for this AccountInstance
def context
unless @instance_context
- @instance_context = AccountContext.new(@version, @params['sid'],)
+ @instance_context = AccountContext.new(@version, @params['sid'])
end
@instance_context
end
##
@@ -745,10 +745,10 @@
# Account
# @param [account.Status] status Alter the status of this account with a given
# Status
# @return [AccountInstance] Updated AccountInstance
def update(friendly_name: :unset, status: :unset)
- context.update(friendly_name: friendly_name, status: status,)
+ context.update(friendly_name: friendly_name, status: status)
end
##
# Access the addresses
# @return [addresses] addresses
\ No newline at end of file