rokka_client_codegen 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/LICENSE +21 -0
  4. data/README.md +123 -0
  5. data/Rakefile +8 -0
  6. data/config.json +5 -0
  7. data/docs/AdminApi.md +398 -0
  8. data/docs/ListSourceImagesResponse.md +11 -0
  9. data/docs/ListStacksResponse.md +8 -0
  10. data/docs/Membership.md +11 -0
  11. data/docs/Organization.md +14 -0
  12. data/docs/OrganizationDefinition.md +10 -0
  13. data/docs/OrganizationOptions.md +10 -0
  14. data/docs/Role.md +8 -0
  15. data/docs/SourceImage.md +24 -0
  16. data/docs/SourceimagesApi.md +1032 -0
  17. data/docs/Stack.md +14 -0
  18. data/docs/StackDefinition.md +10 -0
  19. data/docs/StackExpression.md +9 -0
  20. data/docs/StackExpressionOverrides.md +8 -0
  21. data/docs/StackOperation.md +9 -0
  22. data/docs/StackOperationDescription.md +11 -0
  23. data/docs/StackOptions.md +8 -0
  24. data/docs/StacksApi.md +329 -0
  25. data/docs/User.md +11 -0
  26. data/docs/UserDefinition.md +9 -0
  27. data/examples/createstack.rb +33 -0
  28. data/examples/liststacks.rb +19 -0
  29. data/examples/setsubjectarea.rb +37 -0
  30. data/examples/uploadimage.rb +28 -0
  31. data/generate.sh +3 -0
  32. data/git_push.sh +55 -0
  33. data/lib/rokka_client_codegen.rb +59 -0
  34. data/lib/rokka_client_codegen/api/admin_api.rb +439 -0
  35. data/lib/rokka_client_codegen/api/sourceimages_api.rb +1225 -0
  36. data/lib/rokka_client_codegen/api/stacks_api.rb +371 -0
  37. data/lib/rokka_client_codegen/api_client.rb +389 -0
  38. data/lib/rokka_client_codegen/api_error.rb +38 -0
  39. data/lib/rokka_client_codegen/configuration.rb +209 -0
  40. data/lib/rokka_client_codegen/models/list_source_images_response.rb +217 -0
  41. data/lib/rokka_client_codegen/models/list_stacks_response.rb +190 -0
  42. data/lib/rokka_client_codegen/models/membership.rb +215 -0
  43. data/lib/rokka_client_codegen/models/organization.rb +264 -0
  44. data/lib/rokka_client_codegen/models/organization_definition.rb +211 -0
  45. data/lib/rokka_client_codegen/models/organization_options.rb +208 -0
  46. data/lib/rokka_client_codegen/models/role.rb +194 -0
  47. data/lib/rokka_client_codegen/models/source_image.rb +333 -0
  48. data/lib/rokka_client_codegen/models/stack.rb +246 -0
  49. data/lib/rokka_client_codegen/models/stack_definition.rb +217 -0
  50. data/lib/rokka_client_codegen/models/stack_expression.rb +207 -0
  51. data/lib/rokka_client_codegen/models/stack_expression_overrides.rb +188 -0
  52. data/lib/rokka_client_codegen/models/stack_operation.rb +203 -0
  53. data/lib/rokka_client_codegen/models/stack_operation_description.rb +231 -0
  54. data/lib/rokka_client_codegen/models/stack_options.rb +193 -0
  55. data/lib/rokka_client_codegen/models/user.rb +216 -0
  56. data/lib/rokka_client_codegen/models/user_definition.rb +204 -0
  57. data/lib/rokka_client_codegen/version.rb +15 -0
  58. data/patches/README.patch +59 -0
  59. data/patches/sourceimage_hash_long_hash.patch +62 -0
  60. data/rokka_client_codegen.gemspec +45 -0
  61. data/spec/api/admin_api_spec.rb +125 -0
  62. data/spec/api/sourceimages_api_spec.rb +274 -0
  63. data/spec/api/stacks_api_spec.rb +110 -0
  64. data/spec/api_client_spec.rb +226 -0
  65. data/spec/configuration_spec.rb +42 -0
  66. data/spec/models/list_source_images_response_spec.rb +60 -0
  67. data/spec/models/list_stacks_response_spec.rb +42 -0
  68. data/spec/models/membership_spec.rb +60 -0
  69. data/spec/models/organization_definition_spec.rb +54 -0
  70. data/spec/models/organization_options_spec.rb +54 -0
  71. data/spec/models/organization_spec.rb +78 -0
  72. data/spec/models/role_spec.rb +42 -0
  73. data/spec/models/source_image_spec.rb +138 -0
  74. data/spec/models/stack_definition_spec.rb +54 -0
  75. data/spec/models/stack_expression_overrides_spec.rb +42 -0
  76. data/spec/models/stack_expression_spec.rb +48 -0
  77. data/spec/models/stack_operation_description_spec.rb +60 -0
  78. data/spec/models/stack_operation_spec.rb +48 -0
  79. data/spec/models/stack_options_spec.rb +42 -0
  80. data/spec/models/stack_spec.rb +78 -0
  81. data/spec/models/user_definition_spec.rb +48 -0
  82. data/spec/models/user_spec.rb +60 -0
  83. data/spec/spec_helper.rb +111 -0
  84. metadata +330 -0
