Class: PactBroker::Client::Webhooks::Create
- Inherits:
-
Object
- Object
- PactBroker::Client::Webhooks::Create
- Defined in:
- lib/pact_broker/client/webhooks/create.rb
Constant Summary collapse
- WEBHOOKS_WITH_OPTIONAL_PACTICICPANTS_NOT_SUPPORTED =
"This version of the Pact Broker requires that both consumer and provider are specified for a webhook. Please upgrade your broker to >= 2.22.0 to create a webhook with optional consumer and provider."
- CREATING_WEBHOOK_WITH_UUID_NOT_SUPPORTED =
"This version of the Pact Broker does not support creating webhooks with a specified UUID. Please upgrade your broker to >= 2.49.0 or use the create-webhook command."
Instance Attribute Summary collapse
-
#basic_auth_options ⇒ Object
readonly
Returns the value of attribute basic_auth_options.
-
#pact_broker_base_url ⇒ Object
readonly
Returns the value of attribute pact_broker_base_url.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#verbose ⇒ Object
readonly
Returns the value of attribute verbose.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(params, pact_broker_base_url, pact_broker_client_options) ⇒ Create
constructor
A new instance of Create.
Constructor Details
#initialize(params, pact_broker_base_url, pact_broker_client_options) ⇒ Create
Returns a new instance of Create.
25 26 27 28 29 |
# File 'lib/pact_broker/client/webhooks/create.rb', line 25 def initialize(params, pact_broker_base_url, ) @params = OpenStruct.new(params) @pact_broker_base_url = pact_broker_base_url @http_client = PactBroker::Client::Hal::HttpClient.new(.merge([:basic_auth] || {})) end |
Instance Attribute Details
#basic_auth_options ⇒ Object (readonly)
Returns the value of attribute basic_auth_options.
19 20 21 |
# File 'lib/pact_broker/client/webhooks/create.rb', line 19 def @basic_auth_options end |
#pact_broker_base_url ⇒ Object (readonly)
Returns the value of attribute pact_broker_base_url.
19 20 21 |
# File 'lib/pact_broker/client/webhooks/create.rb', line 19 def pact_broker_base_url @pact_broker_base_url end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
19 20 21 |
# File 'lib/pact_broker/client/webhooks/create.rb', line 19 def params @params end |
#verbose ⇒ Object (readonly)
Returns the value of attribute verbose.
19 20 21 |
# File 'lib/pact_broker/client/webhooks/create.rb', line 19 def verbose @verbose end |
Class Method Details
.call(params, pact_broker_base_url, pact_broker_client_options) ⇒ Object
21 22 23 |
# File 'lib/pact_broker/client/webhooks/create.rb', line 21 def self.call(params, pact_broker_base_url, ) new(params, pact_broker_base_url, ).call end |
Instance Method Details
#call ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/pact_broker/client/webhooks/create.rb', line 31 def call if params.consumer && params.provider && !params.uuid create_webhook_with_consumer_and_provider else create_webhook_with_optional_consumer_and_provider end end |