texel-docusign 0.2.32 → 0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,5 +11,8 @@ lib/docusign/base.rb
11
11
  lib/docusign/docusign.rb
12
12
  lib/docusign/docusignDriver.rb
13
13
  lib/docusign/docusignMappingRegistry.rb
14
+ lib/docusign/credential.rb
15
+ lib/docusign/credentialDriver.rb
16
+ lib/docusign/credentialMappingRegistry.rb
14
17
  tasks/docusign_tasks.rake
15
18
  test/test_docusign.rb
data/Rakefile CHANGED
@@ -24,6 +24,11 @@ namespace :docusign do
24
24
  wsdl_path = File.expand_path(File.dirname(__FILE__) + "/lib/DocuSign3.0.10API.wsdl")
25
25
  wsdl2ruby('docusign', 'Docusign', "file://#{wsdl_path}")
26
26
  end
27
+
28
+ task :generate_credential_api do
29
+ wsdl_path = File.expand_path(File.dirname(__FILE__) + "/lib/Credential.wsdl")
30
+ wsdl2ruby('docusign_credential', 'Docusign::Credential', "file://#{wsdl_path}")
31
+ end
27
32
  end
28
33
  end
29
34
 
@@ -17,7 +17,7 @@
17
17
 
18
18
  Gem::Specification.new do |s|
19
19
  s.name = %q{docusign}
20
- s.version = "0.2.32"
20
+ s.version = "0.3"
21
21
 
22
22
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
23
23
  s.authors = ["Leigh Caplan"]
@@ -27,7 +27,25 @@ Gem::Specification.new do |s|
27
27
  s.email = ["texel1@gmail.com"]
28
28
  s.executables = ["docusign"]
29
29
  s.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.txt"]
30
- s.files = ["History.txt", "Manifest.txt", "README.txt", "Rakefile", "bin/docusign", "docusign.gemspec", "lib/DocuSign3.0.10API.wsdl", "lib/docusign.rb", "lib/docusign/auth_header_handler.rb", "lib/docusign/base.rb", "lib/docusign/docusign.rb", "lib/docusign/docusignDriver.rb", "lib/docusign/docusignMappingRegistry.rb", "tasks/docusign_tasks.rake", "test/test_docusign.rb"]
30
+ s.files = [
31
+ "History.txt",
32
+ "Manifest.txt",
33
+ "README.txt",
34
+ "Rakefile",
35
+ "bin/docusign",
36
+ "docusign.gemspec",
37
+ "lib/DocuSign3.0.10API.wsdl",
38
+ "lib/docusign.rb",
39
+ "lib/docusign/auth_header_handler.rb",
40
+ "lib/docusign/base.rb",
41
+ "lib/docusign/docusign.rb",
42
+ "lib/docusign/docusignDriver.rb",
43
+ "lib/docusign/docusignMappingRegistry.rb",
44
+ "lib/docusign/credential.rb",
45
+ "lib/docusign/credentialDriver.rb",
46
+ "lib/docusign/credentialMappingRegistry.rb",
47
+ "tasks/docusign_tasks.rake",
48
+ "test/test_docusign.rb"]
31
49
  s.has_rdoc = true