@@ -0,0 +1,19 @@
1
+ # Load the gem
2
+ require 'rokka_client_codegen'
3
+
4
+ # Setup authorization
5
+ RokkaClientCodegen.configure do |config|
6
+ # Configure API key authorization: ApiKeyAuth
7
+ config.api_key['api-key'] = 'YOUR_API_KEY'
8
+ end
9
+
10
+ organization = 'test'
11
+ api_instance = RokkaClientCodegen::StacksApi.new
12
+
13
+
14
+ begin
15
+ result = api_instance.list_stacks(organization)
16
+ p result
17
+ rescue RokkaClientCodegen::ApiError => e
18
+ puts "Exception when calling: #{e}"
19
+ end
@@ -0,0 +1,37 @@
1
+ # Load the gem
2
+ require 'rokka_client_codegen'
3
+
4
+ # Setup authorization
5
+ RokkaClientCodegen.configure do |config|
6
+ # Configure API key authorization: ApiKeyAuth
7
+ config.api_key['api-key'] = 'YOUR_API_KEY'
8
+ #config.debugging = true
9
+ end
10
+
11
+ organization = 'test'
12
+
13
+ api_instance = RokkaClientCodegen::SourceimagesApi.new
14
+
15
+ meta_dynamic_definition = {:width => 1, :height => 1, :x => 10, :y => 10} # Object | Dynamic Meta Data definition
16
+
17
+ hash = "cf5c133959e8ae77d9e5c50583c6c30dcf645109" # String |
18
+
19
+ meta_name = "subject_area" # String |
20
+
21
+ opts = {
22
+ delete_previous: false # BOOLEAN | If the image with the original hash should be deleted
23
+ }
24
+
25
+ begin
26
+ #Adds or updates a specific dynamic meta data for an image.
27
+ result = api_instance.create_source_image_meta_dynamic_with_name(meta_dynamic_definition, organization, hash, meta_name, opts)
28
+ p result
29
+ first_image = result
30
+ p "The new hash is " + first_image.long_hash
31
+ p "Dynamicmeta is " + (first_image.dynamic_metadata).to_s
32
+ p "Dynamicmeta subject_area is " + first_image.dynamic_metadata[:subject_area].to_s
33
+ p "Dynamicmeta subject_area.x is " + first_image.dynamic_metadata[:subject_area][:x].to_s
34
+ rescue RokkaClientCodegen::ApiError => e
35
+ puts "Exception when calling: #{e}"
36
+ p e.response_body
37
+ end
@@ -0,0 +1,28 @@
1
+ # Load the gem
2
+ require 'rokka_client_codegen'
3
+
4
+ # Setup authorization
5
+ RokkaClientCodegen.configure do |config|
6
+ # Configure API key authorization: ApiKeyAuth
7
+ config.api_key['api-key'] = 'YOUR_API_KEY'
8
+ #config.debugging = true
9
+ end
10
+
11
+ organization = 'test'
12
+ api_instance = RokkaClientCodegen::SourceimagesApi.new
13
+
14
+ begin
15
+ image = File.new("image.png") # File | The binary images
16
+ opts = {
17
+ meta_user: '{"foo":"bar"}' # String | User specific JSON metadata that can be used when searching source images. See https://rokka.io/documentation/references/user-metadata.html
18
+ }
19
+ result = api_instance.create_source_image(image, organization, opts);
20
+ p result
21
+ firstImage = result.items[0]
22
+ p "The hash is " + firstImage.long_hash
23
+ p "User metadata is " + (firstImage.user_metadata).to_s
24
+ p "User metadata for foo is " + firstImage.user_metadata[:foo]
25
+ rescue RokkaClientCodegen::ApiError => e
26
+ puts "Exception when calling: #{e}"
27
+ p e.response_body
28
+ end
data/generate.sh ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env bash
2
+ swagger-codegen generate -i https://api.rokka.io/doc.json -l ruby -o . -c config.json
3
+ for i in patches/*.patch; do patch -p1 < $i; done
data/git_push.sh ADDED
@@ -0,0 +1,55 @@
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
+
@@ -0,0 +1,59 @@
1
+ =begin
2
+ #rokka.io
3
+
4
+ #digital image processing done right. [Documentation](https://rokka.io/documentation). [Changelog](https://api.rokka.io/changelog.md).
5
+
6
+ OpenAPI spec version: 1.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.1
10
+
11
+ =end
12
+
13
+ # Common files
14
+ require 'rokka_client_codegen/api_client'
15
+ require 'rokka_client_codegen/api_error'
16
+ require 'rokka_client_codegen/version'
17
+ require 'rokka_client_codegen/configuration'
18
+
19
+ # Models
20
+ require 'rokka_client_codegen/models/list_source_images_response'
21
+ require 'rokka_client_codegen/models/list_stacks_response'
22
+ require 'rokka_client_codegen/models/membership'
23
+ require 'rokka_client_codegen/models/organization'
24
+ require 'rokka_client_codegen/models/organization_definition'
25
+ require 'rokka_client_codegen/models/organization_options'
26
+ require 'rokka_client_codegen/models/role'
27
+ require 'rokka_client_codegen/models/source_image'
28
+ require 'rokka_client_codegen/models/stack'
29
+ require 'rokka_client_codegen/models/stack_definition'
30
+ require 'rokka_client_codegen/models/stack_expression'
31
+ require 'rokka_client_codegen/models/stack_expression_overrides'
32
+ require 'rokka_client_codegen/models/stack_operation'
33
+ require 'rokka_client_codegen/models/stack_operation_description'
34
+ require 'rokka_client_codegen/models/stack_options'
35
+ require 'rokka_client_codegen/models/user'
36
+ require 'rokka_client_codegen/models/user_definition'
37
+
38
+ # APIs
39
+ require 'rokka_client_codegen/api/admin_api'
40
+ require 'rokka_client_codegen/api/sourceimages_api'
41
+ require 'rokka_client_codegen/api/stacks_api'
42
+
43
+ module RokkaClientCodegen
44
+ class << self
45
+ # Customize default settings for the SDK using block.
46
+ # RokkaClientCodegen.configure do |config|
47
+ # config.username = "xxx"
48
+ # config.password = "xxx"
49
+ # end
50
+ # If no block given, return the default Configuration object.
51
+ def configure
52
+ if block_given?
53
+ yield(Configuration.default)
54
+ else
55
+ Configuration.default
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,439 @@
1
+ =begin
2
+ #rokka.io
3
+
4
+ #digital image processing done right. [Documentation](https://rokka.io/documentation). [Changelog](https://api.rokka.io/changelog.md).
5
+
6
+ OpenAPI spec version: 1.0.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.1
10
+
11
+ =end
12
+
13
+ require "uri"
14
+
15
+ module RokkaClientCodegen
16
+ class AdminApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+
23
+ # Add a rokka user into an organization.
24
+ #
25
+ # @param role Role specification
26
+ # @param organization
27
+ # @param email
28
+ # @param [Hash] opts the optional parameters
29
+ # @return [Membership]
30
+ def create_membership(role, organization, email, opts = {})
31
+ data, _status_code, _headers = create_membership_with_http_info(role, organization, email, opts)
32
+ return data
33
+ end
34
+
35
+ # Add a rokka user into an organization.
36
+ #
37
+ # @param role Role specification
38
+ # @param organization
39
+ # @param email
40
+ # @param [Hash] opts the optional parameters
41
+ # @return [Array<(Membership, Fixnum, Hash)>] Membership data, response status code and response headers
42
+ def create_membership_with_http_info(role, organization, email, opts = {})
43
+ if @api_client.config.debugging
44
+ @api_client.config.logger.debug "Calling API: AdminApi.create_membership ..."
45
+ end
46
+ # verify the required parameter 'role' is set
47
+ if @api_client.config.client_side_validation && role.nil?
48
+ fail ArgumentError, "Missing the required parameter 'role' when calling AdminApi.create_membership"
49
+ end
50
+ # verify the required parameter 'organization' is set
51
+ if @api_client.config.client_side_validation && organization.nil?
52
+ fail ArgumentError, "Missing the required parameter 'organization' when calling AdminApi.create_membership"
53
+ end
54
+ if @api_client.config.client_side_validation && organization !~ Regexp.new(/[0-9a-z\\-]+/)
55
+ fail ArgumentError, "invalid value for 'organization' when calling AdminApi.create_membership, must conform to the pattern /[0-9a-z\\-]+/."
56
+ end
57
+
58
+ # verify the required parameter 'email' is set
59
+ if @api_client.config.client_side_validation && email.nil?
60
+ fail ArgumentError, "Missing the required parameter 'email' when calling AdminApi.create_membership"
61
+ end
62
+ # resource path
63
+ local_var_path = "/organizations/{organization}/memberships/{email}".sub('{' + 'organization' + '}', organization.to_s).sub('{' + 'email' + '}', email.to_s)
64
+
65
+ # query parameters
66
+ query_params = {}
67
+
68
+ # header parameters
69
+ header_params = {}
70
+
71
+ # form parameters
72
+ form_params = {}
73
+
74
+ # http body (model)
75
+ post_body = @api_client.object_to_http_body(role)
76
+ auth_names = ['ApiKeyAuth']
77
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
78
+ :header_params => header_params,
79
+ :query_params => query_params,
80
+ :form_params => form_params,
81
+ :body => post_body,
82
+ :auth_names => auth_names,
83
+ :return_type => 'Membership')
84
+ if @api_client.config.debugging
85
+ @api_client.config.logger.debug "API called: AdminApi#create_membership\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
86
+ end
87
+ return data, status_code, headers
88
+ end
89
+
90
+ # Register a new Organization.
91
+ #
92
+ # @param organization Name of the organization to create (must be a web safe string)
93
+ # @param organization_definition Organization information
94
+ # @param [Hash] opts the optional parameters
95
+ # @return [Organization]
96
+ def create_organization(organization, organization_definition, opts = {})
97
+ data, _status_code, _headers = create_organization_with_http_info(organization, organization_definition, opts)
98
+ return data
99
+ end
100
+
101
+ # Register a new Organization.
102
+ #
103
+ # @param organization Name of the organization to create (must be a web safe string)
104
+ # @param organization_definition Organization information
105
+ # @param [Hash] opts the optional parameters
106
+ # @return [Array<(Organization, Fixnum, Hash)>] Organization data, response status code and response headers
107
+ def create_organization_with_http_info(organization, organization_definition, opts = {})
108
+ if @api_client.config.debugging
109
+ @api_client.config.logger.debug "Calling API: AdminApi.create_organization ..."
110
+ end
111
+ # verify the required parameter 'organization' is set
112
+ if @api_client.config.client_side_validation && organization.nil?
113
+ fail ArgumentError, "Missing the required parameter 'organization' when calling AdminApi.create_organization"
114
+ end
115
+ if @api_client.config.client_side_validation && organization !~ Regexp.new(/[0-9a-z\\-]+/)
116
+ fail ArgumentError, "invalid value for 'organization' when calling AdminApi.create_organization, must conform to the pattern /[0-9a-z\\-]+/."
117
+ end
118
+
119
+ # verify the required parameter 'organization_definition' is set
120
+ if @api_client.config.client_side_validation && organization_definition.nil?
121
+ fail ArgumentError, "Missing the required parameter 'organization_definition' when calling AdminApi.create_organization"
122
+ end
123
+ # resource path
124
+ local_var_path = "/organizations/{organization}".sub('{' + 'organization' + '}', organization.to_s)
125
+
126
+ # query parameters
127
+ query_params = {}
128
+
129
+ # header parameters
130
+ header_params = {}
131
+
132
+ # form parameters
133
+ form_params = {}
134
+
135
+ # http body (model)
136
+ post_body = @api_client.object_to_http_body(organization_definition)
137
+ auth_names = ['ApiKeyAuth']
138
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
139
+ :header_params => header_params,
140
+ :query_params => query_params,
141
+ :form_params => form_params,
142
+ :body => post_body,
143
+ :auth_names => auth_names,
144
+ :return_type => 'Organization')
145
+ if @api_client.config.debugging
146
+ @api_client.config.logger.debug "API called: AdminApi#create_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
147
+ end
148
+ return data, status_code, headers
149
+ end
150
+
151
+ # Update options for an organization.
152
+ # This is currently used for the remote_* options. See https://rokka.io/documentation/references/stacks.html#loading-images-from-a-remote-url for details.
153
+ # @param organization Organization name
154
+ # @param organization_options Organization options
155
+ # @param [Hash] opts the optional parameters
156
+ # @return [Organization]
157
+ def create_organization_options(organization, organization_options, opts = {})
158
+ data, _status_code, _headers = create_organization_options_with_http_info(organization, organization_options, opts)
159
+ return data
160
+ end
161
+
162
+ # Update options for an organization.
163
+ # This is currently used for the remote_* options. See https://rokka.io/documentation/references/stacks.html#loading-images-from-a-remote-url for details.
164
+ # @param organization Organization name
165
+ # @param organization_options Organization options
166
+ # @param [Hash] opts the optional parameters
167
+ # @return [Array<(Organization, Fixnum, Hash)>] Organization data, response status code and response headers
168
+ def create_organization_options_with_http_info(organization, organization_options, opts = {})
169
+ if @api_client.config.debugging
170
+ @api_client.config.logger.debug "Calling API: AdminApi.create_organization_options ..."
171
+ end
172
+ # verify the required parameter 'organization' is set
173
+ if @api_client.config.client_side_validation && organization.nil?
174
+ fail ArgumentError, "Missing the required parameter 'organization' when calling AdminApi.create_organization_options"
175
+ end
176
+ if @api_client.config.client_side_validation && organization !~ Regexp.new(/[0-9a-z\\-]+/)
177
+ fail ArgumentError, "invalid value for 'organization' when calling AdminApi.create_organization_options, must conform to the pattern /[0-9a-z\\-]+/."
178
+ end
179
+
180
+ # verify the required parameter 'organization_options' is set
181
+ if @api_client.config.client_side_validation && organization_options.nil?
182
+ fail ArgumentError, "Missing the required parameter 'organization_options' when calling AdminApi.create_organization_options"
183
+ end
184
+ # resource path
185
+ local_var_path = "/organizations/{organization}/options".sub('{' + 'organization' + '}', organization.to_s)
186
+
187
+ # query parameters
188
+ query_params = {}
189
+
190
+ # header parameters
191
+ header_params = {}
192
+
193
+ # form parameters
194
+ form_params = {}
195
+
196
+ # http body (model)
197
+ post_body = @api_client.object_to_http_body(organization_options)
198
+ auth_names = ['ApiKeyAuth']
199
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
200
+ :header_params => header_params,
201
+ :query_params => query_params,
202
+ :form_params => form_params,
203
+ :body => post_body,
204
+ :auth_names => auth_names,
205
+ :return_type => 'Organization')
206
+ if @api_client.config.debugging
207
+ @api_client.config.logger.debug "API called: AdminApi#create_organization_options\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
208
+ end
209
+ return data, status_code, headers
210
+ end
211
+
212
+ # Register new user.
213
+ #
214
+ # @param user_definition User information
215
+ # @param [Hash] opts the optional parameters
216
+ # @return [User]
217
+ def create_user(user_definition, opts = {})
218
+ data, _status_code, _headers = create_user_with_http_info(user_definition, opts)
219
+ return data
220
+ end
221
+
222
+ # Register new user.
223
+ #
224
+ # @param user_definition User information
225
+ # @param [Hash] opts the optional parameters
226
+ # @return [Array<(User, Fixnum, Hash)>] User data, response status code and response headers
227
+ def create_user_with_http_info(user_definition, opts = {})
228
+ if @api_client.config.debugging
229
+ @api_client.config.logger.debug "Calling API: AdminApi.create_user ..."
230
+ end
231
+ # verify the required parameter 'user_definition' is set
232
+ if @api_client.config.client_side_validation && user_definition.nil?
233
+ fail ArgumentError, "Missing the required parameter 'user_definition' when calling AdminApi.create_user"
234
+ end
235
+ # resource path
236
+ local_var_path = "/users"
237
+
238
+ # query parameters
239
+ query_params = {}
240
+
241
+ # header parameters
242
+ header_params = {}
243
+
244
+ # form parameters
245
+ form_params = {}
246
+
247
+ # http body (model)
248
+ post_body = @api_client.object_to_http_body(user_definition)
249
+ auth_names = ['ApiKeyAuth']
250
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
251
+ :header_params => header_params,
252
+ :query_params => query_params,
253
+ :form_params => form_params,
254
+ :body => post_body,
255
+ :auth_names => auth_names,
256
+ :return_type => 'User')
257
+ if @api_client.config.debugging
258
+ @api_client.config.logger.debug "API called: AdminApi#create_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
259
+ end
260
+ return data, status_code, headers
261
+ end
262
+
263
+ # Remove a user from an organization.
264
+ #
265
+ # @param organization
266
+ # @param email
267
+ # @param [Hash] opts the optional parameters
268
+ # @return [nil]
269
+ def delete_membership(organization, email, opts = {})
270
+ delete_membership_with_http_info(organization, email, opts)
271
+ return nil
272
+ end
273
+
274
+ # Remove a user from an organization.
275
+ #
276
+ # @param organization
277
+ # @param email
278
+ # @param [Hash] opts the optional parameters
279
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
280
+ def delete_membership_with_http_info(organization, email, opts = {})
281
+ if @api_client.config.debugging
282
+ @api_client.config.logger.debug "Calling API: AdminApi.delete_membership ..."
283
+ end
284
+ # verify the required parameter 'organization' is set
285
+ if @api_client.config.client_side_validation && organization.nil?
286
+ fail ArgumentError, "Missing the required parameter 'organization' when calling AdminApi.delete_membership"
287
+ end
288
+ if @api_client.config.client_side_validation && organization !~ Regexp.new(/[0-9a-z\\-]+/)
289
+ fail ArgumentError, "invalid value for 'organization' when calling AdminApi.delete_membership, must conform to the pattern /[0-9a-z\\-]+/."
290
+ end
291
+
292
+ # verify the required parameter 'email' is set
293
+ if @api_client.config.client_side_validation && email.nil?
294
+ fail ArgumentError, "Missing the required parameter 'email' when calling AdminApi.delete_membership"
295
+ end
296
+ # resource path
297
+ local_var_path = "/organizations/{organization}/memberships/{email}".sub('{' + 'organization' + '}', organization.to_s).sub('{' + 'email' + '}', email.to_s)
298
+
299
+ # query parameters
300
+ query_params = {}
301
+
302
+ # header parameters
303
+ header_params = {}
304
+
305
+ # form parameters
306
+ form_params = {}
307
+
308
+ # http body (model)
309
+ post_body = nil
310
+ auth_names = ['ApiKeyAuth']
311
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
312
+ :header_params => header_params,
313
+ :query_params => query_params,
314
+ :form_params => form_params,
315
+ :body => post_body,
316
+ :auth_names => auth_names)
317
+ if @api_client.config.debugging
318
+ @api_client.config.logger.debug "API called: AdminApi#delete_membership\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
319
+ end
320
+ return data, status_code, headers
321
+ end
322
+
323
+ # Get information about organization membership of a rokka user.
324
+ #
325
+ # @param organization
326
+ # @param email
327
+ # @param [Hash] opts the optional parameters
328
+ # @return [Membership]
329
+ def get_membership(organization, email, opts = {})
330
+ data, _status_code, _headers = get_membership_with_http_info(organization, email, opts)
331
+ return data
332
+ end
333
+
334
+ # Get information about organization membership of a rokka user.
335
+ #
336
+ # @param organization
337
+ # @param email
338
+ # @param [Hash] opts the optional parameters
339
+ # @return [Array<(Membership, Fixnum, Hash)>] Membership data, response status code and response headers
340
+ def get_membership_with_http_info(organization, email, opts = {})
341
+ if @api_client.config.debugging
342
+ @api_client.config.logger.debug "Calling API: AdminApi.get_membership ..."
343
+ end
344
+ # verify the required parameter 'organization' is set
345
+ if @api_client.config.client_side_validation && organization.nil?
346
+ fail ArgumentError, "Missing the required parameter 'organization' when calling AdminApi.get_membership"
347
+ end
348
+ if @api_client.config.client_side_validation && organization !~ Regexp.new(/[0-9a-z\\-]+/)
349
+ fail ArgumentError, "invalid value for 'organization' when calling AdminApi.get_membership, must conform to the pattern /[0-9a-z\\-]+/."
350
+ end
351
+
352
+ # verify the required parameter 'email' is set
353
+ if @api_client.config.client_side_validation && email.nil?
354
+ fail ArgumentError, "Missing the required parameter 'email' when calling AdminApi.get_membership"
355
+ end
356
+ # resource path
357
+ local_var_path = "/organizations/{organization}/memberships/{email}".sub('{' + 'organization' + '}', organization.to_s).sub('{' + 'email' + '}', email.to_s)
358
+
359
+ # query parameters
360
+ query_params = {}
361
+
362
+ # header parameters
363
+ header_params = {}
364
+
365
+ # form parameters
366
+ form_params = {}
367
+
368
+ # http body (model)
369
+ post_body = nil
370
+ auth_names = ['ApiKeyAuth']
371
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
372
+ :header_params => header_params,
373
+ :query_params => query_params,
374
+ :form_params => form_params,
375
+ :body => post_body,
376
+ :auth_names => auth_names,
377
+ :return_type => 'Membership')
378
+ if @api_client.config.debugging
379
+ @api_client.config.logger.debug "API called: AdminApi#get_membership\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
380
+ end
381
+ return data, status_code, headers
382
+ end
383
+
384
+ # Get information about an organization.
385
+ #
386
+ # @param organization Organization name
387
+ # @param [Hash] opts the optional parameters
388
+ # @return [Organization]
389
+ def get_organization(organization, opts = {})
390
+ data, _status_code, _headers = get_organization_with_http_info(organization, opts)
391
+ return data
392
+ end
393
+
394
+ # Get information about an organization.
395
+ #
396
+ # @param organization Organization name
397
+ # @param [Hash] opts the optional parameters
398
+ # @return [Array<(Organization, Fixnum, Hash)>] Organization data, response status code and response headers
399
+ def get_organization_with_http_info(organization, opts = {})
400
+ if @api_client.config.debugging
401
+ @api_client.config.logger.debug "Calling API: AdminApi.get_organization ..."
402
+ end
403
+ # verify the required parameter 'organization' is set
404
+ if @api_client.config.client_side_validation && organization.nil?
405
+ fail ArgumentError, "Missing the required parameter 'organization' when calling AdminApi.get_organization"
406
+ end
407
+ if @api_client.config.client_side_validation && organization !~ Regexp.new(/[0-9a-z\\-]+/)
408
+ fail ArgumentError, "invalid value for 'organization' when calling AdminApi.get_organization, must conform to the pattern /[0-9a-z\\-]+/."
409
+ end
410
+
411
+ # resource path
412
+ local_var_path = "/organizations/{organization}".sub('{' + 'organization' + '}', organization.to_s)
413
+
414
+ # query parameters
415
+ query_params = {}
416
+
417
+ # header parameters
418
+ header_params = {}
419
+
420
+ # form parameters
421
+ form_params = {}
422
+
423
+ # http body (model)
424
+ post_body = nil
425
+ auth_names = ['ApiKeyAuth']
426
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
427
+ :header_params => header_params,
428
+ :query_params => query_params,
429
+ :form_params => form_params,
430
+ :body => post_body,
431
+ :auth_names => auth_names,
432
+ :return_type => 'Organization')
433
+ if @api_client.config.debugging
434
+ @api_client.config.logger.debug "API called: AdminApi#get_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
435
+ end
436
+ return data, status_code, headers
437
+ end
438
+ end
439
+ end