Class: PactBroker::Api::Resources::Verifications
Instance Method Summary
collapse
#maybe_params_with_consumer_version_number, #metadata, #pact_params
#webhook_execution_configuration
Instance Method Details
#allowed_methods ⇒ Object
24
25
26
|
# File 'lib/pact_broker/api/resources/verifications.rb', line 24
def allowed_methods
["POST", "OPTIONS"]
end
|
#content_types_accepted ⇒ Object
16
17
18
|
# File 'lib/pact_broker/api/resources/verifications.rb', line 16
def content_types_accepted
[["application/json", :from_json]]
end
|
#content_types_provided ⇒ Object
20
21
22
|
# File 'lib/pact_broker/api/resources/verifications.rb', line 20
def content_types_provided
[["application/hal+json", :to_json]]
end
|
#create_path ⇒ Object
48
49
50
|
# File 'lib/pact_broker/api/resources/verifications.rb', line 48
def create_path
new_verification_url(pact, next_verification_number, base_url)
end
|
#from_json ⇒ Object
52
53
54
55
56
|
# File 'lib/pact_broker/api/resources/verifications.rb', line 52
def from_json
verification = verification_service.create(next_verification_number, verification_params, pact, event_context, webhook_options)
response.body = decorator_for(verification).to_json(decorator_options)
true
end
|
36
37
38
39
40
41
42
43
44
45
46
|
# File 'lib/pact_broker/api/resources/verifications.rb', line 36
def malformed_request?
if request.post?
return true if invalid_json?
errors = verification_service.errors(params)
if !errors.empty?
set_json_validation_error_messages(errors.messages)
return true
end
end
false
end
|
#policy_name ⇒ Object
58
59
60
|
# File 'lib/pact_broker/api/resources/verifications.rb', line 58
def policy_name
:'verifications::verifications'
end
|
#policy_pacticipant ⇒ Object
62
63
64
|
# File 'lib/pact_broker/api/resources/verifications.rb', line 62
def policy_pacticipant
provider
end
|
#post_is_create? ⇒ Boolean
28
29
30
|
# File 'lib/pact_broker/api/resources/verifications.rb', line 28
def post_is_create?
true
end
|
#resource_exists? ⇒ Boolean
32
33
34
|
# File 'lib/pact_broker/api/resources/verifications.rb', line 32
def resource_exists?
!!pact
end
|