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_code) ⇒ 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
143 144 145 |
# File 'lib/docusign_dtr/client.rb', line 143 def Activity # rubocop:disable Naming/MethodName @activity ||= DocusignDtr::Activity.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName end |
#base_uri ⇒ Object
159 160 161 |
# File 'lib/docusign_dtr/client.rb', line 159 def base_uri @base_uri ||= @test_mode ? 'https://stage.cartavi.com/restapi/v1' : 'https://cartavi.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_code) ⇒ Object
25 26 27 |
# File 'lib/docusign_dtr/client.rb', line 25 def handle_error(response_code) raise error_type(response_code), "Error communicating: Response code #{response_code}" 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 40 41 |
# File 'lib/docusign_dtr/client.rb', line 37 def MetaActivityType # rubocop:disable Naming/MethodName # rubocop:disable LineLength ||= DocusignDtr::MetaActivityType.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName # rubocop:enable LineLength end |
#MetaClosingStatus ⇒ Object
rubocop:disable Naming/MethodName
43 44 45 46 47 |
# File 'lib/docusign_dtr/client.rb', line 43 def MetaClosingStatus # rubocop:disable Naming/MethodName # rubocop:disable LineLength ||= DocusignDtr::MetaClosingStatus.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName # rubocop:enable LineLength end |
#MetaContactSide ⇒ Object
rubocop:disable Naming/MethodName
49 50 51 52 53 |
# File 'lib/docusign_dtr/client.rb', line 49 def MetaContactSide # rubocop:disable Naming/MethodName # rubocop:disable LineLength ||= DocusignDtr::MetaContactSide.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName # rubocop:enable LineLength end |
#MetaCountry ⇒ Object
rubocop:disable Naming/MethodName
55 56 57 |
# File 'lib/docusign_dtr/client.rb', line 55 def MetaCountry # rubocop:disable Naming/MethodName ||= DocusignDtr::MetaCountry.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName end |
#MetaCurrency ⇒ Object
rubocop:disable Naming/MethodName
59 60 61 62 63 |
# File 'lib/docusign_dtr/client.rb', line 59 def MetaCurrency # rubocop:disable Naming/MethodName # rubocop:disable LineLength ||= DocusignDtr::MetaCurrency.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName # rubocop:enable LineLength end |
#MetaFinancingType ⇒ Object
rubocop:disable Naming/MethodName
65 66 67 68 69 |
# File 'lib/docusign_dtr/client.rb', line 65 def MetaFinancingType # rubocop:disable Naming/MethodName # rubocop:disable LineLength ||= DocusignDtr::MetaFinancingType.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName # rubocop:enable LineLength end |
#MetaOriginOfLeadType ⇒ Object
rubocop:disable Naming/MethodName
71 72 73 74 75 |
# File 'lib/docusign_dtr/client.rb', line 71 def MetaOriginOfLeadType # rubocop:disable Naming/MethodName # rubocop:disable LineLength ||= DocusignDtr::MetaOriginOfLeadType.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName # rubocop:enable LineLength end |
#MetaPropertyType ⇒ Object
rubocop:disable Naming/MethodName
77 78 79 80 81 |
# File 'lib/docusign_dtr/client.rb', line 77 def MetaPropertyType # rubocop:disable Naming/MethodName # rubocop:disable LineLength ||= DocusignDtr::MetaPropertyType.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName # rubocop:enable LineLength end |
#MetaRole ⇒ Object
rubocop:disable Naming/MethodName
83 84 85 |
# File 'lib/docusign_dtr/client.rb', line 83 def MetaRole # rubocop:disable Naming/MethodName ||= DocusignDtr::MetaRole.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName end |
#MetaRoomContactType ⇒ Object
rubocop:disable Naming/MethodName
87 88 89 90 91 |
# File 'lib/docusign_dtr/client.rb', line 87 def MetaRoomContactType # rubocop:disable Naming/MethodName # rubocop:disable LineLength ||= DocusignDtr::MetaRoomContactType.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName # rubocop:enable LineLength end |
#MetaSellerDecisionType ⇒ Object
rubocop:disable Naming/MethodName
93 94 95 96 97 |
# File 'lib/docusign_dtr/client.rb', line 93 def MetaSellerDecisionType # rubocop:disable Naming/MethodName # rubocop:disable LineLength ||= DocusignDtr::MetaSellerDecisionType.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName # rubocop:enable LineLength end |
#MetaSpecialCircumstanceType ⇒ Object
rubocop:disable Naming/MethodName
99 100 101 102 103 |
# File 'lib/docusign_dtr/client.rb', line 99 def MetaSpecialCircumstanceType # rubocop:disable Naming/MethodName # rubocop:disable LineLength ||= DocusignDtr::MetaSpecialCircumstanceType.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName # rubocop:enable LineLength end |
#MetaState ⇒ Object
rubocop:disable Naming/MethodName
105 106 107 |
# File 'lib/docusign_dtr/client.rb', line 105 def MetaState # rubocop:disable Naming/MethodName ||= DocusignDtr::MetaState.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName end |
#MetaTaskDateType ⇒ Object
rubocop:disable Naming/MethodName
109 110 111 112 113 |
# File 'lib/docusign_dtr/client.rb', line 109 def MetaTaskDateType # rubocop:disable Naming/MethodName # rubocop:disable LineLength ||= DocusignDtr::MetaTaskDateType.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName # rubocop:enable LineLength end |
#MetaTimezone ⇒ Object
rubocop:disable Naming/MethodName
115 116 117 118 119 |
# File 'lib/docusign_dtr/client.rb', line 115 def MetaTimezone # rubocop:disable Naming/MethodName # rubocop:disable LineLength ||= DocusignDtr::MetaTimezone.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName # rubocop:enable LineLength end |
#MetaTransactionSide ⇒ Object
rubocop:disable Naming/MethodName
121 122 123 124 125 |
# File 'lib/docusign_dtr/client.rb', line 121 def MetaTransactionSide # rubocop:disable Naming/MethodName # rubocop:disable LineLength ||= DocusignDtr::MetaTransactionSide.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName # rubocop:enable LineLength end |
#Office ⇒ Object
rubocop:disable Naming/MethodName
127 128 129 |
# File 'lib/docusign_dtr/client.rb', line 127 def Office # rubocop:disable Naming/MethodName @office ||= DocusignDtr::Office.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName end |
#Profile ⇒ Object
rubocop:disable Naming/MethodName
155 156 157 |
# File 'lib/docusign_dtr/client.rb', line 155 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: headers, timeout: 60) handle_error(response.code) if response.code != 200 response.parsed_response end |
#Region ⇒ Object
rubocop:disable Naming/MethodName
135 136 137 |
# File 'lib/docusign_dtr/client.rb', line 135 def Region # rubocop:disable Naming/MethodName @region ||= DocusignDtr::Region.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName end |
#Room ⇒ Object
rubocop:disable Naming/MethodName
131 132 133 |
# File 'lib/docusign_dtr/client.rb', line 131 def Room # rubocop:disable Naming/MethodName @room ||= DocusignDtr::Room.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName end |
#TaskList ⇒ Object
rubocop:disable Naming/MethodName
139 140 141 |
# File 'lib/docusign_dtr/client.rb', line 139 def TaskList # rubocop:disable Naming/MethodName @task_list ||= DocusignDtr::TaskList.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName end |
#Title ⇒ Object
rubocop:disable Naming/MethodName
147 148 149 |
# File 'lib/docusign_dtr/client.rb', line 147 def Title # rubocop:disable Naming/MethodName @title ||= DocusignDtr::Title.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName end |
#User ⇒ Object
rubocop:disable Naming/MethodName
151 152 153 |
# File 'lib/docusign_dtr/client.rb', line 151 def User # rubocop:disable Naming/MethodName @user ||= DocusignDtr::User.new(client: self) # rubocop:disable Naming/MemoizedInstanceVariableName end |