Class: VericredClient::ProviderNotificationSubscriptionsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/vericred_client/api/provider_notification_subscriptions_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ProviderNotificationSubscriptionsApi

Returns a new instance of ProviderNotificationSubscriptionsApi.



19
20
21
# File 'lib/vericred_client/api/provider_notification_subscriptions_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/vericred_client/api/provider_notification_subscriptions_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_provider_notification_subscription(opts = {}) ⇒ NotificationSubscriptionResponse

Subscribe Subscribe to receive webhook notifications when providers join or leave a network. The request must include a list of National Provider Index (NPI) numbers for providers, a callback URL where notifications should be sent, and either a plan ID or a network ID. The response will include a ‘nonce` value. The `nonce` will be included in all webhook notifications originating from this subscription and will be used as the identifier for all subsequent requests. The `network_id` and `plan_id` are mutually exclusive. The request must include a value for one of the fields, but cannot include both. Examples of valid request bodies are as follows: “` { "npis": ["2712589", "8498549", "19528190"], "plan_id": 1, "callback_url": "example.com/webhook" } “` “` { "npis": ["2712589", "8498549", "19528190"], "network_id": 1, "callback_url": "example.com/webhook" } “`

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



28
29
30
31
# File 'lib/vericred_client/api/provider_notification_subscriptions_api.rb', line 28

def create_provider_notification_subscription(opts = {})
  data, _status_code, _headers = create_provider_notification_subscription_with_http_info(opts)
  return data
end

#create_provider_notification_subscription_with_http_info(opts = {}) ⇒ Array<(NotificationSubscriptionResponse, Fixnum, Hash)>

Subscribe Subscribe to receive webhook notifications when providers join or leave a network. The request must include a list of National Provider Index (NPI) numbers for providers, a callback URL where notifications should be sent, and either a plan ID or a network ID. The response will include a &#x60;nonce&#x60; value. The &#x60;nonce&#x60; will be included in all webhook notifications originating from this subscription and will be used as the identifier for all subsequent requests. The &#x60;network_id&#x60; and &#x60;plan_id&#x60; are mutually exclusive. The request must include a value for one of the fields, but cannot include both. Examples of valid request bodies are as follows: &#x60;&#x60;&#x60; { &quot;npis&quot;: [&quot;2712589&quot;, &quot;8498549&quot;, &quot;19528190&quot;], &quot;plan_id&quot;: 1, &quot;callback_url&quot;: &quot;example.com/webhook&quot; } &#x60;&#x60;&#x60; &#x60;&#x60;&#x60; { &quot;npis&quot;: [&quot;2712589&quot;, &quot;8498549&quot;, &quot;19528190&quot;], &quot;network_id&quot;: 1, &quot;callback_url&quot;: &quot;example.com/webhook&quot; } &#x60;&#x60;&#x60;

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/vericred_client/api/provider_notification_subscriptions_api.rb', line 38

def create_provider_notification_subscription_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProviderNotificationSubscriptionsApi.create_provider_notification_subscription ..."
  end
  # resource path
  local_var_path = "/providers/subscription"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'root'])
  auth_names = ['Vericred-Api-Key']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'NotificationSubscriptionResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProviderNotificationSubscriptionsApi#create_provider_notification_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_provider_notification_subscription(nonce, opts = {}) ⇒ nil

Unsubscribe Unsubscribe from an existing webhook notification.

Parameters:

  • nonce

    The nonce value that was included in the response when the subscription was created

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


79
80
81
82
# File 'lib/vericred_client/api/provider_notification_subscriptions_api.rb', line 79

def delete_provider_notification_subscription(nonce, opts = {})
  delete_provider_notification_subscription_with_http_info(nonce, opts)
  return nil
end

#delete_provider_notification_subscription_with_http_info(nonce, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Unsubscribe Unsubscribe from an existing webhook notification.

Parameters:

  • nonce

    The nonce value that was included in the response when the subscription was created

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/vericred_client/api/provider_notification_subscriptions_api.rb', line 89

def delete_provider_notification_subscription_with_http_info(nonce, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProviderNotificationSubscriptionsApi.delete_provider_notification_subscription ..."
  end
  # verify the required parameter 'nonce' is set
  if @api_client.config.client_side_validation && nonce.nil?
    fail ArgumentError, "Missing the required parameter 'nonce' when calling ProviderNotificationSubscriptionsApi.delete_provider_notification_subscription"
  end
  # resource path
  local_var_path = "/providers/subscription/{nonce}".sub('{' + 'nonce' + '}', nonce.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['Vericred-Api-Key']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProviderNotificationSubscriptionsApi#delete_provider_notification_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#notify_provider_notification_subscription(opts = {}) ⇒ nil

Webhook Webhook notifications are sent when there are events relevant to a subscription. Notifications will be sent to the callback URL that was provided in the original request. The endpoint handling this request should respond with a successful status code (200 <= Status Code < 300). If a successful status code is not returned the notification will be sent again at a regular interval.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

  • (nil)


131
132
133
134
# File 'lib/vericred_client/api/provider_notification_subscriptions_api.rb', line 131

def notify_provider_notification_subscription(opts = {})
  notify_provider_notification_subscription_with_http_info(opts)
  return nil
end

#notify_provider_notification_subscription_with_http_info(opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Webhook Webhook notifications are sent when there are events relevant to a subscription. Notifications will be sent to the callback URL that was provided in the original request. The endpoint handling this request should respond with a successful status code (200 &lt;&#x3D; Status Code &lt; 300). If a successful status code is not returned the notification will be sent again at a regular interval.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# File 'lib/vericred_client/api/provider_notification_subscriptions_api.rb', line 141

def notify_provider_notification_subscription_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProviderNotificationSubscriptionsApi.notify_provider_notification_subscription ..."
  end
  # resource path
  local_var_path = "/CALLBACK_URL"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'root'])
  auth_names = ['Vericred-Api-Key']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProviderNotificationSubscriptionsApi#notify_provider_notification_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end