32
50
  s.homepage = %q{http://www.docusign.com}
33
51
  s.rdoc_options = ["--main", "README.txt"]
@@ -21,5 +21,8 @@ require 'docusign/docusignMappingRegistry'
21
21
  require 'docusign/docusignDriver'
22
22
  require 'docusign/base'
23
23
  require 'docusign/auth_header_handler'
24
+ require 'docusign/credential'
25
+ require 'docusign/credentialDriver'
26
+ require 'docusign/credentialMappingRegistry'
24
27
 
25
28
  Docusign::VERSION = '0.2'
@@ -33,6 +33,14 @@ module Docusign
33
33
 
34
34
  connection
35
35
  end
36
+
37
+ def credentials(email, password, endpoint_url=nil)
38
+
39
+ connection = Docusign::Credential::CredentialSoap.new
40
+ connection.endpoint_url = endpoint_url if endpoint_url
41
+
42
+ connection.login(:email => email, :password => password).loginResult
43
+ end
36
44
  end
37
45
  end
38
46
  end
@@ -0,0 +1,136 @@
1
+ require 'xsd/qname'
2
+
3
+ module Docusign; module Credential
4
+
5
+
6
+ # {http://www.docusign.net/API/Credential}ArrayOfAccount
7
+ class ArrayOfAccount < ::Array
8
+
9
+ # {http://www.docusign.net/API/Credential}Account
10
+ # accountID - SOAP::SOAPString
11
+ # accountName - SOAP::SOAPString
12
+ # userID - SOAP::SOAPString
13
+ # userName - SOAP::SOAPString
14
+ # email - SOAP::SOAPString
15
+ class Account
16
+ attr_accessor :accountID
17
+ attr_accessor :accountName
18
+ attr_accessor :userID
19
+ attr_accessor :userName
20
+ attr_accessor :email
21
+
22
+ def initialize(accountID = nil, accountName = nil, userID = nil, userName = nil, email = nil)
23
+ @accountID = accountID
24
+ @accountName = accountName
25
+ @userID = userID
26
+ @userName = userName
27
+ @email = email
28
+ end
29
+ end
30
+ end
31
+
32
+ # {http://www.docusign.net/API/Credential}ErrorCode
33
+ class ErrorCode < ::String
34
+ Account_Lacks_Permissions = ErrorCode.new("Account_Lacks_Permissions")
35
+ Success = ErrorCode.new("Success")
36
+ Unspecified_Error = ErrorCode.new("Unspecified_Error")
37
+ User_Authentication_Failed = ErrorCode.new("User_Authentication_Failed")
38
+ User_Does_Not_Exist_In_System = ErrorCode.new("User_Does_Not_Exist_In_System")
39
+ User_Lacks_Permissions = ErrorCode.new("User_Lacks_Permissions")
40
+ end
41
+
42
+ # {http://www.docusign.net/API/Credential}Ping
43
+ class Ping
44
+ def initialize
45
+ end
46
+ end
47
+
48
+ # {http://www.docusign.net/API/Credential}PingResponse
49
+ # pingResult - SOAP::SOAPBoolean
50
+ class PingResponse
51
+ attr_accessor :pingResult
52
+
53
+ def initialize(pingResult = nil)
54
+ @pingResult = pingResult
55
+ end
56
+ end
57
+
58
+ # {http://www.docusign.net/API/Credential}Login
59
+ # email - SOAP::SOAPString
60
+ # password - SOAP::SOAPString
61
+ class Login
62
+ attr_accessor :email
63
+ attr_accessor :password
64
+
65
+ def initialize(email = nil, password = nil)
66
+ @email = email
67
+ @password = password
68
+ end
69
+ end
70
+
71
+ # {http://www.docusign.net/API/Credential}LoginResponse
72
+ # loginResult - Docusign::Credential::LoginResponse::LoginResult
73
+ class LoginResponse
74
+
75
+ # inner class for member: LoginResult
76
+ # {http://www.docusign.net/API/Credential}LoginResult
77
+ # success - SOAP::SOAPBoolean
78
+ # errorCode - Docusign::Credential::ErrorCode
79
+ # authenticationMessage - SOAP::SOAPString
80
+ # accounts - Docusign::Credential::ArrayOfAccount
81
+ class LoginResult
82
+ attr_accessor :success
83
+ attr_accessor :errorCode
84
+ attr_accessor :authenticationMessage
85
+ attr_accessor :accounts
86
+
87
+ def initialize(success = nil, errorCode = nil, authenticationMessage = nil, accounts = nil)
88
+ @success = success
89
+ @errorCode = errorCode
90
+ @authenticationMessage = authenticationMessage
91
+ @accounts = accounts
92
+ end
93
+
94
+ def success?
95
+ @success
96
+ end
97
+ end
98
+
99
+ attr_accessor :loginResult
100
+
101
+ def initialize(loginResult = nil)
102
+ @loginResult = loginResult
103
+ end
104
+ end
105
+
106
+ # {http://www.docusign.net/API/Credential}GetAuthenticationToken
107
+ # email - SOAP::SOAPString
108
+ # password - SOAP::SOAPString
109
+ # accountID - SOAP::SOAPString
110
+ # goToEnvelopeID - SOAP::SOAPString
111
+ class GetAuthenticationToken
112
+ attr_accessor :email
113
+ attr_accessor :password
114
+ attr_accessor :accountID
115
+ attr_accessor :goToEnvelopeID
116
+
117
+ def initialize(email = nil, password = nil, accountID = nil, goToEnvelopeID = nil)
118
+ @email = email
119
+ @password = password
120
+ @accountID = accountID
121
+ @goToEnvelopeID = goToEnvelopeID
122
+ end
123
+ end
124
+
125
+ # {http://www.docusign.net/API/Credential}GetAuthenticationTokenResponse
126
+ # getAuthenticationTokenResult - SOAP::SOAPString
127
+ class GetAuthenticationTokenResponse
128
+ attr_accessor :getAuthenticationTokenResult
129
+
130
+ def initialize(getAuthenticationTokenResult = nil)
131
+ @getAuthenticationTokenResult = getAuthenticationTokenResult
132
+ end
133
+ end
134
+
135
+
136
+ end; end
@@ -0,0 +1,65 @@
1
+ require 'soap/rpc/driver'
2
+
3
+ module Docusign::Credential
4
+
5
+ class CredentialSoap < ::SOAP::RPC::Driver
6
+ DefaultEndpointUrl = "https://demo.docusign.net/api/3.0/Credential.asmx"
7
+
8
+ Methods = [
9
+ [ "http://www.docusign.net/API/Credential/Ping",
10
+ "ping",
11
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/Credential", "Ping"]],
12
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/Credential", "PingResponse"]] ],
13
+ { :request_style => :document, :request_use => :literal,
14
+ :response_style => :document, :response_use => :literal,
15
+ :faults => {} }
16
+ ],
17
+ [ "http://www.docusign.net/API/Credential/Login",
18
+ "login",
19
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/Credential", "Login"]],
20
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/Credential", "LoginResponse"]] ],
21
+ { :request_style => :document, :request_use => :literal,
22
+ :response_style => :document, :response_use => :literal,
23
+ :faults => {} }
24
+ ],
25
+ [ "http://www.docusign.net/API/Credential/GetAuthenticationToken",
26
+ "getAuthenticationToken",
27
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/Credential", "GetAuthenticationToken"]],
28
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://www.docusign.net/API/Credential", "GetAuthenticationTokenResponse"]] ],
29
+ { :request_style => :document, :request_use => :literal,
30
+ :response_style => :document, :response_use => :literal,
31
+ :faults => {} }
32
+ ]
33
+ ]
34
+
35
+ def initialize(endpoint_url = nil)
36
+ endpoint_url ||= DefaultEndpointUrl
37
+ super(endpoint_url, nil)
38
+ self.mapping_registry = DefaultMappingRegistry::EncodedRegistry
39
+ self.literal_mapping_registry = DefaultMappingRegistry::LiteralRegistry
40
+ init_methods
41
+ end
42
+
43
+ private
44
+
45
+ def init_methods
46
+ Methods.each do |definitions|
47
+ opt = definitions.last
48
+ if opt[:request_style] == :document
49
+ add_document_operation(*definitions)
50
+ else
51
+ add_rpc_operation(*definitions)
52
+ qname = definitions[0]
53
+ name = definitions[2]
54
+ if qname.name != name and qname.name.capitalize == name.capitalize
55
+ ::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg|
56
+ __send__(name, *arg)
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
63
+
64
+
65
+ end
@@ -0,0 +1,128 @@
1
+ require 'soap/mapping'
2
+
3
+ module Docusign; module Credential
4
+
5
+ module DefaultMappingRegistry
6
+ EncodedRegistry = ::SOAP::Mapping::EncodedRegistry.new
7
+ LiteralRegistry = ::SOAP::Mapping::LiteralRegistry.new
8
+ NsCredential = "http://www.docusign.net/API/Credential"
9
+
10
+ EncodedRegistry.register(
11
+ :class => Docusign::Credential::ArrayOfAccount,
12
+ :schema_type => XSD::QName.new(NsCredential, "ArrayOfAccount"),
13
+ :schema_element => [
14
+ ["account", ["Docusign::Credential::ArrayOfAccount::Account[]", XSD::QName.new(NsCredential, "Account")], [0, nil]]
15
+ ]
16
+ )
17
+
18
+ EncodedRegistry.register(
19
+ :class => Docusign::Credential::ArrayOfAccount::Account,
20
+ :schema_name => XSD::QName.new(NsCredential, "Account"),
21
+ :is_anonymous => true,
22
+ :schema_qualified => true,
23
+ :schema_element => [
24
+ ["accountID", ["SOAP::SOAPString", XSD::QName.new(NsCredential, "AccountID")], [0, 1]],
25
+ ["accountName", ["SOAP::SOAPString", XSD::QName.new(NsCredential, "AccountName")], [0, 1]],
26
+ ["userID", ["SOAP::SOAPString", XSD::QName.new(NsCredential, "UserID")], [0, 1]],
27
+ ["userName", ["SOAP::SOAPString", XSD::QName.new(NsCredential, "UserName")], [0, 1]],
28
+ ["email", ["SOAP::SOAPString", XSD::QName.new(NsCredential, "Email")], [0, 1]]
29
+ ]
30
+ )
31
+
32
+ EncodedRegistry.register(
33
+ :class => Docusign::Credential::ErrorCode,
34
+ :schema_type => XSD::QName.new(NsCredential, "ErrorCode")
35
+ )
36
+
37
+ LiteralRegistry.register(
38
+ :class => Docusign::Credential::ArrayOfAccount,
39
+ :schema_type => XSD::QName.new(NsCredential, "ArrayOfAccount"),
40
+ :schema_element => [
41
+ ["account", ["Docusign::Credential::ArrayOfAccount::Account[]", XSD::QName.new(NsCredential, "Account")], [0, nil]]
42
+ ]
43
+ )
44
+
45
+ LiteralRegistry.register(
46
+ :class => Docusign::Credential::ArrayOfAccount::Account,
47
+ :schema_name => XSD::QName.new(NsCredential, "Account"),
48
+ :is_anonymous => true,
49
+ :schema_qualified => true,
50
+ :schema_element => [
51
+ ["accountID", ["SOAP::SOAPString", XSD::QName.new(NsCredential, "AccountID")], [0, 1]],
52
+ ["accountName", ["SOAP::SOAPString", XSD::QName.new(NsCredential, "AccountName")], [0, 1]],
53
+ ["userID", ["SOAP::SOAPString", XSD::QName.new(NsCredential, "UserID")], [0, 1]],
54
+ ["userName", ["SOAP::SOAPString", XSD::QName.new(NsCredential, "UserName")], [0, 1]],
55
+ ["email", ["SOAP::SOAPString", XSD::QName.new(NsCredential, "Email")], [0, 1]]
56
+ ]
57
+ )
58
+
59
+ LiteralRegistry.register(
60
+ :class => Docusign::Credential::ErrorCode,
61
+ :schema_type => XSD::QName.new(NsCredential, "ErrorCode")
62
+ )
63
+
64
+ LiteralRegistry.register(
65
+ :class => Docusign::Credential::Ping,
66
+ :schema_name => XSD::QName.new(NsCredential, "Ping"),
67
+ :schema_element => []
68
+ )
69
+
70
+ LiteralRegistry.register(
71
+ :class => Docusign::Credential::PingResponse,
72
+ :schema_name => XSD::QName.new(NsCredential, "PingResponse"),
73
+ :schema_element => [
74
+ ["pingResult", ["SOAP::SOAPBoolean", XSD::QName.new(NsCredential, "PingResult")]]
75
+ ]
76
+ )
77
+
78
+ LiteralRegistry.register(
79
+ :class => Docusign::Credential::Login,
80
+ :schema_name => XSD::QName.new(NsCredential, "Login"),
81
+ :schema_element => [
82
+ ["email", ["SOAP::SOAPString", XSD::QName.new(NsCredential, "Email")], [0, 1]],
83
+ ["password", ["SOAP::SOAPString", XSD::QName.new(NsCredential, "Password")], [0, 1]]
84
+ ]
85
+ )
86
+
87
+ LiteralRegistry.register(
88
+ :class => Docusign::Credential::LoginResponse,
89
+ :schema_name => XSD::QName.new(NsCredential, "LoginResponse"),
90
+ :schema_element => [
91
+ ["loginResult", ["Docusign::Credential::LoginResponse::LoginResult", XSD::QName.new(NsCredential, "LoginResult")], [0, 1]]
92
+ ]
93
+ )
94
+
95
+ LiteralRegistry.register(
96
+ :class => Docusign::Credential::LoginResponse::LoginResult,
97
+ :schema_name => XSD::QName.new(NsCredential, "LoginResult"),
98
+ :is_anonymous => true,
99
+ :schema_qualified => true,
100
+ :schema_element => [
101
+ ["success", ["SOAP::SOAPBoolean", XSD::QName.new(NsCredential, "Success")]],
102
+ ["errorCode", ["Docusign::Credential::ErrorCode", XSD::QName.new(NsCredential, "ErrorCode")], [0, 1]],
103
+ ["authenticationMessage", ["SOAP::SOAPString", XSD::QName.new(NsCredential, "AuthenticationMessage")], [0, 1]],
104
+ ["accounts", ["Docusign::Credential::ArrayOfAccount", XSD::QName.new(NsCredential, "Accounts")], [0, 1]]
105
+ ]
106
+ )
107
+
108
+ LiteralRegistry.register(
109
+ :class => Docusign::Credential::GetAuthenticationToken,
110
+ :schema_name => XSD::QName.new(NsCredential, "GetAuthenticationToken"),
111
+ :schema_element => [
112
+ ["email", ["SOAP::SOAPString", XSD::QName.new(NsCredential, "Email")], [0, 1]],
113
+ ["password", ["SOAP::SOAPString", XSD::QName.new(NsCredential, "Password")], [0, 1]],
114
+ ["accountID", ["SOAP::SOAPString", XSD::QName.new(NsCredential, "AccountID")], [0, 1]],
115
+ ["goToEnvelopeID", ["SOAP::SOAPString", XSD::QName.new(NsCredential, "GoToEnvelopeID")], [0, 1]]
116
+ ]
117
+ )
118
+
119
+ LiteralRegistry.register(
120
+ :class => Docusign::Credential::GetAuthenticationTokenResponse,
121
+ :schema_name => XSD::QName.new(NsCredential, "GetAuthenticationTokenResponse"),
122
+ :schema_element => [
123
+ ["getAuthenticationTokenResult", ["SOAP::SOAPString", XSD::QName.new(NsCredential, "GetAuthenticationTokenResult")], [0, 1]]
124
+ ]
125
+ )
126
+ end
127
+
128
+ end; end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: texel-docusign
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.32
4
+ version: "0.3"
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leigh Caplan
@@ -47,6 +47,9 @@ files:
47
47
  - lib/docusign/docusign.rb
48
48
  - lib/docusign/docusignDriver.rb
49
49
  - lib/docusign/docusignMappingRegistry.rb
50
+ - lib/docusign/credential.rb
51
+ - lib/docusign/credentialDriver.rb
52
+ - lib/docusign/credentialMappingRegistry.rb
50
53
  - tasks/docusign_tasks.rake
51
54
  - test/test_docusign.rb
52
55
  has_rdoc: true