├── .swagger-codegen └── VERSION ├── .rspec ├── runLinter.sh ├── tests ├── .DS_Store ├── docs │ ├── Test.pdf │ └── organization_user_import.csv └── Gemfile ├── lib └── docusign_admin │ ├── .DS_Store │ ├── client │ ├── .DS_Store │ └── api_error.rb │ ├── version.rb │ ├── api │ ├── reserved_domains_api.rb │ ├── identity_providers_api.rb │ └── organizations_api.rb │ └── models │ ├── user_identity_request.rb │ ├── organization_simple_id_object.rb │ ├── update_response.rb │ ├── org_export_selected_domain.rb │ ├── organization_export_domain.rb │ ├── individual_membership_data_redaction_request.rb │ ├── org_export_selected_account.rb │ ├── organization_export_account.rb │ ├── membership_data_redaction_request.rb │ ├── update_users_request.rb │ ├── users_drilldown_response.rb │ ├── update_users_email_request.rb │ ├── org_report_list_response.rb │ ├── organization_exports_response.rb │ ├── organization_imports_response.rb │ ├── organization_accounts_request.rb │ ├── delete_membership_request.rb │ ├── permissions_response.rb │ ├── org_report_create_response.rb │ ├── organizations_response.rb │ ├── domains_response.rb │ ├── link_response.rb │ ├── force_activate_membership_request.rb │ ├── identity_providers_response.rb │ ├── permission_profile_response.rb │ ├── ds_group_request.rb │ ├── org_report_list_response_requestor.rb │ ├── asset_group_account_clones.rb │ ├── organization_account_request.rb │ ├── sub_account_create_worker_response.rb │ ├── asset_group_accounts_response.rb │ └── ds_group_users_add_request.rb ├── Gemfile ├── Rakefile ├── .gitignore ├── LICENSE ├── .swagger-codegen-ignore ├── git_push.sh ├── docusign_admin.gemspec ├── CHANGELOG.md ├── README.md └── .rubocop.yml /.swagger-codegen/VERSION: -------------------------------------------------------------------------------- 1 | 2.4.21 -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --color 2 | --require spec_helper 3 | -------------------------------------------------------------------------------- /runLinter.sh: -------------------------------------------------------------------------------- 1 | ./vendor/bundle/ruby/2.6.0/bin/rubocop -a -------------------------------------------------------------------------------- /tests/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/docusign-admin-ruby-client/master/tests/.DS_Store -------------------------------------------------------------------------------- /tests/docs/Test.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/docusign-admin-ruby-client/master/tests/docs/Test.pdf -------------------------------------------------------------------------------- /lib/docusign_admin/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/docusign-admin-ruby-client/master/lib/docusign_admin/.DS_Store -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gemspec 4 | 5 | group :development, :test do 6 | gem 'rake', '~> 12.3.3' 7 | end 8 | -------------------------------------------------------------------------------- /tests/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gem 'rspec' 4 | 5 | gem 'ffi', '1.14.2' 6 | gem 'docusign_admin', path: '../' 7 | -------------------------------------------------------------------------------- /lib/docusign_admin/client/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/docusign-admin-ruby-client/master/lib/docusign_admin/client/.DS_Store -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | begin 2 | require 'rspec/core/rake_task' 3 | 4 | RSpec::Core::RakeTask.new(:spec) 5 | task default: :spec 6 | rescue LoadError 7 | # no rspec available 8 | end 9 | -------------------------------------------------------------------------------- /lib/docusign_admin/version.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | module DocuSign_Admin 13 | VERSION = '2.0.0' 14 | end 15 | -------------------------------------------------------------------------------- /tests/docs/organization_user_import.csv: -------------------------------------------------------------------------------- 1 | AccountID,AccountName,FirstName,LastName,UserEmail,eSignPermissionProfile,Group,Language,UserTitle,CompanyName,AddressLine1,AddressLine2,City,StateRegionProvince,PostalCode,Phone,LoginPolicy,AutoActivate 2 | ,Sample Account,John,Markson,John@testing.test,Account Administrator,Everyone,en,Mr.,Some Division,123 4th St,Suite C1,Seattle,WA,8178,2065559999,fedAuthRequired, -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by: https://github.com/swagger-api/swagger-codegen.git 2 | # 3 | 4 | *.gem 5 | *.rbc 6 | /.config 7 | /coverage/ 8 | /InstalledFiles 9 | /pkg/ 10 | /spec/reports/ 11 | /spec/examples.txt 12 | /test/tmp/ 13 | /test/version_tmp/ 14 | /tmp/ 15 | 16 | ## Specific to RubyMotion: 17 | .dat* 18 | .repl_history 19 | build/ 20 | 21 | ## Documentation cache and generated files: 22 | /.yardoc/ 23 | /_yardoc/ 24 | /doc/ 25 | /rdoc/ 26 | 27 | ## Environment normalization: 28 | /.bundle/ 29 | /vendor/bundle 30 | /lib/bundler/man/ 31 | 32 | # for a library or gem, you might want to ignore these files since the code is 33 | # intended to run in multiple environments; otherwise, check them in: 34 | # Gemfile.lock 35 | # .ruby-version 36 | # .ruby-gemset 37 | 38 | # unless supporting rvm < 1.11.0 or doing something fancy, ignore this: 39 | .rvmrc 40 | 41 | tests/docs/private.pem 42 | Gemfile.* -------------------------------------------------------------------------------- /lib/docusign_admin/client/api_error.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | module DocuSign_Admin 13 | class ApiError < StandardError 14 | attr_reader :code, :response_headers, :response_body 15 | 16 | # Usage examples: 17 | # ApiError.new 18 | # ApiError.new("message") 19 | # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") 20 | # ApiError.new(:code => 404, :message => "Not Found") 21 | def initialize(arg = nil) 22 | if arg.is_a? Hash 23 | if arg.key?(:message) || arg.key?('message') 24 | super(arg[:message] || arg['message']) 25 | else 26 | super arg 27 | end 28 | 29 | arg.each do |k, v| 30 | instance_variable_set "@#{k}", v 31 | end 32 | else 33 | super arg 34 | end 35 | end 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2017- DocuSign, Inc. (https://www.docusign.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.swagger-codegen-ignore: -------------------------------------------------------------------------------- 1 | # Swagger Codegen Ignore 2 | # Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen 3 | 4 | # Use this file to prevent files from being overwritten by the generator. 5 | # The patterns follow closely to .gitignore or .dockerignore. 6 | 7 | # As an example, the C# client generator defines ApiClient.cs. 8 | # You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: 9 | #ApiClient.cs 10 | 11 | # You can match any string of characters against a directory, file or extension with a single asterisk (*): 12 | #foo/*/qux 13 | # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux 14 | 15 | # You can recursively match patterns against a directory, file or extension with a double asterisk (**): 16 | #foo/**/qux 17 | # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux 18 | 19 | # You can also negate patterns with an exclamation (!). 20 | # For example, you can ignore all files in a docs folder with the file extension .md: 21 | #docs/*.md 22 | # Then explicitly reverse the ignore rule for a single file: 23 | #!docs/README.md 24 | 25 | # Swagger and Git files 26 | .swagger-codegen-ignore 27 | git_push.sh 28 | .gitignore 29 | README.md 30 | CHANGELOG.md 31 | best_practices.md 32 | 33 | 34 | # Project files 35 | LICENSE 36 | .travis.yml 37 | Gemfile 38 | Gemfile.lock 39 | Rakefile 40 | 41 | # Specific src and test files 42 | .rspec 43 | docs/ 44 | spec/ 45 | tests/ 46 | -------------------------------------------------------------------------------- /git_push.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Generated by: https://github.com/swagger-api/swagger-codegen.git 4 | # 5 | # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ 6 | # 7 | # Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" 8 | 9 | git_user_id=$1 10 | git_repo_id=$2 11 | release_note=$3 12 | 13 | if [ "$git_user_id" = "" ]; then 14 | git_user_id="GIT_USER_ID" 15 | echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" 16 | fi 17 | 18 | if [ "$git_repo_id" = "" ]; then 19 | git_repo_id="GIT_REPO_ID" 20 | echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" 21 | fi 22 | 23 | if [ "$release_note" = "" ]; then 24 | release_note="Minor update" 25 | echo "[INFO] No command line input provided. Set \$release_note to $release_note" 26 | fi 27 | 28 | # Initialize the local directory as a Git repository 29 | git init 30 | 31 | # Adds the files in the local repository and stages them for commit. 32 | git add . 33 | 34 | # Commits the tracked changes and prepares them to be pushed to a remote repository. 35 | git commit -m "$release_note" 36 | 37 | # Sets the new remote 38 | git_remote=`git remote` 39 | if [ "$git_remote" = "" ]; then # git remote not defined 40 | 41 | if [ "$GIT_TOKEN" = "" ]; then 42 | echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." 43 | git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git 44 | else 45 | git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git 46 | fi 47 | 48 | fi 49 | 50 | git pull origin master 51 | 52 | # Pushes (Forces) the changes in the local repository up to the remote repository 53 | echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" 54 | git push origin master 2>&1 | grep -v 'To https' 55 | 56 | -------------------------------------------------------------------------------- /docusign_admin.gemspec: -------------------------------------------------------------------------------- 1 | # -*- encoding: utf-8 -*- 2 | 3 | =begin 4 | #Docusign Admin API 5 | 6 | #An API for an organization administrator to manage organizations, accounts and users 7 | 8 | OpenAPI spec version: v2.1 9 | Contact: devcenter@docusign.com 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | 12 | =end 13 | 14 | $:.push File.expand_path("../lib", __FILE__) 15 | require "docusign_admin/version" 16 | 17 | Gem::Specification.new do |s| 18 | s.name = "docusign_admin" 19 | s.version = DocuSign_Admin::VERSION 20 | s.platform = Gem::Platform::RUBY 21 | s.authors = ["DocuSign"] 22 | s.email = ["devcenter@docusign.com"] 23 | s.homepage = "https://github.com/docusign/docusign-admin-ruby-client" 24 | s.summary = "Docusign Admin API Ruby Gem" 25 | s.description = "The Docusign Admin API enables you to automate user management with your existing systems while ensuring governance and compliance." 26 | s.license = "MIT" 27 | s.required_ruby_version = ">= 1.9" 28 | 29 | s.add_runtime_dependency 'jwt', '~> 2.2', '>= 2.2.1' 30 | s.add_runtime_dependency 'addressable', '~> 2.7', '>= 2.7.0' 31 | s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' 32 | s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' 33 | 34 | s.add_development_dependency 'rspec-mocks', '~> 3.8', '>= 3.8.0' 35 | s.add_development_dependency 'rspec-expectations', '~> 3.8', '>= 3.8.0' 36 | s.add_development_dependency 'rspec', '~> 3.4', '>= 3.4.0' 37 | s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1' 38 | s.add_development_dependency 'webmock', '~> 1.24', '>= 1.24.3' 39 | s.add_development_dependency 'autotest', '~> 4.4', '>= 4.4.6' 40 | s.add_development_dependency 'autotest-rails-pure', '~> 4.1', '>= 4.1.2' 41 | s.add_development_dependency 'autotest-growl', '~> 0.2', '>= 0.2.16' 42 | s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.11' 43 | 44 | s.files = `find *`.split("\n").uniq.sort.select{|f| !f.empty? } 45 | s.test_files = `find spec/*`.split("\n") 46 | s.executables = [] 47 | s.require_paths = ["lib"] 48 | end -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [v2.0.0] - Admin API v2.1-1.4.1 - 2024-10-28 2 | ### Changed 3 | - Added support for version v2.1-1.4.1 of the DocuSign Admin API. 4 | - Removed the staging base path and OAuth path constant. 5 | - Updated the SDK release version. 6 | 7 | ## [v2.0.0.rc2] - Admin API v2.1-1.4.1 - 2024-10-22 8 | ### Changed 9 | - Added support for version v2.1-1.4.1 of the DocuSign Admin API. 10 | - Removed the staging base path and OAuth path constant. 11 | - Updated the SDK release version. 12 | 13 | ## [v2.0.0.rc1] - Admin API v2.1-1.4.0 - 2024-08-27 14 | ### Breaking Changes 15 |
16 | API Changes (Click to expand) 17 | 18 |
19 |
20 | 21 | Added new query parameter "include_ds_groups" to the API "/v2/organizations/{organizationId}/users": 22 | 23 |

Added New APIs for Account Creation

