Class: PactBroker::Client::Pacticipants
Instance Attribute Summary
Attributes inherited from BaseClient
#base_url, #client_options
Instance Method Summary
collapse
Methods inherited from BaseClient
#default_get_headers, #default_patch_headers, #default_put_headers, #default_request_headers, #get, #handle_response, #initialize, #patch, #put, #url_for_relation, #verbose?
#string_keys_to_symbols
Methods included from UrlHelpers
#encode_param, #encode_query_param
Instance Method Details
#get1(options) ⇒ Object
19
20
21
22
23
24
|
# File 'lib/pact_broker/client/pacticipants.rb', line 19
def get1 options
response = get(pacticipant_base_url(options), headers: )
handle_response(response) do
JSON.parse(response.body)
end
end
|
#list ⇒ Object
26
27
28
29
30
31
|
# File 'lib/pact_broker/client/pacticipants.rb', line 26
def list
response = get("/pacticipants", headers: )
handle_response(response) do
JSON.parse(response.body)
end
end
|
#repository_url(options) ⇒ Object
33
34
35
36
37
38
|
# File 'lib/pact_broker/client/pacticipants.rb', line 33
def repository_url options
response = get("#{pacticipant_base_url(options)}/repository_url", headers: .merge('Accept' => 'text/plain'))
handle_response(response) do
response.body
end
end
|
#update(options) ⇒ Object
11
12
13
14
15
16
17
|
# File 'lib/pact_broker/client/pacticipants.rb', line 11
def update options
body = options.select{ | key, v | [:repository_url].include?(key)}
response = patch(pacticipant_base_url(options), body: body, headers: )
handle_response(response) do
true
end
end
|
#versions ⇒ Object
7
8
9
|
# File 'lib/pact_broker/client/pacticipants.rb', line 7
def versions
Versions.new base_url: base_url, client_options: client_options
end
|