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

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

Instance Method Summary collapse

Constructor Details

#initialize(version, service_sid, sid) ⇒ BuildStatusContext

Initialize the BuildStatusContext

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.



53
54
55
56
57
58
59
60
61
# File 'lib/twilio-ruby/rest/serverless/v1/service/build/build_status.rb', line 53

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]}/Status"

    
end

Instance Method Details

#fetchBuildStatusInstance

Fetch the BuildStatusInstance

Returns:



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/twilio-ruby/rest/serverless/v1/service/build/build_status.rb', line 65

def fetch

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

#inspectObject

Provide a detailed, user friendly representation



92
93
94
95
# File 'lib/twilio-ruby/rest/serverless/v1/service/build/build_status.rb', line 92

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

#to_sObject

Provide a user friendly representation



85
86
87
88
# File 'lib/twilio-ruby/rest/serverless/v1/service/build/build_status.rb', line 85

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