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

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

Defined Under Namespace

Classes: BuildStatusContext, BuildStatusInstance, BuildStatusList, BuildStatusPage

Instance Method Summary collapse

Constructor Details

#initialize(version, service_sid, sid) ⇒ BuildContext

Initialize the BuildContext

Parameters:

  • version (Version)

    Version that contains the resource

  • service_sid (String)

    The SID of the Service to fetch the Build resource from.

  • sid (String)

    The SID of the Build resource to fetch.



174
175
176
177
178
179
180
181
182
183
# File 'lib/twilio-ruby/rest/serverless/v1/service/build.rb', line 174

def initialize(version, service_sid, sid)
    super(version)

    # Path Solution
    @solution = { service_sid: service_sid, sid: sid,  }
    @uri = "/Services/#{@solution[:service_sid]}/Builds/#{@solution[:sid]}"

    # Dependents
    @build_status = nil
end

Instance Method Details

#build_statusBuildStatusList, BuildStatusContext

Access the build_status



220
221
222
223
224
225
226
# File 'lib/twilio-ruby/rest/serverless/v1/service/build.rb', line 220

def build_status
    BuildStatusContext.new(
            @version,
            @solution[:service_sid],
            @solution[:sid]
            )
end

#deleteBoolean

Delete the BuildInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



187
188
189
190
191
192
193
194
# File 'lib/twilio-ruby/rest/serverless/v1/service/build.rb', line 187

def delete

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    @version.delete('DELETE', @uri, headers: headers)
end

#fetchBuildInstance

Fetch the BuildInstance

Returns:



199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# File 'lib/twilio-ruby/rest/serverless/v1/service/build.rb', line 199

def fetch

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.fetch('GET', @uri, headers: headers)
    BuildInstance.new(
        @version,
        payload,
        service_sid: @solution[:service_sid],
        sid: @solution[:sid],
    )
end

#inspectObject

Provide a detailed, user friendly representation



237
238
239
240
# File 'lib/twilio-ruby/rest/serverless/v1/service/build.rb', line 237

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

#to_sObject

Provide a user friendly representation



230
231
232
233
# File 'lib/twilio-ruby/rest/serverless/v1/service/build.rb', line 230

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