Class: DocusignDtr::Client
- Inherits:
-
Object
- Object
- DocusignDtr::Client
- Includes:
- HTTParty
- Defined in:
- lib/docusign_dtr/client.rb
Overview
rubocop:disable Metrics/ClassLength
Instance Attribute Summary collapse
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
-
#Activity ⇒ Object
rubocop:disable Naming/MethodName.
- #base_uri ⇒ Object
-
#Document ⇒ Object
rubocop:disable Naming/MethodName.
- #get(page, params = {}) ⇒ Object
- #handle_error(response) ⇒ Object
-
#initialize(token:, test_mode: true, application: 'docusign_dtr') ⇒ Client
constructor
A new instance of Client.
-
#Member ⇒ Object
rubocop:disable Naming/MethodName.
-
#MetaActivityType ⇒ Object
rubocop:disable Naming/MethodName.
-
#MetaClosingStatus ⇒ Object
rubocop:disable Naming/MethodName.
-
#MetaContactSide ⇒ Object
rubocop:disable Naming/MethodName.
-
#MetaCountry ⇒ Object
rubocop:disable Naming/MethodName.
-
#MetaCurrency ⇒ Object
rubocop:disable Naming/MethodName.
-
#MetaFinancingType ⇒ Object
rubocop:disable Naming/MethodName.
-
#MetaOriginOfLeadType ⇒ Object
rubocop:disable Naming/MethodName.
-
#MetaPropertyType ⇒ Object
rubocop:disable Naming/MethodName.
-
#MetaRole ⇒ Object
rubocop:disable Naming/MethodName.
-
#MetaRoomContactType ⇒ Object
rubocop:disable Naming/MethodName.
-
#MetaSellerDecisionType ⇒ Object
rubocop:disable Naming/MethodName.
-
#MetaSpecialCircumstanceType ⇒ Object
rubocop:disable Naming/MethodName.
-
#MetaState ⇒ Object
rubocop:disable Naming/MethodName.
-
#MetaTaskDateType ⇒ Object
rubocop:disable Naming/MethodName.
-
#MetaTimezone ⇒ Object
rubocop:disable Naming/MethodName.
-
#MetaTransactionSide ⇒ Object
rubocop:disable Naming/MethodName.
-
#Office ⇒ Object
rubocop:disable Naming/MethodName.
-
#Profile ⇒ Object
rubocop:disable Naming/MethodName.
- #raw(page, params = {}) ⇒ Object
-
#Region ⇒ Object
rubocop:disable Naming/MethodName.
-
#Room ⇒ Object
rubocop:disable Naming/MethodName.
-
#TaskList ⇒ Object
rubocop:disable Naming/MethodName.
-
#Title ⇒ Object
rubocop:disable Naming/MethodName.
-
#User ⇒ Object
rubocop:disable Naming/MethodName.
Constructor Details
#initialize(token:, test_mode: true, application: 'docusign_dtr') ⇒ Client
Returns a new instance of Client.
6 7 8 9 10 11 |
# File 'lib/docusign_dtr/client.rb', line 6 def initialize(token:, test_mode: true, application: 'docusign_dtr') @test_mode = test_mode @token = token @application = application raise 'Missing Token' unless token end |
Instance Attribute Details
#token ⇒ Object
Returns the value of attribute token.
4 5 6 |
# File 'lib/docusign_dtr/client.rb', line 4 def token @token end |
Instance Method Details
#Activity ⇒ Object
rubocop:disable Naming/MethodName
117 118 119 |
# File 'lib/docusign_dtr/client.rb', line 117 def Activity # rubocop:disable Naming/MethodName @activity ||= DocusignDtr::Activity.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName end |
#base_uri ⇒ Object
133 134 135 |
# File 'lib/docusign_dtr/client.rb', line 133 def base_uri @base_uri ||= @test_mode ? 'https://demo.rooms.docusign.com/restapi/v1' : 'https://rooms.docusign.com/restapi/v1' end |
#Document ⇒ Object
rubocop:disable Naming/MethodName
29 30 31 |
# File 'lib/docusign_dtr/client.rb', line 29 def Document # rubocop:disable Naming/MethodName @document ||= DocusignDtr::Document.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName end |
#get(page, params = {}) ⇒ Object
13 14 15 16 |
# File 'lib/docusign_dtr/client.rb', line 13 def get(page, params = {}) response = raw(page, params) snakify(response) end |
#handle_error(response) ⇒ Object
25 26 27 |
# File 'lib/docusign_dtr/client.rb', line 25 def handle_error(response) DocusignDtr::Auth::Error.new(response:).build end |
#Member ⇒ Object
rubocop:disable Naming/MethodName
33 34 35 |
# File 'lib/docusign_dtr/client.rb', line 33 def Member # rubocop:disable Naming/MethodName @member ||= DocusignDtr::Member.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName end |
#MetaActivityType ⇒ Object
rubocop:disable Naming/MethodName
37 38 39 |
# File 'lib/docusign_dtr/client.rb', line 37 def MetaActivityType # rubocop:disable Naming/MethodName @meta_activity_type ||= DocusignDtr::MetaActivityType.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName end |
#MetaClosingStatus ⇒ Object
rubocop:disable Naming/MethodName
41 42 43 |
# File 'lib/docusign_dtr/client.rb', line 41 def MetaClosingStatus # rubocop:disable Naming/MethodName @meta_closing_status ||= DocusignDtr::MetaClosingStatus.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName end |
#MetaContactSide ⇒ Object
rubocop:disable Naming/MethodName
45 46 47 |
# File 'lib/docusign_dtr/client.rb', line 45 def MetaContactSide # rubocop:disable Naming/MethodName @meta_contact_side ||= DocusignDtr::MetaContactSide.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName end |
#MetaCountry ⇒ Object
rubocop:disable Naming/MethodName
49 50 51 |
# File 'lib/docusign_dtr/client.rb', line 49 def MetaCountry # rubocop:disable Naming/MethodName @meta_country ||= DocusignDtr::MetaCountry.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName end |
#MetaCurrency ⇒ Object
rubocop:disable Naming/MethodName
53 54 55 |
# File 'lib/docusign_dtr/client.rb', line 53 def MetaCurrency # rubocop:disable Naming/MethodName @meta_currency ||= DocusignDtr::MetaCurrency.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName end |
#MetaFinancingType ⇒ Object
rubocop:disable Naming/MethodName
57 58 59 |
# File 'lib/docusign_dtr/client.rb', line 57 def MetaFinancingType # rubocop:disable Naming/MethodName @meta_financing_type ||= DocusignDtr::MetaFinancingType.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName end |
#MetaOriginOfLeadType ⇒ Object
rubocop:disable Naming/MethodName
61 62 63 |
# File 'lib/docusign_dtr/client.rb', line 61 def MetaOriginOfLeadType # rubocop:disable Naming/MethodName @meta_origin_of_lead_type ||= DocusignDtr::MetaOriginOfLeadType.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName end |
#MetaPropertyType ⇒ Object
rubocop:disable Naming/MethodName
65 66 67 |
# File 'lib/docusign_dtr/client.rb', line 65 def MetaPropertyType # rubocop:disable Naming/MethodName @meta_property_type ||= DocusignDtr::MetaPropertyType.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName end |
#MetaRole ⇒ Object
rubocop:disable Naming/MethodName
69 70 71 |
# File 'lib/docusign_dtr/client.rb', line 69 def MetaRole # rubocop:disable Naming/MethodName @meta_role ||= DocusignDtr::MetaRole.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName end |
#MetaRoomContactType ⇒ Object
rubocop:disable Naming/MethodName
73 74 75 |
# File 'lib/docusign_dtr/client.rb', line 73 def MetaRoomContactType # rubocop:disable Naming/MethodName @meta_room_contact_type ||= DocusignDtr::MetaRoomContactType.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName end |
#MetaSellerDecisionType ⇒ Object
rubocop:disable Naming/MethodName
77 78 79 |
# File 'lib/docusign_dtr/client.rb', line 77 def MetaSellerDecisionType # rubocop:disable Naming/MethodName @meta_seller_decision_type ||= DocusignDtr::MetaSellerDecisionType.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName end |
#MetaSpecialCircumstanceType ⇒ Object
rubocop:disable Naming/MethodName
81 82 83 |
# File 'lib/docusign_dtr/client.rb', line 81 def MetaSpecialCircumstanceType # rubocop:disable Naming/MethodName @meta_special_circumstance_type ||= DocusignDtr::MetaSpecialCircumstanceType.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName end |
#MetaState ⇒ Object
rubocop:disable Naming/MethodName
85 86 87 |
# File 'lib/docusign_dtr/client.rb', line 85 def MetaState # rubocop:disable Naming/MethodName @meta_state ||= DocusignDtr::MetaState.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName end |
#MetaTaskDateType ⇒ Object
rubocop:disable Naming/MethodName
89 90 91 |
# File 'lib/docusign_dtr/client.rb', line 89 def MetaTaskDateType # rubocop:disable Naming/MethodName @meta_task_date_type ||= DocusignDtr::MetaTaskDateType.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName end |
#MetaTimezone ⇒ Object
rubocop:disable Naming/MethodName
93 94 95 |
# File 'lib/docusign_dtr/client.rb', line 93 def MetaTimezone # rubocop:disable Naming/MethodName @meta_timezone ||= DocusignDtr::MetaTimezone.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName end |
#MetaTransactionSide ⇒ Object
rubocop:disable Naming/MethodName
97 98 99 |
# File 'lib/docusign_dtr/client.rb', line 97 def MetaTransactionSide # rubocop:disable Naming/MethodName @meta_transaction_side ||= DocusignDtr::MetaTransactionSide.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName end |
#Office ⇒ Object
rubocop:disable Naming/MethodName
101 102 103 |
# File 'lib/docusign_dtr/client.rb', line 101 def Office # rubocop:disable Naming/MethodName @office ||= DocusignDtr::Office.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName end |
#Profile ⇒ Object
rubocop:disable Naming/MethodName
129 130 131 |
# File 'lib/docusign_dtr/client.rb', line 129 def Profile # rubocop:disable Naming/MethodName @profile ||= DocusignDtr::Profile.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName end |
#raw(page, params = {}) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/docusign_dtr/client.rb', line 18 def raw(page, params = {}) full_path = [base_uri, page].join response = self.class.get(full_path, query: params, headers:, timeout: 60) handle_error(response) response.parsed_response end |
#Region ⇒ Object
rubocop:disable Naming/MethodName
109 110 111 |
# File 'lib/docusign_dtr/client.rb', line 109 def Region # rubocop:disable Naming/MethodName @region ||= DocusignDtr::Region.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName end |
#Room ⇒ Object
rubocop:disable Naming/MethodName
105 106 107 |
# File 'lib/docusign_dtr/client.rb', line 105 def Room # rubocop:disable Naming/MethodName @room ||= DocusignDtr::Room.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName end |
#TaskList ⇒ Object
rubocop:disable Naming/MethodName
113 114 115 |
# File 'lib/docusign_dtr/client.rb', line 113 def TaskList # rubocop:disable Naming/MethodName @task_list ||= DocusignDtr::TaskList.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName end |
#Title ⇒ Object
rubocop:disable Naming/MethodName
121 122 123 |
# File 'lib/docusign_dtr/client.rb', line 121 def Title # rubocop:disable Naming/MethodName @title ||= DocusignDtr::Title.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName end |
#User ⇒ Object
rubocop:disable Naming/MethodName
125 126 127 |
# File 'lib/docusign_dtr/client.rb', line 125 def User # rubocop:disable Naming/MethodName @user ||= DocusignDtr::User.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName end |