Class: DocusignDtr::Client

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/docusign_dtr/client.rb

Overview

rubocop:disable Metrics/ClassLength

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#tokenObject

Returns the value of attribute token.



4
5
6
# File 'lib/docusign_dtr/client.rb', line 4

def token
  @token
end

Instance Method Details

#ActivityObject

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_uriObject



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

#DocumentObject

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: response).build
end

#MemberObject

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

#MetaActivityTypeObject

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

#MetaClosingStatusObject

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

#MetaContactSideObject

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

#MetaCountryObject

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

#MetaCurrencyObject

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

#MetaFinancingTypeObject

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

#MetaOriginOfLeadTypeObject

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

#MetaPropertyTypeObject

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

#MetaRoleObject

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

#MetaRoomContactTypeObject

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

#MetaSellerDecisionTypeObject

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

#MetaSpecialCircumstanceTypeObject

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

#MetaStateObject

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

#MetaTaskDateTypeObject

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

#MetaTimezoneObject

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

#MetaTransactionSideObject

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

#OfficeObject

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

#ProfileObject

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: headers, timeout: 60)
  handle_error(response)
  response.parsed_response
end

#RegionObject

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

#RoomObject

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

#TaskListObject

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

#TitleObject

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

#UserObject

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