Class: Candid::PayerPlanGroups::V1::Client
- Inherits:
-
Object
- Object
- Candid::PayerPlanGroups::V1::Client
- Defined in:
- lib/candid/payer_plan_groups/v_1/client.rb
Instance Method Summary collapse
-
#create(request_options: {}, **params) ⇒ Candid::PayerPlanGroups::V1::Types::PayerPlanGroup
Create a payer plan group.
-
#deactivate(request_options: {}, **params) ⇒ Candid::PayerPlanGroups::V1::Types::PayerPlanGroup
Marks the payer plan group as deactivated.
-
#get(request_options: {}, **params) ⇒ Candid::PayerPlanGroups::V1::Types::PayerPlanGroup
Return a plan group with a given ID.
-
#get_multi(request_options: {}, **params) ⇒ Candid::PayerPlanGroups::V1::Types::PayerPlanGroupPage
Returns all payer plan groups matching filter criteria.
- #initialize(client:) ⇒ Candid::PayerPlanGroups::V1::Client constructor
-
#update(request_options: {}, **params) ⇒ Candid::PayerPlanGroups::V1::Types::PayerPlanGroup
Update any of the fields on a payer plan group.
Constructor Details
#initialize(client:) ⇒ Candid::PayerPlanGroups::V1::Client
8 9 10 |
# File 'lib/candid/payer_plan_groups/v_1/client.rb', line 8 def initialize(client:) @client = client end |
Instance Method Details
#create(request_options: {}, **params) ⇒ Candid::PayerPlanGroups::V1::Types::PayerPlanGroup
Create a payer plan group
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/candid/payer_plan_groups/v_1/client.rb', line 68 def create(request_options: {}, **params) _request = Candid::Internal::JSON::Request.new( base_url: [:base_url] || Candid::Environment::PRODUCTION, method: "POST", path: "/api/payer-plan-groups/v1", body: Candid::PayerPlanGroups::V1::Types::MutablePayerPlanGroup.new(params).to_h ) begin _response = @client.send(_request) rescue Net::HTTPRequestTimeout raise Candid::Errors::TimeoutError end code = _response.code.to_i if code.between?(200, 299) Candid::PayerPlanGroups::V1::Types::PayerPlanGroup.load(_response.body) else error_class = Candid::Errors::ResponseError.subclass_for_code(code) raise error_class.new(_response.body, code: code) end end |
#deactivate(request_options: {}, **params) ⇒ Candid::PayerPlanGroups::V1::Types::PayerPlanGroup
Marks the payer plan group as deactivated
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/candid/payer_plan_groups/v_1/client.rb', line 116 def deactivate(request_options: {}, **params) _request = Candid::Internal::JSON::Request.new( base_url: [:base_url] || Candid::Environment::PRODUCTION, method: "PATCH", path: "/api/payer-plan-groups/v1/#{params[:payer_plan_group_id]}" ) begin _response = @client.send(_request) rescue Net::HTTPRequestTimeout raise Candid::Errors::TimeoutError end code = _response.code.to_i if code.between?(200, 299) Candid::PayerPlanGroups::V1::Types::PayerPlanGroup.load(_response.body) else error_class = Candid::Errors::ResponseError.subclass_for_code(code) raise error_class.new(_response.body, code: code) end end |
#get(request_options: {}, **params) ⇒ Candid::PayerPlanGroups::V1::Types::PayerPlanGroup
Return a plan group with a given ID.
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/candid/payer_plan_groups/v_1/client.rb', line 45 def get(request_options: {}, **params) _request = Candid::Internal::JSON::Request.new( base_url: [:base_url] || Candid::Environment::PRODUCTION, method: "GET", path: "/api/payer-plan-groups/v1/#{params[:payer_plan_group_id]}" ) begin _response = @client.send(_request) rescue Net::HTTPRequestTimeout raise Candid::Errors::TimeoutError end code = _response.code.to_i if code.between?(200, 299) Candid::PayerPlanGroups::V1::Types::PayerPlanGroup.load(_response.body) else error_class = Candid::Errors::ResponseError.subclass_for_code(code) raise error_class.new(_response.body, code: code) end end |
#get_multi(request_options: {}, **params) ⇒ Candid::PayerPlanGroups::V1::Types::PayerPlanGroupPage
Returns all payer plan groups matching filter criteria.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/candid/payer_plan_groups/v_1/client.rb', line 15 def get_multi(request_options: {}, **params) params = Candid::Internal::Types::Utils.symbolize_keys(params) _query_param_names = i[plan_group_name payer_uuid payer_id plan_type is_active payer_plan_group_id limit sort_by_similarity sort sort_direction page_token] _query = params.slice(*_query_param_names) params.except(*_query_param_names) _request = Candid::Internal::JSON::Request.new( base_url: [:base_url] || Candid::Environment::PRODUCTION, method: "GET", path: "/api/payer-plan-groups/v1", query: _query ) begin _response = @client.send(_request) rescue Net::HTTPRequestTimeout raise Candid::Errors::TimeoutError end code = _response.code.to_i if code.between?(200, 299) Candid::PayerPlanGroups::V1::Types::PayerPlanGroupPage.load(_response.body) else error_class = Candid::Errors::ResponseError.subclass_for_code(code) raise error_class.new(_response.body, code: code) end end |
#update(request_options: {}, **params) ⇒ Candid::PayerPlanGroups::V1::Types::PayerPlanGroup
Update any of the fields on a payer plan group
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/candid/payer_plan_groups/v_1/client.rb', line 92 def update(request_options: {}, **params) _request = Candid::Internal::JSON::Request.new( base_url: [:base_url] || Candid::Environment::PRODUCTION, method: "PUT", path: "/api/payer-plan-groups/v1/#{params[:payer_plan_group_id]}", body: Candid::PayerPlanGroups::V1::Types::MutablePayerPlanGroup.new(params).to_h ) begin _response = @client.send(_request) rescue Net::HTTPRequestTimeout raise Candid::Errors::TimeoutError end code = _response.code.to_i if code.between?(200, 299) Candid::PayerPlanGroups::V1::Types::PayerPlanGroup.load(_response.body) else error_class = Candid::Errors::ResponseError.subclass_for_code(code) raise error_class.new(_response.body, code: code) end end |