24 |
  • GET: get subscription details for organization
  • 25 |
  • POST: initiate Create account request
  • 26 |
  • GET: get ongoing process details by org ID
  • 27 |
  • GET: get individual process details by org ID, asset group ID, asset group work ID
  • 28 | 29 | 30 |
    31 |
    32 | 33 | ### Other Changes 34 | - Updated logic to derive the `oauth_base_path` from `base_path`. 35 | - Added support for version v2.1-1.4.0 of the DocuSign Admin API. 36 | - Updated the SDK release version. 37 | 38 | ## [v1.3.0] - Admin API v2.1-1.3.0 - 2023-08-02 39 | ### Changed 40 | - Added support for version v2.1-1.3.0 of the DocuSign Admin API. 41 | - Updated the SDK release version. 42 | 43 | New endpoints: 44 | * `GET /v1/organizations/{organizationId}/assetGroups/accounts` Get asset group accounts for an organization. 45 | * `POST /v1/organizations/{organizationId}/assetGroups/accountClone` Clone an existing DocuSign account. 46 | * `GET /v1/organizations/{organizationId}/assetGroups/accountClones` Gets all asset group account clones for an organization. 47 | * `GET /v1/organizations/{organizationId}/assetGroups/{assetGroupId}/accountClones/{assetGroupWorkId}` Gets information about a single cloned account. 48 | ## [v1.2.0] - Admin API v2.1-1.2.0 - 2023-05-21 49 | ### Changed 50 | - Added support for version v2.1-1.2.0 of the DocuSign Admin API. 51 | - Updated the SDK release version. 52 | 53 | ## [v1.1.0] - Admin API v2.1-1.1.0 - 2022-04-26 54 | ### Changed 55 | - Added support for version v2.1-1.1.0 of the DocuSign Admin API. 56 | - Updated the SDK release version. 57 | 58 | ## [1.0.0] - Admin API v2.1-1.0.0 - 2021-09-16 59 | ### Changed 60 | - Added support for version v2.1-1.0.0 of the DocuSign Admin API. 61 | - Updated the SDK release version. 62 | 63 | 64 | -------------------------------------------------------------------------------- /lib/docusign_admin/api/reserved_domains_api.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | require "uri" 13 | 14 | module DocuSign_Admin 15 | 16 | 17 | class ReservedDomainsApi 18 | attr_accessor :api_client 19 | 20 | def initialize(api_client = ReservedDomainsApi.default) 21 | @api_client = api_client 22 | end 23 | 24 | # Returns the list of reserved domains for the organization. 25 | # Required scopes: domain_read 26 | # @param organization_id The organization ID Guid 27 | # @return [DomainsResponse] 28 | def get_reserved_domains(organization_id) 29 | data, _status_code, _headers = get_reserved_domains_with_http_info(organization_id) 30 | return data 31 | end 32 | 33 | # Returns the list of reserved domains for the organization. 34 | # Required scopes: domain_read 35 | # @param organization_id The organization ID Guid 36 | # @return [Array<(DomainsResponse, Fixnum, Hash)>] DomainsResponse data, response status code and response headers 37 | def get_reserved_domains_with_http_info(organization_id) 38 | if @api_client.config.debugging 39 | @api_client.config.logger.debug "Calling API: ReservedDomainsApi.get_reserved_domains ..." 40 | end 41 | # verify the required parameter 'organization_id' is set 42 | fail ArgumentError, "Missing the required parameter 'organization_id' when calling ReservedDomainsApi.get_reserved_domains" if organization_id.nil? 43 | # resource path 44 | local_var_path = "/v2/organizations/{organizationId}/reserved_domains".sub('{format}','json').sub('{' + 'organizationId' + '}', organization_id.to_s) 45 | 46 | # query parameters 47 | query_params = {} 48 | 49 | # header parameters 50 | header_params = {} 51 | # HTTP header 'Accept' (if needed) 52 | header_params['Accept'] = @api_client.select_header_accept(['application/json']) 53 | # HTTP header 'Content-Type' 54 | header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) 55 | 56 | # form parameters 57 | form_params = {} 58 | 59 | # http body (model) 60 | post_body = nil 61 | auth_names = [] 62 | data, status_code, headers = @api_client.call_api(:GET, local_var_path, 63 | :header_params => header_params, 64 | :query_params => query_params, 65 | :form_params => form_params, 66 | :body => post_body, 67 | :auth_names => auth_names, 68 | :return_type => 'DomainsResponse') 69 | if @api_client.config.debugging 70 | @api_client.config.logger.debug "API called: ReservedDomainsApi#get_reserved_domains\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" 71 | end 72 | return data, status_code, headers 73 | end 74 | end 75 | end -------------------------------------------------------------------------------- /lib/docusign_admin/api/identity_providers_api.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | require "uri" 13 | 14 | module DocuSign_Admin 15 | 16 | 17 | class IdentityProvidersApi 18 | attr_accessor :api_client 19 | 20 | def initialize(api_client = IdentityProvidersApi.default) 21 | @api_client = api_client 22 | end 23 | 24 | # Returns the list of identity providers for the organization. 25 | # Required scopes: identity_provider_read 26 | # @param organization_id The organization ID Guid 27 | # @return [IdentityProvidersResponse] 28 | def get_identity_providers(organization_id) 29 | data, _status_code, _headers = get_identity_providers_with_http_info(organization_id) 30 | return data 31 | end 32 | 33 | # Returns the list of identity providers for the organization. 34 | # Required scopes: identity_provider_read 35 | # @param organization_id The organization ID Guid 36 | # @return [Array<(IdentityProvidersResponse, Fixnum, Hash)>] IdentityProvidersResponse data, response status code and response headers 37 | def get_identity_providers_with_http_info(organization_id) 38 | if @api_client.config.debugging 39 | @api_client.config.logger.debug "Calling API: IdentityProvidersApi.get_identity_providers ..." 40 | end 41 | # verify the required parameter 'organization_id' is set 42 | fail ArgumentError, "Missing the required parameter 'organization_id' when calling IdentityProvidersApi.get_identity_providers" if organization_id.nil? 43 | # resource path 44 | local_var_path = "/v2/organizations/{organizationId}/identity_providers".sub('{format}','json').sub('{' + 'organizationId' + '}', organization_id.to_s) 45 | 46 | # query parameters 47 | query_params = {} 48 | 49 | # header parameters 50 | header_params = {} 51 | # HTTP header 'Accept' (if needed) 52 | header_params['Accept'] = @api_client.select_header_accept(['application/json']) 53 | # HTTP header 'Content-Type' 54 | header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) 55 | 56 | # form parameters 57 | form_params = {} 58 | 59 | # http body (model) 60 | post_body = nil 61 | auth_names = [] 62 | data, status_code, headers = @api_client.call_api(:GET, local_var_path, 63 | :header_params => header_params, 64 | :query_params => query_params, 65 | :form_params => form_params, 66 | :body => post_body, 67 | :auth_names => auth_names, 68 | :return_type => 'IdentityProvidersResponse') 69 | if @api_client.config.debugging 70 | @api_client.config.logger.debug "API called: IdentityProvidersApi#get_identity_providers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" 71 | end 72 | return data, status_code, headers 73 | end 74 | end 75 | end -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # The Official DocuSign Admin Ruby Client SDK 2 | 3 | [![RubyGems version][rubygems-image]][rubygems-url] 4 | [![RubyGems downloads][downloads-image]][downloads-url] 5 | [![Build status][travis-image]][travis-url] 6 | 7 | ## Requirements 8 | * Ruby 1.9+ 9 | * Free [developer account](https://go.docusign.com/sandbox/productshot/?elqCampaignId=16531) 10 | 11 | ## Compatibility 12 | * Ruby 1.9+ 13 | 14 | ## Installation 15 | This SDK is provided as open source, which enables you to customize its functionality to suit your particular use case. To do so, download or clone the repository. If the SDK’s given functionality meets your integration needs, or if you’re working through our [code examples](https://developers.docusign.com/docs/admin-api/how-to/) from the [DocuSign Developer Center](https://developers.docusign.com/), you merely need to install it by following the instructions below. 16 | 17 | ### Installation via your application's Gemfile: 18 | 1. In your application's Gemfile, add: 19 | `gem 'docusign_admin'` 20 | 2. Open your preferred console. 21 | 3. In your project directory, execute the installer by typing: **bundle install** 22 | 23 | ### Manual installation: 24 | 1. Open your preferred console. 25 | 2. In the console, type: **gem install docusign_admin** 26 | 27 | ### Dependencies 28 | This client has the following external dependencies: 29 | * Jwt>=1.5.2 30 | * Json>=2.1.0 31 | * Typhoeus>=1.0.1 32 | 33 | ## Code examples 34 | You can find on our GitHub a self-executing package of code examples for the DocuSign Admin C# SDK, called a [Launcher](https://github.com/docusign/code-examples-ruby/blob/master/README.md), that demonstrates common use cases. You can also download a version preconfigured for your DocuSign developer account from [Quickstart](https://developers.docusign.com/docs/admin-api/quickstart/). These examples can use either the [Authorization Code Grant](https://developers.docusign.com/docs/admin-api/guides/authentication/oauth2-code-grant) or [JSON Web Token (JWT)](https://developers.docusign.com/docs/admin-api/guides/authentication/oauth2-jsonwebtoken) authentication workflows. 35 | 36 | ## OAuth implementations 37 | For details regarding which type of OAuth grant will work best for your DocuSign integration, see [Choose OAuth Type](https://developers.docusign.com/platform/auth/choose/) in the [DocuSign Developer Center](https://developers.docusign.com/). 38 | 39 | For security purposes, DocuSign recommends using the [Authorization Code Grant](https://developers.docusign.com/docs/admin-api/guides/authentication/oauth2-code-grant) flow. 40 | 41 | ## Support 42 | Log issues against this client through GitHub. We also have an [active developer community on Stack Overflow](https://stackoverflow.com/questions/tagged/docusignapi). 43 | 44 | ## License 45 | The DocuSign Admin Ruby Client SDK is licensed under the [MIT License](https://github.com/docusign/docusign-ruby-client/blob/master/LICENSE). 46 | 47 | ### Additional resources 48 | * [DocuSign Developer Center](https://developers.docusign.com/) 49 | * [DocuSign API on Twitter](https://twitter.com/docusignapi) 50 | * [DocuSign For Developers on LinkedIn](https://www.linkedin.com/showcase/docusign-for-developers/) 51 | * [DocuSign For Developers on YouTube](https://www.youtube.com/channel/UCJSJ2kMs_qeQotmw4-lX2NQ) -------------------------------------------------------------------------------- /lib/docusign_admin/api/organizations_api.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | require "uri" 13 | 14 | module DocuSign_Admin 15 | 16 | 17 | class OrganizationsApi 18 | attr_accessor :api_client 19 | 20 | def initialize(api_client = OrganizationsApi.default) 21 | @api_client = api_client 22 | end 23 | 24 | # Redacts membership and user data for users in an organization. 25 | # Required scopes: user_data_redact 26 | # @param organization_id The organization ID Guid 27 | # @param request_model The request body describing the users and memberships to be redacted 28 | # @return [IndividualUserDataRedactionResponse] 29 | def redact_individual_user_data(organization_id, request_model) 30 | data, _status_code, _headers = redact_individual_user_data_with_http_info(organization_id, request_model) 31 | return data 32 | end 33 | 34 | # Redacts membership and user data for users in an organization. 35 | # Required scopes: user_data_redact 36 | # @param organization_id The organization ID Guid 37 | # @param request_model The request body describing the users and memberships to be redacted 38 | # @return [Array<(IndividualUserDataRedactionResponse, Fixnum, Hash)>] IndividualUserDataRedactionResponse data, response status code and response headers 39 | def redact_individual_user_data_with_http_info(organization_id, request_model) 40 | if @api_client.config.debugging 41 | @api_client.config.logger.debug "Calling API: OrganizationsApi.redact_individual_user_data ..." 42 | end 43 | # verify the required parameter 'organization_id' is set 44 | fail ArgumentError, "Missing the required parameter 'organization_id' when calling OrganizationsApi.redact_individual_user_data" if organization_id.nil? 45 | # verify the required parameter 'request_model' is set 46 | fail ArgumentError, "Missing the required parameter 'request_model' when calling OrganizationsApi.redact_individual_user_data" if request_model.nil? 47 | # resource path 48 | local_var_path = "/v2/data_redaction/organizations/{organizationId}/user".sub('{format}','json').sub('{' + 'organizationId' + '}', organization_id.to_s) 49 | 50 | # query parameters 51 | query_params = {} 52 | 53 | # header parameters 54 | header_params = {} 55 | # HTTP header 'Accept' (if needed) 56 | header_params['Accept'] = @api_client.select_header_accept(['application/json']) 57 | # HTTP header 'Content-Type' 58 | header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) 59 | 60 | # form parameters 61 | form_params = {} 62 | 63 | # http body (model) 64 | post_body = @api_client.object_to_http_body(request_model) 65 | auth_names = [] 66 | data, status_code, headers = @api_client.call_api(:POST, local_var_path, 67 | :header_params => header_params, 68 | :query_params => query_params, 69 | :form_params => form_params, 70 | :body => post_body, 71 | :auth_names => auth_names, 72 | :return_type => 'IndividualUserDataRedactionResponse') 73 | if @api_client.config.debugging 74 | @api_client.config.logger.debug "API called: OrganizationsApi#redact_individual_user_data\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" 75 | end 76 | return data, status_code, headers 77 | end 78 | end 79 | end -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | # This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) 2 | # Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) 3 | AllCops: 4 | TargetRubyVersion: 2.6 5 | # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop 6 | # to ignore them, so only the ones explicitly set in this file are enabled. 7 | DisabledByDefault: true 8 | Exclude: 9 | - '**/templates/**/*' 10 | - '**/vendor/**/*' 11 | - 'actionpack/lib/action_dispatch/journey/parser.rb' 12 | 13 | # Prefer &&/|| over and/or. 14 | Style/AndOr: 15 | Enabled: true 16 | 17 | # Align `when` with `case`. 18 | Layout/CaseIndentation: 19 | Enabled: true 20 | 21 | # Align comments with method definitions. 22 | Layout/CommentIndentation: 23 | Enabled: true 24 | 25 | Layout/ElseAlignment: 26 | Enabled: true 27 | 28 | Layout/EmptyLineAfterMagicComment: 29 | Enabled: true 30 | 31 | # In a regular class definition, no empty lines around the body. 32 | Layout/EmptyLinesAroundClassBody: 33 | Enabled: true 34 | 35 | # In a regular method definition, no empty lines around the body. 36 | Layout/EmptyLinesAroundMethodBody: 37 | Enabled: true 38 | 39 | # In a regular module definition, no empty lines around the body. 40 | Layout/EmptyLinesAroundModuleBody: 41 | Enabled: true 42 | 43 | Layout/FirstParameterIndentation: 44 | Enabled: true 45 | 46 | # Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. 47 | Style/HashSyntax: 48 | Enabled: false 49 | 50 | # Method definitions after `private` or `protected` isolated calls need one 51 | # extra level of indentation. 52 | Layout/IndentationConsistency: 53 | Enabled: true 54 | EnforcedStyle: indented_internal_methods 55 | 56 | # Two spaces, no tabs (for indentation). 57 | Layout/IndentationWidth: 58 | Enabled: true 59 | 60 | Layout/LeadingCommentSpace: 61 | Enabled: true 62 | 63 | Layout/SpaceAfterColon: 64 | Enabled: true 65 | 66 | Layout/SpaceAfterComma: 67 | Enabled: true 68 | 69 | Layout/SpaceAroundEqualsInParameterDefault: 70 | Enabled: true 71 | 72 | Layout/SpaceAroundKeyword: 73 | Enabled: true 74 | 75 | Layout/SpaceAroundOperators: 76 | Enabled: true 77 | 78 | Layout/SpaceBeforeComma: 79 | Enabled: true 80 | 81 | Layout/SpaceBeforeFirstArg: 82 | Enabled: true 83 | 84 | Style/DefWithParentheses: 85 | Enabled: true 86 | 87 | # Defining a method with parameters needs parentheses. 88 | Style/MethodDefParentheses: 89 | Enabled: true 90 | 91 | Style/FrozenStringLiteralComment: 92 | Enabled: false 93 | EnforcedStyle: always 94 | 95 | # Use `foo {}` not `foo{}`. 96 | Layout/SpaceBeforeBlockBraces: 97 | Enabled: true 98 | 99 | # Use `foo { bar }` not `foo {bar}`. 100 | Layout/SpaceInsideBlockBraces: 101 | Enabled: true 102 | 103 | # Use `{ a: 1 }` not `{a:1}`. 104 | Layout/SpaceInsideHashLiteralBraces: 105 | Enabled: true 106 | 107 | Layout/SpaceInsideParens: 108 | Enabled: true 109 | 110 | # Check quotes usage according to lint rule below. 111 | #Style/StringLiterals: 112 | # Enabled: true 113 | # EnforcedStyle: single_quotes 114 | 115 | # Detect hard tabs, no hard tabs. 116 | Layout/IndentationStyle: 117 | Enabled: true 118 | 119 | # Blank lines should not have any spaces. 120 | Layout/TrailingEmptyLines: 121 | Enabled: true 122 | 123 | # No trailing whitespace. 124 | Layout/TrailingWhitespace: 125 | Enabled: false 126 | 127 | # Use quotes for string literals when they are enough. 128 | Style/RedundantPercentQ: 129 | Enabled: true 130 | 131 | # Align `end` with the matching keyword or starting expression except for 132 | # assignments, where it should be aligned with the LHS. 133 | Lint/EndAlignment: 134 | Enabled: true 135 | EnforcedStyleAlignWith: variable 136 | AutoCorrect: true 137 | 138 | # Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg. 139 | Lint/RequireParentheses: 140 | Enabled: true 141 | 142 | Style/RedundantReturn: 143 | Enabled: true 144 | AllowMultipleReturnValues: true 145 | 146 | Style/Semicolon: 147 | Enabled: true 148 | AllowAsExpressionSeparator: true 149 | -------------------------------------------------------------------------------- /lib/docusign_admin/models/user_identity_request.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | require 'date' 13 | 14 | module DocuSign_Admin 15 | class UserIdentityRequest 16 | attr_accessor :id 17 | 18 | # Attribute mapping from ruby-style variable name to JSON key. 19 | def self.attribute_map 20 | { 21 | :'id' => :'id' 22 | } 23 | end 24 | 25 | # Attribute type mapping. 26 | def self.swagger_types 27 | { 28 | :'id' => :'String' 29 | } 30 | end 31 | 32 | # Initializes the object 33 | # @param [Hash] attributes Model attributes in the form of hash 34 | def initialize(attributes = {}) 35 | return unless attributes.is_a?(Hash) 36 | 37 | # convert string to symbol for hash key 38 | attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } 39 | 40 | if attributes.has_key?(:'id') 41 | self.id = attributes[:'id'] 42 | end 43 | end 44 | 45 | # Show invalid properties with the reasons. Usually used together with valid? 46 | # @return Array for valid properties with the reasons 47 | def list_invalid_properties 48 | invalid_properties = Array.new 49 | invalid_properties 50 | end 51 | 52 | # Check to see if the all the properties in the model are valid 53 | # @return true if the model is valid 54 | def valid? 55 | true 56 | end 57 | 58 | # Checks equality by comparing each attribute. 59 | # @param [Object] Object to be compared 60 | def ==(o) 61 | return true if self.equal?(o) 62 | self.class == o.class && 63 | id == o.id 64 | end 65 | 66 | # @see the `==` method 67 | # @param [Object] Object to be compared 68 | def eql?(o) 69 | self == o 70 | end 71 | 72 | # Calculates hash code according to all attributes. 73 | # @return [Fixnum] Hash code 74 | def hash 75 | [id].hash 76 | end 77 | 78 | # Builds the object from hash 79 | # @param [Hash] attributes Model attributes in the form of hash 80 | # @return [Object] Returns the model itself 81 | def build_from_hash(attributes) 82 | return nil unless attributes.is_a?(Hash) 83 | self.class.swagger_types.each_pair do |key, type| 84 | if type =~ /\AArray<(.*)>/i 85 | # check to ensure the input is an array given that the attribute 86 | # is documented as an array but the input is not 87 | if attributes[self.class.attribute_map[key]].is_a?(Array) 88 | self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) 89 | end 90 | elsif !attributes[self.class.attribute_map[key]].nil? 91 | self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) 92 | end # or else data not found in attributes(hash), not an issue as the data can be optional 93 | end 94 | 95 | self 96 | end 97 | 98 | # Deserializes the data based on type 99 | # @param string type Data type 100 | # @param string value Value to be deserialized 101 | # @return [Object] Deserialized data 102 | def _deserialize(type, value) 103 | case type.to_sym 104 | when :DateTime 105 | DateTime.parse(value) 106 | when :Date 107 | Date.parse(value) 108 | when :String 109 | value.to_s 110 | when :Integer 111 | value.to_i 112 | when :Float 113 | value.to_f 114 | when :BOOLEAN 115 | if value.to_s =~ /\A(true|t|yes|y|1)\z/i 116 | true 117 | else 118 | false 119 | end 120 | when :Object 121 | # generic object (usually a Hash), return directly 122 | value 123 | when /\AArray<(?.+)>\z/ 124 | inner_type = Regexp.last_match[:inner_type] 125 | value.map { |v| _deserialize(inner_type, v) } 126 | when /\AHash<(?.+?), (?.+)>\z/ 127 | k_type = Regexp.last_match[:k_type] 128 | v_type = Regexp.last_match[:v_type] 129 | {}.tap do |hash| 130 | value.each do |k, v| 131 | hash[_deserialize(k_type, k)] = _deserialize(v_type, v) 132 | end 133 | end 134 | else # model 135 | temp_model = DocuSign_Admin.const_get(type).new 136 | temp_model.build_from_hash(value) 137 | end 138 | end 139 | 140 | # Returns the string representation of the object 141 | # @return [String] String presentation of the object 142 | def to_s 143 | to_hash.to_s 144 | end 145 | 146 | # to_body is an alias to to_hash (backward compatibility) 147 | # @return [Hash] Returns the object in the form of hash 148 | def to_body 149 | to_hash 150 | end 151 | 152 | # Returns the object in the form of hash 153 | # @return [Hash] Returns the object in the form of hash 154 | def to_hash 155 | hash = {} 156 | self.class.attribute_map.each_pair do |attr, param| 157 | value = self.send(attr) 158 | next if value.nil? 159 | hash[param] = _to_hash(value) 160 | end 161 | hash 162 | end 163 | 164 | # Outputs non-array value in the form of hash 165 | # For object, use to_hash. Otherwise, just return the value 166 | # @param [Object] value Any valid value 167 | # @return [Hash] Returns the value in the form of hash 168 | def _to_hash(value) 169 | if value.is_a?(Array) 170 | value.compact.map { |v| _to_hash(v) } 171 | elsif value.is_a?(Hash) 172 | {}.tap do |hash| 173 | value.each { |k, v| hash[k] = _to_hash(v) } 174 | end 175 | elsif value.respond_to? :to_hash 176 | value.to_hash 177 | else 178 | value 179 | end 180 | end 181 | 182 | end 183 | end 184 | -------------------------------------------------------------------------------- /lib/docusign_admin/models/organization_simple_id_object.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | require 'date' 13 | 14 | module DocuSign_Admin 15 | class OrganizationSimpleIdObject 16 | attr_accessor :id 17 | 18 | # Attribute mapping from ruby-style variable name to JSON key. 19 | def self.attribute_map 20 | { 21 | :'id' => :'id' 22 | } 23 | end 24 | 25 | # Attribute type mapping. 26 | def self.swagger_types 27 | { 28 | :'id' => :'String' 29 | } 30 | end 31 | 32 | # Initializes the object 33 | # @param [Hash] attributes Model attributes in the form of hash 34 | def initialize(attributes = {}) 35 | return unless attributes.is_a?(Hash) 36 | 37 | # convert string to symbol for hash key 38 | attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } 39 | 40 | if attributes.has_key?(:'id') 41 | self.id = attributes[:'id'] 42 | end 43 | end 44 | 45 | # Show invalid properties with the reasons. Usually used together with valid? 46 | # @return Array for valid properties with the reasons 47 | def list_invalid_properties 48 | invalid_properties = Array.new 49 | invalid_properties 50 | end 51 | 52 | # Check to see if the all the properties in the model are valid 53 | # @return true if the model is valid 54 | def valid? 55 | true 56 | end 57 | 58 | # Checks equality by comparing each attribute. 59 | # @param [Object] Object to be compared 60 | def ==(o) 61 | return true if self.equal?(o) 62 | self.class == o.class && 63 | id == o.id 64 | end 65 | 66 | # @see the `==` method 67 | # @param [Object] Object to be compared 68 | def eql?(o) 69 | self == o 70 | end 71 | 72 | # Calculates hash code according to all attributes. 73 | # @return [Fixnum] Hash code 74 | def hash 75 | [id].hash 76 | end 77 | 78 | # Builds the object from hash 79 | # @param [Hash] attributes Model attributes in the form of hash 80 | # @return [Object] Returns the model itself 81 | def build_from_hash(attributes) 82 | return nil unless attributes.is_a?(Hash) 83 | self.class.swagger_types.each_pair do |key, type| 84 | if type =~ /\AArray<(.*)>/i 85 | # check to ensure the input is an array given that the attribute 86 | # is documented as an array but the input is not 87 | if attributes[self.class.attribute_map[key]].is_a?(Array) 88 | self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) 89 | end 90 | elsif !attributes[self.class.attribute_map[key]].nil? 91 | self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) 92 | end # or else data not found in attributes(hash), not an issue as the data can be optional 93 | end 94 | 95 | self 96 | end 97 | 98 | # Deserializes the data based on type 99 | # @param string type Data type 100 | # @param string value Value to be deserialized 101 | # @return [Object] Deserialized data 102 | def _deserialize(type, value) 103 | case type.to_sym 104 | when :DateTime 105 | DateTime.parse(value) 106 | when :Date 107 | Date.parse(value) 108 | when :String 109 | value.to_s 110 | when :Integer 111 | value.to_i 112 | when :Float 113 | value.to_f 114 | when :BOOLEAN 115 | if value.to_s =~ /\A(true|t|yes|y|1)\z/i 116 | true 117 | else 118 | false 119 | end 120 | when :Object 121 | # generic object (usually a Hash), return directly 122 | value 123 | when /\AArray<(?.+)>\z/ 124 | inner_type = Regexp.last_match[:inner_type] 125 | value.map { |v| _deserialize(inner_type, v) } 126 | when /\AHash<(?.+?), (?.+)>\z/ 127 | k_type = Regexp.last_match[:k_type] 128 | v_type = Regexp.last_match[:v_type] 129 | {}.tap do |hash| 130 | value.each do |k, v| 131 | hash[_deserialize(k_type, k)] = _deserialize(v_type, v) 132 | end 133 | end 134 | else # model 135 | temp_model = DocuSign_Admin.const_get(type).new 136 | temp_model.build_from_hash(value) 137 | end 138 | end 139 | 140 | # Returns the string representation of the object 141 | # @return [String] String presentation of the object 142 | def to_s 143 | to_hash.to_s 144 | end 145 | 146 | # to_body is an alias to to_hash (backward compatibility) 147 | # @return [Hash] Returns the object in the form of hash 148 | def to_body 149 | to_hash 150 | end 151 | 152 | # Returns the object in the form of hash 153 | # @return [Hash] Returns the object in the form of hash 154 | def to_hash 155 | hash = {} 156 | self.class.attribute_map.each_pair do |attr, param| 157 | value = self.send(attr) 158 | next if value.nil? 159 | hash[param] = _to_hash(value) 160 | end 161 | hash 162 | end 163 | 164 | # Outputs non-array value in the form of hash 165 | # For object, use to_hash. Otherwise, just return the value 166 | # @param [Object] value Any valid value 167 | # @return [Hash] Returns the value in the form of hash 168 | def _to_hash(value) 169 | if value.is_a?(Array) 170 | value.compact.map { |v| _to_hash(v) } 171 | elsif value.is_a?(Hash) 172 | {}.tap do |hash| 173 | value.each { |k, v| hash[k] = _to_hash(v) } 174 | end 175 | elsif value.respond_to? :to_hash 176 | value.to_hash 177 | else 178 | value 179 | end 180 | end 181 | 182 | end 183 | end 184 | -------------------------------------------------------------------------------- /lib/docusign_admin/models/update_response.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | require 'date' 13 | 14 | module DocuSign_Admin 15 | class UpdateResponse 16 | attr_accessor :status 17 | 18 | # Attribute mapping from ruby-style variable name to JSON key. 19 | def self.attribute_map 20 | { 21 | :'status' => :'status' 22 | } 23 | end 24 | 25 | # Attribute type mapping. 26 | def self.swagger_types 27 | { 28 | :'status' => :'String' 29 | } 30 | end 31 | 32 | # Initializes the object 33 | # @param [Hash] attributes Model attributes in the form of hash 34 | def initialize(attributes = {}) 35 | return unless attributes.is_a?(Hash) 36 | 37 | # convert string to symbol for hash key 38 | attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } 39 | 40 | if attributes.has_key?(:'status') 41 | self.status = attributes[:'status'] 42 | end 43 | end 44 | 45 | # Show invalid properties with the reasons. Usually used together with valid? 46 | # @return Array for valid properties with the reasons 47 | def list_invalid_properties 48 | invalid_properties = Array.new 49 | invalid_properties 50 | end 51 | 52 | # Check to see if the all the properties in the model are valid 53 | # @return true if the model is valid 54 | def valid? 55 | true 56 | end 57 | 58 | # Checks equality by comparing each attribute. 59 | # @param [Object] Object to be compared 60 | def ==(o) 61 | return true if self.equal?(o) 62 | self.class == o.class && 63 | status == o.status 64 | end 65 | 66 | # @see the `==` method 67 | # @param [Object] Object to be compared 68 | def eql?(o) 69 | self == o 70 | end 71 | 72 | # Calculates hash code according to all attributes. 73 | # @return [Fixnum] Hash code 74 | def hash 75 | [status].hash 76 | end 77 | 78 | # Builds the object from hash 79 | # @param [Hash] attributes Model attributes in the form of hash 80 | # @return [Object] Returns the model itself 81 | def build_from_hash(attributes) 82 | return nil unless attributes.is_a?(Hash) 83 | self.class.swagger_types.each_pair do |key, type| 84 | if type =~ /\AArray<(.*)>/i 85 | # check to ensure the input is an array given that the attribute 86 | # is documented as an array but the input is not 87 | if attributes[self.class.attribute_map[key]].is_a?(Array) 88 | self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) 89 | end 90 | elsif !attributes[self.class.attribute_map[key]].nil? 91 | self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) 92 | end # or else data not found in attributes(hash), not an issue as the data can be optional 93 | end 94 | 95 | self 96 | end 97 | 98 | # Deserializes the data based on type 99 | # @param string type Data type 100 | # @param string value Value to be deserialized 101 | # @return [Object] Deserialized data 102 | def _deserialize(type, value) 103 | case type.to_sym 104 | when :DateTime 105 | DateTime.parse(value) 106 | when :Date 107 | Date.parse(value) 108 | when :String 109 | value.to_s 110 | when :Integer 111 | value.to_i 112 | when :Float 113 | value.to_f 114 | when :BOOLEAN 115 | if value.to_s =~ /\A(true|t|yes|y|1)\z/i 116 | true 117 | else 118 | false 119 | end 120 | when :Object 121 | # generic object (usually a Hash), return directly 122 | value 123 | when /\AArray<(?.+)>\z/ 124 | inner_type = Regexp.last_match[:inner_type] 125 | value.map { |v| _deserialize(inner_type, v) } 126 | when /\AHash<(?.+?), (?.+)>\z/ 127 | k_type = Regexp.last_match[:k_type] 128 | v_type = Regexp.last_match[:v_type] 129 | {}.tap do |hash| 130 | value.each do |k, v| 131 | hash[_deserialize(k_type, k)] = _deserialize(v_type, v) 132 | end 133 | end 134 | else # model 135 | temp_model = DocuSign_Admin.const_get(type).new 136 | temp_model.build_from_hash(value) 137 | end 138 | end 139 | 140 | # Returns the string representation of the object 141 | # @return [String] String presentation of the object 142 | def to_s 143 | to_hash.to_s 144 | end 145 | 146 | # to_body is an alias to to_hash (backward compatibility) 147 | # @return [Hash] Returns the object in the form of hash 148 | def to_body 149 | to_hash 150 | end 151 | 152 | # Returns the object in the form of hash 153 | # @return [Hash] Returns the object in the form of hash 154 | def to_hash 155 | hash = {} 156 | self.class.attribute_map.each_pair do |attr, param| 157 | value = self.send(attr) 158 | next if value.nil? 159 | hash[param] = _to_hash(value) 160 | end 161 | hash 162 | end 163 | 164 | # Outputs non-array value in the form of hash 165 | # For object, use to_hash. Otherwise, just return the value 166 | # @param [Object] value Any valid value 167 | # @return [Hash] Returns the value in the form of hash 168 | def _to_hash(value) 169 | if value.is_a?(Array) 170 | value.compact.map { |v| _to_hash(v) } 171 | elsif value.is_a?(Hash) 172 | {}.tap do |hash| 173 | value.each { |k, v| hash[k] = _to_hash(v) } 174 | end 175 | elsif value.respond_to? :to_hash 176 | value.to_hash 177 | else 178 | value 179 | end 180 | end 181 | 182 | end 183 | end 184 | -------------------------------------------------------------------------------- /lib/docusign_admin/models/org_export_selected_domain.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | require 'date' 13 | 14 | module DocuSign_Admin 15 | class OrgExportSelectedDomain 16 | attr_accessor :domain 17 | 18 | # Attribute mapping from ruby-style variable name to JSON key. 19 | def self.attribute_map 20 | { 21 | :'domain' => :'domain' 22 | } 23 | end 24 | 25 | # Attribute type mapping. 26 | def self.swagger_types 27 | { 28 | :'domain' => :'String' 29 | } 30 | end 31 | 32 | # Initializes the object 33 | # @param [Hash] attributes Model attributes in the form of hash 34 | def initialize(attributes = {}) 35 | return unless attributes.is_a?(Hash) 36 | 37 | # convert string to symbol for hash key 38 | attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } 39 | 40 | if attributes.has_key?(:'domain') 41 | self.domain = attributes[:'domain'] 42 | end 43 | end 44 | 45 | # Show invalid properties with the reasons. Usually used together with valid? 46 | # @return Array for valid properties with the reasons 47 | def list_invalid_properties 48 | invalid_properties = Array.new 49 | invalid_properties 50 | end 51 | 52 | # Check to see if the all the properties in the model are valid 53 | # @return true if the model is valid 54 | def valid? 55 | true 56 | end 57 | 58 | # Checks equality by comparing each attribute. 59 | # @param [Object] Object to be compared 60 | def ==(o) 61 | return true if self.equal?(o) 62 | self.class == o.class && 63 | domain == o.domain 64 | end 65 | 66 | # @see the `==` method 67 | # @param [Object] Object to be compared 68 | def eql?(o) 69 | self == o 70 | end 71 | 72 | # Calculates hash code according to all attributes. 73 | # @return [Fixnum] Hash code 74 | def hash 75 | [domain].hash 76 | end 77 | 78 | # Builds the object from hash 79 | # @param [Hash] attributes Model attributes in the form of hash 80 | # @return [Object] Returns the model itself 81 | def build_from_hash(attributes) 82 | return nil unless attributes.is_a?(Hash) 83 | self.class.swagger_types.each_pair do |key, type| 84 | if type =~ /\AArray<(.*)>/i 85 | # check to ensure the input is an array given that the attribute 86 | # is documented as an array but the input is not 87 | if attributes[self.class.attribute_map[key]].is_a?(Array) 88 | self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) 89 | end 90 | elsif !attributes[self.class.attribute_map[key]].nil? 91 | self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) 92 | end # or else data not found in attributes(hash), not an issue as the data can be optional 93 | end 94 | 95 | self 96 | end 97 | 98 | # Deserializes the data based on type 99 | # @param string type Data type 100 | # @param string value Value to be deserialized 101 | # @return [Object] Deserialized data 102 | def _deserialize(type, value) 103 | case type.to_sym 104 | when :DateTime 105 | DateTime.parse(value) 106 | when :Date 107 | Date.parse(value) 108 | when :String 109 | value.to_s 110 | when :Integer 111 | value.to_i 112 | when :Float 113 | value.to_f 114 | when :BOOLEAN 115 | if value.to_s =~ /\A(true|t|yes|y|1)\z/i 116 | true 117 | else 118 | false 119 | end 120 | when :Object 121 | # generic object (usually a Hash), return directly 122 | value 123 | when /\AArray<(?.+)>\z/ 124 | inner_type = Regexp.last_match[:inner_type] 125 | value.map { |v| _deserialize(inner_type, v) } 126 | when /\AHash<(?.+?), (?.+)>\z/ 127 | k_type = Regexp.last_match[:k_type] 128 | v_type = Regexp.last_match[:v_type] 129 | {}.tap do |hash| 130 | value.each do |k, v| 131 | hash[_deserialize(k_type, k)] = _deserialize(v_type, v) 132 | end 133 | end 134 | else # model 135 | temp_model = DocuSign_Admin.const_get(type).new 136 | temp_model.build_from_hash(value) 137 | end 138 | end 139 | 140 | # Returns the string representation of the object 141 | # @return [String] String presentation of the object 142 | def to_s 143 | to_hash.to_s 144 | end 145 | 146 | # to_body is an alias to to_hash (backward compatibility) 147 | # @return [Hash] Returns the object in the form of hash 148 | def to_body 149 | to_hash 150 | end 151 | 152 | # Returns the object in the form of hash 153 | # @return [Hash] Returns the object in the form of hash 154 | def to_hash 155 | hash = {} 156 | self.class.attribute_map.each_pair do |attr, param| 157 | value = self.send(attr) 158 | next if value.nil? 159 | hash[param] = _to_hash(value) 160 | end 161 | hash 162 | end 163 | 164 | # Outputs non-array value in the form of hash 165 | # For object, use to_hash. Otherwise, just return the value 166 | # @param [Object] value Any valid value 167 | # @return [Hash] Returns the value in the form of hash 168 | def _to_hash(value) 169 | if value.is_a?(Array) 170 | value.compact.map { |v| _to_hash(v) } 171 | elsif value.is_a?(Hash) 172 | {}.tap do |hash| 173 | value.each { |k, v| hash[k] = _to_hash(v) } 174 | end 175 | elsif value.respond_to? :to_hash 176 | value.to_hash 177 | else 178 | value 179 | end 180 | end 181 | 182 | end 183 | end 184 | -------------------------------------------------------------------------------- /lib/docusign_admin/models/organization_export_domain.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | require 'date' 13 | 14 | module DocuSign_Admin 15 | class OrganizationExportDomain 16 | attr_accessor :domain 17 | 18 | # Attribute mapping from ruby-style variable name to JSON key. 19 | def self.attribute_map 20 | { 21 | :'domain' => :'domain' 22 | } 23 | end 24 | 25 | # Attribute type mapping. 26 | def self.swagger_types 27 | { 28 | :'domain' => :'String' 29 | } 30 | end 31 | 32 | # Initializes the object 33 | # @param [Hash] attributes Model attributes in the form of hash 34 | def initialize(attributes = {}) 35 | return unless attributes.is_a?(Hash) 36 | 37 | # convert string to symbol for hash key 38 | attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } 39 | 40 | if attributes.has_key?(:'domain') 41 | self.domain = attributes[:'domain'] 42 | end 43 | end 44 | 45 | # Show invalid properties with the reasons. Usually used together with valid? 46 | # @return Array for valid properties with the reasons 47 | def list_invalid_properties 48 | invalid_properties = Array.new 49 | invalid_properties 50 | end 51 | 52 | # Check to see if the all the properties in the model are valid 53 | # @return true if the model is valid 54 | def valid? 55 | true 56 | end 57 | 58 | # Checks equality by comparing each attribute. 59 | # @param [Object] Object to be compared 60 | def ==(o) 61 | return true if self.equal?(o) 62 | self.class == o.class && 63 | domain == o.domain 64 | end 65 | 66 | # @see the `==` method 67 | # @param [Object] Object to be compared 68 | def eql?(o) 69 | self == o 70 | end 71 | 72 | # Calculates hash code according to all attributes. 73 | # @return [Fixnum] Hash code 74 | def hash 75 | [domain].hash 76 | end 77 | 78 | # Builds the object from hash 79 | # @param [Hash] attributes Model attributes in the form of hash 80 | # @return [Object] Returns the model itself 81 | def build_from_hash(attributes) 82 | return nil unless attributes.is_a?(Hash) 83 | self.class.swagger_types.each_pair do |key, type| 84 | if type =~ /\AArray<(.*)>/i 85 | # check to ensure the input is an array given that the attribute 86 | # is documented as an array but the input is not 87 | if attributes[self.class.attribute_map[key]].is_a?(Array) 88 | self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) 89 | end 90 | elsif !attributes[self.class.attribute_map[key]].nil? 91 | self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) 92 | end # or else data not found in attributes(hash), not an issue as the data can be optional 93 | end 94 | 95 | self 96 | end 97 | 98 | # Deserializes the data based on type 99 | # @param string type Data type 100 | # @param string value Value to be deserialized 101 | # @return [Object] Deserialized data 102 | def _deserialize(type, value) 103 | case type.to_sym 104 | when :DateTime 105 | DateTime.parse(value) 106 | when :Date 107 | Date.parse(value) 108 | when :String 109 | value.to_s 110 | when :Integer 111 | value.to_i 112 | when :Float 113 | value.to_f 114 | when :BOOLEAN 115 | if value.to_s =~ /\A(true|t|yes|y|1)\z/i 116 | true 117 | else 118 | false 119 | end 120 | when :Object 121 | # generic object (usually a Hash), return directly 122 | value 123 | when /\AArray<(?.+)>\z/ 124 | inner_type = Regexp.last_match[:inner_type] 125 | value.map { |v| _deserialize(inner_type, v) } 126 | when /\AHash<(?.+?), (?.+)>\z/ 127 | k_type = Regexp.last_match[:k_type] 128 | v_type = Regexp.last_match[:v_type] 129 | {}.tap do |hash| 130 | value.each do |k, v| 131 | hash[_deserialize(k_type, k)] = _deserialize(v_type, v) 132 | end 133 | end 134 | else # model 135 | temp_model = DocuSign_Admin.const_get(type).new 136 | temp_model.build_from_hash(value) 137 | end 138 | end 139 | 140 | # Returns the string representation of the object 141 | # @return [String] String presentation of the object 142 | def to_s 143 | to_hash.to_s 144 | end 145 | 146 | # to_body is an alias to to_hash (backward compatibility) 147 | # @return [Hash] Returns the object in the form of hash 148 | def to_body 149 | to_hash 150 | end 151 | 152 | # Returns the object in the form of hash 153 | # @return [Hash] Returns the object in the form of hash 154 | def to_hash 155 | hash = {} 156 | self.class.attribute_map.each_pair do |attr, param| 157 | value = self.send(attr) 158 | next if value.nil? 159 | hash[param] = _to_hash(value) 160 | end 161 | hash 162 | end 163 | 164 | # Outputs non-array value in the form of hash 165 | # For object, use to_hash. Otherwise, just return the value 166 | # @param [Object] value Any valid value 167 | # @return [Hash] Returns the value in the form of hash 168 | def _to_hash(value) 169 | if value.is_a?(Array) 170 | value.compact.map { |v| _to_hash(v) } 171 | elsif value.is_a?(Hash) 172 | {}.tap do |hash| 173 | value.each { |k, v| hash[k] = _to_hash(v) } 174 | end 175 | elsif value.respond_to? :to_hash 176 | value.to_hash 177 | else 178 | value 179 | end 180 | end 181 | 182 | end 183 | end 184 | -------------------------------------------------------------------------------- /lib/docusign_admin/models/individual_membership_data_redaction_request.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | require 'date' 13 | 14 | module DocuSign_Admin 15 | class IndividualMembershipDataRedactionRequest 16 | attr_accessor :user_id 17 | 18 | # Attribute mapping from ruby-style variable name to JSON key. 19 | def self.attribute_map 20 | { 21 | :'user_id' => :'user_id' 22 | } 23 | end 24 | 25 | # Attribute type mapping. 26 | def self.swagger_types 27 | { 28 | :'user_id' => :'String' 29 | } 30 | end 31 | 32 | # Initializes the object 33 | # @param [Hash] attributes Model attributes in the form of hash 34 | def initialize(attributes = {}) 35 | return unless attributes.is_a?(Hash) 36 | 37 | # convert string to symbol for hash key 38 | attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } 39 | 40 | if attributes.has_key?(:'user_id') 41 | self.user_id = attributes[:'user_id'] 42 | end 43 | end 44 | 45 | # Show invalid properties with the reasons. Usually used together with valid? 46 | # @return Array for valid properties with the reasons 47 | def list_invalid_properties 48 | invalid_properties = Array.new 49 | invalid_properties 50 | end 51 | 52 | # Check to see if the all the properties in the model are valid 53 | # @return true if the model is valid 54 | def valid? 55 | true 56 | end 57 | 58 | # Checks equality by comparing each attribute. 59 | # @param [Object] Object to be compared 60 | def ==(o) 61 | return true if self.equal?(o) 62 | self.class == o.class && 63 | user_id == o.user_id 64 | end 65 | 66 | # @see the `==` method 67 | # @param [Object] Object to be compared 68 | def eql?(o) 69 | self == o 70 | end 71 | 72 | # Calculates hash code according to all attributes. 73 | # @return [Fixnum] Hash code 74 | def hash 75 | [user_id].hash 76 | end 77 | 78 | # Builds the object from hash 79 | # @param [Hash] attributes Model attributes in the form of hash 80 | # @return [Object] Returns the model itself 81 | def build_from_hash(attributes) 82 | return nil unless attributes.is_a?(Hash) 83 | self.class.swagger_types.each_pair do |key, type| 84 | if type =~ /\AArray<(.*)>/i 85 | # check to ensure the input is an array given that the attribute 86 | # is documented as an array but the input is not 87 | if attributes[self.class.attribute_map[key]].is_a?(Array) 88 | self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) 89 | end 90 | elsif !attributes[self.class.attribute_map[key]].nil? 91 | self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) 92 | end # or else data not found in attributes(hash), not an issue as the data can be optional 93 | end 94 | 95 | self 96 | end 97 | 98 | # Deserializes the data based on type 99 | # @param string type Data type 100 | # @param string value Value to be deserialized 101 | # @return [Object] Deserialized data 102 | def _deserialize(type, value) 103 | case type.to_sym 104 | when :DateTime 105 | DateTime.parse(value) 106 | when :Date 107 | Date.parse(value) 108 | when :String 109 | value.to_s 110 | when :Integer 111 | value.to_i 112 | when :Float 113 | value.to_f 114 | when :BOOLEAN 115 | if value.to_s =~ /\A(true|t|yes|y|1)\z/i 116 | true 117 | else 118 | false 119 | end 120 | when :Object 121 | # generic object (usually a Hash), return directly 122 | value 123 | when /\AArray<(?.+)>\z/ 124 | inner_type = Regexp.last_match[:inner_type] 125 | value.map { |v| _deserialize(inner_type, v) } 126 | when /\AHash<(?.+?), (?.+)>\z/ 127 | k_type = Regexp.last_match[:k_type] 128 | v_type = Regexp.last_match[:v_type] 129 | {}.tap do |hash| 130 | value.each do |k, v| 131 | hash[_deserialize(k_type, k)] = _deserialize(v_type, v) 132 | end 133 | end 134 | else # model 135 | temp_model = DocuSign_Admin.const_get(type).new 136 | temp_model.build_from_hash(value) 137 | end 138 | end 139 | 140 | # Returns the string representation of the object 141 | # @return [String] String presentation of the object 142 | def to_s 143 | to_hash.to_s 144 | end 145 | 146 | # to_body is an alias to to_hash (backward compatibility) 147 | # @return [Hash] Returns the object in the form of hash 148 | def to_body 149 | to_hash 150 | end 151 | 152 | # Returns the object in the form of hash 153 | # @return [Hash] Returns the object in the form of hash 154 | def to_hash 155 | hash = {} 156 | self.class.attribute_map.each_pair do |attr, param| 157 | value = self.send(attr) 158 | next if value.nil? 159 | hash[param] = _to_hash(value) 160 | end 161 | hash 162 | end 163 | 164 | # Outputs non-array value in the form of hash 165 | # For object, use to_hash. Otherwise, just return the value 166 | # @param [Object] value Any valid value 167 | # @return [Hash] Returns the value in the form of hash 168 | def _to_hash(value) 169 | if value.is_a?(Array) 170 | value.compact.map { |v| _to_hash(v) } 171 | elsif value.is_a?(Hash) 172 | {}.tap do |hash| 173 | value.each { |k, v| hash[k] = _to_hash(v) } 174 | end 175 | elsif value.respond_to? :to_hash 176 | value.to_hash 177 | else 178 | value 179 | end 180 | end 181 | 182 | end 183 | end 184 | -------------------------------------------------------------------------------- /lib/docusign_admin/models/org_export_selected_account.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | require 'date' 13 | 14 | module DocuSign_Admin 15 | class OrgExportSelectedAccount 16 | attr_accessor :account_id 17 | 18 | # Attribute mapping from ruby-style variable name to JSON key. 19 | def self.attribute_map 20 | { 21 | :'account_id' => :'account_id' 22 | } 23 | end 24 | 25 | # Attribute type mapping. 26 | def self.swagger_types 27 | { 28 | :'account_id' => :'String' 29 | } 30 | end 31 | 32 | # Initializes the object 33 | # @param [Hash] attributes Model attributes in the form of hash 34 | def initialize(attributes = {}) 35 | return unless attributes.is_a?(Hash) 36 | 37 | # convert string to symbol for hash key 38 | attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } 39 | 40 | if attributes.has_key?(:'account_id') 41 | self.account_id = attributes[:'account_id'] 42 | end 43 | end 44 | 45 | # Show invalid properties with the reasons. Usually used together with valid? 46 | # @return Array for valid properties with the reasons 47 | def list_invalid_properties 48 | invalid_properties = Array.new 49 | invalid_properties 50 | end 51 | 52 | # Check to see if the all the properties in the model are valid 53 | # @return true if the model is valid 54 | def valid? 55 | true 56 | end 57 | 58 | # Checks equality by comparing each attribute. 59 | # @param [Object] Object to be compared 60 | def ==(o) 61 | return true if self.equal?(o) 62 | self.class == o.class && 63 | account_id == o.account_id 64 | end 65 | 66 | # @see the `==` method 67 | # @param [Object] Object to be compared 68 | def eql?(o) 69 | self == o 70 | end 71 | 72 | # Calculates hash code according to all attributes. 73 | # @return [Fixnum] Hash code 74 | def hash 75 | [account_id].hash 76 | end 77 | 78 | # Builds the object from hash 79 | # @param [Hash] attributes Model attributes in the form of hash 80 | # @return [Object] Returns the model itself 81 | def build_from_hash(attributes) 82 | return nil unless attributes.is_a?(Hash) 83 | self.class.swagger_types.each_pair do |key, type| 84 | if type =~ /\AArray<(.*)>/i 85 | # check to ensure the input is an array given that the attribute 86 | # is documented as an array but the input is not 87 | if attributes[self.class.attribute_map[key]].is_a?(Array) 88 | self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) 89 | end 90 | elsif !attributes[self.class.attribute_map[key]].nil? 91 | self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) 92 | end # or else data not found in attributes(hash), not an issue as the data can be optional 93 | end 94 | 95 | self 96 | end 97 | 98 | # Deserializes the data based on type 99 | # @param string type Data type 100 | # @param string value Value to be deserialized 101 | # @return [Object] Deserialized data 102 | def _deserialize(type, value) 103 | case type.to_sym 104 | when :DateTime 105 | DateTime.parse(value) 106 | when :Date 107 | Date.parse(value) 108 | when :String 109 | value.to_s 110 | when :Integer 111 | value.to_i 112 | when :Float 113 | value.to_f 114 | when :BOOLEAN 115 | if value.to_s =~ /\A(true|t|yes|y|1)\z/i 116 | true 117 | else 118 | false 119 | end 120 | when :Object 121 | # generic object (usually a Hash), return directly 122 | value 123 | when /\AArray<(?.+)>\z/ 124 | inner_type = Regexp.last_match[:inner_type] 125 | value.map { |v| _deserialize(inner_type, v) } 126 | when /\AHash<(?.+?), (?.+)>\z/ 127 | k_type = Regexp.last_match[:k_type] 128 | v_type = Regexp.last_match[:v_type] 129 | {}.tap do |hash| 130 | value.each do |k, v| 131 | hash[_deserialize(k_type, k)] = _deserialize(v_type, v) 132 | end 133 | end 134 | else # model 135 | temp_model = DocuSign_Admin.const_get(type).new 136 | temp_model.build_from_hash(value) 137 | end 138 | end 139 | 140 | # Returns the string representation of the object 141 | # @return [String] String presentation of the object 142 | def to_s 143 | to_hash.to_s 144 | end 145 | 146 | # to_body is an alias to to_hash (backward compatibility) 147 | # @return [Hash] Returns the object in the form of hash 148 | def to_body 149 | to_hash 150 | end 151 | 152 | # Returns the object in the form of hash 153 | # @return [Hash] Returns the object in the form of hash 154 | def to_hash 155 | hash = {} 156 | self.class.attribute_map.each_pair do |attr, param| 157 | value = self.send(attr) 158 | next if value.nil? 159 | hash[param] = _to_hash(value) 160 | end 161 | hash 162 | end 163 | 164 | # Outputs non-array value in the form of hash 165 | # For object, use to_hash. Otherwise, just return the value 166 | # @param [Object] value Any valid value 167 | # @return [Hash] Returns the value in the form of hash 168 | def _to_hash(value) 169 | if value.is_a?(Array) 170 | value.compact.map { |v| _to_hash(v) } 171 | elsif value.is_a?(Hash) 172 | {}.tap do |hash| 173 | value.each { |k, v| hash[k] = _to_hash(v) } 174 | end 175 | elsif value.respond_to? :to_hash 176 | value.to_hash 177 | else 178 | value 179 | end 180 | end 181 | 182 | end 183 | end 184 | -------------------------------------------------------------------------------- /lib/docusign_admin/models/organization_export_account.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | require 'date' 13 | 14 | module DocuSign_Admin 15 | class OrganizationExportAccount 16 | attr_accessor :account_id 17 | 18 | # Attribute mapping from ruby-style variable name to JSON key. 19 | def self.attribute_map 20 | { 21 | :'account_id' => :'account_id' 22 | } 23 | end 24 | 25 | # Attribute type mapping. 26 | def self.swagger_types 27 | { 28 | :'account_id' => :'String' 29 | } 30 | end 31 | 32 | # Initializes the object 33 | # @param [Hash] attributes Model attributes in the form of hash 34 | def initialize(attributes = {}) 35 | return unless attributes.is_a?(Hash) 36 | 37 | # convert string to symbol for hash key 38 | attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } 39 | 40 | if attributes.has_key?(:'account_id') 41 | self.account_id = attributes[:'account_id'] 42 | end 43 | end 44 | 45 | # Show invalid properties with the reasons. Usually used together with valid? 46 | # @return Array for valid properties with the reasons 47 | def list_invalid_properties 48 | invalid_properties = Array.new 49 | invalid_properties 50 | end 51 | 52 | # Check to see if the all the properties in the model are valid 53 | # @return true if the model is valid 54 | def valid? 55 | true 56 | end 57 | 58 | # Checks equality by comparing each attribute. 59 | # @param [Object] Object to be compared 60 | def ==(o) 61 | return true if self.equal?(o) 62 | self.class == o.class && 63 | account_id == o.account_id 64 | end 65 | 66 | # @see the `==` method 67 | # @param [Object] Object to be compared 68 | def eql?(o) 69 | self == o 70 | end 71 | 72 | # Calculates hash code according to all attributes. 73 | # @return [Fixnum] Hash code 74 | def hash 75 | [account_id].hash 76 | end 77 | 78 | # Builds the object from hash 79 | # @param [Hash] attributes Model attributes in the form of hash 80 | # @return [Object] Returns the model itself 81 | def build_from_hash(attributes) 82 | return nil unless attributes.is_a?(Hash) 83 | self.class.swagger_types.each_pair do |key, type| 84 | if type =~ /\AArray<(.*)>/i 85 | # check to ensure the input is an array given that the attribute 86 | # is documented as an array but the input is not 87 | if attributes[self.class.attribute_map[key]].is_a?(Array) 88 | self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) 89 | end 90 | elsif !attributes[self.class.attribute_map[key]].nil? 91 | self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) 92 | end # or else data not found in attributes(hash), not an issue as the data can be optional 93 | end 94 | 95 | self 96 | end 97 | 98 | # Deserializes the data based on type 99 | # @param string type Data type 100 | # @param string value Value to be deserialized 101 | # @return [Object] Deserialized data 102 | def _deserialize(type, value) 103 | case type.to_sym 104 | when :DateTime 105 | DateTime.parse(value) 106 | when :Date 107 | Date.parse(value) 108 | when :String 109 | value.to_s 110 | when :Integer 111 | value.to_i 112 | when :Float 113 | value.to_f 114 | when :BOOLEAN 115 | if value.to_s =~ /\A(true|t|yes|y|1)\z/i 116 | true 117 | else 118 | false 119 | end 120 | when :Object 121 | # generic object (usually a Hash), return directly 122 | value 123 | when /\AArray<(?.+)>\z/ 124 | inner_type = Regexp.last_match[:inner_type] 125 | value.map { |v| _deserialize(inner_type, v) } 126 | when /\AHash<(?.+?), (?.+)>\z/ 127 | k_type = Regexp.last_match[:k_type] 128 | v_type = Regexp.last_match[:v_type] 129 | {}.tap do |hash| 130 | value.each do |k, v| 131 | hash[_deserialize(k_type, k)] = _deserialize(v_type, v) 132 | end 133 | end 134 | else # model 135 | temp_model = DocuSign_Admin.const_get(type).new 136 | temp_model.build_from_hash(value) 137 | end 138 | end 139 | 140 | # Returns the string representation of the object 141 | # @return [String] String presentation of the object 142 | def to_s 143 | to_hash.to_s 144 | end 145 | 146 | # to_body is an alias to to_hash (backward compatibility) 147 | # @return [Hash] Returns the object in the form of hash 148 | def to_body 149 | to_hash 150 | end 151 | 152 | # Returns the object in the form of hash 153 | # @return [Hash] Returns the object in the form of hash 154 | def to_hash 155 | hash = {} 156 | self.class.attribute_map.each_pair do |attr, param| 157 | value = self.send(attr) 158 | next if value.nil? 159 | hash[param] = _to_hash(value) 160 | end 161 | hash 162 | end 163 | 164 | # Outputs non-array value in the form of hash 165 | # For object, use to_hash. Otherwise, just return the value 166 | # @param [Object] value Any valid value 167 | # @return [Hash] Returns the value in the form of hash 168 | def _to_hash(value) 169 | if value.is_a?(Array) 170 | value.compact.map { |v| _to_hash(v) } 171 | elsif value.is_a?(Hash) 172 | {}.tap do |hash| 173 | value.each { |k, v| hash[k] = _to_hash(v) } 174 | end 175 | elsif value.respond_to? :to_hash 176 | value.to_hash 177 | else 178 | value 179 | end 180 | end 181 | 182 | end 183 | end 184 | -------------------------------------------------------------------------------- /lib/docusign_admin/models/membership_data_redaction_request.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | require 'date' 13 | 14 | module DocuSign_Admin 15 | class MembershipDataRedactionRequest 16 | attr_accessor :account_id 17 | 18 | # Attribute mapping from ruby-style variable name to JSON key. 19 | def self.attribute_map 20 | { 21 | :'account_id' => :'account_id' 22 | } 23 | end 24 | 25 | # Attribute type mapping. 26 | def self.swagger_types 27 | { 28 | :'account_id' => :'String' 29 | } 30 | end 31 | 32 | # Initializes the object 33 | # @param [Hash] attributes Model attributes in the form of hash 34 | def initialize(attributes = {}) 35 | return unless attributes.is_a?(Hash) 36 | 37 | # convert string to symbol for hash key 38 | attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } 39 | 40 | if attributes.has_key?(:'account_id') 41 | self.account_id = attributes[:'account_id'] 42 | end 43 | end 44 | 45 | # Show invalid properties with the reasons. Usually used together with valid? 46 | # @return Array for valid properties with the reasons 47 | def list_invalid_properties 48 | invalid_properties = Array.new 49 | invalid_properties 50 | end 51 | 52 | # Check to see if the all the properties in the model are valid 53 | # @return true if the model is valid 54 | def valid? 55 | true 56 | end 57 | 58 | # Checks equality by comparing each attribute. 59 | # @param [Object] Object to be compared 60 | def ==(o) 61 | return true if self.equal?(o) 62 | self.class == o.class && 63 | account_id == o.account_id 64 | end 65 | 66 | # @see the `==` method 67 | # @param [Object] Object to be compared 68 | def eql?(o) 69 | self == o 70 | end 71 | 72 | # Calculates hash code according to all attributes. 73 | # @return [Fixnum] Hash code 74 | def hash 75 | [account_id].hash 76 | end 77 | 78 | # Builds the object from hash 79 | # @param [Hash] attributes Model attributes in the form of hash 80 | # @return [Object] Returns the model itself 81 | def build_from_hash(attributes) 82 | return nil unless attributes.is_a?(Hash) 83 | self.class.swagger_types.each_pair do |key, type| 84 | if type =~ /\AArray<(.*)>/i 85 | # check to ensure the input is an array given that the attribute 86 | # is documented as an array but the input is not 87 | if attributes[self.class.attribute_map[key]].is_a?(Array) 88 | self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) 89 | end 90 | elsif !attributes[self.class.attribute_map[key]].nil? 91 | self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) 92 | end # or else data not found in attributes(hash), not an issue as the data can be optional 93 | end 94 | 95 | self 96 | end 97 | 98 | # Deserializes the data based on type 99 | # @param string type Data type 100 | # @param string value Value to be deserialized 101 | # @return [Object] Deserialized data 102 | def _deserialize(type, value) 103 | case type.to_sym 104 | when :DateTime 105 | DateTime.parse(value) 106 | when :Date 107 | Date.parse(value) 108 | when :String 109 | value.to_s 110 | when :Integer 111 | value.to_i 112 | when :Float 113 | value.to_f 114 | when :BOOLEAN 115 | if value.to_s =~ /\A(true|t|yes|y|1)\z/i 116 | true 117 | else 118 | false 119 | end 120 | when :Object 121 | # generic object (usually a Hash), return directly 122 | value 123 | when /\AArray<(?.+)>\z/ 124 | inner_type = Regexp.last_match[:inner_type] 125 | value.map { |v| _deserialize(inner_type, v) } 126 | when /\AHash<(?.+?), (?.+)>\z/ 127 | k_type = Regexp.last_match[:k_type] 128 | v_type = Regexp.last_match[:v_type] 129 | {}.tap do |hash| 130 | value.each do |k, v| 131 | hash[_deserialize(k_type, k)] = _deserialize(v_type, v) 132 | end 133 | end 134 | else # model 135 | temp_model = DocuSign_Admin.const_get(type).new 136 | temp_model.build_from_hash(value) 137 | end 138 | end 139 | 140 | # Returns the string representation of the object 141 | # @return [String] String presentation of the object 142 | def to_s 143 | to_hash.to_s 144 | end 145 | 146 | # to_body is an alias to to_hash (backward compatibility) 147 | # @return [Hash] Returns the object in the form of hash 148 | def to_body 149 | to_hash 150 | end 151 | 152 | # Returns the object in the form of hash 153 | # @return [Hash] Returns the object in the form of hash 154 | def to_hash 155 | hash = {} 156 | self.class.attribute_map.each_pair do |attr, param| 157 | value = self.send(attr) 158 | next if value.nil? 159 | hash[param] = _to_hash(value) 160 | end 161 | hash 162 | end 163 | 164 | # Outputs non-array value in the form of hash 165 | # For object, use to_hash. Otherwise, just return the value 166 | # @param [Object] value Any valid value 167 | # @return [Hash] Returns the value in the form of hash 168 | def _to_hash(value) 169 | if value.is_a?(Array) 170 | value.compact.map { |v| _to_hash(v) } 171 | elsif value.is_a?(Hash) 172 | {}.tap do |hash| 173 | value.each { |k, v| hash[k] = _to_hash(v) } 174 | end 175 | elsif value.respond_to? :to_hash 176 | value.to_hash 177 | else 178 | value 179 | end 180 | end 181 | 182 | end 183 | end 184 | -------------------------------------------------------------------------------- /lib/docusign_admin/models/update_users_request.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | require 'date' 13 | 14 | module DocuSign_Admin 15 | class UpdateUsersRequest 16 | attr_accessor :users 17 | 18 | # Attribute mapping from ruby-style variable name to JSON key. 19 | def self.attribute_map 20 | { 21 | :'users' => :'users' 22 | } 23 | end 24 | 25 | # Attribute type mapping. 26 | def self.swagger_types 27 | { 28 | :'users' => :'Array' 29 | } 30 | end 31 | 32 | # Initializes the object 33 | # @param [Hash] attributes Model attributes in the form of hash 34 | def initialize(attributes = {}) 35 | return unless attributes.is_a?(Hash) 36 | 37 | # convert string to symbol for hash key 38 | attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } 39 | 40 | if attributes.has_key?(:'users') 41 | if (value = attributes[:'users']).is_a?(Array) 42 | self.users = value 43 | end 44 | end 45 | end 46 | 47 | # Show invalid properties with the reasons. Usually used together with valid? 48 | # @return Array for valid properties with the reasons 49 | def list_invalid_properties 50 | invalid_properties = Array.new 51 | invalid_properties 52 | end 53 | 54 | # Check to see if the all the properties in the model are valid 55 | # @return true if the model is valid 56 | def valid? 57 | true 58 | end 59 | 60 | # Checks equality by comparing each attribute. 61 | # @param [Object] Object to be compared 62 | def ==(o) 63 | return true if self.equal?(o) 64 | self.class == o.class && 65 | users == o.users 66 | end 67 | 68 | # @see the `==` method 69 | # @param [Object] Object to be compared 70 | def eql?(o) 71 | self == o 72 | end 73 | 74 | # Calculates hash code according to all attributes. 75 | # @return [Fixnum] Hash code 76 | def hash 77 | [users].hash 78 | end 79 | 80 | # Builds the object from hash 81 | # @param [Hash] attributes Model attributes in the form of hash 82 | # @return [Object] Returns the model itself 83 | def build_from_hash(attributes) 84 | return nil unless attributes.is_a?(Hash) 85 | self.class.swagger_types.each_pair do |key, type| 86 | if type =~ /\AArray<(.*)>/i 87 | # check to ensure the input is an array given that the attribute 88 | # is documented as an array but the input is not 89 | if attributes[self.class.attribute_map[key]].is_a?(Array) 90 | self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) 91 | end 92 | elsif !attributes[self.class.attribute_map[key]].nil? 93 | self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) 94 | end # or else data not found in attributes(hash), not an issue as the data can be optional 95 | end 96 | 97 | self 98 | end 99 | 100 | # Deserializes the data based on type 101 | # @param string type Data type 102 | # @param string value Value to be deserialized 103 | # @return [Object] Deserialized data 104 | def _deserialize(type, value) 105 | case type.to_sym 106 | when :DateTime 107 | DateTime.parse(value) 108 | when :Date 109 | Date.parse(value) 110 | when :String 111 | value.to_s 112 | when :Integer 113 | value.to_i 114 | when :Float 115 | value.to_f 116 | when :BOOLEAN 117 | if value.to_s =~ /\A(true|t|yes|y|1)\z/i 118 | true 119 | else 120 | false 121 | end 122 | when :Object 123 | # generic object (usually a Hash), return directly 124 | value 125 | when /\AArray<(?.+)>\z/ 126 | inner_type = Regexp.last_match[:inner_type] 127 | value.map { |v| _deserialize(inner_type, v) } 128 | when /\AHash<(?.+?), (?.+)>\z/ 129 | k_type = Regexp.last_match[:k_type] 130 | v_type = Regexp.last_match[:v_type] 131 | {}.tap do |hash| 132 | value.each do |k, v| 133 | hash[_deserialize(k_type, k)] = _deserialize(v_type, v) 134 | end 135 | end 136 | else # model 137 | temp_model = DocuSign_Admin.const_get(type).new 138 | temp_model.build_from_hash(value) 139 | end 140 | end 141 | 142 | # Returns the string representation of the object 143 | # @return [String] String presentation of the object 144 | def to_s 145 | to_hash.to_s 146 | end 147 | 148 | # to_body is an alias to to_hash (backward compatibility) 149 | # @return [Hash] Returns the object in the form of hash 150 | def to_body 151 | to_hash 152 | end 153 | 154 | # Returns the object in the form of hash 155 | # @return [Hash] Returns the object in the form of hash 156 | def to_hash 157 | hash = {} 158 | self.class.attribute_map.each_pair do |attr, param| 159 | value = self.send(attr) 160 | next if value.nil? 161 | hash[param] = _to_hash(value) 162 | end 163 | hash 164 | end 165 | 166 | # Outputs non-array value in the form of hash 167 | # For object, use to_hash. Otherwise, just return the value 168 | # @param [Object] value Any valid value 169 | # @return [Hash] Returns the value in the form of hash 170 | def _to_hash(value) 171 | if value.is_a?(Array) 172 | value.compact.map { |v| _to_hash(v) } 173 | elsif value.is_a?(Hash) 174 | {}.tap do |hash| 175 | value.each { |k, v| hash[k] = _to_hash(v) } 176 | end 177 | elsif value.respond_to? :to_hash 178 | value.to_hash 179 | else 180 | value 181 | end 182 | end 183 | 184 | end 185 | end 186 | -------------------------------------------------------------------------------- /lib/docusign_admin/models/users_drilldown_response.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | require 'date' 13 | 14 | module DocuSign_Admin 15 | class UsersDrilldownResponse 16 | attr_accessor :users 17 | 18 | # Attribute mapping from ruby-style variable name to JSON key. 19 | def self.attribute_map 20 | { 21 | :'users' => :'users' 22 | } 23 | end 24 | 25 | # Attribute type mapping. 26 | def self.swagger_types 27 | { 28 | :'users' => :'Array' 29 | } 30 | end 31 | 32 | # Initializes the object 33 | # @param [Hash] attributes Model attributes in the form of hash 34 | def initialize(attributes = {}) 35 | return unless attributes.is_a?(Hash) 36 | 37 | # convert string to symbol for hash key 38 | attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } 39 | 40 | if attributes.has_key?(:'users') 41 | if (value = attributes[:'users']).is_a?(Array) 42 | self.users = value 43 | end 44 | end 45 | end 46 | 47 | # Show invalid properties with the reasons. Usually used together with valid? 48 | # @return Array for valid properties with the reasons 49 | def list_invalid_properties 50 | invalid_properties = Array.new 51 | invalid_properties 52 | end 53 | 54 | # Check to see if the all the properties in the model are valid 55 | # @return true if the model is valid 56 | def valid? 57 | true 58 | end 59 | 60 | # Checks equality by comparing each attribute. 61 | # @param [Object] Object to be compared 62 | def ==(o) 63 | return true if self.equal?(o) 64 | self.class == o.class && 65 | users == o.users 66 | end 67 | 68 | # @see the `==` method 69 | # @param [Object] Object to be compared 70 | def eql?(o) 71 | self == o 72 | end 73 | 74 | # Calculates hash code according to all attributes. 75 | # @return [Fixnum] Hash code 76 | def hash 77 | [users].hash 78 | end 79 | 80 | # Builds the object from hash 81 | # @param [Hash] attributes Model attributes in the form of hash 82 | # @return [Object] Returns the model itself 83 | def build_from_hash(attributes) 84 | return nil unless attributes.is_a?(Hash) 85 | self.class.swagger_types.each_pair do |key, type| 86 | if type =~ /\AArray<(.*)>/i 87 | # check to ensure the input is an array given that the attribute 88 | # is documented as an array but the input is not 89 | if attributes[self.class.attribute_map[key]].is_a?(Array) 90 | self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) 91 | end 92 | elsif !attributes[self.class.attribute_map[key]].nil? 93 | self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) 94 | end # or else data not found in attributes(hash), not an issue as the data can be optional 95 | end 96 | 97 | self 98 | end 99 | 100 | # Deserializes the data based on type 101 | # @param string type Data type 102 | # @param string value Value to be deserialized 103 | # @return [Object] Deserialized data 104 | def _deserialize(type, value) 105 | case type.to_sym 106 | when :DateTime 107 | DateTime.parse(value) 108 | when :Date 109 | Date.parse(value) 110 | when :String 111 | value.to_s 112 | when :Integer 113 | value.to_i 114 | when :Float 115 | value.to_f 116 | when :BOOLEAN 117 | if value.to_s =~ /\A(true|t|yes|y|1)\z/i 118 | true 119 | else 120 | false 121 | end 122 | when :Object 123 | # generic object (usually a Hash), return directly 124 | value 125 | when /\AArray<(?.+)>\z/ 126 | inner_type = Regexp.last_match[:inner_type] 127 | value.map { |v| _deserialize(inner_type, v) } 128 | when /\AHash<(?.+?), (?.+)>\z/ 129 | k_type = Regexp.last_match[:k_type] 130 | v_type = Regexp.last_match[:v_type] 131 | {}.tap do |hash| 132 | value.each do |k, v| 133 | hash[_deserialize(k_type, k)] = _deserialize(v_type, v) 134 | end 135 | end 136 | else # model 137 | temp_model = DocuSign_Admin.const_get(type).new 138 | temp_model.build_from_hash(value) 139 | end 140 | end 141 | 142 | # Returns the string representation of the object 143 | # @return [String] String presentation of the object 144 | def to_s 145 | to_hash.to_s 146 | end 147 | 148 | # to_body is an alias to to_hash (backward compatibility) 149 | # @return [Hash] Returns the object in the form of hash 150 | def to_body 151 | to_hash 152 | end 153 | 154 | # Returns the object in the form of hash 155 | # @return [Hash] Returns the object in the form of hash 156 | def to_hash 157 | hash = {} 158 | self.class.attribute_map.each_pair do |attr, param| 159 | value = self.send(attr) 160 | next if value.nil? 161 | hash[param] = _to_hash(value) 162 | end 163 | hash 164 | end 165 | 166 | # Outputs non-array value in the form of hash 167 | # For object, use to_hash. Otherwise, just return the value 168 | # @param [Object] value Any valid value 169 | # @return [Hash] Returns the value in the form of hash 170 | def _to_hash(value) 171 | if value.is_a?(Array) 172 | value.compact.map { |v| _to_hash(v) } 173 | elsif value.is_a?(Hash) 174 | {}.tap do |hash| 175 | value.each { |k, v| hash[k] = _to_hash(v) } 176 | end 177 | elsif value.respond_to? :to_hash 178 | value.to_hash 179 | else 180 | value 181 | end 182 | end 183 | 184 | end 185 | end 186 | -------------------------------------------------------------------------------- /lib/docusign_admin/models/update_users_email_request.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | require 'date' 13 | 14 | module DocuSign_Admin 15 | class UpdateUsersEmailRequest 16 | attr_accessor :users 17 | 18 | # Attribute mapping from ruby-style variable name to JSON key. 19 | def self.attribute_map 20 | { 21 | :'users' => :'users' 22 | } 23 | end 24 | 25 | # Attribute type mapping. 26 | def self.swagger_types 27 | { 28 | :'users' => :'Array' 29 | } 30 | end 31 | 32 | # Initializes the object 33 | # @param [Hash] attributes Model attributes in the form of hash 34 | def initialize(attributes = {}) 35 | return unless attributes.is_a?(Hash) 36 | 37 | # convert string to symbol for hash key 38 | attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } 39 | 40 | if attributes.has_key?(:'users') 41 | if (value = attributes[:'users']).is_a?(Array) 42 | self.users = value 43 | end 44 | end 45 | end 46 | 47 | # Show invalid properties with the reasons. Usually used together with valid? 48 | # @return Array for valid properties with the reasons 49 | def list_invalid_properties 50 | invalid_properties = Array.new 51 | invalid_properties 52 | end 53 | 54 | # Check to see if the all the properties in the model are valid 55 | # @return true if the model is valid 56 | def valid? 57 | true 58 | end 59 | 60 | # Checks equality by comparing each attribute. 61 | # @param [Object] Object to be compared 62 | def ==(o) 63 | return true if self.equal?(o) 64 | self.class == o.class && 65 | users == o.users 66 | end 67 | 68 | # @see the `==` method 69 | # @param [Object] Object to be compared 70 | def eql?(o) 71 | self == o 72 | end 73 | 74 | # Calculates hash code according to all attributes. 75 | # @return [Fixnum] Hash code 76 | def hash 77 | [users].hash 78 | end 79 | 80 | # Builds the object from hash 81 | # @param [Hash] attributes Model attributes in the form of hash 82 | # @return [Object] Returns the model itself 83 | def build_from_hash(attributes) 84 | return nil unless attributes.is_a?(Hash) 85 | self.class.swagger_types.each_pair do |key, type| 86 | if type =~ /\AArray<(.*)>/i 87 | # check to ensure the input is an array given that the attribute 88 | # is documented as an array but the input is not 89 | if attributes[self.class.attribute_map[key]].is_a?(Array) 90 | self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) 91 | end 92 | elsif !attributes[self.class.attribute_map[key]].nil? 93 | self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) 94 | end # or else data not found in attributes(hash), not an issue as the data can be optional 95 | end 96 | 97 | self 98 | end 99 | 100 | # Deserializes the data based on type 101 | # @param string type Data type 102 | # @param string value Value to be deserialized 103 | # @return [Object] Deserialized data 104 | def _deserialize(type, value) 105 | case type.to_sym 106 | when :DateTime 107 | DateTime.parse(value) 108 | when :Date 109 | Date.parse(value) 110 | when :String 111 | value.to_s 112 | when :Integer 113 | value.to_i 114 | when :Float 115 | value.to_f 116 | when :BOOLEAN 117 | if value.to_s =~ /\A(true|t|yes|y|1)\z/i 118 | true 119 | else 120 | false 121 | end 122 | when :Object 123 | # generic object (usually a Hash), return directly 124 | value 125 | when /\AArray<(?.+)>\z/ 126 | inner_type = Regexp.last_match[:inner_type] 127 | value.map { |v| _deserialize(inner_type, v) } 128 | when /\AHash<(?.+?), (?.+)>\z/ 129 | k_type = Regexp.last_match[:k_type] 130 | v_type = Regexp.last_match[:v_type] 131 | {}.tap do |hash| 132 | value.each do |k, v| 133 | hash[_deserialize(k_type, k)] = _deserialize(v_type, v) 134 | end 135 | end 136 | else # model 137 | temp_model = DocuSign_Admin.const_get(type).new 138 | temp_model.build_from_hash(value) 139 | end 140 | end 141 | 142 | # Returns the string representation of the object 143 | # @return [String] String presentation of the object 144 | def to_s 145 | to_hash.to_s 146 | end 147 | 148 | # to_body is an alias to to_hash (backward compatibility) 149 | # @return [Hash] Returns the object in the form of hash 150 | def to_body 151 | to_hash 152 | end 153 | 154 | # Returns the object in the form of hash 155 | # @return [Hash] Returns the object in the form of hash 156 | def to_hash 157 | hash = {} 158 | self.class.attribute_map.each_pair do |attr, param| 159 | value = self.send(attr) 160 | next if value.nil? 161 | hash[param] = _to_hash(value) 162 | end 163 | hash 164 | end 165 | 166 | # Outputs non-array value in the form of hash 167 | # For object, use to_hash. Otherwise, just return the value 168 | # @param [Object] value Any valid value 169 | # @return [Hash] Returns the value in the form of hash 170 | def _to_hash(value) 171 | if value.is_a?(Array) 172 | value.compact.map { |v| _to_hash(v) } 173 | elsif value.is_a?(Hash) 174 | {}.tap do |hash| 175 | value.each { |k, v| hash[k] = _to_hash(v) } 176 | end 177 | elsif value.respond_to? :to_hash 178 | value.to_hash 179 | else 180 | value 181 | end 182 | end 183 | 184 | end 185 | end 186 | -------------------------------------------------------------------------------- /lib/docusign_admin/models/org_report_list_response.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | require 'date' 13 | 14 | module DocuSign_Admin 15 | class OrgReportListResponse 16 | attr_accessor :reports 17 | 18 | # Attribute mapping from ruby-style variable name to JSON key. 19 | def self.attribute_map 20 | { 21 | :'reports' => :'reports' 22 | } 23 | end 24 | 25 | # Attribute type mapping. 26 | def self.swagger_types 27 | { 28 | :'reports' => :'Array' 29 | } 30 | end 31 | 32 | # Initializes the object 33 | # @param [Hash] attributes Model attributes in the form of hash 34 | def initialize(attributes = {}) 35 | return unless attributes.is_a?(Hash) 36 | 37 | # convert string to symbol for hash key 38 | attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } 39 | 40 | if attributes.has_key?(:'reports') 41 | if (value = attributes[:'reports']).is_a?(Array) 42 | self.reports = value 43 | end 44 | end 45 | end 46 | 47 | # Show invalid properties with the reasons. Usually used together with valid? 48 | # @return Array for valid properties with the reasons 49 | def list_invalid_properties 50 | invalid_properties = Array.new 51 | invalid_properties 52 | end 53 | 54 | # Check to see if the all the properties in the model are valid 55 | # @return true if the model is valid 56 | def valid? 57 | true 58 | end 59 | 60 | # Checks equality by comparing each attribute. 61 | # @param [Object] Object to be compared 62 | def ==(o) 63 | return true if self.equal?(o) 64 | self.class == o.class && 65 | reports == o.reports 66 | end 67 | 68 | # @see the `==` method 69 | # @param [Object] Object to be compared 70 | def eql?(o) 71 | self == o 72 | end 73 | 74 | # Calculates hash code according to all attributes. 75 | # @return [Fixnum] Hash code 76 | def hash 77 | [reports].hash 78 | end 79 | 80 | # Builds the object from hash 81 | # @param [Hash] attributes Model attributes in the form of hash 82 | # @return [Object] Returns the model itself 83 | def build_from_hash(attributes) 84 | return nil unless attributes.is_a?(Hash) 85 | self.class.swagger_types.each_pair do |key, type| 86 | if type =~ /\AArray<(.*)>/i 87 | # check to ensure the input is an array given that the attribute 88 | # is documented as an array but the input is not 89 | if attributes[self.class.attribute_map[key]].is_a?(Array) 90 | self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) 91 | end 92 | elsif !attributes[self.class.attribute_map[key]].nil? 93 | self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) 94 | end # or else data not found in attributes(hash), not an issue as the data can be optional 95 | end 96 | 97 | self 98 | end 99 | 100 | # Deserializes the data based on type 101 | # @param string type Data type 102 | # @param string value Value to be deserialized 103 | # @return [Object] Deserialized data 104 | def _deserialize(type, value) 105 | case type.to_sym 106 | when :DateTime 107 | DateTime.parse(value) 108 | when :Date 109 | Date.parse(value) 110 | when :String 111 | value.to_s 112 | when :Integer 113 | value.to_i 114 | when :Float 115 | value.to_f 116 | when :BOOLEAN 117 | if value.to_s =~ /\A(true|t|yes|y|1)\z/i 118 | true 119 | else 120 | false 121 | end 122 | when :Object 123 | # generic object (usually a Hash), return directly 124 | value 125 | when /\AArray<(?.+)>\z/ 126 | inner_type = Regexp.last_match[:inner_type] 127 | value.map { |v| _deserialize(inner_type, v) } 128 | when /\AHash<(?.+?), (?.+)>\z/ 129 | k_type = Regexp.last_match[:k_type] 130 | v_type = Regexp.last_match[:v_type] 131 | {}.tap do |hash| 132 | value.each do |k, v| 133 | hash[_deserialize(k_type, k)] = _deserialize(v_type, v) 134 | end 135 | end 136 | else # model 137 | temp_model = DocuSign_Admin.const_get(type).new 138 | temp_model.build_from_hash(value) 139 | end 140 | end 141 | 142 | # Returns the string representation of the object 143 | # @return [String] String presentation of the object 144 | def to_s 145 | to_hash.to_s 146 | end 147 | 148 | # to_body is an alias to to_hash (backward compatibility) 149 | # @return [Hash] Returns the object in the form of hash 150 | def to_body 151 | to_hash 152 | end 153 | 154 | # Returns the object in the form of hash 155 | # @return [Hash] Returns the object in the form of hash 156 | def to_hash 157 | hash = {} 158 | self.class.attribute_map.each_pair do |attr, param| 159 | value = self.send(attr) 160 | next if value.nil? 161 | hash[param] = _to_hash(value) 162 | end 163 | hash 164 | end 165 | 166 | # Outputs non-array value in the form of hash 167 | # For object, use to_hash. Otherwise, just return the value 168 | # @param [Object] value Any valid value 169 | # @return [Hash] Returns the value in the form of hash 170 | def _to_hash(value) 171 | if value.is_a?(Array) 172 | value.compact.map { |v| _to_hash(v) } 173 | elsif value.is_a?(Hash) 174 | {}.tap do |hash| 175 | value.each { |k, v| hash[k] = _to_hash(v) } 176 | end 177 | elsif value.respond_to? :to_hash 178 | value.to_hash 179 | else 180 | value 181 | end 182 | end 183 | 184 | end 185 | end 186 | -------------------------------------------------------------------------------- /lib/docusign_admin/models/organization_exports_response.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | require 'date' 13 | 14 | module DocuSign_Admin 15 | class OrganizationExportsResponse 16 | attr_accessor :exports 17 | 18 | # Attribute mapping from ruby-style variable name to JSON key. 19 | def self.attribute_map 20 | { 21 | :'exports' => :'exports' 22 | } 23 | end 24 | 25 | # Attribute type mapping. 26 | def self.swagger_types 27 | { 28 | :'exports' => :'Array' 29 | } 30 | end 31 | 32 | # Initializes the object 33 | # @param [Hash] attributes Model attributes in the form of hash 34 | def initialize(attributes = {}) 35 | return unless attributes.is_a?(Hash) 36 | 37 | # convert string to symbol for hash key 38 | attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } 39 | 40 | if attributes.has_key?(:'exports') 41 | if (value = attributes[:'exports']).is_a?(Array) 42 | self.exports = value 43 | end 44 | end 45 | end 46 | 47 | # Show invalid properties with the reasons. Usually used together with valid? 48 | # @return Array for valid properties with the reasons 49 | def list_invalid_properties 50 | invalid_properties = Array.new 51 | invalid_properties 52 | end 53 | 54 | # Check to see if the all the properties in the model are valid 55 | # @return true if the model is valid 56 | def valid? 57 | true 58 | end 59 | 60 | # Checks equality by comparing each attribute. 61 | # @param [Object] Object to be compared 62 | def ==(o) 63 | return true if self.equal?(o) 64 | self.class == o.class && 65 | exports == o.exports 66 | end 67 | 68 | # @see the `==` method 69 | # @param [Object] Object to be compared 70 | def eql?(o) 71 | self == o 72 | end 73 | 74 | # Calculates hash code according to all attributes. 75 | # @return [Fixnum] Hash code 76 | def hash 77 | [exports].hash 78 | end 79 | 80 | # Builds the object from hash 81 | # @param [Hash] attributes Model attributes in the form of hash 82 | # @return [Object] Returns the model itself 83 | def build_from_hash(attributes) 84 | return nil unless attributes.is_a?(Hash) 85 | self.class.swagger_types.each_pair do |key, type| 86 | if type =~ /\AArray<(.*)>/i 87 | # check to ensure the input is an array given that the attribute 88 | # is documented as an array but the input is not 89 | if attributes[self.class.attribute_map[key]].is_a?(Array) 90 | self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) 91 | end 92 | elsif !attributes[self.class.attribute_map[key]].nil? 93 | self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) 94 | end # or else data not found in attributes(hash), not an issue as the data can be optional 95 | end 96 | 97 | self 98 | end 99 | 100 | # Deserializes the data based on type 101 | # @param string type Data type 102 | # @param string value Value to be deserialized 103 | # @return [Object] Deserialized data 104 | def _deserialize(type, value) 105 | case type.to_sym 106 | when :DateTime 107 | DateTime.parse(value) 108 | when :Date 109 | Date.parse(value) 110 | when :String 111 | value.to_s 112 | when :Integer 113 | value.to_i 114 | when :Float 115 | value.to_f 116 | when :BOOLEAN 117 | if value.to_s =~ /\A(true|t|yes|y|1)\z/i 118 | true 119 | else 120 | false 121 | end 122 | when :Object 123 | # generic object (usually a Hash), return directly 124 | value 125 | when /\AArray<(?.+)>\z/ 126 | inner_type = Regexp.last_match[:inner_type] 127 | value.map { |v| _deserialize(inner_type, v) } 128 | when /\AHash<(?.+?), (?.+)>\z/ 129 | k_type = Regexp.last_match[:k_type] 130 | v_type = Regexp.last_match[:v_type] 131 | {}.tap do |hash| 132 | value.each do |k, v| 133 | hash[_deserialize(k_type, k)] = _deserialize(v_type, v) 134 | end 135 | end 136 | else # model 137 | temp_model = DocuSign_Admin.const_get(type).new 138 | temp_model.build_from_hash(value) 139 | end 140 | end 141 | 142 | # Returns the string representation of the object 143 | # @return [String] String presentation of the object 144 | def to_s 145 | to_hash.to_s 146 | end 147 | 148 | # to_body is an alias to to_hash (backward compatibility) 149 | # @return [Hash] Returns the object in the form of hash 150 | def to_body 151 | to_hash 152 | end 153 | 154 | # Returns the object in the form of hash 155 | # @return [Hash] Returns the object in the form of hash 156 | def to_hash 157 | hash = {} 158 | self.class.attribute_map.each_pair do |attr, param| 159 | value = self.send(attr) 160 | next if value.nil? 161 | hash[param] = _to_hash(value) 162 | end 163 | hash 164 | end 165 | 166 | # Outputs non-array value in the form of hash 167 | # For object, use to_hash. Otherwise, just return the value 168 | # @param [Object] value Any valid value 169 | # @return [Hash] Returns the value in the form of hash 170 | def _to_hash(value) 171 | if value.is_a?(Array) 172 | value.compact.map { |v| _to_hash(v) } 173 | elsif value.is_a?(Hash) 174 | {}.tap do |hash| 175 | value.each { |k, v| hash[k] = _to_hash(v) } 176 | end 177 | elsif value.respond_to? :to_hash 178 | value.to_hash 179 | else 180 | value 181 | end 182 | end 183 | 184 | end 185 | end 186 | -------------------------------------------------------------------------------- /lib/docusign_admin/models/organization_imports_response.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | require 'date' 13 | 14 | module DocuSign_Admin 15 | class OrganizationImportsResponse 16 | attr_accessor :imports 17 | 18 | # Attribute mapping from ruby-style variable name to JSON key. 19 | def self.attribute_map 20 | { 21 | :'imports' => :'imports' 22 | } 23 | end 24 | 25 | # Attribute type mapping. 26 | def self.swagger_types 27 | { 28 | :'imports' => :'Array' 29 | } 30 | end 31 | 32 | # Initializes the object 33 | # @param [Hash] attributes Model attributes in the form of hash 34 | def initialize(attributes = {}) 35 | return unless attributes.is_a?(Hash) 36 | 37 | # convert string to symbol for hash key 38 | attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } 39 | 40 | if attributes.has_key?(:'imports') 41 | if (value = attributes[:'imports']).is_a?(Array) 42 | self.imports = value 43 | end 44 | end 45 | end 46 | 47 | # Show invalid properties with the reasons. Usually used together with valid? 48 | # @return Array for valid properties with the reasons 49 | def list_invalid_properties 50 | invalid_properties = Array.new 51 | invalid_properties 52 | end 53 | 54 | # Check to see if the all the properties in the model are valid 55 | # @return true if the model is valid 56 | def valid? 57 | true 58 | end 59 | 60 | # Checks equality by comparing each attribute. 61 | # @param [Object] Object to be compared 62 | def ==(o) 63 | return true if self.equal?(o) 64 | self.class == o.class && 65 | imports == o.imports 66 | end 67 | 68 | # @see the `==` method 69 | # @param [Object] Object to be compared 70 | def eql?(o) 71 | self == o 72 | end 73 | 74 | # Calculates hash code according to all attributes. 75 | # @return [Fixnum] Hash code 76 | def hash 77 | [imports].hash 78 | end 79 | 80 | # Builds the object from hash 81 | # @param [Hash] attributes Model attributes in the form of hash 82 | # @return [Object] Returns the model itself 83 | def build_from_hash(attributes) 84 | return nil unless attributes.is_a?(Hash) 85 | self.class.swagger_types.each_pair do |key, type| 86 | if type =~ /\AArray<(.*)>/i 87 | # check to ensure the input is an array given that the attribute 88 | # is documented as an array but the input is not 89 | if attributes[self.class.attribute_map[key]].is_a?(Array) 90 | self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) 91 | end 92 | elsif !attributes[self.class.attribute_map[key]].nil? 93 | self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) 94 | end # or else data not found in attributes(hash), not an issue as the data can be optional 95 | end 96 | 97 | self 98 | end 99 | 100 | # Deserializes the data based on type 101 | # @param string type Data type 102 | # @param string value Value to be deserialized 103 | # @return [Object] Deserialized data 104 | def _deserialize(type, value) 105 | case type.to_sym 106 | when :DateTime 107 | DateTime.parse(value) 108 | when :Date 109 | Date.parse(value) 110 | when :String 111 | value.to_s 112 | when :Integer 113 | value.to_i 114 | when :Float 115 | value.to_f 116 | when :BOOLEAN 117 | if value.to_s =~ /\A(true|t|yes|y|1)\z/i 118 | true 119 | else 120 | false 121 | end 122 | when :Object 123 | # generic object (usually a Hash), return directly 124 | value 125 | when /\AArray<(?.+)>\z/ 126 | inner_type = Regexp.last_match[:inner_type] 127 | value.map { |v| _deserialize(inner_type, v) } 128 | when /\AHash<(?.+?), (?.+)>\z/ 129 | k_type = Regexp.last_match[:k_type] 130 | v_type = Regexp.last_match[:v_type] 131 | {}.tap do |hash| 132 | value.each do |k, v| 133 | hash[_deserialize(k_type, k)] = _deserialize(v_type, v) 134 | end 135 | end 136 | else # model 137 | temp_model = DocuSign_Admin.const_get(type).new 138 | temp_model.build_from_hash(value) 139 | end 140 | end 141 | 142 | # Returns the string representation of the object 143 | # @return [String] String presentation of the object 144 | def to_s 145 | to_hash.to_s 146 | end 147 | 148 | # to_body is an alias to to_hash (backward compatibility) 149 | # @return [Hash] Returns the object in the form of hash 150 | def to_body 151 | to_hash 152 | end 153 | 154 | # Returns the object in the form of hash 155 | # @return [Hash] Returns the object in the form of hash 156 | def to_hash 157 | hash = {} 158 | self.class.attribute_map.each_pair do |attr, param| 159 | value = self.send(attr) 160 | next if value.nil? 161 | hash[param] = _to_hash(value) 162 | end 163 | hash 164 | end 165 | 166 | # Outputs non-array value in the form of hash 167 | # For object, use to_hash. Otherwise, just return the value 168 | # @param [Object] value Any valid value 169 | # @return [Hash] Returns the value in the form of hash 170 | def _to_hash(value) 171 | if value.is_a?(Array) 172 | value.compact.map { |v| _to_hash(v) } 173 | elsif value.is_a?(Hash) 174 | {}.tap do |hash| 175 | value.each { |k, v| hash[k] = _to_hash(v) } 176 | end 177 | elsif value.respond_to? :to_hash 178 | value.to_hash 179 | else 180 | value 181 | end 182 | end 183 | 184 | end 185 | end 186 | -------------------------------------------------------------------------------- /lib/docusign_admin/models/organization_accounts_request.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | require 'date' 13 | 14 | module DocuSign_Admin 15 | class OrganizationAccountsRequest 16 | attr_accessor :accounts 17 | 18 | # Attribute mapping from ruby-style variable name to JSON key. 19 | def self.attribute_map 20 | { 21 | :'accounts' => :'accounts' 22 | } 23 | end 24 | 25 | # Attribute type mapping. 26 | def self.swagger_types 27 | { 28 | :'accounts' => :'Array' 29 | } 30 | end 31 | 32 | # Initializes the object 33 | # @param [Hash] attributes Model attributes in the form of hash 34 | def initialize(attributes = {}) 35 | return unless attributes.is_a?(Hash) 36 | 37 | # convert string to symbol for hash key 38 | attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } 39 | 40 | if attributes.has_key?(:'accounts') 41 | if (value = attributes[:'accounts']).is_a?(Array) 42 | self.accounts = value 43 | end 44 | end 45 | end 46 | 47 | # Show invalid properties with the reasons. Usually used together with valid? 48 | # @return Array for valid properties with the reasons 49 | def list_invalid_properties 50 | invalid_properties = Array.new 51 | invalid_properties 52 | end 53 | 54 | # Check to see if the all the properties in the model are valid 55 | # @return true if the model is valid 56 | def valid? 57 | true 58 | end 59 | 60 | # Checks equality by comparing each attribute. 61 | # @param [Object] Object to be compared 62 | def ==(o) 63 | return true if self.equal?(o) 64 | self.class == o.class && 65 | accounts == o.accounts 66 | end 67 | 68 | # @see the `==` method 69 | # @param [Object] Object to be compared 70 | def eql?(o) 71 | self == o 72 | end 73 | 74 | # Calculates hash code according to all attributes. 75 | # @return [Fixnum] Hash code 76 | def hash 77 | [accounts].hash 78 | end 79 | 80 | # Builds the object from hash 81 | # @param [Hash] attributes Model attributes in the form of hash 82 | # @return [Object] Returns the model itself 83 | def build_from_hash(attributes) 84 | return nil unless attributes.is_a?(Hash) 85 | self.class.swagger_types.each_pair do |key, type| 86 | if type =~ /\AArray<(.*)>/i 87 | # check to ensure the input is an array given that the attribute 88 | # is documented as an array but the input is not 89 | if attributes[self.class.attribute_map[key]].is_a?(Array) 90 | self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) 91 | end 92 | elsif !attributes[self.class.attribute_map[key]].nil? 93 | self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) 94 | end # or else data not found in attributes(hash), not an issue as the data can be optional 95 | end 96 | 97 | self 98 | end 99 | 100 | # Deserializes the data based on type 101 | # @param string type Data type 102 | # @param string value Value to be deserialized 103 | # @return [Object] Deserialized data 104 | def _deserialize(type, value) 105 | case type.to_sym 106 | when :DateTime 107 | DateTime.parse(value) 108 | when :Date 109 | Date.parse(value) 110 | when :String 111 | value.to_s 112 | when :Integer 113 | value.to_i 114 | when :Float 115 | value.to_f 116 | when :BOOLEAN 117 | if value.to_s =~ /\A(true|t|yes|y|1)\z/i 118 | true 119 | else 120 | false 121 | end 122 | when :Object 123 | # generic object (usually a Hash), return directly 124 | value 125 | when /\AArray<(?.+)>\z/ 126 | inner_type = Regexp.last_match[:inner_type] 127 | value.map { |v| _deserialize(inner_type, v) } 128 | when /\AHash<(?.+?), (?.+)>\z/ 129 | k_type = Regexp.last_match[:k_type] 130 | v_type = Regexp.last_match[:v_type] 131 | {}.tap do |hash| 132 | value.each do |k, v| 133 | hash[_deserialize(k_type, k)] = _deserialize(v_type, v) 134 | end 135 | end 136 | else # model 137 | temp_model = DocuSign_Admin.const_get(type).new 138 | temp_model.build_from_hash(value) 139 | end 140 | end 141 | 142 | # Returns the string representation of the object 143 | # @return [String] String presentation of the object 144 | def to_s 145 | to_hash.to_s 146 | end 147 | 148 | # to_body is an alias to to_hash (backward compatibility) 149 | # @return [Hash] Returns the object in the form of hash 150 | def to_body 151 | to_hash 152 | end 153 | 154 | # Returns the object in the form of hash 155 | # @return [Hash] Returns the object in the form of hash 156 | def to_hash 157 | hash = {} 158 | self.class.attribute_map.each_pair do |attr, param| 159 | value = self.send(attr) 160 | next if value.nil? 161 | hash[param] = _to_hash(value) 162 | end 163 | hash 164 | end 165 | 166 | # Outputs non-array value in the form of hash 167 | # For object, use to_hash. Otherwise, just return the value 168 | # @param [Object] value Any valid value 169 | # @return [Hash] Returns the value in the form of hash 170 | def _to_hash(value) 171 | if value.is_a?(Array) 172 | value.compact.map { |v| _to_hash(v) } 173 | elsif value.is_a?(Hash) 174 | {}.tap do |hash| 175 | value.each { |k, v| hash[k] = _to_hash(v) } 176 | end 177 | elsif value.respond_to? :to_hash 178 | value.to_hash 179 | else 180 | value 181 | end 182 | end 183 | 184 | end 185 | end 186 | -------------------------------------------------------------------------------- /lib/docusign_admin/models/delete_membership_request.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | require 'date' 13 | 14 | module DocuSign_Admin 15 | class DeleteMembershipRequest 16 | attr_accessor :id 17 | 18 | # Attribute mapping from ruby-style variable name to JSON key. 19 | def self.attribute_map 20 | { 21 | :'id' => :'id' 22 | } 23 | end 24 | 25 | # Attribute type mapping. 26 | def self.swagger_types 27 | { 28 | :'id' => :'String' 29 | } 30 | end 31 | 32 | # Initializes the object 33 | # @param [Hash] attributes Model attributes in the form of hash 34 | def initialize(attributes = {}) 35 | return unless attributes.is_a?(Hash) 36 | 37 | # convert string to symbol for hash key 38 | attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } 39 | 40 | if attributes.has_key?(:'id') 41 | self.id = attributes[:'id'] 42 | end 43 | end 44 | 45 | # Show invalid properties with the reasons. Usually used together with valid? 46 | # @return Array for valid properties with the reasons 47 | def list_invalid_properties 48 | invalid_properties = Array.new 49 | if @id.nil? 50 | invalid_properties.push('invalid value for "id", id cannot be nil.') 51 | end 52 | 53 | invalid_properties 54 | end 55 | 56 | # Check to see if the all the properties in the model are valid 57 | # @return true if the model is valid 58 | def valid? 59 | return false if @id.nil? 60 | true 61 | end 62 | 63 | # Checks equality by comparing each attribute. 64 | # @param [Object] Object to be compared 65 | def ==(o) 66 | return true if self.equal?(o) 67 | self.class == o.class && 68 | id == o.id 69 | end 70 | 71 | # @see the `==` method 72 | # @param [Object] Object to be compared 73 | def eql?(o) 74 | self == o 75 | end 76 | 77 | # Calculates hash code according to all attributes. 78 | # @return [Fixnum] Hash code 79 | def hash 80 | [id].hash 81 | end 82 | 83 | # Builds the object from hash 84 | # @param [Hash] attributes Model attributes in the form of hash 85 | # @return [Object] Returns the model itself 86 | def build_from_hash(attributes) 87 | return nil unless attributes.is_a?(Hash) 88 | self.class.swagger_types.each_pair do |key, type| 89 | if type =~ /\AArray<(.*)>/i 90 | # check to ensure the input is an array given that the attribute 91 | # is documented as an array but the input is not 92 | if attributes[self.class.attribute_map[key]].is_a?(Array) 93 | self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) 94 | end 95 | elsif !attributes[self.class.attribute_map[key]].nil? 96 | self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) 97 | end # or else data not found in attributes(hash), not an issue as the data can be optional 98 | end 99 | 100 | self 101 | end 102 | 103 | # Deserializes the data based on type 104 | # @param string type Data type 105 | # @param string value Value to be deserialized 106 | # @return [Object] Deserialized data 107 | def _deserialize(type, value) 108 | case type.to_sym 109 | when :DateTime 110 | DateTime.parse(value) 111 | when :Date 112 | Date.parse(value) 113 | when :String 114 | value.to_s 115 | when :Integer 116 | value.to_i 117 | when :Float 118 | value.to_f 119 | when :BOOLEAN 120 | if value.to_s =~ /\A(true|t|yes|y|1)\z/i 121 | true 122 | else 123 | false 124 | end 125 | when :Object 126 | # generic object (usually a Hash), return directly 127 | value 128 | when /\AArray<(?.+)>\z/ 129 | inner_type = Regexp.last_match[:inner_type] 130 | value.map { |v| _deserialize(inner_type, v) } 131 | when /\AHash<(?.+?), (?.+)>\z/ 132 | k_type = Regexp.last_match[:k_type] 133 | v_type = Regexp.last_match[:v_type] 134 | {}.tap do |hash| 135 | value.each do |k, v| 136 | hash[_deserialize(k_type, k)] = _deserialize(v_type, v) 137 | end 138 | end 139 | else # model 140 | temp_model = DocuSign_Admin.const_get(type).new 141 | temp_model.build_from_hash(value) 142 | end 143 | end 144 | 145 | # Returns the string representation of the object 146 | # @return [String] String presentation of the object 147 | def to_s 148 | to_hash.to_s 149 | end 150 | 151 | # to_body is an alias to to_hash (backward compatibility) 152 | # @return [Hash] Returns the object in the form of hash 153 | def to_body 154 | to_hash 155 | end 156 | 157 | # Returns the object in the form of hash 158 | # @return [Hash] Returns the object in the form of hash 159 | def to_hash 160 | hash = {} 161 | self.class.attribute_map.each_pair do |attr, param| 162 | value = self.send(attr) 163 | next if value.nil? 164 | hash[param] = _to_hash(value) 165 | end 166 | hash 167 | end 168 | 169 | # Outputs non-array value in the form of hash 170 | # For object, use to_hash. Otherwise, just return the value 171 | # @param [Object] value Any valid value 172 | # @return [Hash] Returns the value in the form of hash 173 | def _to_hash(value) 174 | if value.is_a?(Array) 175 | value.compact.map { |v| _to_hash(v) } 176 | elsif value.is_a?(Hash) 177 | {}.tap do |hash| 178 | value.each { |k, v| hash[k] = _to_hash(v) } 179 | end 180 | elsif value.respond_to? :to_hash 181 | value.to_hash 182 | else 183 | value 184 | end 185 | end 186 | 187 | end 188 | end 189 | -------------------------------------------------------------------------------- /lib/docusign_admin/models/permissions_response.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | require 'date' 13 | 14 | module DocuSign_Admin 15 | class PermissionsResponse 16 | attr_accessor :permissions 17 | 18 | # Attribute mapping from ruby-style variable name to JSON key. 19 | def self.attribute_map 20 | { 21 | :'permissions' => :'permissions' 22 | } 23 | end 24 | 25 | # Attribute type mapping. 26 | def self.swagger_types 27 | { 28 | :'permissions' => :'Array' 29 | } 30 | end 31 | 32 | # Initializes the object 33 | # @param [Hash] attributes Model attributes in the form of hash 34 | def initialize(attributes = {}) 35 | return unless attributes.is_a?(Hash) 36 | 37 | # convert string to symbol for hash key 38 | attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } 39 | 40 | if attributes.has_key?(:'permissions') 41 | if (value = attributes[:'permissions']).is_a?(Array) 42 | self.permissions = value 43 | end 44 | end 45 | end 46 | 47 | # Show invalid properties with the reasons. Usually used together with valid? 48 | # @return Array for valid properties with the reasons 49 | def list_invalid_properties 50 | invalid_properties = Array.new 51 | invalid_properties 52 | end 53 | 54 | # Check to see if the all the properties in the model are valid 55 | # @return true if the model is valid 56 | def valid? 57 | true 58 | end 59 | 60 | # Checks equality by comparing each attribute. 61 | # @param [Object] Object to be compared 62 | def ==(o) 63 | return true if self.equal?(o) 64 | self.class == o.class && 65 | permissions == o.permissions 66 | end 67 | 68 | # @see the `==` method 69 | # @param [Object] Object to be compared 70 | def eql?(o) 71 | self == o 72 | end 73 | 74 | # Calculates hash code according to all attributes. 75 | # @return [Fixnum] Hash code 76 | def hash 77 | [permissions].hash 78 | end 79 | 80 | # Builds the object from hash 81 | # @param [Hash] attributes Model attributes in the form of hash 82 | # @return [Object] Returns the model itself 83 | def build_from_hash(attributes) 84 | return nil unless attributes.is_a?(Hash) 85 | self.class.swagger_types.each_pair do |key, type| 86 | if type =~ /\AArray<(.*)>/i 87 | # check to ensure the input is an array given that the attribute 88 | # is documented as an array but the input is not 89 | if attributes[self.class.attribute_map[key]].is_a?(Array) 90 | self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) 91 | end 92 | elsif !attributes[self.class.attribute_map[key]].nil? 93 | self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) 94 | end # or else data not found in attributes(hash), not an issue as the data can be optional 95 | end 96 | 97 | self 98 | end 99 | 100 | # Deserializes the data based on type 101 | # @param string type Data type 102 | # @param string value Value to be deserialized 103 | # @return [Object] Deserialized data 104 | def _deserialize(type, value) 105 | case type.to_sym 106 | when :DateTime 107 | DateTime.parse(value) 108 | when :Date 109 | Date.parse(value) 110 | when :String 111 | value.to_s 112 | when :Integer 113 | value.to_i 114 | when :Float 115 | value.to_f 116 | when :BOOLEAN 117 | if value.to_s =~ /\A(true|t|yes|y|1)\z/i 118 | true 119 | else 120 | false 121 | end 122 | when :Object 123 | # generic object (usually a Hash), return directly 124 | value 125 | when /\AArray<(?.+)>\z/ 126 | inner_type = Regexp.last_match[:inner_type] 127 | value.map { |v| _deserialize(inner_type, v) } 128 | when /\AHash<(?.+?), (?.+)>\z/ 129 | k_type = Regexp.last_match[:k_type] 130 | v_type = Regexp.last_match[:v_type] 131 | {}.tap do |hash| 132 | value.each do |k, v| 133 | hash[_deserialize(k_type, k)] = _deserialize(v_type, v) 134 | end 135 | end 136 | else # model 137 | temp_model = DocuSign_Admin.const_get(type).new 138 | temp_model.build_from_hash(value) 139 | end 140 | end 141 | 142 | # Returns the string representation of the object 143 | # @return [String] String presentation of the object 144 | def to_s 145 | to_hash.to_s 146 | end 147 | 148 | # to_body is an alias to to_hash (backward compatibility) 149 | # @return [Hash] Returns the object in the form of hash 150 | def to_body 151 | to_hash 152 | end 153 | 154 | # Returns the object in the form of hash 155 | # @return [Hash] Returns the object in the form of hash 156 | def to_hash 157 | hash = {} 158 | self.class.attribute_map.each_pair do |attr, param| 159 | value = self.send(attr) 160 | next if value.nil? 161 | hash[param] = _to_hash(value) 162 | end 163 | hash 164 | end 165 | 166 | # Outputs non-array value in the form of hash 167 | # For object, use to_hash. Otherwise, just return the value 168 | # @param [Object] value Any valid value 169 | # @return [Hash] Returns the value in the form of hash 170 | def _to_hash(value) 171 | if value.is_a?(Array) 172 | value.compact.map { |v| _to_hash(v) } 173 | elsif value.is_a?(Hash) 174 | {}.tap do |hash| 175 | value.each { |k, v| hash[k] = _to_hash(v) } 176 | end 177 | elsif value.respond_to? :to_hash 178 | value.to_hash 179 | else 180 | value 181 | end 182 | end 183 | 184 | end 185 | end 186 | -------------------------------------------------------------------------------- /lib/docusign_admin/models/org_report_create_response.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | require 'date' 13 | 14 | module DocuSign_Admin 15 | class OrgReportCreateResponse 16 | attr_accessor :report_correlation_id 17 | 18 | # Attribute mapping from ruby-style variable name to JSON key. 19 | def self.attribute_map 20 | { 21 | :'report_correlation_id' => :'report_correlation_id' 22 | } 23 | end 24 | 25 | # Attribute type mapping. 26 | def self.swagger_types 27 | { 28 | :'report_correlation_id' => :'String' 29 | } 30 | end 31 | 32 | # Initializes the object 33 | # @param [Hash] attributes Model attributes in the form of hash 34 | def initialize(attributes = {}) 35 | return unless attributes.is_a?(Hash) 36 | 37 | # convert string to symbol for hash key 38 | attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } 39 | 40 | if attributes.has_key?(:'report_correlation_id') 41 | self.report_correlation_id = attributes[:'report_correlation_id'] 42 | end 43 | end 44 | 45 | # Show invalid properties with the reasons. Usually used together with valid? 46 | # @return Array for valid properties with the reasons 47 | def list_invalid_properties 48 | invalid_properties = Array.new 49 | invalid_properties 50 | end 51 | 52 | # Check to see if the all the properties in the model are valid 53 | # @return true if the model is valid 54 | def valid? 55 | true 56 | end 57 | 58 | # Checks equality by comparing each attribute. 59 | # @param [Object] Object to be compared 60 | def ==(o) 61 | return true if self.equal?(o) 62 | self.class == o.class && 63 | report_correlation_id == o.report_correlation_id 64 | end 65 | 66 | # @see the `==` method 67 | # @param [Object] Object to be compared 68 | def eql?(o) 69 | self == o 70 | end 71 | 72 | # Calculates hash code according to all attributes. 73 | # @return [Fixnum] Hash code 74 | def hash 75 | [report_correlation_id].hash 76 | end 77 | 78 | # Builds the object from hash 79 | # @param [Hash] attributes Model attributes in the form of hash 80 | # @return [Object] Returns the model itself 81 | def build_from_hash(attributes) 82 | return nil unless attributes.is_a?(Hash) 83 | self.class.swagger_types.each_pair do |key, type| 84 | if type =~ /\AArray<(.*)>/i 85 | # check to ensure the input is an array given that the attribute 86 | # is documented as an array but the input is not 87 | if attributes[self.class.attribute_map[key]].is_a?(Array) 88 | self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) 89 | end 90 | elsif !attributes[self.class.attribute_map[key]].nil? 91 | self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) 92 | end # or else data not found in attributes(hash), not an issue as the data can be optional 93 | end 94 | 95 | self 96 | end 97 | 98 | # Deserializes the data based on type 99 | # @param string type Data type 100 | # @param string value Value to be deserialized 101 | # @return [Object] Deserialized data 102 | def _deserialize(type, value) 103 | case type.to_sym 104 | when :DateTime 105 | DateTime.parse(value) 106 | when :Date 107 | Date.parse(value) 108 | when :String 109 | value.to_s 110 | when :Integer 111 | value.to_i 112 | when :Float 113 | value.to_f 114 | when :BOOLEAN 115 | if value.to_s =~ /\A(true|t|yes|y|1)\z/i 116 | true 117 | else 118 | false 119 | end 120 | when :Object 121 | # generic object (usually a Hash), return directly 122 | value 123 | when /\AArray<(?.+)>\z/ 124 | inner_type = Regexp.last_match[:inner_type] 125 | value.map { |v| _deserialize(inner_type, v) } 126 | when /\AHash<(?.+?), (?.+)>\z/ 127 | k_type = Regexp.last_match[:k_type] 128 | v_type = Regexp.last_match[:v_type] 129 | {}.tap do |hash| 130 | value.each do |k, v| 131 | hash[_deserialize(k_type, k)] = _deserialize(v_type, v) 132 | end 133 | end 134 | else # model 135 | temp_model = DocuSign_Admin.const_get(type).new 136 | temp_model.build_from_hash(value) 137 | end 138 | end 139 | 140 | # Returns the string representation of the object 141 | # @return [String] String presentation of the object 142 | def to_s 143 | to_hash.to_s 144 | end 145 | 146 | # to_body is an alias to to_hash (backward compatibility) 147 | # @return [Hash] Returns the object in the form of hash 148 | def to_body 149 | to_hash 150 | end 151 | 152 | # Returns the object in the form of hash 153 | # @return [Hash] Returns the object in the form of hash 154 | def to_hash 155 | hash = {} 156 | self.class.attribute_map.each_pair do |attr, param| 157 | value = self.send(attr) 158 | next if value.nil? 159 | hash[param] = _to_hash(value) 160 | end 161 | hash 162 | end 163 | 164 | # Outputs non-array value in the form of hash 165 | # For object, use to_hash. Otherwise, just return the value 166 | # @param [Object] value Any valid value 167 | # @return [Hash] Returns the value in the form of hash 168 | def _to_hash(value) 169 | if value.is_a?(Array) 170 | value.compact.map { |v| _to_hash(v) } 171 | elsif value.is_a?(Hash) 172 | {}.tap do |hash| 173 | value.each { |k, v| hash[k] = _to_hash(v) } 174 | end 175 | elsif value.respond_to? :to_hash 176 | value.to_hash 177 | else 178 | value 179 | end 180 | end 181 | 182 | end 183 | end 184 | -------------------------------------------------------------------------------- /lib/docusign_admin/models/organizations_response.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | require 'date' 13 | 14 | module DocuSign_Admin 15 | class OrganizationsResponse 16 | attr_accessor :organizations 17 | 18 | # Attribute mapping from ruby-style variable name to JSON key. 19 | def self.attribute_map 20 | { 21 | :'organizations' => :'organizations' 22 | } 23 | end 24 | 25 | # Attribute type mapping. 26 | def self.swagger_types 27 | { 28 | :'organizations' => :'Array' 29 | } 30 | end 31 | 32 | # Initializes the object 33 | # @param [Hash] attributes Model attributes in the form of hash 34 | def initialize(attributes = {}) 35 | return unless attributes.is_a?(Hash) 36 | 37 | # convert string to symbol for hash key 38 | attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } 39 | 40 | if attributes.has_key?(:'organizations') 41 | if (value = attributes[:'organizations']).is_a?(Array) 42 | self.organizations = value 43 | end 44 | end 45 | end 46 | 47 | # Show invalid properties with the reasons. Usually used together with valid? 48 | # @return Array for valid properties with the reasons 49 | def list_invalid_properties 50 | invalid_properties = Array.new 51 | invalid_properties 52 | end 53 | 54 | # Check to see if the all the properties in the model are valid 55 | # @return true if the model is valid 56 | def valid? 57 | true 58 | end 59 | 60 | # Checks equality by comparing each attribute. 61 | # @param [Object] Object to be compared 62 | def ==(o) 63 | return true if self.equal?(o) 64 | self.class == o.class && 65 | organizations == o.organizations 66 | end 67 | 68 | # @see the `==` method 69 | # @param [Object] Object to be compared 70 | def eql?(o) 71 | self == o 72 | end 73 | 74 | # Calculates hash code according to all attributes. 75 | # @return [Fixnum] Hash code 76 | def hash 77 | [organizations].hash 78 | end 79 | 80 | # Builds the object from hash 81 | # @param [Hash] attributes Model attributes in the form of hash 82 | # @return [Object] Returns the model itself 83 | def build_from_hash(attributes) 84 | return nil unless attributes.is_a?(Hash) 85 | self.class.swagger_types.each_pair do |key, type| 86 | if type =~ /\AArray<(.*)>/i 87 | # check to ensure the input is an array given that the attribute 88 | # is documented as an array but the input is not 89 | if attributes[self.class.attribute_map[key]].is_a?(Array) 90 | self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) 91 | end 92 | elsif !attributes[self.class.attribute_map[key]].nil? 93 | self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) 94 | end # or else data not found in attributes(hash), not an issue as the data can be optional 95 | end 96 | 97 | self 98 | end 99 | 100 | # Deserializes the data based on type 101 | # @param string type Data type 102 | # @param string value Value to be deserialized 103 | # @return [Object] Deserialized data 104 | def _deserialize(type, value) 105 | case type.to_sym 106 | when :DateTime 107 | DateTime.parse(value) 108 | when :Date 109 | Date.parse(value) 110 | when :String 111 | value.to_s 112 | when :Integer 113 | value.to_i 114 | when :Float 115 | value.to_f 116 | when :BOOLEAN 117 | if value.to_s =~ /\A(true|t|yes|y|1)\z/i 118 | true 119 | else 120 | false 121 | end 122 | when :Object 123 | # generic object (usually a Hash), return directly 124 | value 125 | when /\AArray<(?.+)>\z/ 126 | inner_type = Regexp.last_match[:inner_type] 127 | value.map { |v| _deserialize(inner_type, v) } 128 | when /\AHash<(?.+?), (?.+)>\z/ 129 | k_type = Regexp.last_match[:k_type] 130 | v_type = Regexp.last_match[:v_type] 131 | {}.tap do |hash| 132 | value.each do |k, v| 133 | hash[_deserialize(k_type, k)] = _deserialize(v_type, v) 134 | end 135 | end 136 | else # model 137 | temp_model = DocuSign_Admin.const_get(type).new 138 | temp_model.build_from_hash(value) 139 | end 140 | end 141 | 142 | # Returns the string representation of the object 143 | # @return [String] String presentation of the object 144 | def to_s 145 | to_hash.to_s 146 | end 147 | 148 | # to_body is an alias to to_hash (backward compatibility) 149 | # @return [Hash] Returns the object in the form of hash 150 | def to_body 151 | to_hash 152 | end 153 | 154 | # Returns the object in the form of hash 155 | # @return [Hash] Returns the object in the form of hash 156 | def to_hash 157 | hash = {} 158 | self.class.attribute_map.each_pair do |attr, param| 159 | value = self.send(attr) 160 | next if value.nil? 161 | hash[param] = _to_hash(value) 162 | end 163 | hash 164 | end 165 | 166 | # Outputs non-array value in the form of hash 167 | # For object, use to_hash. Otherwise, just return the value 168 | # @param [Object] value Any valid value 169 | # @return [Hash] Returns the value in the form of hash 170 | def _to_hash(value) 171 | if value.is_a?(Array) 172 | value.compact.map { |v| _to_hash(v) } 173 | elsif value.is_a?(Hash) 174 | {}.tap do |hash| 175 | value.each { |k, v| hash[k] = _to_hash(v) } 176 | end 177 | elsif value.respond_to? :to_hash 178 | value.to_hash 179 | else 180 | value 181 | end 182 | end 183 | 184 | end 185 | end 186 | -------------------------------------------------------------------------------- /lib/docusign_admin/models/domains_response.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | require 'date' 13 | 14 | module DocuSign_Admin 15 | class DomainsResponse 16 | attr_accessor :reserved_domains 17 | 18 | # Attribute mapping from ruby-style variable name to JSON key. 19 | def self.attribute_map 20 | { 21 | :'reserved_domains' => :'reserved_domains' 22 | } 23 | end 24 | 25 | # Attribute type mapping. 26 | def self.swagger_types 27 | { 28 | :'reserved_domains' => :'Array' 29 | } 30 | end 31 | 32 | # Initializes the object 33 | # @param [Hash] attributes Model attributes in the form of hash 34 | def initialize(attributes = {}) 35 | return unless attributes.is_a?(Hash) 36 | 37 | # convert string to symbol for hash key 38 | attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } 39 | 40 | if attributes.has_key?(:'reserved_domains') 41 | if (value = attributes[:'reserved_domains']).is_a?(Array) 42 | self.reserved_domains = value 43 | end 44 | end 45 | end 46 | 47 | # Show invalid properties with the reasons. Usually used together with valid? 48 | # @return Array for valid properties with the reasons 49 | def list_invalid_properties 50 | invalid_properties = Array.new 51 | invalid_properties 52 | end 53 | 54 | # Check to see if the all the properties in the model are valid 55 | # @return true if the model is valid 56 | def valid? 57 | true 58 | end 59 | 60 | # Checks equality by comparing each attribute. 61 | # @param [Object] Object to be compared 62 | def ==(o) 63 | return true if self.equal?(o) 64 | self.class == o.class && 65 | reserved_domains == o.reserved_domains 66 | end 67 | 68 | # @see the `==` method 69 | # @param [Object] Object to be compared 70 | def eql?(o) 71 | self == o 72 | end 73 | 74 | # Calculates hash code according to all attributes. 75 | # @return [Fixnum] Hash code 76 | def hash 77 | [reserved_domains].hash 78 | end 79 | 80 | # Builds the object from hash 81 | # @param [Hash] attributes Model attributes in the form of hash 82 | # @return [Object] Returns the model itself 83 | def build_from_hash(attributes) 84 | return nil unless attributes.is_a?(Hash) 85 | self.class.swagger_types.each_pair do |key, type| 86 | if type =~ /\AArray<(.*)>/i 87 | # check to ensure the input is an array given that the attribute 88 | # is documented as an array but the input is not 89 | if attributes[self.class.attribute_map[key]].is_a?(Array) 90 | self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) 91 | end 92 | elsif !attributes[self.class.attribute_map[key]].nil? 93 | self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) 94 | end # or else data not found in attributes(hash), not an issue as the data can be optional 95 | end 96 | 97 | self 98 | end 99 | 100 | # Deserializes the data based on type 101 | # @param string type Data type 102 | # @param string value Value to be deserialized 103 | # @return [Object] Deserialized data 104 | def _deserialize(type, value) 105 | case type.to_sym 106 | when :DateTime 107 | DateTime.parse(value) 108 | when :Date 109 | Date.parse(value) 110 | when :String 111 | value.to_s 112 | when :Integer 113 | value.to_i 114 | when :Float 115 | value.to_f 116 | when :BOOLEAN 117 | if value.to_s =~ /\A(true|t|yes|y|1)\z/i 118 | true 119 | else 120 | false 121 | end 122 | when :Object 123 | # generic object (usually a Hash), return directly 124 | value 125 | when /\AArray<(?.+)>\z/ 126 | inner_type = Regexp.last_match[:inner_type] 127 | value.map { |v| _deserialize(inner_type, v) } 128 | when /\AHash<(?.+?), (?.+)>\z/ 129 | k_type = Regexp.last_match[:k_type] 130 | v_type = Regexp.last_match[:v_type] 131 | {}.tap do |hash| 132 | value.each do |k, v| 133 | hash[_deserialize(k_type, k)] = _deserialize(v_type, v) 134 | end 135 | end 136 | else # model 137 | temp_model = DocuSign_Admin.const_get(type).new 138 | temp_model.build_from_hash(value) 139 | end 140 | end 141 | 142 | # Returns the string representation of the object 143 | # @return [String] String presentation of the object 144 | def to_s 145 | to_hash.to_s 146 | end 147 | 148 | # to_body is an alias to to_hash (backward compatibility) 149 | # @return [Hash] Returns the object in the form of hash 150 | def to_body 151 | to_hash 152 | end 153 | 154 | # Returns the object in the form of hash 155 | # @return [Hash] Returns the object in the form of hash 156 | def to_hash 157 | hash = {} 158 | self.class.attribute_map.each_pair do |attr, param| 159 | value = self.send(attr) 160 | next if value.nil? 161 | hash[param] = _to_hash(value) 162 | end 163 | hash 164 | end 165 | 166 | # Outputs non-array value in the form of hash 167 | # For object, use to_hash. Otherwise, just return the value 168 | # @param [Object] value Any valid value 169 | # @return [Hash] Returns the value in the form of hash 170 | def _to_hash(value) 171 | if value.is_a?(Array) 172 | value.compact.map { |v| _to_hash(v) } 173 | elsif value.is_a?(Hash) 174 | {}.tap do |hash| 175 | value.each { |k, v| hash[k] = _to_hash(v) } 176 | end 177 | elsif value.respond_to? :to_hash 178 | value.to_hash 179 | else 180 | value 181 | end 182 | end 183 | 184 | end 185 | end 186 | -------------------------------------------------------------------------------- /lib/docusign_admin/models/link_response.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | require 'date' 13 | 14 | module DocuSign_Admin 15 | class LinkResponse 16 | attr_accessor :rel 17 | 18 | attr_accessor :href 19 | 20 | # Attribute mapping from ruby-style variable name to JSON key. 21 | def self.attribute_map 22 | { 23 | :'rel' => :'rel', 24 | :'href' => :'href' 25 | } 26 | end 27 | 28 | # Attribute type mapping. 29 | def self.swagger_types 30 | { 31 | :'rel' => :'String', 32 | :'href' => :'String' 33 | } 34 | end 35 | 36 | # Initializes the object 37 | # @param [Hash] attributes Model attributes in the form of hash 38 | def initialize(attributes = {}) 39 | return unless attributes.is_a?(Hash) 40 | 41 | # convert string to symbol for hash key 42 | attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } 43 | 44 | if attributes.has_key?(:'rel') 45 | self.rel = attributes[:'rel'] 46 | end 47 | 48 | if attributes.has_key?(:'href') 49 | self.href = attributes[:'href'] 50 | end 51 | end 52 | 53 | # Show invalid properties with the reasons. Usually used together with valid? 54 | # @return Array for valid properties with the reasons 55 | def list_invalid_properties 56 | invalid_properties = Array.new 57 | invalid_properties 58 | end 59 | 60 | # Check to see if the all the properties in the model are valid 61 | # @return true if the model is valid 62 | def valid? 63 | true 64 | end 65 | 66 | # Checks equality by comparing each attribute. 67 | # @param [Object] Object to be compared 68 | def ==(o) 69 | return true if self.equal?(o) 70 | self.class == o.class && 71 | rel == o.rel && 72 | href == o.href 73 | end 74 | 75 | # @see the `==` method 76 | # @param [Object] Object to be compared 77 | def eql?(o) 78 | self == o 79 | end 80 | 81 | # Calculates hash code according to all attributes. 82 | # @return [Fixnum] Hash code 83 | def hash 84 | [rel, href].hash 85 | end 86 | 87 | # Builds the object from hash 88 | # @param [Hash] attributes Model attributes in the form of hash 89 | # @return [Object] Returns the model itself 90 | def build_from_hash(attributes) 91 | return nil unless attributes.is_a?(Hash) 92 | self.class.swagger_types.each_pair do |key, type| 93 | if type =~ /\AArray<(.*)>/i 94 | # check to ensure the input is an array given that the attribute 95 | # is documented as an array but the input is not 96 | if attributes[self.class.attribute_map[key]].is_a?(Array) 97 | self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) 98 | end 99 | elsif !attributes[self.class.attribute_map[key]].nil? 100 | self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) 101 | end # or else data not found in attributes(hash), not an issue as the data can be optional 102 | end 103 | 104 | self 105 | end 106 | 107 | # Deserializes the data based on type 108 | # @param string type Data type 109 | # @param string value Value to be deserialized 110 | # @return [Object] Deserialized data 111 | def _deserialize(type, value) 112 | case type.to_sym 113 | when :DateTime 114 | DateTime.parse(value) 115 | when :Date 116 | Date.parse(value) 117 | when :String 118 | value.to_s 119 | when :Integer 120 | value.to_i 121 | when :Float 122 | value.to_f 123 | when :BOOLEAN 124 | if value.to_s =~ /\A(true|t|yes|y|1)\z/i 125 | true 126 | else 127 | false 128 | end 129 | when :Object 130 | # generic object (usually a Hash), return directly 131 | value 132 | when /\AArray<(?.+)>\z/ 133 | inner_type = Regexp.last_match[:inner_type] 134 | value.map { |v| _deserialize(inner_type, v) } 135 | when /\AHash<(?.+?), (?.+)>\z/ 136 | k_type = Regexp.last_match[:k_type] 137 | v_type = Regexp.last_match[:v_type] 138 | {}.tap do |hash| 139 | value.each do |k, v| 140 | hash[_deserialize(k_type, k)] = _deserialize(v_type, v) 141 | end 142 | end 143 | else # model 144 | temp_model = DocuSign_Admin.const_get(type).new 145 | temp_model.build_from_hash(value) 146 | end 147 | end 148 | 149 | # Returns the string representation of the object 150 | # @return [String] String presentation of the object 151 | def to_s 152 | to_hash.to_s 153 | end 154 | 155 | # to_body is an alias to to_hash (backward compatibility) 156 | # @return [Hash] Returns the object in the form of hash 157 | def to_body 158 | to_hash 159 | end 160 | 161 | # Returns the object in the form of hash 162 | # @return [Hash] Returns the object in the form of hash 163 | def to_hash 164 | hash = {} 165 | self.class.attribute_map.each_pair do |attr, param| 166 | value = self.send(attr) 167 | next if value.nil? 168 | hash[param] = _to_hash(value) 169 | end 170 | hash 171 | end 172 | 173 | # Outputs non-array value in the form of hash 174 | # For object, use to_hash. Otherwise, just return the value 175 | # @param [Object] value Any valid value 176 | # @return [Hash] Returns the value in the form of hash 177 | def _to_hash(value) 178 | if value.is_a?(Array) 179 | value.compact.map { |v| _to_hash(v) } 180 | elsif value.is_a?(Hash) 181 | {}.tap do |hash| 182 | value.each { |k, v| hash[k] = _to_hash(v) } 183 | end 184 | elsif value.respond_to? :to_hash 185 | value.to_hash 186 | else 187 | value 188 | end 189 | end 190 | 191 | end 192 | end 193 | -------------------------------------------------------------------------------- /lib/docusign_admin/models/force_activate_membership_request.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | require 'date' 13 | 14 | module DocuSign_Admin 15 | class ForceActivateMembershipRequest 16 | attr_accessor :site_id 17 | 18 | # Attribute mapping from ruby-style variable name to JSON key. 19 | def self.attribute_map 20 | { 21 | :'site_id' => :'site_id' 22 | } 23 | end 24 | 25 | # Attribute type mapping. 26 | def self.swagger_types 27 | { 28 | :'site_id' => :'Integer' 29 | } 30 | end 31 | 32 | # Initializes the object 33 | # @param [Hash] attributes Model attributes in the form of hash 34 | def initialize(attributes = {}) 35 | return unless attributes.is_a?(Hash) 36 | 37 | # convert string to symbol for hash key 38 | attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } 39 | 40 | if attributes.has_key?(:'site_id') 41 | self.site_id = attributes[:'site_id'] 42 | end 43 | end 44 | 45 | # Show invalid properties with the reasons. Usually used together with valid? 46 | # @return Array for valid properties with the reasons 47 | def list_invalid_properties 48 | invalid_properties = Array.new 49 | if @site_id.nil? 50 | invalid_properties.push('invalid value for "site_id", site_id cannot be nil.') 51 | end 52 | 53 | invalid_properties 54 | end 55 | 56 | # Check to see if the all the properties in the model are valid 57 | # @return true if the model is valid 58 | def valid? 59 | return false if @site_id.nil? 60 | true 61 | end 62 | 63 | # Checks equality by comparing each attribute. 64 | # @param [Object] Object to be compared 65 | def ==(o) 66 | return true if self.equal?(o) 67 | self.class == o.class && 68 | site_id == o.site_id 69 | end 70 | 71 | # @see the `==` method 72 | # @param [Object] Object to be compared 73 | def eql?(o) 74 | self == o 75 | end 76 | 77 | # Calculates hash code according to all attributes. 78 | # @return [Fixnum] Hash code 79 | def hash 80 | [site_id].hash 81 | end 82 | 83 | # Builds the object from hash 84 | # @param [Hash] attributes Model attributes in the form of hash 85 | # @return [Object] Returns the model itself 86 | def build_from_hash(attributes) 87 | return nil unless attributes.is_a?(Hash) 88 | self.class.swagger_types.each_pair do |key, type| 89 | if type =~ /\AArray<(.*)>/i 90 | # check to ensure the input is an array given that the attribute 91 | # is documented as an array but the input is not 92 | if attributes[self.class.attribute_map[key]].is_a?(Array) 93 | self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) 94 | end 95 | elsif !attributes[self.class.attribute_map[key]].nil? 96 | self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) 97 | end # or else data not found in attributes(hash), not an issue as the data can be optional 98 | end 99 | 100 | self 101 | end 102 | 103 | # Deserializes the data based on type 104 | # @param string type Data type 105 | # @param string value Value to be deserialized 106 | # @return [Object] Deserialized data 107 | def _deserialize(type, value) 108 | case type.to_sym 109 | when :DateTime 110 | DateTime.parse(value) 111 | when :Date 112 | Date.parse(value) 113 | when :String 114 | value.to_s 115 | when :Integer 116 | value.to_i 117 | when :Float 118 | value.to_f 119 | when :BOOLEAN 120 | if value.to_s =~ /\A(true|t|yes|y|1)\z/i 121 | true 122 | else 123 | false 124 | end 125 | when :Object 126 | # generic object (usually a Hash), return directly 127 | value 128 | when /\AArray<(?.+)>\z/ 129 | inner_type = Regexp.last_match[:inner_type] 130 | value.map { |v| _deserialize(inner_type, v) } 131 | when /\AHash<(?.+?), (?.+)>\z/ 132 | k_type = Regexp.last_match[:k_type] 133 | v_type = Regexp.last_match[:v_type] 134 | {}.tap do |hash| 135 | value.each do |k, v| 136 | hash[_deserialize(k_type, k)] = _deserialize(v_type, v) 137 | end 138 | end 139 | else # model 140 | temp_model = DocuSign_Admin.const_get(type).new 141 | temp_model.build_from_hash(value) 142 | end 143 | end 144 | 145 | # Returns the string representation of the object 146 | # @return [String] String presentation of the object 147 | def to_s 148 | to_hash.to_s 149 | end 150 | 151 | # to_body is an alias to to_hash (backward compatibility) 152 | # @return [Hash] Returns the object in the form of hash 153 | def to_body 154 | to_hash 155 | end 156 | 157 | # Returns the object in the form of hash 158 | # @return [Hash] Returns the object in the form of hash 159 | def to_hash 160 | hash = {} 161 | self.class.attribute_map.each_pair do |attr, param| 162 | value = self.send(attr) 163 | next if value.nil? 164 | hash[param] = _to_hash(value) 165 | end 166 | hash 167 | end 168 | 169 | # Outputs non-array value in the form of hash 170 | # For object, use to_hash. Otherwise, just return the value 171 | # @param [Object] value Any valid value 172 | # @return [Hash] Returns the value in the form of hash 173 | def _to_hash(value) 174 | if value.is_a?(Array) 175 | value.compact.map { |v| _to_hash(v) } 176 | elsif value.is_a?(Hash) 177 | {}.tap do |hash| 178 | value.each { |k, v| hash[k] = _to_hash(v) } 179 | end 180 | elsif value.respond_to? :to_hash 181 | value.to_hash 182 | else 183 | value 184 | end 185 | end 186 | 187 | end 188 | end 189 | -------------------------------------------------------------------------------- /lib/docusign_admin/models/identity_providers_response.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | require 'date' 13 | 14 | module DocuSign_Admin 15 | class IdentityProvidersResponse 16 | attr_accessor :identity_providers 17 | 18 | # Attribute mapping from ruby-style variable name to JSON key. 19 | def self.attribute_map 20 | { 21 | :'identity_providers' => :'identity_providers' 22 | } 23 | end 24 | 25 | # Attribute type mapping. 26 | def self.swagger_types 27 | { 28 | :'identity_providers' => :'Array' 29 | } 30 | end 31 | 32 | # Initializes the object 33 | # @param [Hash] attributes Model attributes in the form of hash 34 | def initialize(attributes = {}) 35 | return unless attributes.is_a?(Hash) 36 | 37 | # convert string to symbol for hash key 38 | attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } 39 | 40 | if attributes.has_key?(:'identity_providers') 41 | if (value = attributes[:'identity_providers']).is_a?(Array) 42 | self.identity_providers = value 43 | end 44 | end 45 | end 46 | 47 | # Show invalid properties with the reasons. Usually used together with valid? 48 | # @return Array for valid properties with the reasons 49 | def list_invalid_properties 50 | invalid_properties = Array.new 51 | invalid_properties 52 | end 53 | 54 | # Check to see if the all the properties in the model are valid 55 | # @return true if the model is valid 56 | def valid? 57 | true 58 | end 59 | 60 | # Checks equality by comparing each attribute. 61 | # @param [Object] Object to be compared 62 | def ==(o) 63 | return true if self.equal?(o) 64 | self.class == o.class && 65 | identity_providers == o.identity_providers 66 | end 67 | 68 | # @see the `==` method 69 | # @param [Object] Object to be compared 70 | def eql?(o) 71 | self == o 72 | end 73 | 74 | # Calculates hash code according to all attributes. 75 | # @return [Fixnum] Hash code 76 | def hash 77 | [identity_providers].hash 78 | end 79 | 80 | # Builds the object from hash 81 | # @param [Hash] attributes Model attributes in the form of hash 82 | # @return [Object] Returns the model itself 83 | def build_from_hash(attributes) 84 | return nil unless attributes.is_a?(Hash) 85 | self.class.swagger_types.each_pair do |key, type| 86 | if type =~ /\AArray<(.*)>/i 87 | # check to ensure the input is an array given that the attribute 88 | # is documented as an array but the input is not 89 | if attributes[self.class.attribute_map[key]].is_a?(Array) 90 | self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) 91 | end 92 | elsif !attributes[self.class.attribute_map[key]].nil? 93 | self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) 94 | end # or else data not found in attributes(hash), not an issue as the data can be optional 95 | end 96 | 97 | self 98 | end 99 | 100 | # Deserializes the data based on type 101 | # @param string type Data type 102 | # @param string value Value to be deserialized 103 | # @return [Object] Deserialized data 104 | def _deserialize(type, value) 105 | case type.to_sym 106 | when :DateTime 107 | DateTime.parse(value) 108 | when :Date 109 | Date.parse(value) 110 | when :String 111 | value.to_s 112 | when :Integer 113 | value.to_i 114 | when :Float 115 | value.to_f 116 | when :BOOLEAN 117 | if value.to_s =~ /\A(true|t|yes|y|1)\z/i 118 | true 119 | else 120 | false 121 | end 122 | when :Object 123 | # generic object (usually a Hash), return directly 124 | value 125 | when /\AArray<(?.+)>\z/ 126 | inner_type = Regexp.last_match[:inner_type] 127 | value.map { |v| _deserialize(inner_type, v) } 128 | when /\AHash<(?.+?), (?.+)>\z/ 129 | k_type = Regexp.last_match[:k_type] 130 | v_type = Regexp.last_match[:v_type] 131 | {}.tap do |hash| 132 | value.each do |k, v| 133 | hash[_deserialize(k_type, k)] = _deserialize(v_type, v) 134 | end 135 | end 136 | else # model 137 | temp_model = DocuSign_Admin.const_get(type).new 138 | temp_model.build_from_hash(value) 139 | end 140 | end 141 | 142 | # Returns the string representation of the object 143 | # @return [String] String presentation of the object 144 | def to_s 145 | to_hash.to_s 146 | end 147 | 148 | # to_body is an alias to to_hash (backward compatibility) 149 | # @return [Hash] Returns the object in the form of hash 150 | def to_body 151 | to_hash 152 | end 153 | 154 | # Returns the object in the form of hash 155 | # @return [Hash] Returns the object in the form of hash 156 | def to_hash 157 | hash = {} 158 | self.class.attribute_map.each_pair do |attr, param| 159 | value = self.send(attr) 160 | next if value.nil? 161 | hash[param] = _to_hash(value) 162 | end 163 | hash 164 | end 165 | 166 | # Outputs non-array value in the form of hash 167 | # For object, use to_hash. Otherwise, just return the value 168 | # @param [Object] value Any valid value 169 | # @return [Hash] Returns the value in the form of hash 170 | def _to_hash(value) 171 | if value.is_a?(Array) 172 | value.compact.map { |v| _to_hash(v) } 173 | elsif value.is_a?(Hash) 174 | {}.tap do |hash| 175 | value.each { |k, v| hash[k] = _to_hash(v) } 176 | end 177 | elsif value.respond_to? :to_hash 178 | value.to_hash 179 | else 180 | value 181 | end 182 | end 183 | 184 | end 185 | end 186 | -------------------------------------------------------------------------------- /lib/docusign_admin/models/permission_profile_response.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | require 'date' 13 | 14 | module DocuSign_Admin 15 | class PermissionProfileResponse 16 | attr_accessor :id 17 | 18 | attr_accessor :name 19 | 20 | # Attribute mapping from ruby-style variable name to JSON key. 21 | def self.attribute_map 22 | { 23 | :'id' => :'id', 24 | :'name' => :'name' 25 | } 26 | end 27 | 28 | # Attribute type mapping. 29 | def self.swagger_types 30 | { 31 | :'id' => :'Integer', 32 | :'name' => :'String' 33 | } 34 | end 35 | 36 | # Initializes the object 37 | # @param [Hash] attributes Model attributes in the form of hash 38 | def initialize(attributes = {}) 39 | return unless attributes.is_a?(Hash) 40 | 41 | # convert string to symbol for hash key 42 | attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } 43 | 44 | if attributes.has_key?(:'id') 45 | self.id = attributes[:'id'] 46 | end 47 | 48 | if attributes.has_key?(:'name') 49 | self.name = attributes[:'name'] 50 | end 51 | end 52 | 53 | # Show invalid properties with the reasons. Usually used together with valid? 54 | # @return Array for valid properties with the reasons 55 | def list_invalid_properties 56 | invalid_properties = Array.new 57 | invalid_properties 58 | end 59 | 60 | # Check to see if the all the properties in the model are valid 61 | # @return true if the model is valid 62 | def valid? 63 | true 64 | end 65 | 66 | # Checks equality by comparing each attribute. 67 | # @param [Object] Object to be compared 68 | def ==(o) 69 | return true if self.equal?(o) 70 | self.class == o.class && 71 | id == o.id && 72 | name == o.name 73 | end 74 | 75 | # @see the `==` method 76 | # @param [Object] Object to be compared 77 | def eql?(o) 78 | self == o 79 | end 80 | 81 | # Calculates hash code according to all attributes. 82 | # @return [Fixnum] Hash code 83 | def hash 84 | [id, name].hash 85 | end 86 | 87 | # Builds the object from hash 88 | # @param [Hash] attributes Model attributes in the form of hash 89 | # @return [Object] Returns the model itself 90 | def build_from_hash(attributes) 91 | return nil unless attributes.is_a?(Hash) 92 | self.class.swagger_types.each_pair do |key, type| 93 | if type =~ /\AArray<(.*)>/i 94 | # check to ensure the input is an array given that the attribute 95 | # is documented as an array but the input is not 96 | if attributes[self.class.attribute_map[key]].is_a?(Array) 97 | self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) 98 | end 99 | elsif !attributes[self.class.attribute_map[key]].nil? 100 | self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) 101 | end # or else data not found in attributes(hash), not an issue as the data can be optional 102 | end 103 | 104 | self 105 | end 106 | 107 | # Deserializes the data based on type 108 | # @param string type Data type 109 | # @param string value Value to be deserialized 110 | # @return [Object] Deserialized data 111 | def _deserialize(type, value) 112 | case type.to_sym 113 | when :DateTime 114 | DateTime.parse(value) 115 | when :Date 116 | Date.parse(value) 117 | when :String 118 | value.to_s 119 | when :Integer 120 | value.to_i 121 | when :Float 122 | value.to_f 123 | when :BOOLEAN 124 | if value.to_s =~ /\A(true|t|yes|y|1)\z/i 125 | true 126 | else 127 | false 128 | end 129 | when :Object 130 | # generic object (usually a Hash), return directly 131 | value 132 | when /\AArray<(?.+)>\z/ 133 | inner_type = Regexp.last_match[:inner_type] 134 | value.map { |v| _deserialize(inner_type, v) } 135 | when /\AHash<(?.+?), (?.+)>\z/ 136 | k_type = Regexp.last_match[:k_type] 137 | v_type = Regexp.last_match[:v_type] 138 | {}.tap do |hash| 139 | value.each do |k, v| 140 | hash[_deserialize(k_type, k)] = _deserialize(v_type, v) 141 | end 142 | end 143 | else # model 144 | temp_model = DocuSign_Admin.const_get(type).new 145 | temp_model.build_from_hash(value) 146 | end 147 | end 148 | 149 | # Returns the string representation of the object 150 | # @return [String] String presentation of the object 151 | def to_s 152 | to_hash.to_s 153 | end 154 | 155 | # to_body is an alias to to_hash (backward compatibility) 156 | # @return [Hash] Returns the object in the form of hash 157 | def to_body 158 | to_hash 159 | end 160 | 161 | # Returns the object in the form of hash 162 | # @return [Hash] Returns the object in the form of hash 163 | def to_hash 164 | hash = {} 165 | self.class.attribute_map.each_pair do |attr, param| 166 | value = self.send(attr) 167 | next if value.nil? 168 | hash[param] = _to_hash(value) 169 | end 170 | hash 171 | end 172 | 173 | # Outputs non-array value in the form of hash 174 | # For object, use to_hash. Otherwise, just return the value 175 | # @param [Object] value Any valid value 176 | # @return [Hash] Returns the value in the form of hash 177 | def _to_hash(value) 178 | if value.is_a?(Array) 179 | value.compact.map { |v| _to_hash(v) } 180 | elsif value.is_a?(Hash) 181 | {}.tap do |hash| 182 | value.each { |k, v| hash[k] = _to_hash(v) } 183 | end 184 | elsif value.respond_to? :to_hash 185 | value.to_hash 186 | else 187 | value 188 | end 189 | end 190 | 191 | end 192 | end 193 | -------------------------------------------------------------------------------- /lib/docusign_admin/models/ds_group_request.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | require 'date' 13 | 14 | module DocuSign_Admin 15 | class DSGroupRequest 16 | attr_accessor :ds_group_id 17 | 18 | # Attribute mapping from ruby-style variable name to JSON key. 19 | def self.attribute_map 20 | { 21 | :'ds_group_id' => :'ds_group_id' 22 | } 23 | end 24 | 25 | # Attribute type mapping. 26 | def self.swagger_types 27 | { 28 | :'ds_group_id' => :'String' 29 | } 30 | end 31 | 32 | # Initializes the object 33 | # @param [Hash] attributes Model attributes in the form of hash 34 | def initialize(attributes = {}) 35 | return unless attributes.is_a?(Hash) 36 | 37 | # convert string to symbol for hash key 38 | attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } 39 | 40 | if attributes.has_key?(:'ds_group_id') 41 | self.ds_group_id = attributes[:'ds_group_id'] 42 | end 43 | end 44 | 45 | # Show invalid properties with the reasons. Usually used together with valid? 46 | # @return Array for valid properties with the reasons 47 | def list_invalid_properties 48 | invalid_properties = Array.new 49 | if @ds_group_id.nil? 50 | invalid_properties.push('invalid value for "ds_group_id", ds_group_id cannot be nil.') 51 | end 52 | 53 | invalid_properties 54 | end 55 | 56 | # Check to see if the all the properties in the model are valid 57 | # @return true if the model is valid 58 | def valid? 59 | return false if @ds_group_id.nil? 60 | true 61 | end 62 | 63 | # Checks equality by comparing each attribute. 64 | # @param [Object] Object to be compared 65 | def ==(o) 66 | return true if self.equal?(o) 67 | self.class == o.class && 68 | ds_group_id == o.ds_group_id 69 | end 70 | 71 | # @see the `==` method 72 | # @param [Object] Object to be compared 73 | def eql?(o) 74 | self == o 75 | end 76 | 77 | # Calculates hash code according to all attributes. 78 | # @return [Fixnum] Hash code 79 | def hash 80 | [ds_group_id].hash 81 | end 82 | 83 | # Builds the object from hash 84 | # @param [Hash] attributes Model attributes in the form of hash 85 | # @return [Object] Returns the model itself 86 | def build_from_hash(attributes) 87 | return nil unless attributes.is_a?(Hash) 88 | self.class.swagger_types.each_pair do |key, type| 89 | if type =~ /\AArray<(.*)>/i 90 | # check to ensure the input is an array given that the attribute 91 | # is documented as an array but the input is not 92 | if attributes[self.class.attribute_map[key]].is_a?(Array) 93 | self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) 94 | end 95 | elsif !attributes[self.class.attribute_map[key]].nil? 96 | self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) 97 | end # or else data not found in attributes(hash), not an issue as the data can be optional 98 | end 99 | 100 | self 101 | end 102 | 103 | # Deserializes the data based on type 104 | # @param string type Data type 105 | # @param string value Value to be deserialized 106 | # @return [Object] Deserialized data 107 | def _deserialize(type, value) 108 | case type.to_sym 109 | when :DateTime 110 | DateTime.parse(value) 111 | when :Date 112 | Date.parse(value) 113 | when :String 114 | value.to_s 115 | when :Integer 116 | value.to_i 117 | when :Float 118 | value.to_f 119 | when :BOOLEAN 120 | if value.to_s =~ /\A(true|t|yes|y|1)\z/i 121 | true 122 | else 123 | false 124 | end 125 | when :Object 126 | # generic object (usually a Hash), return directly 127 | value 128 | when /\AArray<(?.+)>\z/ 129 | inner_type = Regexp.last_match[:inner_type] 130 | value.map { |v| _deserialize(inner_type, v) } 131 | when /\AHash<(?.+?), (?.+)>\z/ 132 | k_type = Regexp.last_match[:k_type] 133 | v_type = Regexp.last_match[:v_type] 134 | {}.tap do |hash| 135 | value.each do |k, v| 136 | hash[_deserialize(k_type, k)] = _deserialize(v_type, v) 137 | end 138 | end 139 | else # model 140 | temp_model = DocuSign_Admin.const_get(type).new 141 | temp_model.build_from_hash(value) 142 | end 143 | end 144 | 145 | # Returns the string representation of the object 146 | # @return [String] String presentation of the object 147 | def to_s 148 | to_hash.to_s 149 | end 150 | 151 | # to_body is an alias to to_hash (backward compatibility) 152 | # @return [Hash] Returns the object in the form of hash 153 | def to_body 154 | to_hash 155 | end 156 | 157 | # Returns the object in the form of hash 158 | # @return [Hash] Returns the object in the form of hash 159 | def to_hash 160 | hash = {} 161 | self.class.attribute_map.each_pair do |attr, param| 162 | value = self.send(attr) 163 | next if value.nil? 164 | hash[param] = _to_hash(value) 165 | end 166 | hash 167 | end 168 | 169 | # Outputs non-array value in the form of hash 170 | # For object, use to_hash. Otherwise, just return the value 171 | # @param [Object] value Any valid value 172 | # @return [Hash] Returns the value in the form of hash 173 | def _to_hash(value) 174 | if value.is_a?(Array) 175 | value.compact.map { |v| _to_hash(v) } 176 | elsif value.is_a?(Hash) 177 | {}.tap do |hash| 178 | value.each { |k, v| hash[k] = _to_hash(v) } 179 | end 180 | elsif value.respond_to? :to_hash 181 | value.to_hash 182 | else 183 | value 184 | end 185 | end 186 | 187 | end 188 | end 189 | -------------------------------------------------------------------------------- /lib/docusign_admin/models/org_report_list_response_requestor.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | require 'date' 13 | 14 | module DocuSign_Admin 15 | class OrgReportListResponseRequestor 16 | attr_accessor :id 17 | 18 | attr_accessor :name 19 | 20 | # Attribute mapping from ruby-style variable name to JSON key. 21 | def self.attribute_map 22 | { 23 | :'id' => :'id', 24 | :'name' => :'name' 25 | } 26 | end 27 | 28 | # Attribute type mapping. 29 | def self.swagger_types 30 | { 31 | :'id' => :'String', 32 | :'name' => :'String' 33 | } 34 | end 35 | 36 | # Initializes the object 37 | # @param [Hash] attributes Model attributes in the form of hash 38 | def initialize(attributes = {}) 39 | return unless attributes.is_a?(Hash) 40 | 41 | # convert string to symbol for hash key 42 | attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } 43 | 44 | if attributes.has_key?(:'id') 45 | self.id = attributes[:'id'] 46 | end 47 | 48 | if attributes.has_key?(:'name') 49 | self.name = attributes[:'name'] 50 | end 51 | end 52 | 53 | # Show invalid properties with the reasons. Usually used together with valid? 54 | # @return Array for valid properties with the reasons 55 | def list_invalid_properties 56 | invalid_properties = Array.new 57 | invalid_properties 58 | end 59 | 60 | # Check to see if the all the properties in the model are valid 61 | # @return true if the model is valid 62 | def valid? 63 | true 64 | end 65 | 66 | # Checks equality by comparing each attribute. 67 | # @param [Object] Object to be compared 68 | def ==(o) 69 | return true if self.equal?(o) 70 | self.class == o.class && 71 | id == o.id && 72 | name == o.name 73 | end 74 | 75 | # @see the `==` method 76 | # @param [Object] Object to be compared 77 | def eql?(o) 78 | self == o 79 | end 80 | 81 | # Calculates hash code according to all attributes. 82 | # @return [Fixnum] Hash code 83 | def hash 84 | [id, name].hash 85 | end 86 | 87 | # Builds the object from hash 88 | # @param [Hash] attributes Model attributes in the form of hash 89 | # @return [Object] Returns the model itself 90 | def build_from_hash(attributes) 91 | return nil unless attributes.is_a?(Hash) 92 | self.class.swagger_types.each_pair do |key, type| 93 | if type =~ /\AArray<(.*)>/i 94 | # check to ensure the input is an array given that the attribute 95 | # is documented as an array but the input is not 96 | if attributes[self.class.attribute_map[key]].is_a?(Array) 97 | self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) 98 | end 99 | elsif !attributes[self.class.attribute_map[key]].nil? 100 | self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) 101 | end # or else data not found in attributes(hash), not an issue as the data can be optional 102 | end 103 | 104 | self 105 | end 106 | 107 | # Deserializes the data based on type 108 | # @param string type Data type 109 | # @param string value Value to be deserialized 110 | # @return [Object] Deserialized data 111 | def _deserialize(type, value) 112 | case type.to_sym 113 | when :DateTime 114 | DateTime.parse(value) 115 | when :Date 116 | Date.parse(value) 117 | when :String 118 | value.to_s 119 | when :Integer 120 | value.to_i 121 | when :Float 122 | value.to_f 123 | when :BOOLEAN 124 | if value.to_s =~ /\A(true|t|yes|y|1)\z/i 125 | true 126 | else 127 | false 128 | end 129 | when :Object 130 | # generic object (usually a Hash), return directly 131 | value 132 | when /\AArray<(?.+)>\z/ 133 | inner_type = Regexp.last_match[:inner_type] 134 | value.map { |v| _deserialize(inner_type, v) } 135 | when /\AHash<(?.+?), (?.+)>\z/ 136 | k_type = Regexp.last_match[:k_type] 137 | v_type = Regexp.last_match[:v_type] 138 | {}.tap do |hash| 139 | value.each do |k, v| 140 | hash[_deserialize(k_type, k)] = _deserialize(v_type, v) 141 | end 142 | end 143 | else # model 144 | temp_model = DocuSign_Admin.const_get(type).new 145 | temp_model.build_from_hash(value) 146 | end 147 | end 148 | 149 | # Returns the string representation of the object 150 | # @return [String] String presentation of the object 151 | def to_s 152 | to_hash.to_s 153 | end 154 | 155 | # to_body is an alias to to_hash (backward compatibility) 156 | # @return [Hash] Returns the object in the form of hash 157 | def to_body 158 | to_hash 159 | end 160 | 161 | # Returns the object in the form of hash 162 | # @return [Hash] Returns the object in the form of hash 163 | def to_hash 164 | hash = {} 165 | self.class.attribute_map.each_pair do |attr, param| 166 | value = self.send(attr) 167 | next if value.nil? 168 | hash[param] = _to_hash(value) 169 | end 170 | hash 171 | end 172 | 173 | # Outputs non-array value in the form of hash 174 | # For object, use to_hash. Otherwise, just return the value 175 | # @param [Object] value Any valid value 176 | # @return [Hash] Returns the value in the form of hash 177 | def _to_hash(value) 178 | if value.is_a?(Array) 179 | value.compact.map { |v| _to_hash(v) } 180 | elsif value.is_a?(Hash) 181 | {}.tap do |hash| 182 | value.each { |k, v| hash[k] = _to_hash(v) } 183 | end 184 | elsif value.respond_to? :to_hash 185 | value.to_hash 186 | else 187 | value 188 | end 189 | end 190 | 191 | end 192 | end 193 | -------------------------------------------------------------------------------- /lib/docusign_admin/models/asset_group_account_clones.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | require 'date' 13 | 14 | module DocuSign_Admin 15 | class AssetGroupAccountClones 16 | # The list of asset group accounts. 17 | attr_accessor :asset_group_works 18 | 19 | # Attribute mapping from ruby-style variable name to JSON key. 20 | def self.attribute_map 21 | { 22 | :'asset_group_works' => :'assetGroupWorks' 23 | } 24 | end 25 | 26 | # Attribute type mapping. 27 | def self.swagger_types 28 | { 29 | :'asset_group_works' => :'Array' 30 | } 31 | end 32 | 33 | # Initializes the object 34 | # @param [Hash] attributes Model attributes in the form of hash 35 | def initialize(attributes = {}) 36 | return unless attributes.is_a?(Hash) 37 | 38 | # convert string to symbol for hash key 39 | attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } 40 | 41 | if attributes.has_key?(:'assetGroupWorks') 42 | if (value = attributes[:'assetGroupWorks']).is_a?(Array) 43 | self.asset_group_works = value 44 | end 45 | end 46 | end 47 | 48 | # Show invalid properties with the reasons. Usually used together with valid? 49 | # @return Array for valid properties with the reasons 50 | def list_invalid_properties 51 | invalid_properties = Array.new 52 | invalid_properties 53 | end 54 | 55 | # Check to see if the all the properties in the model are valid 56 | # @return true if the model is valid 57 | def valid? 58 | true 59 | end 60 | 61 | # Checks equality by comparing each attribute. 62 | # @param [Object] Object to be compared 63 | def ==(o) 64 | return true if self.equal?(o) 65 | self.class == o.class && 66 | asset_group_works == o.asset_group_works 67 | end 68 | 69 | # @see the `==` method 70 | # @param [Object] Object to be compared 71 | def eql?(o) 72 | self == o 73 | end 74 | 75 | # Calculates hash code according to all attributes. 76 | # @return [Fixnum] Hash code 77 | def hash 78 | [asset_group_works].hash 79 | end 80 | 81 | # Builds the object from hash 82 | # @param [Hash] attributes Model attributes in the form of hash 83 | # @return [Object] Returns the model itself 84 | def build_from_hash(attributes) 85 | return nil unless attributes.is_a?(Hash) 86 | self.class.swagger_types.each_pair do |key, type| 87 | if type =~ /\AArray<(.*)>/i 88 | # check to ensure the input is an array given that the attribute 89 | # is documented as an array but the input is not 90 | if attributes[self.class.attribute_map[key]].is_a?(Array) 91 | self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) 92 | end 93 | elsif !attributes[self.class.attribute_map[key]].nil? 94 | self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) 95 | end # or else data not found in attributes(hash), not an issue as the data can be optional 96 | end 97 | 98 | self 99 | end 100 | 101 | # Deserializes the data based on type 102 | # @param string type Data type 103 | # @param string value Value to be deserialized 104 | # @return [Object] Deserialized data 105 | def _deserialize(type, value) 106 | case type.to_sym 107 | when :DateTime 108 | DateTime.parse(value) 109 | when :Date 110 | Date.parse(value) 111 | when :String 112 | value.to_s 113 | when :Integer 114 | value.to_i 115 | when :Float 116 | value.to_f 117 | when :BOOLEAN 118 | if value.to_s =~ /\A(true|t|yes|y|1)\z/i 119 | true 120 | else 121 | false 122 | end 123 | when :Object 124 | # generic object (usually a Hash), return directly 125 | value 126 | when /\AArray<(?.+)>\z/ 127 | inner_type = Regexp.last_match[:inner_type] 128 | value.map { |v| _deserialize(inner_type, v) } 129 | when /\AHash<(?.+?), (?.+)>\z/ 130 | k_type = Regexp.last_match[:k_type] 131 | v_type = Regexp.last_match[:v_type] 132 | {}.tap do |hash| 133 | value.each do |k, v| 134 | hash[_deserialize(k_type, k)] = _deserialize(v_type, v) 135 | end 136 | end 137 | else # model 138 | temp_model = DocuSign_Admin.const_get(type).new 139 | temp_model.build_from_hash(value) 140 | end 141 | end 142 | 143 | # Returns the string representation of the object 144 | # @return [String] String presentation of the object 145 | def to_s 146 | to_hash.to_s 147 | end 148 | 149 | # to_body is an alias to to_hash (backward compatibility) 150 | # @return [Hash] Returns the object in the form of hash 151 | def to_body 152 | to_hash 153 | end 154 | 155 | # Returns the object in the form of hash 156 | # @return [Hash] Returns the object in the form of hash 157 | def to_hash 158 | hash = {} 159 | self.class.attribute_map.each_pair do |attr, param| 160 | value = self.send(attr) 161 | next if value.nil? 162 | hash[param] = _to_hash(value) 163 | end 164 | hash 165 | end 166 | 167 | # Outputs non-array value in the form of hash 168 | # For object, use to_hash. Otherwise, just return the value 169 | # @param [Object] value Any valid value 170 | # @return [Hash] Returns the value in the form of hash 171 | def _to_hash(value) 172 | if value.is_a?(Array) 173 | value.compact.map { |v| _to_hash(v) } 174 | elsif value.is_a?(Hash) 175 | {}.tap do |hash| 176 | value.each { |k, v| hash[k] = _to_hash(v) } 177 | end 178 | elsif value.respond_to? :to_hash 179 | value.to_hash 180 | else 181 | value 182 | end 183 | end 184 | 185 | end 186 | end 187 | -------------------------------------------------------------------------------- /lib/docusign_admin/models/organization_account_request.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | require 'date' 13 | 14 | module DocuSign_Admin 15 | class OrganizationAccountRequest 16 | attr_accessor :account_id 17 | 18 | # Attribute mapping from ruby-style variable name to JSON key. 19 | def self.attribute_map 20 | { 21 | :'account_id' => :'account_id' 22 | } 23 | end 24 | 25 | # Attribute type mapping. 26 | def self.swagger_types 27 | { 28 | :'account_id' => :'String' 29 | } 30 | end 31 | 32 | # Initializes the object 33 | # @param [Hash] attributes Model attributes in the form of hash 34 | def initialize(attributes = {}) 35 | return unless attributes.is_a?(Hash) 36 | 37 | # convert string to symbol for hash key 38 | attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } 39 | 40 | if attributes.has_key?(:'account_id') 41 | self.account_id = attributes[:'account_id'] 42 | end 43 | end 44 | 45 | # Show invalid properties with the reasons. Usually used together with valid? 46 | # @return Array for valid properties with the reasons 47 | def list_invalid_properties 48 | invalid_properties = Array.new 49 | if @account_id.nil? 50 | invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') 51 | end 52 | 53 | invalid_properties 54 | end 55 | 56 | # Check to see if the all the properties in the model are valid 57 | # @return true if the model is valid 58 | def valid? 59 | return false if @account_id.nil? 60 | true 61 | end 62 | 63 | # Checks equality by comparing each attribute. 64 | # @param [Object] Object to be compared 65 | def ==(o) 66 | return true if self.equal?(o) 67 | self.class == o.class && 68 | account_id == o.account_id 69 | end 70 | 71 | # @see the `==` method 72 | # @param [Object] Object to be compared 73 | def eql?(o) 74 | self == o 75 | end 76 | 77 | # Calculates hash code according to all attributes. 78 | # @return [Fixnum] Hash code 79 | def hash 80 | [account_id].hash 81 | end 82 | 83 | # Builds the object from hash 84 | # @param [Hash] attributes Model attributes in the form of hash 85 | # @return [Object] Returns the model itself 86 | def build_from_hash(attributes) 87 | return nil unless attributes.is_a?(Hash) 88 | self.class.swagger_types.each_pair do |key, type| 89 | if type =~ /\AArray<(.*)>/i 90 | # check to ensure the input is an array given that the attribute 91 | # is documented as an array but the input is not 92 | if attributes[self.class.attribute_map[key]].is_a?(Array) 93 | self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) 94 | end 95 | elsif !attributes[self.class.attribute_map[key]].nil? 96 | self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) 97 | end # or else data not found in attributes(hash), not an issue as the data can be optional 98 | end 99 | 100 | self 101 | end 102 | 103 | # Deserializes the data based on type 104 | # @param string type Data type 105 | # @param string value Value to be deserialized 106 | # @return [Object] Deserialized data 107 | def _deserialize(type, value) 108 | case type.to_sym 109 | when :DateTime 110 | DateTime.parse(value) 111 | when :Date 112 | Date.parse(value) 113 | when :String 114 | value.to_s 115 | when :Integer 116 | value.to_i 117 | when :Float 118 | value.to_f 119 | when :BOOLEAN 120 | if value.to_s =~ /\A(true|t|yes|y|1)\z/i 121 | true 122 | else 123 | false 124 | end 125 | when :Object 126 | # generic object (usually a Hash), return directly 127 | value 128 | when /\AArray<(?.+)>\z/ 129 | inner_type = Regexp.last_match[:inner_type] 130 | value.map { |v| _deserialize(inner_type, v) } 131 | when /\AHash<(?.+?), (?.+)>\z/ 132 | k_type = Regexp.last_match[:k_type] 133 | v_type = Regexp.last_match[:v_type] 134 | {}.tap do |hash| 135 | value.each do |k, v| 136 | hash[_deserialize(k_type, k)] = _deserialize(v_type, v) 137 | end 138 | end 139 | else # model 140 | temp_model = DocuSign_Admin.const_get(type).new 141 | temp_model.build_from_hash(value) 142 | end 143 | end 144 | 145 | # Returns the string representation of the object 146 | # @return [String] String presentation of the object 147 | def to_s 148 | to_hash.to_s 149 | end 150 | 151 | # to_body is an alias to to_hash (backward compatibility) 152 | # @return [Hash] Returns the object in the form of hash 153 | def to_body 154 | to_hash 155 | end 156 | 157 | # Returns the object in the form of hash 158 | # @return [Hash] Returns the object in the form of hash 159 | def to_hash 160 | hash = {} 161 | self.class.attribute_map.each_pair do |attr, param| 162 | value = self.send(attr) 163 | next if value.nil? 164 | hash[param] = _to_hash(value) 165 | end 166 | hash 167 | end 168 | 169 | # Outputs non-array value in the form of hash 170 | # For object, use to_hash. Otherwise, just return the value 171 | # @param [Object] value Any valid value 172 | # @return [Hash] Returns the value in the form of hash 173 | def _to_hash(value) 174 | if value.is_a?(Array) 175 | value.compact.map { |v| _to_hash(v) } 176 | elsif value.is_a?(Hash) 177 | {}.tap do |hash| 178 | value.each { |k, v| hash[k] = _to_hash(v) } 179 | end 180 | elsif value.respond_to? :to_hash 181 | value.to_hash 182 | else 183 | value 184 | end 185 | end 186 | 187 | end 188 | end 189 | -------------------------------------------------------------------------------- /lib/docusign_admin/models/sub_account_create_worker_response.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | require 'date' 13 | 14 | module DocuSign_Admin 15 | class SubAccountCreateWorkerResponse 16 | # The list of create acccount processes 17 | attr_accessor :asset_group_works 18 | 19 | # Attribute mapping from ruby-style variable name to JSON key. 20 | def self.attribute_map 21 | { 22 | :'asset_group_works' => :'assetGroupWorks' 23 | } 24 | end 25 | 26 | # Attribute type mapping. 27 | def self.swagger_types 28 | { 29 | :'asset_group_works' => :'Array' 30 | } 31 | end 32 | 33 | # Initializes the object 34 | # @param [Hash] attributes Model attributes in the form of hash 35 | def initialize(attributes = {}) 36 | return unless attributes.is_a?(Hash) 37 | 38 | # convert string to symbol for hash key 39 | attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } 40 | 41 | if attributes.has_key?(:'assetGroupWorks') 42 | if (value = attributes[:'assetGroupWorks']).is_a?(Array) 43 | self.asset_group_works = value 44 | end 45 | end 46 | end 47 | 48 | # Show invalid properties with the reasons. Usually used together with valid? 49 | # @return Array for valid properties with the reasons 50 | def list_invalid_properties 51 | invalid_properties = Array.new 52 | invalid_properties 53 | end 54 | 55 | # Check to see if the all the properties in the model are valid 56 | # @return true if the model is valid 57 | def valid? 58 | true 59 | end 60 | 61 | # Checks equality by comparing each attribute. 62 | # @param [Object] Object to be compared 63 | def ==(o) 64 | return true if self.equal?(o) 65 | self.class == o.class && 66 | asset_group_works == o.asset_group_works 67 | end 68 | 69 | # @see the `==` method 70 | # @param [Object] Object to be compared 71 | def eql?(o) 72 | self == o 73 | end 74 | 75 | # Calculates hash code according to all attributes. 76 | # @return [Fixnum] Hash code 77 | def hash 78 | [asset_group_works].hash 79 | end 80 | 81 | # Builds the object from hash 82 | # @param [Hash] attributes Model attributes in the form of hash 83 | # @return [Object] Returns the model itself 84 | def build_from_hash(attributes) 85 | return nil unless attributes.is_a?(Hash) 86 | self.class.swagger_types.each_pair do |key, type| 87 | if type =~ /\AArray<(.*)>/i 88 | # check to ensure the input is an array given that the attribute 89 | # is documented as an array but the input is not 90 | if attributes[self.class.attribute_map[key]].is_a?(Array) 91 | self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) 92 | end 93 | elsif !attributes[self.class.attribute_map[key]].nil? 94 | self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) 95 | end # or else data not found in attributes(hash), not an issue as the data can be optional 96 | end 97 | 98 | self 99 | end 100 | 101 | # Deserializes the data based on type 102 | # @param string type Data type 103 | # @param string value Value to be deserialized 104 | # @return [Object] Deserialized data 105 | def _deserialize(type, value) 106 | case type.to_sym 107 | when :DateTime 108 | DateTime.parse(value) 109 | when :Date 110 | Date.parse(value) 111 | when :String 112 | value.to_s 113 | when :Integer 114 | value.to_i 115 | when :Float 116 | value.to_f 117 | when :BOOLEAN 118 | if value.to_s =~ /\A(true|t|yes|y|1)\z/i 119 | true 120 | else 121 | false 122 | end 123 | when :Object 124 | # generic object (usually a Hash), return directly 125 | value 126 | when /\AArray<(?.+)>\z/ 127 | inner_type = Regexp.last_match[:inner_type] 128 | value.map { |v| _deserialize(inner_type, v) } 129 | when /\AHash<(?.+?), (?.+)>\z/ 130 | k_type = Regexp.last_match[:k_type] 131 | v_type = Regexp.last_match[:v_type] 132 | {}.tap do |hash| 133 | value.each do |k, v| 134 | hash[_deserialize(k_type, k)] = _deserialize(v_type, v) 135 | end 136 | end 137 | else # model 138 | temp_model = DocuSign_Admin.const_get(type).new 139 | temp_model.build_from_hash(value) 140 | end 141 | end 142 | 143 | # Returns the string representation of the object 144 | # @return [String] String presentation of the object 145 | def to_s 146 | to_hash.to_s 147 | end 148 | 149 | # to_body is an alias to to_hash (backward compatibility) 150 | # @return [Hash] Returns the object in the form of hash 151 | def to_body 152 | to_hash 153 | end 154 | 155 | # Returns the object in the form of hash 156 | # @return [Hash] Returns the object in the form of hash 157 | def to_hash 158 | hash = {} 159 | self.class.attribute_map.each_pair do |attr, param| 160 | value = self.send(attr) 161 | next if value.nil? 162 | hash[param] = _to_hash(value) 163 | end 164 | hash 165 | end 166 | 167 | # Outputs non-array value in the form of hash 168 | # For object, use to_hash. Otherwise, just return the value 169 | # @param [Object] value Any valid value 170 | # @return [Hash] Returns the value in the form of hash 171 | def _to_hash(value) 172 | if value.is_a?(Array) 173 | value.compact.map { |v| _to_hash(v) } 174 | elsif value.is_a?(Hash) 175 | {}.tap do |hash| 176 | value.each { |k, v| hash[k] = _to_hash(v) } 177 | end 178 | elsif value.respond_to? :to_hash 179 | value.to_hash 180 | else 181 | value 182 | end 183 | end 184 | 185 | end 186 | end 187 | -------------------------------------------------------------------------------- /lib/docusign_admin/models/asset_group_accounts_response.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | require 'date' 13 | 14 | module DocuSign_Admin 15 | class AssetGroupAccountsResponse 16 | # The list of asset group accounts. 17 | attr_accessor :asset_group_accounts 18 | 19 | # Attribute mapping from ruby-style variable name to JSON key. 20 | def self.attribute_map 21 | { 22 | :'asset_group_accounts' => :'assetGroupAccounts' 23 | } 24 | end 25 | 26 | # Attribute type mapping. 27 | def self.swagger_types 28 | { 29 | :'asset_group_accounts' => :'Array' 30 | } 31 | end 32 | 33 | # Initializes the object 34 | # @param [Hash] attributes Model attributes in the form of hash 35 | def initialize(attributes = {}) 36 | return unless attributes.is_a?(Hash) 37 | 38 | # convert string to symbol for hash key 39 | attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } 40 | 41 | if attributes.has_key?(:'assetGroupAccounts') 42 | if (value = attributes[:'assetGroupAccounts']).is_a?(Array) 43 | self.asset_group_accounts = value 44 | end 45 | end 46 | end 47 | 48 | # Show invalid properties with the reasons. Usually used together with valid? 49 | # @return Array for valid properties with the reasons 50 | def list_invalid_properties 51 | invalid_properties = Array.new 52 | invalid_properties 53 | end 54 | 55 | # Check to see if the all the properties in the model are valid 56 | # @return true if the model is valid 57 | def valid? 58 | true 59 | end 60 | 61 | # Checks equality by comparing each attribute. 62 | # @param [Object] Object to be compared 63 | def ==(o) 64 | return true if self.equal?(o) 65 | self.class == o.class && 66 | asset_group_accounts == o.asset_group_accounts 67 | end 68 | 69 | # @see the `==` method 70 | # @param [Object] Object to be compared 71 | def eql?(o) 72 | self == o 73 | end 74 | 75 | # Calculates hash code according to all attributes. 76 | # @return [Fixnum] Hash code 77 | def hash 78 | [asset_group_accounts].hash 79 | end 80 | 81 | # Builds the object from hash 82 | # @param [Hash] attributes Model attributes in the form of hash 83 | # @return [Object] Returns the model itself 84 | def build_from_hash(attributes) 85 | return nil unless attributes.is_a?(Hash) 86 | self.class.swagger_types.each_pair do |key, type| 87 | if type =~ /\AArray<(.*)>/i 88 | # check to ensure the input is an array given that the attribute 89 | # is documented as an array but the input is not 90 | if attributes[self.class.attribute_map[key]].is_a?(Array) 91 | self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) 92 | end 93 | elsif !attributes[self.class.attribute_map[key]].nil? 94 | self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) 95 | end # or else data not found in attributes(hash), not an issue as the data can be optional 96 | end 97 | 98 | self 99 | end 100 | 101 | # Deserializes the data based on type 102 | # @param string type Data type 103 | # @param string value Value to be deserialized 104 | # @return [Object] Deserialized data 105 | def _deserialize(type, value) 106 | case type.to_sym 107 | when :DateTime 108 | DateTime.parse(value) 109 | when :Date 110 | Date.parse(value) 111 | when :String 112 | value.to_s 113 | when :Integer 114 | value.to_i 115 | when :Float 116 | value.to_f 117 | when :BOOLEAN 118 | if value.to_s =~ /\A(true|t|yes|y|1)\z/i 119 | true 120 | else 121 | false 122 | end 123 | when :Object 124 | # generic object (usually a Hash), return directly 125 | value 126 | when /\AArray<(?.+)>\z/ 127 | inner_type = Regexp.last_match[:inner_type] 128 | value.map { |v| _deserialize(inner_type, v) } 129 | when /\AHash<(?.+?), (?.+)>\z/ 130 | k_type = Regexp.last_match[:k_type] 131 | v_type = Regexp.last_match[:v_type] 132 | {}.tap do |hash| 133 | value.each do |k, v| 134 | hash[_deserialize(k_type, k)] = _deserialize(v_type, v) 135 | end 136 | end 137 | else # model 138 | temp_model = DocuSign_Admin.const_get(type).new 139 | temp_model.build_from_hash(value) 140 | end 141 | end 142 | 143 | # Returns the string representation of the object 144 | # @return [String] String presentation of the object 145 | def to_s 146 | to_hash.to_s 147 | end 148 | 149 | # to_body is an alias to to_hash (backward compatibility) 150 | # @return [Hash] Returns the object in the form of hash 151 | def to_body 152 | to_hash 153 | end 154 | 155 | # Returns the object in the form of hash 156 | # @return [Hash] Returns the object in the form of hash 157 | def to_hash 158 | hash = {} 159 | self.class.attribute_map.each_pair do |attr, param| 160 | value = self.send(attr) 161 | next if value.nil? 162 | hash[param] = _to_hash(value) 163 | end 164 | hash 165 | end 166 | 167 | # Outputs non-array value in the form of hash 168 | # For object, use to_hash. Otherwise, just return the value 169 | # @param [Object] value Any valid value 170 | # @return [Hash] Returns the value in the form of hash 171 | def _to_hash(value) 172 | if value.is_a?(Array) 173 | value.compact.map { |v| _to_hash(v) } 174 | elsif value.is_a?(Hash) 175 | {}.tap do |hash| 176 | value.each { |k, v| hash[k] = _to_hash(v) } 177 | end 178 | elsif value.respond_to? :to_hash 179 | value.to_hash 180 | else 181 | value 182 | end 183 | end 184 | 185 | end 186 | end 187 | -------------------------------------------------------------------------------- /lib/docusign_admin/models/ds_group_users_add_request.rb: -------------------------------------------------------------------------------- 1 | =begin 2 | #Docusign Admin API 3 | 4 | #An API for an organization administrator to manage organizations, accounts and users 5 | 6 | OpenAPI spec version: v2.1 7 | Contact: devcenter@docusign.com 8 | Generated by: https://github.com/swagger-api/swagger-codegen.git 9 | 10 | =end 11 | 12 | require 'date' 13 | 14 | module DocuSign_Admin 15 | class DSGroupUsersAddRequest 16 | attr_accessor :user_ids 17 | 18 | # Attribute mapping from ruby-style variable name to JSON key. 19 | def self.attribute_map 20 | { 21 | :'user_ids' => :'user_ids' 22 | } 23 | end 24 | 25 | # Attribute type mapping. 26 | def self.swagger_types 27 | { 28 | :'user_ids' => :'Array' 29 | } 30 | end 31 | 32 | # Initializes the object 33 | # @param [Hash] attributes Model attributes in the form of hash 34 | def initialize(attributes = {}) 35 | return unless attributes.is_a?(Hash) 36 | 37 | # convert string to symbol for hash key 38 | attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } 39 | 40 | if attributes.has_key?(:'user_ids') 41 | if (value = attributes[:'user_ids']).is_a?(Array) 42 | self.user_ids = value 43 | end 44 | end 45 | end 46 | 47 | # Show invalid properties with the reasons. Usually used together with valid? 48 | # @return Array for valid properties with the reasons 49 | def list_invalid_properties 50 | invalid_properties = Array.new 51 | if @user_ids.nil? 52 | invalid_properties.push('invalid value for "user_ids", user_ids cannot be nil.') 53 | end 54 | 55 | invalid_properties 56 | end 57 | 58 | # Check to see if the all the properties in the model are valid 59 | # @return true if the model is valid 60 | def valid? 61 | return false if @user_ids.nil? 62 | true 63 | end 64 | 65 | # Checks equality by comparing each attribute. 66 | # @param [Object] Object to be compared 67 | def ==(o) 68 | return true if self.equal?(o) 69 | self.class == o.class && 70 | user_ids == o.user_ids 71 | end 72 | 73 | # @see the `==` method 74 | # @param [Object] Object to be compared 75 | def eql?(o) 76 | self == o 77 | end 78 | 79 | # Calculates hash code according to all attributes. 80 | # @return [Fixnum] Hash code 81 | def hash 82 | [user_ids].hash 83 | end 84 | 85 | # Builds the object from hash 86 | # @param [Hash] attributes Model attributes in the form of hash 87 | # @return [Object] Returns the model itself 88 | def build_from_hash(attributes) 89 | return nil unless attributes.is_a?(Hash) 90 | self.class.swagger_types.each_pair do |key, type| 91 | if type =~ /\AArray<(.*)>/i 92 | # check to ensure the input is an array given that the attribute 93 | # is documented as an array but the input is not 94 | if attributes[self.class.attribute_map[key]].is_a?(Array) 95 | self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) 96 | end 97 | elsif !attributes[self.class.attribute_map[key]].nil? 98 | self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) 99 | end # or else data not found in attributes(hash), not an issue as the data can be optional 100 | end 101 | 102 | self 103 | end 104 | 105 | # Deserializes the data based on type 106 | # @param string type Data type 107 | # @param string value Value to be deserialized 108 | # @return [Object] Deserialized data 109 | def _deserialize(type, value) 110 | case type.to_sym 111 | when :DateTime 112 | DateTime.parse(value) 113 | when :Date 114 | Date.parse(value) 115 | when :String 116 | value.to_s 117 | when :Integer 118 | value.to_i 119 | when :Float 120 | value.to_f 121 | when :BOOLEAN 122 | if value.to_s =~ /\A(true|t|yes|y|1)\z/i 123 | true 124 | else 125 | false 126 | end 127 | when :Object 128 | # generic object (usually a Hash), return directly 129 | value 130 | when /\AArray<(?.+)>\z/ 131 | inner_type = Regexp.last_match[:inner_type] 132 | value.map { |v| _deserialize(inner_type, v) } 133 | when /\AHash<(?.+?), (?.+)>\z/ 134 | k_type = Regexp.last_match[:k_type] 135 | v_type = Regexp.last_match[:v_type] 136 | {}.tap do |hash| 137 | value.each do |k, v| 138 | hash[_deserialize(k_type, k)] = _deserialize(v_type, v) 139 | end 140 | end 141 | else # model 142 | temp_model = DocuSign_Admin.const_get(type).new 143 | temp_model.build_from_hash(value) 144 | end 145 | end 146 | 147 | # Returns the string representation of the object 148 | # @return [String] String presentation of the object 149 | def to_s 150 | to_hash.to_s 151 | end 152 | 153 | # to_body is an alias to to_hash (backward compatibility) 154 | # @return [Hash] Returns the object in the form of hash 155 | def to_body 156 | to_hash 157 | end 158 | 159 | # Returns the object in the form of hash 160 | # @return [Hash] Returns the object in the form of hash 161 | def to_hash 162 | hash = {} 163 | self.class.attribute_map.each_pair do |attr, param| 164 | value = self.send(attr) 165 | next if value.nil? 166 | hash[param] = _to_hash(value) 167 | end 168 | hash 169 | end 170 | 171 | # Outputs non-array value in the form of hash 172 | # For object, use to_hash. Otherwise, just return the value 173 | # @param [Object] value Any valid value 174 | # @return [Hash] Returns the value in the form of hash 175 | def _to_hash(value) 176 | if value.is_a?(Array) 177 | value.compact.map { |v| _to_hash(v) } 178 | elsif value.is_a?(Hash) 179 | {}.tap do |hash| 180 | value.each { |k, v| hash[k] = _to_hash(v) } 181 | end 182 | elsif value.respond_to? :to_hash 183 | value.to_hash 184 | else 185 | value 186 | end 187 | end 188 | 189 | end 190 | end 191 | --------------------------------------------------------------------------------