Class: CandidApiClient::BillingNotes::V2::AsyncV2Client

Inherits:
Object
  • Object
show all
Defined in:
lib/candidhealth/billing_notes/v_2/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_client:) ⇒ CandidApiClient::BillingNotes::V2::AsyncV2Client

Parameters:



59
60
61
# File 'lib/candidhealth/billing_notes/v_2/client.rb', line 59

def initialize(request_client:)
  @request_client = request_client
end

Instance Attribute Details

#request_clientCandidApiClient::AsyncRequestClient (readonly)



55
56
57
# File 'lib/candidhealth/billing_notes/v_2/client.rb', line 55

def request_client
  @request_client
end

Instance Method Details

#create(text:, encounter_id:, additional_properties: nil, _field_set: nil, request_options: nil) ⇒ CandidApiClient::BillingNotes::V2::Types::BillingNote

Examples:

api = CandidApiClient::Client.new(base_url: "https://api.example.com", environment: CandidApiClient::Environment::PRODUCTION)
api.billing_notes.v_2.create(encounter_id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")

Parameters:

  • text (String)

    Empty string not allowed.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition

  • _field_set (Object) (defaults to: nil)
  • encounter_id (String)
  • request_options (CandidApiClient::RequestOptions) (defaults to: nil)

Returns:



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/candidhealth/billing_notes/v_2/client.rb', line 72

def create(text:, encounter_id:, additional_properties: nil, _field_set: nil, request_options: nil)
  Async do
    response = @request_client.conn.post do |req|
      req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
      req.headers["Authorization"] = request_options.token unless request_options&.token.nil?
      req.headers = {
    **(req.headers || {}),
    **@request_client.get_headers,
    **(request_options&.additional_headers || {})
      }.compact
      req.body = {
        **(request_options&.additional_body_parameters || {}),
        text: text,
        additional_properties: additional_properties,
        _field_set: _field_set,
        encounter_id: encounter_id
      }.compact
      req.url "#{@request_client.get_url(environment: CandidApi,
                                         request_options: request_options)}/api/billing_notes/v2"
    end
    CandidApiClient::BillingNotes::V2::Types::BillingNote.from_json(json_object: response.body)
  end
end