Class: PactBroker::Webhooks::ExecutionConfiguration

Inherits:
Object
  • Object
show all
Defined in:
lib/pact_broker/webhooks/execution_configuration.rb

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ ExecutionConfiguration

Returns a new instance of ExecutionConfiguration.



8
9
10
# File 'lib/pact_broker/webhooks/execution_configuration.rb', line 8

def initialize(params = {})
  @params = params
end

Instance Method Details

#[](key) ⇒ Object



64
65
66
# File 'lib/pact_broker/webhooks/execution_configuration.rb', line 64

def [](key)
  params[key]
end

#retry_scheduleObject



60
61
62
# File 'lib/pact_broker/webhooks/execution_configuration.rb', line 60

def retry_schedule
  self[:retry_schedule]
end

#to_hashObject



68
69
70
# File 'lib/pact_broker/webhooks/execution_configuration.rb', line 68

def to_hash
  params
end

#webhook_contextObject



56
57
58
# File 'lib/pact_broker/webhooks/execution_configuration.rb', line 56

def webhook_context
  self[:webhook_context]
end

#with_cert_store(value) ⇒ Object



52
53
54
# File 'lib/pact_broker/webhooks/execution_configuration.rb', line 52

def with_cert_store(value)
  with_updated_attribute(cert_store: value)
end

#with_disable_ssl_verification(value) ⇒ Object



48
49
50
# File 'lib/pact_broker/webhooks/execution_configuration.rb', line 48

def with_disable_ssl_verification(value)
  with_updated_attribute(disable_ssl_verification: value)
end

#with_failure_log_message(value) ⇒ Object



24
25
26
# File 'lib/pact_broker/webhooks/execution_configuration.rb', line 24

def with_failure_log_message(value)
  with_updated_attribute(logging_options: { failure_log_message: value })
end

#with_http_success_codes(value) ⇒ Object



36
37
38
# File 'lib/pact_broker/webhooks/execution_configuration.rb', line 36

def with_http_success_codes(value)
  with_updated_attribute(http_success_codes: value)
end

#with_redact_sensitive_data(value) ⇒ Object



28
29
30
# File 'lib/pact_broker/webhooks/execution_configuration.rb', line 28

def with_redact_sensitive_data(value)
  with_updated_attribute(logging_options: { redact_sensitive_data: value })
end

#with_retry_schedule(value) ⇒ Object



32
33
34
# File 'lib/pact_broker/webhooks/execution_configuration.rb', line 32

def with_retry_schedule(value)
  with_updated_attribute(retry_schedule: value)
end

#with_show_response(value) ⇒ Object



16
17
18
# File 'lib/pact_broker/webhooks/execution_configuration.rb', line 16

def with_show_response(value)
  with_updated_attribute(logging_options: { show_response: value })
end

#with_success_log_message(value) ⇒ Object



20
21
22
# File 'lib/pact_broker/webhooks/execution_configuration.rb', line 20

def with_success_log_message(value)
  with_updated_attribute(logging_options: { success_log_message: value })
end

#with_updated_attribute(new_attribute) ⇒ Object



12
13
14
# File 'lib/pact_broker/webhooks/execution_configuration.rb', line 12

def with_updated_attribute(new_attribute)
  ExecutionConfiguration.new(params.deep_merge(new_attribute))
end

#with_user_agent(value) ⇒ Object



44
45
46
# File 'lib/pact_broker/webhooks/execution_configuration.rb', line 44

def with_user_agent(value)
  with_updated_attribute(user_agent: value)
end

#with_webhook_context(value) ⇒ Object



40
41
42
# File 'lib/pact_broker/webhooks/execution_configuration.rb', line 40

def with_webhook_context(value)
  with_updated_attribute(webhook_context: value)
end