Class: Twilio::REST::Serverless::V1::ServiceContext::BuildContext::BuildStatusInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/serverless/v1/service/build/build_status.rb

Overview

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, service_sid: nil, sid: nil) ⇒ BuildStatusInstance

Initialize the BuildStatusInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • service_sid (String) (defaults to: nil)

    The SID of the Service that the Build resource is associated with.

  • sid (String) (defaults to: nil)

    The unique string that we created to identify the Build resource.


135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/twilio-ruby/rest/serverless/v1/service/build/build_status.rb', line 135

def initialize(version, payload, service_sid: nil, sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'sid' => payload['sid'],
      'account_sid' => payload['account_sid'],
      'service_sid' => payload['service_sid'],
      'status' => payload['status'],
      'url' => payload['url'],
  }

  # Context
  @instance_context = nil
  @params = {'service_sid' => service_sid, 'sid' => sid, }
end

Instance Method Details

#account_sidString

Returns The SID of the Account that created the Build resource.

Returns:

  • (String)

    The SID of the Account that created the Build resource


171
172
173
# File 'lib/twilio-ruby/rest/serverless/v1/service/build/build_status.rb', line 171

def 
  @properties['account_sid']
end

#contextBuildStatusContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:


156
157
158
159
160
161
# File 'lib/twilio-ruby/rest/serverless/v1/service/build/build_status.rb', line 156

def context
  unless @instance_context
    @instance_context = BuildStatusContext.new(@version, @params['service_sid'], @params['sid'], )
  end
  @instance_context
end

#fetchBuildStatusInstance

Fetch the BuildStatusInstance

Returns:


196
197
198
# File 'lib/twilio-ruby/rest/serverless/v1/service/build/build_status.rb', line 196

def fetch
  context.fetch
end

#inspectObject

Provide a detailed, user friendly representation


209
210
211
212
# File 'lib/twilio-ruby/rest/serverless/v1/service/build/build_status.rb', line 209

def inspect
  values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Serverless.V1.BuildStatusInstance #{values}>"
end

#service_sidString

Returns The SID of the Service that the Build resource is associated with.

Returns:

  • (String)

    The SID of the Service that the Build resource is associated with


177
178
179
# File 'lib/twilio-ruby/rest/serverless/v1/service/build/build_status.rb', line 177

def service_sid
  @properties['service_sid']
end

#sidString

Returns The unique string that identifies the Build resource.

Returns:

  • (String)

    The unique string that identifies the Build resource


165
166
167
# File 'lib/twilio-ruby/rest/serverless/v1/service/build/build_status.rb', line 165

def sid
  @properties['sid']
end

#statusbuild_status.Status

Returns The status of the Build.

Returns:


183
184
185
# File 'lib/twilio-ruby/rest/serverless/v1/service/build/build_status.rb', line 183

def status
  @properties['status']
end

#to_sObject

Provide a user friendly representation


202
203
204
205
# File 'lib/twilio-ruby/rest/serverless/v1/service/build/build_status.rb', line 202

def to_s
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Serverless.V1.BuildStatusInstance #{values}>"
end

#urlString

Returns The absolute URL of the Build Status resource.

Returns:

  • (String)

    The absolute URL of the Build Status resource


189
190
191
# File 'lib/twilio-ruby/rest/serverless/v1/service/build/build_status.rb', line 189

def url
  @properties['url']
end