Class: Twilio::REST::Accounts::V1::AuthTokenPromotionContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb

Instance Method Summary collapse

Constructor Details

#initialize(version) ⇒ AuthTokenPromotionContext

Initialize the AuthTokenPromotionContext

Parameters:

  • version (Version)

    Version that contains the resource



49
50
51
52
53
54
55
56
57
58
# File 'lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb', line 49

def initialize(version)
    super(version)
    

    # Path Solution
    @solution = {  }
    @uri = "/AuthTokens/Promote"

    
end

Instance Method Details

#inspectObject

Provide a detailed, user friendly representation



125
126
127
128
# File 'lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb', line 125

def inspect
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Accounts.V1.AuthTokenPromotionContext #{context}>"
end

#to_sObject

Provide a user friendly representation



118
119
120
121
# File 'lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb', line 118

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Accounts.V1.AuthTokenPromotionContext #{context}>"
end

#update(suppress_email_notification: :unset) ⇒ AuthTokenPromotionInstance

Update the AuthTokenPromotionInstance

Parameters:

  • suppress_email_notification (Boolean) (defaults to: :unset)

    Whether to suppress the email notification that Twilio sends to the owners and administrators of the account about this Auth Token change. Defaults to false, so Twilio sends the email. Set to true when rotating Auth Tokens across many subaccounts.

Returns:



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb', line 63

def update(
  suppress_email_notification: :unset
)

    data = Twilio::Values.of({
        'SuppressEmailNotification' => suppress_email_notification,
    })

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.update('POST', @uri, data: data, headers: headers)
    AuthTokenPromotionInstance.new(
        @version,
        payload,
    )
end

#update_with_metadata(suppress_email_notification: :unset) ⇒ AuthTokenPromotionInstance

Update the AuthTokenPromotionInstanceMetadata

Parameters:

  • suppress_email_notification (Boolean) (defaults to: :unset)

    Whether to suppress the email notification that Twilio sends to the owners and administrators of the account about this Auth Token change. Defaults to false, so Twilio sends the email. Set to true when rotating Auth Tokens across many subaccounts.

Returns:



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb', line 88

def (
  suppress_email_notification: :unset
)

    data = Twilio::Values.of({
        'SuppressEmailNotification' => suppress_email_notification,
    })

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    response = @version.('POST', @uri, data: data, headers: headers)
    auth_token_promotion_instance = AuthTokenPromotionInstance.new(
        @version,
        response.body,
    )
    AuthTokenPromotionInstanceMetadata.new(
        @version,
        auth_token_promotion_instance,
        response.headers,
        response.status_code
    )
end