strongdm 1.0.0 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (190) hide show
  1. checksums.yaml +4 -4
  2. data/doc/LICENSE.html +45 -136
  3. data/doc/Object.html +623 -105
  4. data/doc/README_md.html +15 -7
  5. data/doc/SDM.html +16 -24
  6. data/doc/SDM/AKS.html +150 -52
  7. data/doc/SDM/AKSBasicAuth.html +130 -36
  8. data/doc/SDM/AKSServiceAccount.html +125 -32
  9. data/doc/SDM/AccountAttachment.html +77 -27
  10. data/doc/SDM/AccountAttachmentCreateOptions.html +62 -13
  11. data/doc/SDM/AccountAttachmentCreateResponse.html +75 -24
  12. data/doc/SDM/AccountAttachmentDeleteResponse.html +69 -19
  13. data/doc/SDM/AccountAttachmentGetResponse.html +75 -23
  14. data/doc/SDM/AccountAttachments.html +62 -61
  15. data/doc/SDM/AccountCreateResponse.html +80 -27
  16. data/doc/SDM/AccountDeleteResponse.html +69 -17
  17. data/doc/SDM/AccountGetResponse.html +74 -21
  18. data/doc/SDM/AccountGrant.html +89 -39
  19. data/doc/SDM/AccountGrantCreateResponse.html +75 -23
  20. data/doc/SDM/AccountGrantDeleteResponse.html +69 -18
  21. data/doc/SDM/AccountGrantGetResponse.html +75 -22
  22. data/doc/SDM/AccountGrants.html +63 -58
  23. data/doc/SDM/AccountUpdateResponse.html +74 -21
  24. data/doc/SDM/Accounts.html +74 -68
  25. data/doc/SDM/AlreadyExistsError.html +13 -10
  26. data/doc/SDM/AmazonEKS.html +163 -48
  27. data/doc/SDM/AmazonES.html +117 -40
  28. data/doc/SDM/Athena.html +117 -40
  29. data/doc/SDM/AuroraMysql.html +122 -44
  30. data/doc/SDM/AuroraPostgres.html +127 -48
  31. data/doc/SDM/AuthenticationError.html +13 -10
  32. data/doc/SDM/BadRequestError.html +13 -10
  33. data/doc/SDM/BigQuery.html +117 -40
  34. data/doc/SDM/Cassandra.html +122 -44
  35. data/doc/SDM/Citus.html +409 -0
  36. data/doc/SDM/Client.html +29 -48
  37. data/doc/SDM/Clustrix.html +122 -44
  38. data/doc/SDM/Cockroach.html +127 -48
  39. data/doc/SDM/CreateResponseMetadata.html +59 -9
  40. data/doc/SDM/DB2.html +391 -0
  41. data/doc/SDM/DeadlineExceededError.html +13 -10
  42. data/doc/SDM/DeleteResponseMetadata.html +60 -10
  43. data/doc/SDM/Druid.html +117 -40
  44. data/doc/SDM/DynamoDB.html +117 -40
  45. data/doc/SDM/Elastic.html +122 -44
  46. data/doc/SDM/ElasticacheRedis.html +117 -40
  47. data/doc/SDM/Gateway.html +108 -39
  48. data/doc/SDM/GetResponseMetadata.html +60 -10
  49. data/doc/SDM/GoogleGKE.html +135 -40
  50. data/doc/SDM/Greenplum.html +127 -48
  51. data/doc/SDM/HTTPAuth.html +122 -44
  52. data/doc/SDM/HTTPBasicAuth.html +127 -48
  53. data/doc/SDM/HTTPNoAuth.html +117 -40
  54. data/doc/SDM/InternalError.html +13 -10
  55. data/doc/SDM/Kubernetes.html +150 -52
  56. data/doc/SDM/KubernetesBasicAuth.html +130 -36
  57. data/doc/SDM/KubernetesServiceAccount.html +125 -32
  58. data/doc/SDM/Maria.html +122 -44
  59. data/doc/SDM/Memcached.html +107 -32
  60. data/doc/SDM/Memsql.html +122 -44
  61. data/doc/SDM/MongoHost.html +127 -48
  62. data/doc/SDM/MongoLegacyHost.html +132 -52
  63. data/doc/SDM/MongoLegacyReplicaset.html +137 -56
  64. data/doc/SDM/MongoReplicaSet.html +137 -56
  65. data/doc/SDM/Mysql.html +122 -44
  66. data/doc/SDM/NodeCreateResponse.html +80 -27
  67. data/doc/SDM/NodeDeleteResponse.html +69 -17
  68. data/doc/SDM/NodeGetResponse.html +74 -21
  69. data/doc/SDM/NodeUpdateResponse.html +74 -21
  70. data/doc/SDM/Nodes.html +75 -70
  71. data/doc/SDM/NotFoundError.html +13 -10
  72. data/doc/SDM/Oracle.html +127 -48
  73. data/doc/SDM/PermissionError.html +13 -10
  74. data/doc/SDM/Plumbing.html +4177 -3576
  75. data/doc/SDM/Postgres.html +127 -48
  76. data/doc/SDM/Presto.html +127 -48
  77. data/doc/SDM/RDP.html +117 -40
  78. data/doc/SDM/RPCError.html +12 -8
  79. data/doc/SDM/RateLimitError.html +13 -10
  80. data/doc/SDM/RateLimitMetadata.html +81 -29
  81. data/doc/SDM/Redis.html +112 -36
  82. data/doc/SDM/Redshift.html +127 -48
  83. data/doc/SDM/Relay.html +96 -27
  84. data/doc/SDM/ResourceCreateResponse.html +74 -21
  85. data/doc/SDM/ResourceDeleteResponse.html +69 -17
  86. data/doc/SDM/ResourceGetResponse.html +74 -21
  87. data/doc/SDM/ResourceUpdateResponse.html +74 -22
  88. data/doc/SDM/Resources.html +71 -63
  89. data/doc/SDM/Role.html +96 -27
  90. data/doc/SDM/RoleAttachment.html +77 -26
  91. data/doc/SDM/RoleAttachmentCreateResponse.html +75 -24
  92. data/doc/SDM/RoleAttachmentDeleteResponse.html +69 -19
  93. data/doc/SDM/RoleAttachmentGetResponse.html +75 -22
  94. data/doc/SDM/RoleAttachments.html +63 -60
  95. data/doc/SDM/RoleCreateResponse.html +75 -23
  96. data/doc/SDM/RoleDeleteResponse.html +69 -17
  97. data/doc/SDM/RoleGetResponse.html +75 -22
  98. data/doc/SDM/RoleGrant.html +77 -24
  99. data/doc/SDM/RoleGrantCreateResponse.html +75 -23
  100. data/doc/SDM/RoleGrantDeleteResponse.html +69 -18
  101. data/doc/SDM/RoleGrantGetResponse.html +75 -22
  102. data/doc/SDM/RoleGrants.html +63 -60
  103. data/doc/SDM/RoleUpdateResponse.html +75 -23
  104. data/doc/SDM/Roles.html +76 -74
  105. data/doc/SDM/SQLServer.html +132 -52
  106. data/doc/SDM/SSH.html +135 -40
  107. data/doc/SDM/SSHCert.html +373 -0
  108. data/doc/SDM/Service.html +95 -25
  109. data/doc/SDM/Snowflake.html +122 -44
  110. data/doc/SDM/Sybase.html +117 -40
  111. data/doc/SDM/SybaseIQ.html +117 -40
  112. data/doc/SDM/Teradata.html +117 -40
  113. data/doc/SDM/UpdateResponseMetadata.html +60 -10
  114. data/doc/SDM/User.html +104 -31
  115. data/doc/V1.html +35 -11
  116. data/doc/V1/AccountAttachments.html +10 -6
  117. data/doc/V1/AccountAttachments/Service.html +11 -8
  118. data/doc/V1/AccountGrants.html +10 -6
  119. data/doc/V1/AccountGrants/Service.html +11 -9
  120. data/doc/V1/Accounts.html +10 -6
  121. data/doc/V1/Accounts/Service.html +12 -10
  122. data/doc/V1/Nodes.html +10 -6
  123. data/doc/V1/Nodes/Service.html +13 -13
  124. data/doc/V1/Resources.html +10 -6
  125. data/doc/V1/Resources/Service.html +10 -6
  126. data/doc/V1/RoleAttachments.html +10 -6
  127. data/doc/V1/RoleAttachments/Service.html +11 -11
  128. data/doc/V1/RoleGrants.html +10 -6
  129. data/doc/V1/RoleGrants/Service.html +11 -11
  130. data/doc/V1/Roles.html +10 -6
  131. data/doc/V1/Roles/Service.html +11 -12
  132. data/doc/V1/Tags.html +113 -0
  133. data/doc/created.rid +45 -37
  134. data/doc/css/fonts.css +6 -6
  135. data/doc/css/rdoc.css +22 -1
  136. data/doc/examples/Gemfile.html +14 -4
  137. data/doc/examples/Gemfile_lock.html +14 -4
  138. data/doc/examples/README_md.html +14 -4
  139. data/doc/examples/okta-sync/Gemfile.html +105 -0
  140. data/doc/examples/okta-sync/Gemfile_lock.html +146 -0
  141. data/doc/index.html +23 -10
  142. data/doc/js/darkfish.js +23 -100
  143. data/doc/js/navigation.js +4 -41
  144. data/doc/js/navigation.js.gz +0 -0
  145. data/doc/js/search.js +32 -31
  146. data/doc/js/search_index.js +1 -1
  147. data/doc/js/search_index.js.gz +0 -0
  148. data/doc/js/searcher.js +7 -6
  149. data/doc/js/searcher.js.gz +0 -0
  150. data/doc/lib/version.html +16 -6
  151. data/doc/strongdm_gemspec.html +15 -5
  152. data/doc/table_of_contents.html +1587 -771
  153. data/examples/Gemfile +2 -2
  154. data/examples/ldap-sync/ldapSync.rb +290 -0
  155. data/examples/listUsers.rb +8 -8
  156. data/examples/okta-sync/Gemfile +4 -0
  157. data/examples/okta-sync/Gemfile.lock +38 -0
  158. data/examples/okta-sync/matchers.yml +11 -0
  159. data/examples/okta-sync/oktaSync.rb +173 -0
  160. data/examples/panicButton.rb +103 -119
  161. data/lib/errors/errors.rb +55 -53
  162. data/lib/grpc/account_attachments_pb.rb +9 -14
  163. data/lib/grpc/account_attachments_services_pb.rb +7 -8
  164. data/lib/grpc/account_grants_pb.rb +10 -10
  165. data/lib/grpc/account_grants_services_pb.rb +8 -9
  166. data/lib/grpc/accounts_pb.rb +12 -9
  167. data/lib/grpc/accounts_services_pb.rb +7 -8
  168. data/lib/grpc/drivers_pb.rb +104 -7
  169. data/lib/grpc/nodes_pb.rb +12 -9
  170. data/lib/grpc/nodes_services_pb.rb +7 -8
  171. data/lib/grpc/options_pb.rb +16 -5
  172. data/lib/grpc/plumbing.rb +4367 -4084
  173. data/lib/grpc/protoc-gen-swagger/options/annotations_pb.rb +4 -4
  174. data/lib/grpc/resources_pb.rb +9 -9
  175. data/lib/grpc/resources_services_pb.rb +7 -8
  176. data/lib/grpc/role_attachments_pb.rb +9 -9
  177. data/lib/grpc/role_attachments_services_pb.rb +7 -8
  178. data/lib/grpc/role_grants_pb.rb +9 -9
  179. data/lib/grpc/role_grants_services_pb.rb +7 -8
  180. data/lib/grpc/roles_pb.rb +11 -9
  181. data/lib/grpc/roles_services_pb.rb +7 -8
  182. data/lib/grpc/spec_pb.rb +7 -8
  183. data/lib/grpc/tags_pb.rb +36 -0
  184. data/lib/models/porcelain.rb +4966 -4017
  185. data/lib/strongdm.rb +94 -95
  186. data/lib/svc.rb +1200 -1224
  187. data/lib/version +16 -2
  188. data/lib/version.rb +6 -6
  189. data/strongdm.gemspec +10 -10
  190. metadata +27 -15
@@ -1,17 +1,17 @@
1
1
  # Copyright 2020 StrongDM Inc
2
- #
2
+ #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
5
5
  # You may obtain a copy of the License at
6
- #
6
+ #
7
7
  # http://www.apache.org/licenses/LICENSE-2.0
8
- #
8
+ #
9
9
  # Unless required by applicable law or agreed to in writing, software
10
10
  # distributed under the License is distributed on an "AS IS" BASIS,
11
11
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
- #
14
+ #
15
15
 
16
16
  # This file was generated by protogen. DO NOT EDIT.
17
17
 
@@ -25,104 +25,103 @@ DEFAULT_MAX_RETRY_DELAY = 300 # 300 seconds
25
25
 
26
26
  module SDM
27
27
 
28
- # Client bundles all the services together and initializes them.
29
- class Client
30
- # Creates a new strongDM API client.
31
- def initialize(api_access_key, api_secret_key, host:"api.strongdm.com:443", insecure:false)
32
- @api_access_key = api_access_key
33
- @api_secret_key = Base64.strict_decode64(api_secret_key)
34
- @max_retries = DEFAULT_MAX_RETRIES
35
- @base_retry_delay = DEFAULT_BASE_RETRY_DELAY
36
- @max_retry_delay = DEFAULT_MAX_RETRY_DELAY
37
- @account_attachments = AccountAttachments.new(host, insecure, self)
38
- @account_grants = AccountGrants.new(host, insecure, self)
39
- @accounts = Accounts.new(host, insecure, self)
40
- @nodes = Nodes.new(host, insecure, self)
41
- @resources = Resources.new(host, insecure, self)
42
- @role_attachments = RoleAttachments.new(host, insecure, self)
43
- @role_grants = RoleGrants.new(host, insecure, self)
44
- @roles = Roles.new(host, insecure, self)
45
- @_test_options = Hash.new
46
- end
47
-
48
- def get_metadata(method_name, req)
49
- return { 'x-sdm-authentication': @api_access_key,'x-sdm-signature': self.sign(method_name, req.to_proto)}
50
- end
51
-
52
- def sign(method_name, msg_bytes)
53
- current_utc_date = Time.now.utc
54
- date = sprintf("%04d-%02d-%02d",current_utc_date.year, current_utc_date.month, current_utc_date.day)
55
-
56
- signing_key = OpenSSL::HMAC.digest(OpenSSL::Digest::SHA256.new, @api_secret_key, date)
57
- signing_key = OpenSSL::HMAC.digest(OpenSSL::Digest::SHA256.new, signing_key, 'sdm_api_v1')
28
+ # Client bundles all the services together and initializes them.
29
+ class Client
30
+ # Creates a new strongDM API client.
31
+ def initialize(api_access_key, api_secret_key, host: "api.strongdm.com:443", insecure: false)
32
+ @api_access_key = api_access_key
33
+ @api_secret_key = Base64.strict_decode64(api_secret_key)
34
+ @max_retries = DEFAULT_MAX_RETRIES
35
+ @base_retry_delay = DEFAULT_BASE_RETRY_DELAY
36
+ @max_retry_delay = DEFAULT_MAX_RETRY_DELAY
37
+ @account_attachments = AccountAttachments.new(host, insecure, self)
38
+ @account_grants = AccountGrants.new(host, insecure, self)
39
+ @accounts = Accounts.new(host, insecure, self)
40
+ @nodes = Nodes.new(host, insecure, self)
41
+ @resources = Resources.new(host, insecure, self)
42
+ @role_attachments = RoleAttachments.new(host, insecure, self)
43
+ @role_grants = RoleGrants.new(host, insecure, self)
44
+ @roles = Roles.new(host, insecure, self)
45
+ @_test_options = Hash.new
46
+ end
58
47
 
59
- sha_req = Digest::SHA256.new
60
- sha_req << method_name
61
- sha_req << "\n"
62
- sha_req << msg_bytes
63
- request_hash = sha_req.digest
48
+ def get_metadata(method_name, req)
49
+ return { 'x-sdm-authentication': @api_access_key, 'x-sdm-signature': self.sign(method_name, req.to_proto) }
50
+ end
64
51
 
65
- return Base64.strict_encode64(OpenSSL::HMAC.digest(OpenSSL::Digest::SHA256.new, signing_key, request_hash))
66
- end
52
+ def sign(method_name, msg_bytes)
53
+ current_utc_date = Time.now.utc
54
+ date = sprintf("%04d-%02d-%02d", current_utc_date.year, current_utc_date.month, current_utc_date.day)
67
55
 
68
- def jitterSleep(iter)
69
- dur_max = @base_retry_delay * 2**iter
70
- if (dur_max > @max_retry_delay)
71
- dur_max = @max_retry_delay
72
- end
73
- dur = rand() * dur_max
74
- sleep(dur)
75
- end
56
+ signing_key = OpenSSL::HMAC.digest(OpenSSL::Digest::SHA256.new, @api_secret_key, date)
57
+ signing_key = OpenSSL::HMAC.digest(OpenSSL::Digest::SHA256.new, signing_key, "sdm_api_v1")
76
58
 
77
- def shouldRetry(iter, err)
78
- if (iter >= @max_retries-1)
79
- return false
80
- end
81
- if not err .is_a? GRPC::BadStatus
82
- return true
83
- end
84
- return err.code() == 13
85
- end
59
+ sha_req = Digest::SHA256.new
60
+ sha_req << method_name
61
+ sha_req << "\n"
62
+ sha_req << msg_bytes
63
+ request_hash = sha_req.digest
86
64
 
87
- attr_reader :max_retries
88
- attr_reader :base_retry_delay
89
- attr_reader :max_retry_delay
65
+ return Base64.strict_encode64(OpenSSL::HMAC.digest(OpenSSL::Digest::SHA256.new, signing_key, request_hash))
66
+ end
90
67
 
91
- # API authentication token (read-only).
92
- attr_reader :api_access_key
93
- # AccountAttachments assign an account to a role.
94
- attr_reader :account_attachments
95
- # AccountGrants connect a resource directly to an account, giving the account the permission to connect to that resource.
96
- attr_reader :account_grants
97
- # Accounts are users that have access to strongDM.
98
- # There are two types of accounts:
99
- # 1. **Regular users:** humans who are authenticated through username and password or SSO
100
- # 2. **Service users:** machines that are authneticated using a service token
101
- attr_reader :accounts
102
- # Nodes make up the strongDM network, and allow your users to connect securely to your resources.
103
- # There are two types of nodes:
104
- # 1. **Relay:** creates connectivity to your datasources, while maintaining the egress-only nature of your firewall
105
- # 1. **Gateways:** a relay that also listens for connections from strongDM clients
106
- attr_reader :nodes
68
+ def jitterSleep(iter)
69
+ dur_max = @base_retry_delay * 2 ** iter
70
+ if (dur_max > @max_retry_delay)
71
+ dur_max = @max_retry_delay
72
+ end
73
+ dur = rand() * dur_max
74
+ sleep(dur)
75
+ end
107
76
 
108
- attr_reader :resources
109
- # RoleAttachments represent relationships between composite roles and the roles
110
- # that make up those composite roles. When a composite role is attached to another
111
- # role, the permissions granted to members of the composite role are augmented to
112
- # include the permissions granted to members of the attached role.
113
- attr_reader :role_attachments
114
- # RoleGrants represent relationships between composite roles and the roles
115
- # that make up those composite roles. When a composite role is attached to another
116
- # role, the permissions granted to members of the composite role are augmented to
117
- # include the permissions granted to members of the attached role.
118
- attr_reader :role_grants
119
- # Roles are tools for controlling user access to resources. Each Role holds a
120
- # list of resources which they grant access to. Composite roles are a special
121
- # type of Role which have no resource associations of their own, but instead
122
- # grant access to the combined resources associated with a set of child roles.
123
- # Each user can be a member of one Role or composite role.
124
- attr_reader :roles
125
- attr_reader :_test_options
77
+ def shouldRetry(iter, err)
78
+ if (iter >= @max_retries - 1)
79
+ return false
80
+ end
81
+ if not err.is_a? GRPC::BadStatus
82
+ return true
83
+ end
84
+ return err.code() == 13
126
85
  end
127
86
 
87
+ attr_reader :max_retries
88
+ attr_reader :base_retry_delay
89
+ attr_reader :max_retry_delay
90
+
91
+ # API authentication token (read-only).
92
+ attr_reader :api_access_key
93
+ # AccountAttachments assign an account to a role.
94
+ attr_reader :account_attachments
95
+ # AccountGrants assign a resource directly to an account, giving the account the permission to connect to that resource.
96
+ attr_reader :account_grants
97
+ # Accounts are users that have access to strongDM.
98
+ # There are two types of accounts:
99
+ # 1. **Regular users:** humans who are authenticated through username and password or SSO
100
+ # 2. **Service users:** machines that are authneticated using a service token
101
+ attr_reader :accounts
102
+ # Nodes make up the strongDM network, and allow your users to connect securely to your resources.
103
+ # There are two types of nodes:
104
+ # 1. **Relay:** creates connectivity to your datasources, while maintaining the egress-only nature of your firewall
105
+ # 1. **Gateways:** a relay that also listens for connections from strongDM clients
106
+ attr_reader :nodes
107
+
108
+ attr_reader :resources
109
+ # RoleAttachments represent relationships between composite roles and the roles
110
+ # that make up those composite roles. When a composite role is attached to another
111
+ # role, the permissions granted to members of the composite role are augmented to
112
+ # include the permissions granted to members of the attached role.
113
+ attr_reader :role_attachments
114
+ # RoleGrants represent relationships between composite roles and the roles
115
+ # that make up those composite roles. When a composite role is attached to another
116
+ # role, the permissions granted to members of the composite role are augmented to
117
+ # include the permissions granted to members of the attached role.
118
+ attr_reader :role_grants
119
+ # Roles are tools for controlling user access to resources. Each Role holds a
120
+ # list of resources which they grant access to. Composite roles are a special
121
+ # type of Role which have no resource associations of their own, but instead
122
+ # grant access to the combined resources associated with a set of child roles.
123
+ # Each user can be a member of one Role or composite role.
124
+ attr_reader :roles
125
+ attr_reader :_test_options
126
+ end
128
127
  end
data/lib/svc.rb CHANGED
@@ -1,1331 +1,1307 @@
1
1
  # Copyright 2020 StrongDM Inc
2
- #
2
+ #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
5
5
  # You may obtain a copy of the License at
6
- #
6
+ #
7
7
  # http://www.apache.org/licenses/LICENSE-2.0
8
- #
8
+ #
9
9
  # Unless required by applicable law or agreed to in writing, software
10
10
  # distributed under the License is distributed on an "AS IS" BASIS,
11
11
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
- #
14
+ #
15
15
 
16
16
  # This file was generated by protogen. DO NOT EDIT.
17
17
 
18
18
  this_dir = File.expand_path(File.dirname(__FILE__))
19
- lib_dir = File.join(this_dir, 'grpc')
19
+ lib_dir = File.join(this_dir, "grpc")
20
20
  $LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
21
- require 'grpc'
22
- require 'enumerator'
23
- Dir[File.join(__dir__, 'grpc', '*.rb')].each {|file| require file }
24
- Dir[File.join(__dir__, 'models', '*.rb')].each {|file| require file }
21
+ require "grpc"
22
+ require "enumerator"
23
+ Dir[File.join(__dir__, "grpc", "*.rb")].each { |file| require file }
24
+ Dir[File.join(__dir__, "models", "*.rb")].each { |file| require file }
25
25
 
26
26
  module SDM
27
- # AccountAttachments assign an account to a role.
28
- class AccountAttachments
29
- def initialize(host, insecure, parent)
30
- begin
31
- if insecure
32
- @stub = V1::AccountAttachments::Stub.new(host, :this_channel_is_insecure)
33
- else
34
- cred = GRPC::Core::ChannelCredentials.new()
35
- @stub = V1::AccountAttachments::Stub.new(host, cred)
36
- end
37
- rescue => exception
38
- raise Plumbing::error_to_porcelain(exception)
39
- end
40
- @parent = parent
27
+ # AccountAttachments assign an account to a role.
28
+ class AccountAttachments
29
+ def initialize(host, insecure, parent)
30
+ begin
31
+ if insecure
32
+ @stub = V1::AccountAttachments::Stub.new(host, :this_channel_is_insecure)
33
+ else
34
+ cred = GRPC::Core::ChannelCredentials.new()
35
+ @stub = V1::AccountAttachments::Stub.new(host, cred)
41
36
  end
42
- # Create registers a new AccountAttachment.
43
- def create(
44
- account_attachment \
45
- ,
46
- options:nil,
47
- deadline:nil)
48
- req = V1::AccountAttachmentCreateRequest.new()
49
-
50
- req.account_attachment = Plumbing::account_attachment_to_plumbing(account_attachment)
51
- req.options = Plumbing::account_attachment_create_options_to_plumbing(options)
52
- tries = 0
53
- plumbing_response = nil
54
- loop do
55
- begin
56
- plumbing_response = @stub.create(req, metadata: @parent.get_metadata('AccountAttachments.Create', req), deadline:deadline)
57
- rescue => exception
58
- if (@parent.shouldRetry(tries, exception))
59
- tries++
60
- @parent.jitterSleep(tries)
61
- next
62
- end
63
- raise Plumbing::error_to_porcelain(exception)
64
- end
65
- break
66
- end
37
+ rescue => exception
38
+ raise Plumbing::convert_error_to_porcelain(exception)
39
+ end
40
+ @parent = parent
41
+ end
67
42
 
68
-
69
- resp = AccountAttachmentCreateResponse.new()
70
- resp.meta = Plumbing::create_response_metadata_to_porcelain(plumbing_response.meta)
71
- resp.account_attachment = Plumbing::account_attachment_to_porcelain(plumbing_response.account_attachment)
72
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
73
- resp
43
+ # Create registers a new AccountAttachment.
44
+ def create(
45
+ account_attachment,
46
+ deadline: nil
47
+ )
48
+ req = V1::AccountAttachmentCreateRequest.new()
49
+
50
+ req.account_attachment = Plumbing::convert_account_attachment_to_plumbing(account_attachment)
51
+ tries = 0
52
+ plumbing_response = nil
53
+ loop do
54
+ begin
55
+ plumbing_response = @stub.create(req, metadata: @parent.get_metadata("AccountAttachments.Create", req), deadline: deadline)
56
+ rescue => exception
57
+ if (@parent.shouldRetry(tries, exception))
58
+ tries + +@parent.jitterSleep(tries)
59
+ next
60
+ end
61
+ raise Plumbing::convert_error_to_porcelain(exception)
74
62
  end
75
- # Get reads one AccountAttachment by ID.
76
- def get(
77
- id \
78
- ,
79
- deadline:nil)
80
- req = V1::AccountAttachmentGetRequest.new()
81
-
82
- req.id = id
83
- tries = 0
84
- plumbing_response = nil
85
- loop do
86
- begin
87
- plumbing_response = @stub.get(req, metadata: @parent.get_metadata('AccountAttachments.Get', req), deadline:deadline)
88
- rescue => exception
89
- if (@parent.shouldRetry(tries, exception))
90
- tries++
91
- @parent.jitterSleep(tries)
92
- next
93
- end
94
- raise Plumbing::error_to_porcelain(exception)
95
- end
96
- break
97
- end
63
+ break
64
+ end
98
65
 
99
-
100
- resp = AccountAttachmentGetResponse.new()
101
- resp.meta = Plumbing::get_response_metadata_to_porcelain(plumbing_response.meta)
102
- resp.account_attachment = Plumbing::account_attachment_to_porcelain(plumbing_response.account_attachment)
103
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
104
- resp
66
+ resp = AccountAttachmentCreateResponse.new()
67
+ resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
68
+ resp.account_attachment = Plumbing::convert_account_attachment_to_porcelain(plumbing_response.account_attachment)
69
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
70
+ resp
71
+ end
72
+
73
+ # Get reads one AccountAttachment by ID.
74
+ def get(
75
+ id,
76
+ deadline: nil
77
+ )
78
+ req = V1::AccountAttachmentGetRequest.new()
79
+
80
+ req.id = (id)
81
+ tries = 0
82
+ plumbing_response = nil
83
+ loop do
84
+ begin
85
+ plumbing_response = @stub.get(req, metadata: @parent.get_metadata("AccountAttachments.Get", req), deadline: deadline)
86
+ rescue => exception
87
+ if (@parent.shouldRetry(tries, exception))
88
+ tries + +@parent.jitterSleep(tries)
89
+ next
90
+ end
91
+ raise Plumbing::convert_error_to_porcelain(exception)
105
92
  end
106
- # Delete removes a AccountAttachment by ID.
107
- def delete(
108
- id \
109
- ,
110
- deadline:nil)
111
- req = V1::AccountAttachmentDeleteRequest.new()
112
-
113
- req.id = id
114
- tries = 0
115
- plumbing_response = nil
116
- loop do
117
- begin
118
- plumbing_response = @stub.delete(req, metadata: @parent.get_metadata('AccountAttachments.Delete', req), deadline:deadline)
119
- rescue => exception
120
- if (@parent.shouldRetry(tries, exception))
121
- tries++
122
- @parent.jitterSleep(tries)
123
- next
124
- end
125
- raise Plumbing::error_to_porcelain(exception)
126
- end
127
- break
128
- end
93
+ break
94
+ end
129
95
 
130
-
131
- resp = AccountAttachmentDeleteResponse.new()
132
- resp.meta = Plumbing::delete_response_metadata_to_porcelain(plumbing_response.meta)
133
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
134
- resp
96
+ resp = AccountAttachmentGetResponse.new()
97
+ resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
98
+ resp.account_attachment = Plumbing::convert_account_attachment_to_porcelain(plumbing_response.account_attachment)
99
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
100
+ resp
101
+ end
102
+
103
+ # Delete removes a AccountAttachment by ID.
104
+ def delete(
105
+ id,
106
+ deadline: nil
107
+ )
108
+ req = V1::AccountAttachmentDeleteRequest.new()
109
+
110
+ req.id = (id)
111
+ tries = 0
112
+ plumbing_response = nil
113
+ loop do
114
+ begin
115
+ plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("AccountAttachments.Delete", req), deadline: deadline)
116
+ rescue => exception
117
+ if (@parent.shouldRetry(tries, exception))
118
+ tries + +@parent.jitterSleep(tries)
119
+ next
120
+ end
121
+ raise Plumbing::convert_error_to_porcelain(exception)
135
122
  end
136
- # List gets a list of AccountAttachments matching a given set of criteria.
137
- def list(
138
- filter \
139
- ,
140
- *args,
141
- deadline:nil)
142
- req = V1::AccountAttachmentListRequest.new()
143
- req.meta = V1::ListRequestMetadata.new()
144
- page_size_option = @parent._test_options['PageSize']
145
- if page_size_option.is_a? Integer
146
- req.meta.limit = page_size_option
123
+ break
124
+ end
125
+
126
+ resp = AccountAttachmentDeleteResponse.new()
127
+ resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
128
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
129
+ resp
130
+ end
131
+
132
+ # List gets a list of AccountAttachments matching a given set of criteria.
133
+ def list(
134
+ filter,
135
+ *args,
136
+ deadline: nil
137
+ )
138
+ req = V1::AccountAttachmentListRequest.new()
139
+ req.meta = V1::ListRequestMetadata.new()
140
+ page_size_option = @parent._test_options["PageSize"]
141
+ if page_size_option.is_a? Integer
142
+ req.meta.limit = page_size_option
143
+ end
144
+
145
+ req.filter = Plumbing::quote_filter_args(filter, *args)
146
+ resp = Enumerator::Generator.new { |g|
147
+ tries = 0
148
+ loop do
149
+ begin
150
+ plumbing_response = @stub.list(req, metadata: @parent.get_metadata("AccountAttachments.List", req), deadline: deadline)
151
+ rescue => exception
152
+ if (@parent.shouldRetry(tries, exception))
153
+ tries + +@parent.jitterSleep(tries)
154
+ next
147
155
  end
148
-
149
- req.filter = Plumbing::quote_filter_args(filter, *args)
150
- resp = Enumerator::Generator.new { |g|
151
- tries = 0
152
- loop do
153
- begin
154
- plumbing_response = @stub.list(req, metadata: @parent.get_metadata('AccountAttachments.List', req), deadline:deadline)
155
- rescue => exception
156
- if (@parent.shouldRetry(tries, exception))
157
- tries++
158
- @parent.jitterSleep(tries)
159
- next
160
- end
161
- raise Plumbing::error_to_porcelain(exception)
162
- end
163
- tries = 0
164
- plumbing_response.account_attachments.each do |plumbing_item|
165
- g.yield Plumbing::account_attachment_to_porcelain(plumbing_item)
166
- end
167
- break if plumbing_response.meta.next_cursor == ""
168
- req.meta.cursor = plumbing_response.meta.next_cursor
169
- end
170
- }
171
- resp
156
+ raise Plumbing::convert_error_to_porcelain(exception)
157
+ end
158
+ tries = 0
159
+ plumbing_response.account_attachments.each do |plumbing_item|
160
+ g.yield Plumbing::convert_account_attachment_to_porcelain(plumbing_item)
161
+ end
162
+ break if plumbing_response.meta.next_cursor == ""
163
+ req.meta.cursor = plumbing_response.meta.next_cursor
172
164
  end
165
+ }
166
+ resp
173
167
  end
174
- # AccountGrants connect a resource directly to an account, giving the account the permission to connect to that resource.
175
- class AccountGrants
176
- def initialize(host, insecure, parent)
177
- begin
178
- if insecure
179
- @stub = V1::AccountGrants::Stub.new(host, :this_channel_is_insecure)
180
- else
181
- cred = GRPC::Core::ChannelCredentials.new()
182
- @stub = V1::AccountGrants::Stub.new(host, cred)
183
- end
184
- rescue => exception
185
- raise Plumbing::error_to_porcelain(exception)
186
- end
187
- @parent = parent
168
+ end
169
+
170
+ # AccountGrants assign a resource directly to an account, giving the account the permission to connect to that resource.
171
+ class AccountGrants
172
+ def initialize(host, insecure, parent)
173
+ begin
174
+ if insecure
175
+ @stub = V1::AccountGrants::Stub.new(host, :this_channel_is_insecure)
176
+ else
177
+ cred = GRPC::Core::ChannelCredentials.new()
178
+ @stub = V1::AccountGrants::Stub.new(host, cred)
188
179
  end
189
- # Create registers a new AccountGrant.
190
- def create(
191
- account_grant \
192
- ,
193
- deadline:nil)
194
- req = V1::AccountGrantCreateRequest.new()
195
-
196
- req.account_grant = Plumbing::account_grant_to_plumbing(account_grant)
197
- tries = 0
198
- plumbing_response = nil
199
- loop do
200
- begin
201
- plumbing_response = @stub.create(req, metadata: @parent.get_metadata('AccountGrants.Create', req), deadline:deadline)
202
- rescue => exception
203
- if (@parent.shouldRetry(tries, exception))
204
- tries++
205
- @parent.jitterSleep(tries)
206
- next
207
- end
208
- raise Plumbing::error_to_porcelain(exception)
209
- end
210
- break
211
- end
180
+ rescue => exception
181
+ raise Plumbing::convert_error_to_porcelain(exception)
182
+ end
183
+ @parent = parent
184
+ end
185
+
186
+ # Create registers a new AccountGrant.
187
+ def create(
188
+ account_grant,
189
+ deadline: nil
190
+ )
191
+ req = V1::AccountGrantCreateRequest.new()
212
192
 
213
-
214
- resp = AccountGrantCreateResponse.new()
215
- resp.meta = Plumbing::create_response_metadata_to_porcelain(plumbing_response.meta)
216
- resp.account_grant = Plumbing::account_grant_to_porcelain(plumbing_response.account_grant)
217
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
218
- resp
193
+ req.account_grant = Plumbing::convert_account_grant_to_plumbing(account_grant)
194
+ tries = 0
195
+ plumbing_response = nil
196
+ loop do
197
+ begin
198
+ plumbing_response = @stub.create(req, metadata: @parent.get_metadata("AccountGrants.Create", req), deadline: deadline)
199
+ rescue => exception
200
+ if (@parent.shouldRetry(tries, exception))
201
+ tries + +@parent.jitterSleep(tries)
202
+ next
203
+ end
204
+ raise Plumbing::convert_error_to_porcelain(exception)
219
205
  end
220
- # Get reads one AccountGrant by ID.
221
- def get(
222
- id \
223
- ,
224
- deadline:nil)
225
- req = V1::AccountGrantGetRequest.new()
226
-
227
- req.id = id
228
- tries = 0
229
- plumbing_response = nil
230
- loop do
231
- begin
232
- plumbing_response = @stub.get(req, metadata: @parent.get_metadata('AccountGrants.Get', req), deadline:deadline)
233
- rescue => exception
234
- if (@parent.shouldRetry(tries, exception))
235
- tries++
236
- @parent.jitterSleep(tries)
237
- next
238
- end
239
- raise Plumbing::error_to_porcelain(exception)
240
- end
241
- break
242
- end
206
+ break
207
+ end
208
+
209
+ resp = AccountGrantCreateResponse.new()
210
+ resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
211
+ resp.account_grant = Plumbing::convert_account_grant_to_porcelain(plumbing_response.account_grant)
212
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
213
+ resp
214
+ end
243
215
 
244
-
245
- resp = AccountGrantGetResponse.new()
246
- resp.meta = Plumbing::get_response_metadata_to_porcelain(plumbing_response.meta)
247
- resp.account_grant = Plumbing::account_grant_to_porcelain(plumbing_response.account_grant)
248
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
249
- resp
216
+ # Get reads one AccountGrant by ID.
217
+ def get(
218
+ id,
219
+ deadline: nil
220
+ )
221
+ req = V1::AccountGrantGetRequest.new()
222
+
223
+ req.id = (id)
224
+ tries = 0
225
+ plumbing_response = nil
226
+ loop do
227
+ begin
228
+ plumbing_response = @stub.get(req, metadata: @parent.get_metadata("AccountGrants.Get", req), deadline: deadline)
229
+ rescue => exception
230
+ if (@parent.shouldRetry(tries, exception))
231
+ tries + +@parent.jitterSleep(tries)
232
+ next
233
+ end
234
+ raise Plumbing::convert_error_to_porcelain(exception)
250
235
  end
251
- # Delete removes a AccountGrant by ID.
252
- def delete(
253
- id \
254
- ,
255
- deadline:nil)
256
- req = V1::AccountGrantDeleteRequest.new()
257
-
258
- req.id = id
259
- tries = 0
260
- plumbing_response = nil
261
- loop do
262
- begin
263
- plumbing_response = @stub.delete(req, metadata: @parent.get_metadata('AccountGrants.Delete', req), deadline:deadline)
264
- rescue => exception
265
- if (@parent.shouldRetry(tries, exception))
266
- tries++
267
- @parent.jitterSleep(tries)
268
- next
269
- end
270
- raise Plumbing::error_to_porcelain(exception)
271
- end
272
- break
273
- end
236
+ break
237
+ end
238
+
239
+ resp = AccountGrantGetResponse.new()
240
+ resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
241
+ resp.account_grant = Plumbing::convert_account_grant_to_porcelain(plumbing_response.account_grant)
242
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
243
+ resp
244
+ end
245
+
246
+ # Delete removes a AccountGrant by ID.
247
+ def delete(
248
+ id,
249
+ deadline: nil
250
+ )
251
+ req = V1::AccountGrantDeleteRequest.new()
274
252
 
275
-
276
- resp = AccountGrantDeleteResponse.new()
277
- resp.meta = Plumbing::delete_response_metadata_to_porcelain(plumbing_response.meta)
278
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
279
- resp
253
+ req.id = (id)
254
+ tries = 0
255
+ plumbing_response = nil
256
+ loop do
257
+ begin
258
+ plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("AccountGrants.Delete", req), deadline: deadline)
259
+ rescue => exception
260
+ if (@parent.shouldRetry(tries, exception))
261
+ tries + +@parent.jitterSleep(tries)
262
+ next
263
+ end
264
+ raise Plumbing::convert_error_to_porcelain(exception)
280
265
  end
281
- # List gets a list of AccountGrants matching a given set of criteria.
282
- def list(
283
- filter \
284
- ,
285
- *args,
286
- deadline:nil)
287
- req = V1::AccountGrantListRequest.new()
288
- req.meta = V1::ListRequestMetadata.new()
289
- page_size_option = @parent._test_options['PageSize']
290
- if page_size_option.is_a? Integer
291
- req.meta.limit = page_size_option
266
+ break
267
+ end
268
+
269
+ resp = AccountGrantDeleteResponse.new()
270
+ resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
271
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
272
+ resp
273
+ end
274
+
275
+ # List gets a list of AccountGrants matching a given set of criteria.
276
+ def list(
277
+ filter,
278
+ *args,
279
+ deadline: nil
280
+ )
281
+ req = V1::AccountGrantListRequest.new()
282
+ req.meta = V1::ListRequestMetadata.new()
283
+ page_size_option = @parent._test_options["PageSize"]
284
+ if page_size_option.is_a? Integer
285
+ req.meta.limit = page_size_option
286
+ end
287
+
288
+ req.filter = Plumbing::quote_filter_args(filter, *args)
289
+ resp = Enumerator::Generator.new { |g|
290
+ tries = 0
291
+ loop do
292
+ begin
293
+ plumbing_response = @stub.list(req, metadata: @parent.get_metadata("AccountGrants.List", req), deadline: deadline)
294
+ rescue => exception
295
+ if (@parent.shouldRetry(tries, exception))
296
+ tries + +@parent.jitterSleep(tries)
297
+ next
292
298
  end
293
-
294
- req.filter = Plumbing::quote_filter_args(filter, *args)
295
- resp = Enumerator::Generator.new { |g|
296
- tries = 0
297
- loop do
298
- begin
299
- plumbing_response = @stub.list(req, metadata: @parent.get_metadata('AccountGrants.List', req), deadline:deadline)
300
- rescue => exception
301
- if (@parent.shouldRetry(tries, exception))
302
- tries++
303
- @parent.jitterSleep(tries)
304
- next
305
- end
306
- raise Plumbing::error_to_porcelain(exception)
307
- end
308
- tries = 0
309
- plumbing_response.account_grants.each do |plumbing_item|
310
- g.yield Plumbing::account_grant_to_porcelain(plumbing_item)
311
- end
312
- break if plumbing_response.meta.next_cursor == ""
313
- req.meta.cursor = plumbing_response.meta.next_cursor
314
- end
315
- }
316
- resp
299
+ raise Plumbing::convert_error_to_porcelain(exception)
300
+ end
301
+ tries = 0
302
+ plumbing_response.account_grants.each do |plumbing_item|
303
+ g.yield Plumbing::convert_account_grant_to_porcelain(plumbing_item)
304
+ end
305
+ break if plumbing_response.meta.next_cursor == ""
306
+ req.meta.cursor = plumbing_response.meta.next_cursor
317
307
  end
308
+ }
309
+ resp
318
310
  end
319
- # Accounts are users that have access to strongDM.
320
- # There are two types of accounts:
321
- # 1. **Regular users:** humans who are authenticated through username and password or SSO
322
- # 2. **Service users:** machines that are authneticated using a service token
323
- class Accounts
324
- def initialize(host, insecure, parent)
325
- begin
326
- if insecure
327
- @stub = V1::Accounts::Stub.new(host, :this_channel_is_insecure)
328
- else
329
- cred = GRPC::Core::ChannelCredentials.new()
330
- @stub = V1::Accounts::Stub.new(host, cred)
331
- end
332
- rescue => exception
333
- raise Plumbing::error_to_porcelain(exception)
334
- end
335
- @parent = parent
311
+ end
312
+
313
+ # Accounts are users that have access to strongDM.
314
+ # There are two types of accounts:
315
+ # 1. **Regular users:** humans who are authenticated through username and password or SSO
316
+ # 2. **Service users:** machines that are authneticated using a service token
317
+ class Accounts
318
+ def initialize(host, insecure, parent)
319
+ begin
320
+ if insecure
321
+ @stub = V1::Accounts::Stub.new(host, :this_channel_is_insecure)
322
+ else
323
+ cred = GRPC::Core::ChannelCredentials.new()
324
+ @stub = V1::Accounts::Stub.new(host, cred)
336
325
  end
337
- # Create registers a new Account.
338
- def create(
339
- account \
340
- ,
341
- deadline:nil)
342
- req = V1::AccountCreateRequest.new()
343
-
344
- req.account = Plumbing::account_to_plumbing(account)
345
- tries = 0
346
- plumbing_response = nil
347
- loop do
348
- begin
349
- plumbing_response = @stub.create(req, metadata: @parent.get_metadata('Accounts.Create', req), deadline:deadline)
350
- rescue => exception
351
- if (@parent.shouldRetry(tries, exception))
352
- tries++
353
- @parent.jitterSleep(tries)
354
- next
355
- end
356
- raise Plumbing::error_to_porcelain(exception)
357
- end
358
- break
359
- end
326
+ rescue => exception
327
+ raise Plumbing::convert_error_to_porcelain(exception)
328
+ end
329
+ @parent = parent
330
+ end
331
+
332
+ # Create registers a new Account.
333
+ def create(
334
+ account,
335
+ deadline: nil
336
+ )
337
+ req = V1::AccountCreateRequest.new()
360
338
 
361
-
362
- resp = AccountCreateResponse.new()
363
- resp.meta = Plumbing::create_response_metadata_to_porcelain(plumbing_response.meta)
364
- resp.account = Plumbing::account_to_porcelain(plumbing_response.account)
365
- resp.token = plumbing_response.token
366
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
367
- resp
339
+ req.account = Plumbing::convert_account_to_plumbing(account)
340
+ tries = 0
341
+ plumbing_response = nil
342
+ loop do
343
+ begin
344
+ plumbing_response = @stub.create(req, metadata: @parent.get_metadata("Accounts.Create", req), deadline: deadline)
345
+ rescue => exception
346
+ if (@parent.shouldRetry(tries, exception))
347
+ tries + +@parent.jitterSleep(tries)
348
+ next
349
+ end
350
+ raise Plumbing::convert_error_to_porcelain(exception)
368
351
  end
369
- # Get reads one Account by ID.
370
- def get(
371
- id \
372
- ,
373
- deadline:nil)
374
- req = V1::AccountGetRequest.new()
375
-
376
- req.id = id
377
- tries = 0
378
- plumbing_response = nil
379
- loop do
380
- begin
381
- plumbing_response = @stub.get(req, metadata: @parent.get_metadata('Accounts.Get', req), deadline:deadline)
382
- rescue => exception
383
- if (@parent.shouldRetry(tries, exception))
384
- tries++
385
- @parent.jitterSleep(tries)
386
- next
387
- end
388
- raise Plumbing::error_to_porcelain(exception)
389
- end
390
- break
391
- end
352
+ break
353
+ end
354
+
355
+ resp = AccountCreateResponse.new()
356
+ resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
357
+ resp.account = Plumbing::convert_account_to_porcelain(plumbing_response.account)
358
+ resp.token = (plumbing_response.token)
359
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
360
+ resp
361
+ end
392
362
 
393
-
394
- resp = AccountGetResponse.new()
395
- resp.meta = Plumbing::get_response_metadata_to_porcelain(plumbing_response.meta)
396
- resp.account = Plumbing::account_to_porcelain(plumbing_response.account)
397
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
398
- resp
363
+ # Get reads one Account by ID.
364
+ def get(
365
+ id,
366
+ deadline: nil
367
+ )
368
+ req = V1::AccountGetRequest.new()
369
+
370
+ req.id = (id)
371
+ tries = 0
372
+ plumbing_response = nil
373
+ loop do
374
+ begin
375
+ plumbing_response = @stub.get(req, metadata: @parent.get_metadata("Accounts.Get", req), deadline: deadline)
376
+ rescue => exception
377
+ if (@parent.shouldRetry(tries, exception))
378
+ tries + +@parent.jitterSleep(tries)
379
+ next
380
+ end
381
+ raise Plumbing::convert_error_to_porcelain(exception)
399
382
  end
400
- # Update patches a Account by ID.
401
- def update(
402
- account \
403
- ,
404
- deadline:nil)
405
- req = V1::AccountUpdateRequest.new()
406
-
407
- req.account = Plumbing::account_to_plumbing(account)
408
- tries = 0
409
- plumbing_response = nil
410
- loop do
411
- begin
412
- plumbing_response = @stub.update(req, metadata: @parent.get_metadata('Accounts.Update', req), deadline:deadline)
413
- rescue => exception
414
- if (@parent.shouldRetry(tries, exception))
415
- tries++
416
- @parent.jitterSleep(tries)
417
- next
418
- end
419
- raise Plumbing::error_to_porcelain(exception)
420
- end
421
- break
422
- end
383
+ break
384
+ end
423
385
 
424
-
425
- resp = AccountUpdateResponse.new()
426
- resp.meta = Plumbing::update_response_metadata_to_porcelain(plumbing_response.meta)
427
- resp.account = Plumbing::account_to_porcelain(plumbing_response.account)
428
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
429
- resp
386
+ resp = AccountGetResponse.new()
387
+ resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
388
+ resp.account = Plumbing::convert_account_to_porcelain(plumbing_response.account)
389
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
390
+ resp
391
+ end
392
+
393
+ # Update patches a Account by ID.
394
+ def update(
395
+ account,
396
+ deadline: nil
397
+ )
398
+ req = V1::AccountUpdateRequest.new()
399
+
400
+ req.account = Plumbing::convert_account_to_plumbing(account)
401
+ tries = 0
402
+ plumbing_response = nil
403
+ loop do
404
+ begin
405
+ plumbing_response = @stub.update(req, metadata: @parent.get_metadata("Accounts.Update", req), deadline: deadline)
406
+ rescue => exception
407
+ if (@parent.shouldRetry(tries, exception))
408
+ tries + +@parent.jitterSleep(tries)
409
+ next
410
+ end
411
+ raise Plumbing::convert_error_to_porcelain(exception)
430
412
  end
431
- # Delete removes a Account by ID.
432
- def delete(
433
- id \
434
- ,
435
- deadline:nil)
436
- req = V1::AccountDeleteRequest.new()
437
-
438
- req.id = id
439
- tries = 0
440
- plumbing_response = nil
441
- loop do
442
- begin
443
- plumbing_response = @stub.delete(req, metadata: @parent.get_metadata('Accounts.Delete', req), deadline:deadline)
444
- rescue => exception
445
- if (@parent.shouldRetry(tries, exception))
446
- tries++
447
- @parent.jitterSleep(tries)
448
- next
449
- end
450
- raise Plumbing::error_to_porcelain(exception)
451
- end
452
- break
453
- end
413
+ break
414
+ end
454
415
 
455
-
456
- resp = AccountDeleteResponse.new()
457
- resp.meta = Plumbing::delete_response_metadata_to_porcelain(plumbing_response.meta)
458
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
459
- resp
416
+ resp = AccountUpdateResponse.new()
417
+ resp.meta = Plumbing::convert_update_response_metadata_to_porcelain(plumbing_response.meta)
418
+ resp.account = Plumbing::convert_account_to_porcelain(plumbing_response.account)
419
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
420
+ resp
421
+ end
422
+
423
+ # Delete removes a Account by ID.
424
+ def delete(
425
+ id,
426
+ deadline: nil
427
+ )
428
+ req = V1::AccountDeleteRequest.new()
429
+
430
+ req.id = (id)
431
+ tries = 0
432
+ plumbing_response = nil
433
+ loop do
434
+ begin
435
+ plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("Accounts.Delete", req), deadline: deadline)
436
+ rescue => exception
437
+ if (@parent.shouldRetry(tries, exception))
438
+ tries + +@parent.jitterSleep(tries)
439
+ next
440
+ end
441
+ raise Plumbing::convert_error_to_porcelain(exception)
460
442
  end
461
- # List gets a list of Accounts matching a given set of criteria.
462
- def list(
463
- filter \
464
- ,
465
- *args,
466
- deadline:nil)
467
- req = V1::AccountListRequest.new()
468
- req.meta = V1::ListRequestMetadata.new()
469
- page_size_option = @parent._test_options['PageSize']
470
- if page_size_option.is_a? Integer
471
- req.meta.limit = page_size_option
443
+ break
444
+ end
445
+
446
+ resp = AccountDeleteResponse.new()
447
+ resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
448
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
449
+ resp
450
+ end
451
+
452
+ # List gets a list of Accounts matching a given set of criteria.
453
+ def list(
454
+ filter,
455
+ *args,
456
+ deadline: nil
457
+ )
458
+ req = V1::AccountListRequest.new()
459
+ req.meta = V1::ListRequestMetadata.new()
460
+ page_size_option = @parent._test_options["PageSize"]
461
+ if page_size_option.is_a? Integer
462
+ req.meta.limit = page_size_option
463
+ end
464
+
465
+ req.filter = Plumbing::quote_filter_args(filter, *args)
466
+ resp = Enumerator::Generator.new { |g|
467
+ tries = 0
468
+ loop do
469
+ begin
470
+ plumbing_response = @stub.list(req, metadata: @parent.get_metadata("Accounts.List", req), deadline: deadline)
471
+ rescue => exception
472
+ if (@parent.shouldRetry(tries, exception))
473
+ tries + +@parent.jitterSleep(tries)
474
+ next
472
475
  end
473
-
474
- req.filter = Plumbing::quote_filter_args(filter, *args)
475
- resp = Enumerator::Generator.new { |g|
476
- tries = 0
477
- loop do
478
- begin
479
- plumbing_response = @stub.list(req, metadata: @parent.get_metadata('Accounts.List', req), deadline:deadline)
480
- rescue => exception
481
- if (@parent.shouldRetry(tries, exception))
482
- tries++
483
- @parent.jitterSleep(tries)
484
- next
485
- end
486
- raise Plumbing::error_to_porcelain(exception)
487
- end
488
- tries = 0
489
- plumbing_response.accounts.each do |plumbing_item|
490
- g.yield Plumbing::account_to_porcelain(plumbing_item)
491
- end
492
- break if plumbing_response.meta.next_cursor == ""
493
- req.meta.cursor = plumbing_response.meta.next_cursor
494
- end
495
- }
496
- resp
476
+ raise Plumbing::convert_error_to_porcelain(exception)
477
+ end
478
+ tries = 0
479
+ plumbing_response.accounts.each do |plumbing_item|
480
+ g.yield Plumbing::convert_account_to_porcelain(plumbing_item)
481
+ end
482
+ break if plumbing_response.meta.next_cursor == ""
483
+ req.meta.cursor = plumbing_response.meta.next_cursor
497
484
  end
485
+ }
486
+ resp
498
487
  end
499
- # Nodes make up the strongDM network, and allow your users to connect securely to your resources.
500
- # There are two types of nodes:
501
- # 1. **Relay:** creates connectivity to your datasources, while maintaining the egress-only nature of your firewall
502
- # 1. **Gateways:** a relay that also listens for connections from strongDM clients
503
- class Nodes
504
- def initialize(host, insecure, parent)
505
- begin
506
- if insecure
507
- @stub = V1::Nodes::Stub.new(host, :this_channel_is_insecure)
508
- else
509
- cred = GRPC::Core::ChannelCredentials.new()
510
- @stub = V1::Nodes::Stub.new(host, cred)
511
- end
512
- rescue => exception
513
- raise Plumbing::error_to_porcelain(exception)
514
- end
515
- @parent = parent
488
+ end
489
+
490
+ # Nodes make up the strongDM network, and allow your users to connect securely to your resources.
491
+ # There are two types of nodes:
492
+ # 1. **Relay:** creates connectivity to your datasources, while maintaining the egress-only nature of your firewall
493
+ # 1. **Gateways:** a relay that also listens for connections from strongDM clients
494
+ class Nodes
495
+ def initialize(host, insecure, parent)
496
+ begin
497
+ if insecure
498
+ @stub = V1::Nodes::Stub.new(host, :this_channel_is_insecure)
499
+ else
500
+ cred = GRPC::Core::ChannelCredentials.new()
501
+ @stub = V1::Nodes::Stub.new(host, cred)
516
502
  end
517
- # Create registers a new Node.
518
- def create(
519
- node \
520
- ,
521
- deadline:nil)
522
- req = V1::NodeCreateRequest.new()
523
-
524
- req.node = Plumbing::node_to_plumbing(node)
525
- tries = 0
526
- plumbing_response = nil
527
- loop do
528
- begin
529
- plumbing_response = @stub.create(req, metadata: @parent.get_metadata('Nodes.Create', req), deadline:deadline)
530
- rescue => exception
531
- if (@parent.shouldRetry(tries, exception))
532
- tries++
533
- @parent.jitterSleep(tries)
534
- next
535
- end
536
- raise Plumbing::error_to_porcelain(exception)
537
- end
538
- break
539
- end
503
+ rescue => exception
504
+ raise Plumbing::convert_error_to_porcelain(exception)
505
+ end
506
+ @parent = parent
507
+ end
508
+
509
+ # Create registers a new Node.
510
+ def create(
511
+ node,
512
+ deadline: nil
513
+ )
514
+ req = V1::NodeCreateRequest.new()
540
515
 
541
-
542
- resp = NodeCreateResponse.new()
543
- resp.meta = Plumbing::create_response_metadata_to_porcelain(plumbing_response.meta)
544
- resp.node = Plumbing::node_to_porcelain(plumbing_response.node)
545
- resp.token = plumbing_response.token
546
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
547
- resp
516
+ req.node = Plumbing::convert_node_to_plumbing(node)
517
+ tries = 0
518
+ plumbing_response = nil
519
+ loop do
520
+ begin
521
+ plumbing_response = @stub.create(req, metadata: @parent.get_metadata("Nodes.Create", req), deadline: deadline)
522
+ rescue => exception
523
+ if (@parent.shouldRetry(tries, exception))
524
+ tries + +@parent.jitterSleep(tries)
525
+ next
526
+ end
527
+ raise Plumbing::convert_error_to_porcelain(exception)
548
528
  end
549
- # Get reads one Node by ID.
550
- def get(
551
- id \
552
- ,
553
- deadline:nil)
554
- req = V1::NodeGetRequest.new()
555
-
556
- req.id = id
557
- tries = 0
558
- plumbing_response = nil
559
- loop do
560
- begin
561
- plumbing_response = @stub.get(req, metadata: @parent.get_metadata('Nodes.Get', req), deadline:deadline)
562
- rescue => exception
563
- if (@parent.shouldRetry(tries, exception))
564
- tries++
565
- @parent.jitterSleep(tries)
566
- next
567
- end
568
- raise Plumbing::error_to_porcelain(exception)
569
- end
570
- break
571
- end
529
+ break
530
+ end
531
+
532
+ resp = NodeCreateResponse.new()
533
+ resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
534
+ resp.node = Plumbing::convert_node_to_porcelain(plumbing_response.node)
535
+ resp.token = (plumbing_response.token)
536
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
537
+ resp
538
+ end
572
539
 
573
-
574
- resp = NodeGetResponse.new()
575
- resp.meta = Plumbing::get_response_metadata_to_porcelain(plumbing_response.meta)
576
- resp.node = Plumbing::node_to_porcelain(plumbing_response.node)
577
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
578
- resp
540
+ # Get reads one Node by ID.
541
+ def get(
542
+ id,
543
+ deadline: nil
544
+ )
545
+ req = V1::NodeGetRequest.new()
546
+
547
+ req.id = (id)
548
+ tries = 0
549
+ plumbing_response = nil
550
+ loop do
551
+ begin
552
+ plumbing_response = @stub.get(req, metadata: @parent.get_metadata("Nodes.Get", req), deadline: deadline)
553
+ rescue => exception
554
+ if (@parent.shouldRetry(tries, exception))
555
+ tries + +@parent.jitterSleep(tries)
556
+ next
557
+ end
558
+ raise Plumbing::convert_error_to_porcelain(exception)
579
559
  end
580
- # Update patches a Node by ID.
581
- def update(
582
- node \
583
- ,
584
- deadline:nil)
585
- req = V1::NodeUpdateRequest.new()
586
-
587
- req.node = Plumbing::node_to_plumbing(node)
588
- tries = 0
589
- plumbing_response = nil
590
- loop do
591
- begin
592
- plumbing_response = @stub.update(req, metadata: @parent.get_metadata('Nodes.Update', req), deadline:deadline)
593
- rescue => exception
594
- if (@parent.shouldRetry(tries, exception))
595
- tries++
596
- @parent.jitterSleep(tries)
597
- next
598
- end
599
- raise Plumbing::error_to_porcelain(exception)
600
- end
601
- break
602
- end
560
+ break
561
+ end
562
+
563
+ resp = NodeGetResponse.new()
564
+ resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
565
+ resp.node = Plumbing::convert_node_to_porcelain(plumbing_response.node)
566
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
567
+ resp
568
+ end
603
569
 
604
-
605
- resp = NodeUpdateResponse.new()
606
- resp.meta = Plumbing::update_response_metadata_to_porcelain(plumbing_response.meta)
607
- resp.node = Plumbing::node_to_porcelain(plumbing_response.node)
608
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
609
- resp
570
+ # Update patches a Node by ID.
571
+ def update(
572
+ node,
573
+ deadline: nil
574
+ )
575
+ req = V1::NodeUpdateRequest.new()
576
+
577
+ req.node = Plumbing::convert_node_to_plumbing(node)
578
+ tries = 0
579
+ plumbing_response = nil
580
+ loop do
581
+ begin
582
+ plumbing_response = @stub.update(req, metadata: @parent.get_metadata("Nodes.Update", req), deadline: deadline)
583
+ rescue => exception
584
+ if (@parent.shouldRetry(tries, exception))
585
+ tries + +@parent.jitterSleep(tries)
586
+ next
587
+ end
588
+ raise Plumbing::convert_error_to_porcelain(exception)
610
589
  end
611
- # Delete removes a Node by ID.
612
- def delete(
613
- id \
614
- ,
615
- deadline:nil)
616
- req = V1::NodeDeleteRequest.new()
617
-
618
- req.id = id
619
- tries = 0
620
- plumbing_response = nil
621
- loop do
622
- begin
623
- plumbing_response = @stub.delete(req, metadata: @parent.get_metadata('Nodes.Delete', req), deadline:deadline)
624
- rescue => exception
625
- if (@parent.shouldRetry(tries, exception))
626
- tries++
627
- @parent.jitterSleep(tries)
628
- next
629
- end
630
- raise Plumbing::error_to_porcelain(exception)
631
- end
632
- break
633
- end
590
+ break
591
+ end
592
+
593
+ resp = NodeUpdateResponse.new()
594
+ resp.meta = Plumbing::convert_update_response_metadata_to_porcelain(plumbing_response.meta)
595
+ resp.node = Plumbing::convert_node_to_porcelain(plumbing_response.node)
596
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
597
+ resp
598
+ end
599
+
600
+ # Delete removes a Node by ID.
601
+ def delete(
602
+ id,
603
+ deadline: nil
604
+ )
605
+ req = V1::NodeDeleteRequest.new()
634
606
 
635
-
636
- resp = NodeDeleteResponse.new()
637
- resp.meta = Plumbing::delete_response_metadata_to_porcelain(plumbing_response.meta)
638
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
639
- resp
607
+ req.id = (id)
608
+ tries = 0
609
+ plumbing_response = nil
610
+ loop do
611
+ begin
612
+ plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("Nodes.Delete", req), deadline: deadline)
613
+ rescue => exception
614
+ if (@parent.shouldRetry(tries, exception))
615
+ tries + +@parent.jitterSleep(tries)
616
+ next
617
+ end
618
+ raise Plumbing::convert_error_to_porcelain(exception)
640
619
  end
641
- # List gets a list of Nodes matching a given set of criteria.
642
- def list(
643
- filter \
644
- ,
645
- *args,
646
- deadline:nil)
647
- req = V1::NodeListRequest.new()
648
- req.meta = V1::ListRequestMetadata.new()
649
- page_size_option = @parent._test_options['PageSize']
650
- if page_size_option.is_a? Integer
651
- req.meta.limit = page_size_option
620
+ break
621
+ end
622
+
623
+ resp = NodeDeleteResponse.new()
624
+ resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
625
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
626
+ resp
627
+ end
628
+
629
+ # List gets a list of Nodes matching a given set of criteria.
630
+ def list(
631
+ filter,
632
+ *args,
633
+ deadline: nil
634
+ )
635
+ req = V1::NodeListRequest.new()
636
+ req.meta = V1::ListRequestMetadata.new()
637
+ page_size_option = @parent._test_options["PageSize"]
638
+ if page_size_option.is_a? Integer
639
+ req.meta.limit = page_size_option
640
+ end
641
+
642
+ req.filter = Plumbing::quote_filter_args(filter, *args)
643
+ resp = Enumerator::Generator.new { |g|
644
+ tries = 0
645
+ loop do
646
+ begin
647
+ plumbing_response = @stub.list(req, metadata: @parent.get_metadata("Nodes.List", req), deadline: deadline)
648
+ rescue => exception
649
+ if (@parent.shouldRetry(tries, exception))
650
+ tries + +@parent.jitterSleep(tries)
651
+ next
652
652
  end
653
-
654
- req.filter = Plumbing::quote_filter_args(filter, *args)
655
- resp = Enumerator::Generator.new { |g|
656
- tries = 0
657
- loop do
658
- begin
659
- plumbing_response = @stub.list(req, metadata: @parent.get_metadata('Nodes.List', req), deadline:deadline)
660
- rescue => exception
661
- if (@parent.shouldRetry(tries, exception))
662
- tries++
663
- @parent.jitterSleep(tries)
664
- next
665
- end
666
- raise Plumbing::error_to_porcelain(exception)
667
- end
668
- tries = 0
669
- plumbing_response.nodes.each do |plumbing_item|
670
- g.yield Plumbing::node_to_porcelain(plumbing_item)
671
- end
672
- break if plumbing_response.meta.next_cursor == ""
673
- req.meta.cursor = plumbing_response.meta.next_cursor
674
- end
675
- }
676
- resp
653
+ raise Plumbing::convert_error_to_porcelain(exception)
654
+ end
655
+ tries = 0
656
+ plumbing_response.nodes.each do |plumbing_item|
657
+ g.yield Plumbing::convert_node_to_porcelain(plumbing_item)
658
+ end
659
+ break if plumbing_response.meta.next_cursor == ""
660
+ req.meta.cursor = plumbing_response.meta.next_cursor
677
661
  end
662
+ }
663
+ resp
678
664
  end
665
+ end
679
666
 
680
- class Resources
681
- def initialize(host, insecure, parent)
682
- begin
683
- if insecure
684
- @stub = V1::Resources::Stub.new(host, :this_channel_is_insecure)
685
- else
686
- cred = GRPC::Core::ChannelCredentials.new()
687
- @stub = V1::Resources::Stub.new(host, cred)
688
- end
689
- rescue => exception
690
- raise Plumbing::error_to_porcelain(exception)
691
- end
692
- @parent = parent
667
+ class Resources
668
+ def initialize(host, insecure, parent)
669
+ begin
670
+ if insecure
671
+ @stub = V1::Resources::Stub.new(host, :this_channel_is_insecure)
672
+ else
673
+ cred = GRPC::Core::ChannelCredentials.new()
674
+ @stub = V1::Resources::Stub.new(host, cred)
693
675
  end
694
- # Create registers a new Resource.
695
- def create(
696
- resource \
697
- ,
698
- deadline:nil)
699
- req = V1::ResourceCreateRequest.new()
700
-
701
- req.resource = Plumbing::resource_to_plumbing(resource)
702
- tries = 0
703
- plumbing_response = nil
704
- loop do
705
- begin
706
- plumbing_response = @stub.create(req, metadata: @parent.get_metadata('Resources.Create', req), deadline:deadline)
707
- rescue => exception
708
- if (@parent.shouldRetry(tries, exception))
709
- tries++
710
- @parent.jitterSleep(tries)
711
- next
712
- end
713
- raise Plumbing::error_to_porcelain(exception)
714
- end
715
- break
716
- end
676
+ rescue => exception
677
+ raise Plumbing::convert_error_to_porcelain(exception)
678
+ end
679
+ @parent = parent
680
+ end
717
681
 
718
-
719
- resp = ResourceCreateResponse.new()
720
- resp.meta = Plumbing::create_response_metadata_to_porcelain(plumbing_response.meta)
721
- resp.resource = Plumbing::resource_to_porcelain(plumbing_response.resource)
722
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
723
- resp
682
+ # Create registers a new Resource.
683
+ def create(
684
+ resource,
685
+ deadline: nil
686
+ )
687
+ req = V1::ResourceCreateRequest.new()
688
+
689
+ req.resource = Plumbing::convert_resource_to_plumbing(resource)
690
+ tries = 0
691
+ plumbing_response = nil
692
+ loop do
693
+ begin
694
+ plumbing_response = @stub.create(req, metadata: @parent.get_metadata("Resources.Create", req), deadline: deadline)
695
+ rescue => exception
696
+ if (@parent.shouldRetry(tries, exception))
697
+ tries + +@parent.jitterSleep(tries)
698
+ next
699
+ end
700
+ raise Plumbing::convert_error_to_porcelain(exception)
724
701
  end
725
- # Get reads one Resource by ID.
726
- def get(
727
- id \
728
- ,
729
- deadline:nil)
730
- req = V1::ResourceGetRequest.new()
731
-
732
- req.id = id
733
- tries = 0
734
- plumbing_response = nil
735
- loop do
736
- begin
737
- plumbing_response = @stub.get(req, metadata: @parent.get_metadata('Resources.Get', req), deadline:deadline)
738
- rescue => exception
739
- if (@parent.shouldRetry(tries, exception))
740
- tries++
741
- @parent.jitterSleep(tries)
742
- next
743
- end
744
- raise Plumbing::error_to_porcelain(exception)
745
- end
746
- break
747
- end
702
+ break
703
+ end
748
704
 
749
-
750
- resp = ResourceGetResponse.new()
751
- resp.meta = Plumbing::get_response_metadata_to_porcelain(plumbing_response.meta)
752
- resp.resource = Plumbing::resource_to_porcelain(plumbing_response.resource)
753
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
754
- resp
705
+ resp = ResourceCreateResponse.new()
706
+ resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
707
+ resp.resource = Plumbing::convert_resource_to_porcelain(plumbing_response.resource)
708
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
709
+ resp
710
+ end
711
+
712
+ # Get reads one Resource by ID.
713
+ def get(
714
+ id,
715
+ deadline: nil
716
+ )
717
+ req = V1::ResourceGetRequest.new()
718
+
719
+ req.id = (id)
720
+ tries = 0
721
+ plumbing_response = nil
722
+ loop do
723
+ begin
724
+ plumbing_response = @stub.get(req, metadata: @parent.get_metadata("Resources.Get", req), deadline: deadline)
725
+ rescue => exception
726
+ if (@parent.shouldRetry(tries, exception))
727
+ tries + +@parent.jitterSleep(tries)
728
+ next
729
+ end
730
+ raise Plumbing::convert_error_to_porcelain(exception)
755
731
  end
756
- # Update patches a Resource by ID.
757
- def update(
758
- resource \
759
- ,
760
- deadline:nil)
761
- req = V1::ResourceUpdateRequest.new()
762
-
763
- req.resource = Plumbing::resource_to_plumbing(resource)
764
- tries = 0
765
- plumbing_response = nil
766
- loop do
767
- begin
768
- plumbing_response = @stub.update(req, metadata: @parent.get_metadata('Resources.Update', req), deadline:deadline)
769
- rescue => exception
770
- if (@parent.shouldRetry(tries, exception))
771
- tries++
772
- @parent.jitterSleep(tries)
773
- next
774
- end
775
- raise Plumbing::error_to_porcelain(exception)
776
- end
777
- break
778
- end
732
+ break
733
+ end
779
734
 
780
-
781
- resp = ResourceUpdateResponse.new()
782
- resp.meta = Plumbing::update_response_metadata_to_porcelain(plumbing_response.meta)
783
- resp.resource = Plumbing::resource_to_porcelain(plumbing_response.resource)
784
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
785
- resp
735
+ resp = ResourceGetResponse.new()
736
+ resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
737
+ resp.resource = Plumbing::convert_resource_to_porcelain(plumbing_response.resource)
738
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
739
+ resp
740
+ end
741
+
742
+ # Update patches a Resource by ID.
743
+ def update(
744
+ resource,
745
+ deadline: nil
746
+ )
747
+ req = V1::ResourceUpdateRequest.new()
748
+
749
+ req.resource = Plumbing::convert_resource_to_plumbing(resource)
750
+ tries = 0
751
+ plumbing_response = nil
752
+ loop do
753
+ begin
754
+ plumbing_response = @stub.update(req, metadata: @parent.get_metadata("Resources.Update", req), deadline: deadline)
755
+ rescue => exception
756
+ if (@parent.shouldRetry(tries, exception))
757
+ tries + +@parent.jitterSleep(tries)
758
+ next
759
+ end
760
+ raise Plumbing::convert_error_to_porcelain(exception)
786
761
  end
787
- # Delete removes a Resource by ID.
788
- def delete(
789
- id \
790
- ,
791
- deadline:nil)
792
- req = V1::ResourceDeleteRequest.new()
793
-
794
- req.id = id
795
- tries = 0
796
- plumbing_response = nil
797
- loop do
798
- begin
799
- plumbing_response = @stub.delete(req, metadata: @parent.get_metadata('Resources.Delete', req), deadline:deadline)
800
- rescue => exception
801
- if (@parent.shouldRetry(tries, exception))
802
- tries++
803
- @parent.jitterSleep(tries)
804
- next
805
- end
806
- raise Plumbing::error_to_porcelain(exception)
807
- end
808
- break
809
- end
762
+ break
763
+ end
764
+
765
+ resp = ResourceUpdateResponse.new()
766
+ resp.meta = Plumbing::convert_update_response_metadata_to_porcelain(plumbing_response.meta)
767
+ resp.resource = Plumbing::convert_resource_to_porcelain(plumbing_response.resource)
768
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
769
+ resp
770
+ end
810
771
 
811
-
812
- resp = ResourceDeleteResponse.new()
813
- resp.meta = Plumbing::delete_response_metadata_to_porcelain(plumbing_response.meta)
814
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
815
- resp
772
+ # Delete removes a Resource by ID.
773
+ def delete(
774
+ id,
775
+ deadline: nil
776
+ )
777
+ req = V1::ResourceDeleteRequest.new()
778
+
779
+ req.id = (id)
780
+ tries = 0
781
+ plumbing_response = nil
782
+ loop do
783
+ begin
784
+ plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("Resources.Delete", req), deadline: deadline)
785
+ rescue => exception
786
+ if (@parent.shouldRetry(tries, exception))
787
+ tries + +@parent.jitterSleep(tries)
788
+ next
789
+ end
790
+ raise Plumbing::convert_error_to_porcelain(exception)
816
791
  end
817
- # List gets a list of Resources matching a given set of criteria.
818
- def list(
819
- filter \
820
- ,
821
- *args,
822
- deadline:nil)
823
- req = V1::ResourceListRequest.new()
824
- req.meta = V1::ListRequestMetadata.new()
825
- page_size_option = @parent._test_options['PageSize']
826
- if page_size_option.is_a? Integer
827
- req.meta.limit = page_size_option
792
+ break
793
+ end
794
+
795
+ resp = ResourceDeleteResponse.new()
796
+ resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
797
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
798
+ resp
799
+ end
800
+
801
+ # List gets a list of Resources matching a given set of criteria.
802
+ def list(
803
+ filter,
804
+ *args,
805
+ deadline: nil
806
+ )
807
+ req = V1::ResourceListRequest.new()
808
+ req.meta = V1::ListRequestMetadata.new()
809
+ page_size_option = @parent._test_options["PageSize"]
810
+ if page_size_option.is_a? Integer
811
+ req.meta.limit = page_size_option
812
+ end
813
+
814
+ req.filter = Plumbing::quote_filter_args(filter, *args)
815
+ resp = Enumerator::Generator.new { |g|
816
+ tries = 0
817
+ loop do
818
+ begin
819
+ plumbing_response = @stub.list(req, metadata: @parent.get_metadata("Resources.List", req), deadline: deadline)
820
+ rescue => exception
821
+ if (@parent.shouldRetry(tries, exception))
822
+ tries + +@parent.jitterSleep(tries)
823
+ next
828
824
  end
829
-
830
- req.filter = Plumbing::quote_filter_args(filter, *args)
831
- resp = Enumerator::Generator.new { |g|
832
- tries = 0
833
- loop do
834
- begin
835
- plumbing_response = @stub.list(req, metadata: @parent.get_metadata('Resources.List', req), deadline:deadline)
836
- rescue => exception
837
- if (@parent.shouldRetry(tries, exception))
838
- tries++
839
- @parent.jitterSleep(tries)
840
- next
841
- end
842
- raise Plumbing::error_to_porcelain(exception)
843
- end
844
- tries = 0
845
- plumbing_response.resources.each do |plumbing_item|
846
- g.yield Plumbing::resource_to_porcelain(plumbing_item)
847
- end
848
- break if plumbing_response.meta.next_cursor == ""
849
- req.meta.cursor = plumbing_response.meta.next_cursor
850
- end
851
- }
852
- resp
825
+ raise Plumbing::convert_error_to_porcelain(exception)
826
+ end
827
+ tries = 0
828
+ plumbing_response.resources.each do |plumbing_item|
829
+ g.yield Plumbing::convert_resource_to_porcelain(plumbing_item)
830
+ end
831
+ break if plumbing_response.meta.next_cursor == ""
832
+ req.meta.cursor = plumbing_response.meta.next_cursor
853
833
  end
834
+ }
835
+ resp
854
836
  end
855
- # RoleAttachments represent relationships between composite roles and the roles
856
- # that make up those composite roles. When a composite role is attached to another
857
- # role, the permissions granted to members of the composite role are augmented to
858
- # include the permissions granted to members of the attached role.
859
- class RoleAttachments
860
- def initialize(host, insecure, parent)
861
- begin
862
- if insecure
863
- @stub = V1::RoleAttachments::Stub.new(host, :this_channel_is_insecure)
864
- else
865
- cred = GRPC::Core::ChannelCredentials.new()
866
- @stub = V1::RoleAttachments::Stub.new(host, cred)
867
- end
868
- rescue => exception
869
- raise Plumbing::error_to_porcelain(exception)
870
- end
871
- @parent = parent
837
+ end
838
+
839
+ # RoleAttachments represent relationships between composite roles and the roles
840
+ # that make up those composite roles. When a composite role is attached to another
841
+ # role, the permissions granted to members of the composite role are augmented to
842
+ # include the permissions granted to members of the attached role.
843
+ class RoleAttachments
844
+ def initialize(host, insecure, parent)
845
+ begin
846
+ if insecure
847
+ @stub = V1::RoleAttachments::Stub.new(host, :this_channel_is_insecure)
848
+ else
849
+ cred = GRPC::Core::ChannelCredentials.new()
850
+ @stub = V1::RoleAttachments::Stub.new(host, cred)
872
851
  end
873
- # Create registers a new RoleAttachment.
874
- def create(
875
- role_attachment \
876
- ,
877
- deadline:nil)
878
- req = V1::RoleAttachmentCreateRequest.new()
879
-
880
- req.role_attachment = Plumbing::role_attachment_to_plumbing(role_attachment)
881
- tries = 0
882
- plumbing_response = nil
883
- loop do
884
- begin
885
- plumbing_response = @stub.create(req, metadata: @parent.get_metadata('RoleAttachments.Create', req), deadline:deadline)
886
- rescue => exception
887
- if (@parent.shouldRetry(tries, exception))
888
- tries++
889
- @parent.jitterSleep(tries)
890
- next
891
- end
892
- raise Plumbing::error_to_porcelain(exception)
893
- end
894
- break
895
- end
852
+ rescue => exception
853
+ raise Plumbing::convert_error_to_porcelain(exception)
854
+ end
855
+ @parent = parent
856
+ end
896
857
 
897
-
898
- resp = RoleAttachmentCreateResponse.new()
899
- resp.meta = Plumbing::create_response_metadata_to_porcelain(plumbing_response.meta)
900
- resp.role_attachment = Plumbing::role_attachment_to_porcelain(plumbing_response.role_attachment)
901
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
902
- resp
858
+ # Create registers a new RoleAttachment.
859
+ def create(
860
+ role_attachment,
861
+ deadline: nil
862
+ )
863
+ req = V1::RoleAttachmentCreateRequest.new()
864
+
865
+ req.role_attachment = Plumbing::convert_role_attachment_to_plumbing(role_attachment)
866
+ tries = 0
867
+ plumbing_response = nil
868
+ loop do
869
+ begin
870
+ plumbing_response = @stub.create(req, metadata: @parent.get_metadata("RoleAttachments.Create", req), deadline: deadline)
871
+ rescue => exception
872
+ if (@parent.shouldRetry(tries, exception))
873
+ tries + +@parent.jitterSleep(tries)
874
+ next
875
+ end
876
+ raise Plumbing::convert_error_to_porcelain(exception)
903
877
  end
904
- # Get reads one RoleAttachment by ID.
905
- def get(
906
- id \
907
- ,
908
- deadline:nil)
909
- req = V1::RoleAttachmentGetRequest.new()
910
-
911
- req.id = id
912
- tries = 0
913
- plumbing_response = nil
914
- loop do
915
- begin
916
- plumbing_response = @stub.get(req, metadata: @parent.get_metadata('RoleAttachments.Get', req), deadline:deadline)
917
- rescue => exception
918
- if (@parent.shouldRetry(tries, exception))
919
- tries++
920
- @parent.jitterSleep(tries)
921
- next
922
- end
923
- raise Plumbing::error_to_porcelain(exception)
924
- end
925
- break
926
- end
878
+ break
879
+ end
880
+
881
+ resp = RoleAttachmentCreateResponse.new()
882
+ resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
883
+ resp.role_attachment = Plumbing::convert_role_attachment_to_porcelain(plumbing_response.role_attachment)
884
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
885
+ resp
886
+ end
887
+
888
+ # Get reads one RoleAttachment by ID.
889
+ def get(
890
+ id,
891
+ deadline: nil
892
+ )
893
+ req = V1::RoleAttachmentGetRequest.new()
927
894
 
928
-
929
- resp = RoleAttachmentGetResponse.new()
930
- resp.meta = Plumbing::get_response_metadata_to_porcelain(plumbing_response.meta)
931
- resp.role_attachment = Plumbing::role_attachment_to_porcelain(plumbing_response.role_attachment)
932
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
933
- resp
895
+ req.id = (id)
896
+ tries = 0
897
+ plumbing_response = nil
898
+ loop do
899
+ begin
900
+ plumbing_response = @stub.get(req, metadata: @parent.get_metadata("RoleAttachments.Get", req), deadline: deadline)
901
+ rescue => exception
902
+ if (@parent.shouldRetry(tries, exception))
903
+ tries + +@parent.jitterSleep(tries)
904
+ next
905
+ end
906
+ raise Plumbing::convert_error_to_porcelain(exception)
934
907
  end
935
- # Delete removes a RoleAttachment by ID.
936
- def delete(
937
- id \
938
- ,
939
- deadline:nil)
940
- req = V1::RoleAttachmentDeleteRequest.new()
941
-
942
- req.id = id
943
- tries = 0
944
- plumbing_response = nil
945
- loop do
946
- begin
947
- plumbing_response = @stub.delete(req, metadata: @parent.get_metadata('RoleAttachments.Delete', req), deadline:deadline)
948
- rescue => exception
949
- if (@parent.shouldRetry(tries, exception))
950
- tries++
951
- @parent.jitterSleep(tries)
952
- next
953
- end
954
- raise Plumbing::error_to_porcelain(exception)
955
- end
956
- break
957
- end
908
+ break
909
+ end
910
+
911
+ resp = RoleAttachmentGetResponse.new()
912
+ resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
913
+ resp.role_attachment = Plumbing::convert_role_attachment_to_porcelain(plumbing_response.role_attachment)
914
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
915
+ resp
916
+ end
958
917
 
959
-
960
- resp = RoleAttachmentDeleteResponse.new()
961
- resp.meta = Plumbing::delete_response_metadata_to_porcelain(plumbing_response.meta)
962
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
963
- resp
918
+ # Delete removes a RoleAttachment by ID.
919
+ def delete(
920
+ id,
921
+ deadline: nil
922
+ )
923
+ req = V1::RoleAttachmentDeleteRequest.new()
924
+
925
+ req.id = (id)
926
+ tries = 0
927
+ plumbing_response = nil
928
+ loop do
929
+ begin
930
+ plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("RoleAttachments.Delete", req), deadline: deadline)
931
+ rescue => exception
932
+ if (@parent.shouldRetry(tries, exception))
933
+ tries + +@parent.jitterSleep(tries)
934
+ next
935
+ end
936
+ raise Plumbing::convert_error_to_porcelain(exception)
964
937
  end
965
- # List gets a list of RoleAttachments matching a given set of criteria.
966
- def list(
967
- filter \
968
- ,
969
- *args,
970
- deadline:nil)
971
- req = V1::RoleAttachmentListRequest.new()
972
- req.meta = V1::ListRequestMetadata.new()
973
- page_size_option = @parent._test_options['PageSize']
974
- if page_size_option.is_a? Integer
975
- req.meta.limit = page_size_option
938
+ break
939
+ end
940
+
941
+ resp = RoleAttachmentDeleteResponse.new()
942
+ resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
943
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
944
+ resp
945
+ end
946
+
947
+ # List gets a list of RoleAttachments matching a given set of criteria.
948
+ def list(
949
+ filter,
950
+ *args,
951
+ deadline: nil
952
+ )
953
+ req = V1::RoleAttachmentListRequest.new()
954
+ req.meta = V1::ListRequestMetadata.new()
955
+ page_size_option = @parent._test_options["PageSize"]
956
+ if page_size_option.is_a? Integer
957
+ req.meta.limit = page_size_option
958
+ end
959
+
960
+ req.filter = Plumbing::quote_filter_args(filter, *args)
961
+ resp = Enumerator::Generator.new { |g|
962
+ tries = 0
963
+ loop do
964
+ begin
965
+ plumbing_response = @stub.list(req, metadata: @parent.get_metadata("RoleAttachments.List", req), deadline: deadline)
966
+ rescue => exception
967
+ if (@parent.shouldRetry(tries, exception))
968
+ tries + +@parent.jitterSleep(tries)
969
+ next
976
970
  end
977
-
978
- req.filter = Plumbing::quote_filter_args(filter, *args)
979
- resp = Enumerator::Generator.new { |g|
980
- tries = 0
981
- loop do
982
- begin
983
- plumbing_response = @stub.list(req, metadata: @parent.get_metadata('RoleAttachments.List', req), deadline:deadline)
984
- rescue => exception
985
- if (@parent.shouldRetry(tries, exception))
986
- tries++
987
- @parent.jitterSleep(tries)
988
- next
989
- end
990
- raise Plumbing::error_to_porcelain(exception)
991
- end
992
- tries = 0
993
- plumbing_response.role_attachments.each do |plumbing_item|
994
- g.yield Plumbing::role_attachment_to_porcelain(plumbing_item)
995
- end
996
- break if plumbing_response.meta.next_cursor == ""
997
- req.meta.cursor = plumbing_response.meta.next_cursor
998
- end
999
- }
1000
- resp
971
+ raise Plumbing::convert_error_to_porcelain(exception)
972
+ end
973
+ tries = 0
974
+ plumbing_response.role_attachments.each do |plumbing_item|
975
+ g.yield Plumbing::convert_role_attachment_to_porcelain(plumbing_item)
976
+ end
977
+ break if plumbing_response.meta.next_cursor == ""
978
+ req.meta.cursor = plumbing_response.meta.next_cursor
1001
979
  end
980
+ }
981
+ resp
1002
982
  end
1003
- # RoleGrants represent relationships between composite roles and the roles
1004
- # that make up those composite roles. When a composite role is attached to another
1005
- # role, the permissions granted to members of the composite role are augmented to
1006
- # include the permissions granted to members of the attached role.
1007
- class RoleGrants
1008
- def initialize(host, insecure, parent)
1009
- begin
1010
- if insecure
1011
- @stub = V1::RoleGrants::Stub.new(host, :this_channel_is_insecure)
1012
- else
1013
- cred = GRPC::Core::ChannelCredentials.new()
1014
- @stub = V1::RoleGrants::Stub.new(host, cred)
1015
- end
1016
- rescue => exception
1017
- raise Plumbing::error_to_porcelain(exception)
1018
- end
1019
- @parent = parent
983
+ end
984
+
985
+ # RoleGrants represent relationships between composite roles and the roles
986
+ # that make up those composite roles. When a composite role is attached to another
987
+ # role, the permissions granted to members of the composite role are augmented to
988
+ # include the permissions granted to members of the attached role.
989
+ class RoleGrants
990
+ def initialize(host, insecure, parent)
991
+ begin
992
+ if insecure
993
+ @stub = V1::RoleGrants::Stub.new(host, :this_channel_is_insecure)
994
+ else
995
+ cred = GRPC::Core::ChannelCredentials.new()
996
+ @stub = V1::RoleGrants::Stub.new(host, cred)
1020
997
  end
1021
- # Create registers a new RoleGrant.
1022
- def create(
1023
- role_grant \
1024
- ,
1025
- deadline:nil)
1026
- req = V1::RoleGrantCreateRequest.new()
1027
-
1028
- req.role_grant = Plumbing::role_grant_to_plumbing(role_grant)
1029
- tries = 0
1030
- plumbing_response = nil
1031
- loop do
1032
- begin
1033
- plumbing_response = @stub.create(req, metadata: @parent.get_metadata('RoleGrants.Create', req), deadline:deadline)
1034
- rescue => exception
1035
- if (@parent.shouldRetry(tries, exception))
1036
- tries++
1037
- @parent.jitterSleep(tries)
1038
- next
1039
- end
1040
- raise Plumbing::error_to_porcelain(exception)
1041
- end
1042
- break
1043
- end
998
+ rescue => exception
999
+ raise Plumbing::convert_error_to_porcelain(exception)
1000
+ end
1001
+ @parent = parent
1002
+ end
1044
1003
 
1045
-
1046
- resp = RoleGrantCreateResponse.new()
1047
- resp.meta = Plumbing::create_response_metadata_to_porcelain(plumbing_response.meta)
1048
- resp.role_grant = Plumbing::role_grant_to_porcelain(plumbing_response.role_grant)
1049
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1050
- resp
1004
+ # Create registers a new RoleGrant.
1005
+ def create(
1006
+ role_grant,
1007
+ deadline: nil
1008
+ )
1009
+ req = V1::RoleGrantCreateRequest.new()
1010
+
1011
+ req.role_grant = Plumbing::convert_role_grant_to_plumbing(role_grant)
1012
+ tries = 0
1013
+ plumbing_response = nil
1014
+ loop do
1015
+ begin
1016
+ plumbing_response = @stub.create(req, metadata: @parent.get_metadata("RoleGrants.Create", req), deadline: deadline)
1017
+ rescue => exception
1018
+ if (@parent.shouldRetry(tries, exception))
1019
+ tries + +@parent.jitterSleep(tries)
1020
+ next
1021
+ end
1022
+ raise Plumbing::convert_error_to_porcelain(exception)
1051
1023
  end
1052
- # Get reads one RoleGrant by ID.
1053
- def get(
1054
- id \
1055
- ,
1056
- deadline:nil)
1057
- req = V1::RoleGrantGetRequest.new()
1058
-
1059
- req.id = id
1060
- tries = 0
1061
- plumbing_response = nil
1062
- loop do
1063
- begin
1064
- plumbing_response = @stub.get(req, metadata: @parent.get_metadata('RoleGrants.Get', req), deadline:deadline)
1065
- rescue => exception
1066
- if (@parent.shouldRetry(tries, exception))
1067
- tries++
1068
- @parent.jitterSleep(tries)
1069
- next
1070
- end
1071
- raise Plumbing::error_to_porcelain(exception)
1072
- end
1073
- break
1074
- end
1024
+ break
1025
+ end
1075
1026
 
1076
-
1077
- resp = RoleGrantGetResponse.new()
1078
- resp.meta = Plumbing::get_response_metadata_to_porcelain(plumbing_response.meta)
1079
- resp.role_grant = Plumbing::role_grant_to_porcelain(plumbing_response.role_grant)
1080
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1081
- resp
1027
+ resp = RoleGrantCreateResponse.new()
1028
+ resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
1029
+ resp.role_grant = Plumbing::convert_role_grant_to_porcelain(plumbing_response.role_grant)
1030
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1031
+ resp
1032
+ end
1033
+
1034
+ # Get reads one RoleGrant by ID.
1035
+ def get(
1036
+ id,
1037
+ deadline: nil
1038
+ )
1039
+ req = V1::RoleGrantGetRequest.new()
1040
+
1041
+ req.id = (id)
1042
+ tries = 0
1043
+ plumbing_response = nil
1044
+ loop do
1045
+ begin
1046
+ plumbing_response = @stub.get(req, metadata: @parent.get_metadata("RoleGrants.Get", req), deadline: deadline)
1047
+ rescue => exception
1048
+ if (@parent.shouldRetry(tries, exception))
1049
+ tries + +@parent.jitterSleep(tries)
1050
+ next
1051
+ end
1052
+ raise Plumbing::convert_error_to_porcelain(exception)
1082
1053
  end
1083
- # Delete removes a RoleGrant by ID.
1084
- def delete(
1085
- id \
1086
- ,
1087
- deadline:nil)
1088
- req = V1::RoleGrantDeleteRequest.new()
1089
-
1090
- req.id = id
1091
- tries = 0
1092
- plumbing_response = nil
1093
- loop do
1094
- begin
1095
- plumbing_response = @stub.delete(req, metadata: @parent.get_metadata('RoleGrants.Delete', req), deadline:deadline)
1096
- rescue => exception
1097
- if (@parent.shouldRetry(tries, exception))
1098
- tries++
1099
- @parent.jitterSleep(tries)
1100
- next
1101
- end
1102
- raise Plumbing::error_to_porcelain(exception)
1103
- end
1104
- break
1105
- end
1054
+ break
1055
+ end
1106
1056
 
1107
-
1108
- resp = RoleGrantDeleteResponse.new()
1109
- resp.meta = Plumbing::delete_response_metadata_to_porcelain(plumbing_response.meta)
1110
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1111
- resp
1057
+ resp = RoleGrantGetResponse.new()
1058
+ resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
1059
+ resp.role_grant = Plumbing::convert_role_grant_to_porcelain(plumbing_response.role_grant)
1060
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1061
+ resp
1062
+ end
1063
+
1064
+ # Delete removes a RoleGrant by ID.
1065
+ def delete(
1066
+ id,
1067
+ deadline: nil
1068
+ )
1069
+ req = V1::RoleGrantDeleteRequest.new()
1070
+
1071
+ req.id = (id)
1072
+ tries = 0
1073
+ plumbing_response = nil
1074
+ loop do
1075
+ begin
1076
+ plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("RoleGrants.Delete", req), deadline: deadline)
1077
+ rescue => exception
1078
+ if (@parent.shouldRetry(tries, exception))
1079
+ tries + +@parent.jitterSleep(tries)
1080
+ next
1081
+ end
1082
+ raise Plumbing::convert_error_to_porcelain(exception)
1112
1083
  end
1113
- # List gets a list of RoleGrants matching a given set of criteria.
1114
- def list(
1115
- filter \
1116
- ,
1117
- *args,
1118
- deadline:nil)
1119
- req = V1::RoleGrantListRequest.new()
1120
- req.meta = V1::ListRequestMetadata.new()
1121
- page_size_option = @parent._test_options['PageSize']
1122
- if page_size_option.is_a? Integer
1123
- req.meta.limit = page_size_option
1084
+ break
1085
+ end
1086
+
1087
+ resp = RoleGrantDeleteResponse.new()
1088
+ resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
1089
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1090
+ resp
1091
+ end
1092
+
1093
+ # List gets a list of RoleGrants matching a given set of criteria.
1094
+ def list(
1095
+ filter,
1096
+ *args,
1097
+ deadline: nil
1098
+ )
1099
+ req = V1::RoleGrantListRequest.new()
1100
+ req.meta = V1::ListRequestMetadata.new()
1101
+ page_size_option = @parent._test_options["PageSize"]
1102
+ if page_size_option.is_a? Integer
1103
+ req.meta.limit = page_size_option
1104
+ end
1105
+
1106
+ req.filter = Plumbing::quote_filter_args(filter, *args)
1107
+ resp = Enumerator::Generator.new { |g|
1108
+ tries = 0
1109
+ loop do
1110
+ begin
1111
+ plumbing_response = @stub.list(req, metadata: @parent.get_metadata("RoleGrants.List", req), deadline: deadline)
1112
+ rescue => exception
1113
+ if (@parent.shouldRetry(tries, exception))
1114
+ tries + +@parent.jitterSleep(tries)
1115
+ next
1124
1116
  end
1125
-
1126
- req.filter = Plumbing::quote_filter_args(filter, *args)
1127
- resp = Enumerator::Generator.new { |g|
1128
- tries = 0
1129
- loop do
1130
- begin
1131
- plumbing_response = @stub.list(req, metadata: @parent.get_metadata('RoleGrants.List', req), deadline:deadline)
1132
- rescue => exception
1133
- if (@parent.shouldRetry(tries, exception))
1134
- tries++
1135
- @parent.jitterSleep(tries)
1136
- next
1137
- end
1138
- raise Plumbing::error_to_porcelain(exception)
1139
- end
1140
- tries = 0
1141
- plumbing_response.role_grants.each do |plumbing_item|
1142
- g.yield Plumbing::role_grant_to_porcelain(plumbing_item)
1143
- end
1144
- break if plumbing_response.meta.next_cursor == ""
1145
- req.meta.cursor = plumbing_response.meta.next_cursor
1146
- end
1147
- }
1148
- resp
1117
+ raise Plumbing::convert_error_to_porcelain(exception)
1118
+ end
1119
+ tries = 0
1120
+ plumbing_response.role_grants.each do |plumbing_item|
1121
+ g.yield Plumbing::convert_role_grant_to_porcelain(plumbing_item)
1122
+ end
1123
+ break if plumbing_response.meta.next_cursor == ""
1124
+ req.meta.cursor = plumbing_response.meta.next_cursor
1149
1125
  end
1126
+ }
1127
+ resp
1150
1128
  end
1151
- # Roles are tools for controlling user access to resources. Each Role holds a
1152
- # list of resources which they grant access to. Composite roles are a special
1153
- # type of Role which have no resource associations of their own, but instead
1154
- # grant access to the combined resources associated with a set of child roles.
1155
- # Each user can be a member of one Role or composite role.
1156
- class Roles
1157
- def initialize(host, insecure, parent)
1158
- begin
1159
- if insecure
1160
- @stub = V1::Roles::Stub.new(host, :this_channel_is_insecure)
1161
- else
1162
- cred = GRPC::Core::ChannelCredentials.new()
1163
- @stub = V1::Roles::Stub.new(host, cred)
1164
- end
1165
- rescue => exception
1166
- raise Plumbing::error_to_porcelain(exception)
1167
- end
1168
- @parent = parent
1129
+ end
1130
+
1131
+ # Roles are tools for controlling user access to resources. Each Role holds a
1132
+ # list of resources which they grant access to. Composite roles are a special
1133
+ # type of Role which have no resource associations of their own, but instead
1134
+ # grant access to the combined resources associated with a set of child roles.
1135
+ # Each user can be a member of one Role or composite role.
1136
+ class Roles
1137
+ def initialize(host, insecure, parent)
1138
+ begin
1139
+ if insecure
1140
+ @stub = V1::Roles::Stub.new(host, :this_channel_is_insecure)
1141
+ else
1142
+ cred = GRPC::Core::ChannelCredentials.new()
1143
+ @stub = V1::Roles::Stub.new(host, cred)
1169
1144
  end
1170
- # Create registers a new Role.
1171
- def create(
1172
- role \
1173
- ,
1174
- deadline:nil)
1175
- req = V1::RoleCreateRequest.new()
1176
-
1177
- req.role = Plumbing::role_to_plumbing(role)
1178
- tries = 0
1179
- plumbing_response = nil
1180
- loop do
1181
- begin
1182
- plumbing_response = @stub.create(req, metadata: @parent.get_metadata('Roles.Create', req), deadline:deadline)
1183
- rescue => exception
1184
- if (@parent.shouldRetry(tries, exception))
1185
- tries++
1186
- @parent.jitterSleep(tries)
1187
- next
1188
- end
1189
- raise Plumbing::error_to_porcelain(exception)
1190
- end
1191
- break
1192
- end
1145
+ rescue => exception
1146
+ raise Plumbing::convert_error_to_porcelain(exception)
1147
+ end
1148
+ @parent = parent
1149
+ end
1150
+
1151
+ # Create registers a new Role.
1152
+ def create(
1153
+ role,
1154
+ deadline: nil
1155
+ )
1156
+ req = V1::RoleCreateRequest.new()
1193
1157
 
1194
-
1195
- resp = RoleCreateResponse.new()
1196
- resp.meta = Plumbing::create_response_metadata_to_porcelain(plumbing_response.meta)
1197
- resp.role = Plumbing::role_to_porcelain(plumbing_response.role)
1198
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1199
- resp
1158
+ req.role = Plumbing::convert_role_to_plumbing(role)
1159
+ tries = 0
1160
+ plumbing_response = nil
1161
+ loop do
1162
+ begin
1163
+ plumbing_response = @stub.create(req, metadata: @parent.get_metadata("Roles.Create", req), deadline: deadline)
1164
+ rescue => exception
1165
+ if (@parent.shouldRetry(tries, exception))
1166
+ tries + +@parent.jitterSleep(tries)
1167
+ next
1168
+ end
1169
+ raise Plumbing::convert_error_to_porcelain(exception)
1200
1170
  end
1201
- # Get reads one Role by ID.
1202
- def get(
1203
- id \
1204
- ,
1205
- deadline:nil)
1206
- req = V1::RoleGetRequest.new()
1207
-
1208
- req.id = id
1209
- tries = 0
1210
- plumbing_response = nil
1211
- loop do
1212
- begin
1213
- plumbing_response = @stub.get(req, metadata: @parent.get_metadata('Roles.Get', req), deadline:deadline)
1214
- rescue => exception
1215
- if (@parent.shouldRetry(tries, exception))
1216
- tries++
1217
- @parent.jitterSleep(tries)
1218
- next
1219
- end
1220
- raise Plumbing::error_to_porcelain(exception)
1221
- end
1222
- break
1223
- end
1171
+ break
1172
+ end
1173
+
1174
+ resp = RoleCreateResponse.new()
1175
+ resp.meta = Plumbing::convert_create_response_metadata_to_porcelain(plumbing_response.meta)
1176
+ resp.role = Plumbing::convert_role_to_porcelain(plumbing_response.role)
1177
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1178
+ resp
1179
+ end
1224
1180
 
1225
-
1226
- resp = RoleGetResponse.new()
1227
- resp.meta = Plumbing::get_response_metadata_to_porcelain(plumbing_response.meta)
1228
- resp.role = Plumbing::role_to_porcelain(plumbing_response.role)
1229
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1230
- resp
1181
+ # Get reads one Role by ID.
1182
+ def get(
1183
+ id,
1184
+ deadline: nil
1185
+ )
1186
+ req = V1::RoleGetRequest.new()
1187
+
1188
+ req.id = (id)
1189
+ tries = 0
1190
+ plumbing_response = nil
1191
+ loop do
1192
+ begin
1193
+ plumbing_response = @stub.get(req, metadata: @parent.get_metadata("Roles.Get", req), deadline: deadline)
1194
+ rescue => exception
1195
+ if (@parent.shouldRetry(tries, exception))
1196
+ tries + +@parent.jitterSleep(tries)
1197
+ next
1198
+ end
1199
+ raise Plumbing::convert_error_to_porcelain(exception)
1231
1200
  end
1232
- # Update patches a Role by ID.
1233
- def update(
1234
- role \
1235
- ,
1236
- deadline:nil)
1237
- req = V1::RoleUpdateRequest.new()
1238
-
1239
- req.role = Plumbing::role_to_plumbing(role)
1240
- tries = 0
1241
- plumbing_response = nil
1242
- loop do
1243
- begin
1244
- plumbing_response = @stub.update(req, metadata: @parent.get_metadata('Roles.Update', req), deadline:deadline)
1245
- rescue => exception
1246
- if (@parent.shouldRetry(tries, exception))
1247
- tries++
1248
- @parent.jitterSleep(tries)
1249
- next
1250
- end
1251
- raise Plumbing::error_to_porcelain(exception)
1252
- end
1253
- break
1254
- end
1201
+ break
1202
+ end
1203
+
1204
+ resp = RoleGetResponse.new()
1205
+ resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)
1206
+ resp.role = Plumbing::convert_role_to_porcelain(plumbing_response.role)
1207
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1208
+ resp
1209
+ end
1255
1210
 
1256
-
1257
- resp = RoleUpdateResponse.new()
1258
- resp.meta = Plumbing::update_response_metadata_to_porcelain(plumbing_response.meta)
1259
- resp.role = Plumbing::role_to_porcelain(plumbing_response.role)
1260
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1261
- resp
1211
+ # Update patches a Role by ID.
1212
+ def update(
1213
+ role,
1214
+ deadline: nil
1215
+ )
1216
+ req = V1::RoleUpdateRequest.new()
1217
+
1218
+ req.role = Plumbing::convert_role_to_plumbing(role)
1219
+ tries = 0
1220
+ plumbing_response = nil
1221
+ loop do
1222
+ begin
1223
+ plumbing_response = @stub.update(req, metadata: @parent.get_metadata("Roles.Update", req), deadline: deadline)
1224
+ rescue => exception
1225
+ if (@parent.shouldRetry(tries, exception))
1226
+ tries + +@parent.jitterSleep(tries)
1227
+ next
1228
+ end
1229
+ raise Plumbing::convert_error_to_porcelain(exception)
1262
1230
  end
1263
- # Delete removes a Role by ID.
1264
- def delete(
1265
- id \
1266
- ,
1267
- deadline:nil)
1268
- req = V1::RoleDeleteRequest.new()
1269
-
1270
- req.id = id
1271
- tries = 0
1272
- plumbing_response = nil
1273
- loop do
1274
- begin
1275
- plumbing_response = @stub.delete(req, metadata: @parent.get_metadata('Roles.Delete', req), deadline:deadline)
1276
- rescue => exception
1277
- if (@parent.shouldRetry(tries, exception))
1278
- tries++
1279
- @parent.jitterSleep(tries)
1280
- next
1281
- end
1282
- raise Plumbing::error_to_porcelain(exception)
1283
- end
1284
- break
1285
- end
1231
+ break
1232
+ end
1233
+
1234
+ resp = RoleUpdateResponse.new()
1235
+ resp.meta = Plumbing::convert_update_response_metadata_to_porcelain(plumbing_response.meta)
1236
+ resp.role = Plumbing::convert_role_to_porcelain(plumbing_response.role)
1237
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1238
+ resp
1239
+ end
1240
+
1241
+ # Delete removes a Role by ID.
1242
+ def delete(
1243
+ id,
1244
+ deadline: nil
1245
+ )
1246
+ req = V1::RoleDeleteRequest.new()
1286
1247
 
1287
-
1288
- resp = RoleDeleteResponse.new()
1289
- resp.meta = Plumbing::delete_response_metadata_to_porcelain(plumbing_response.meta)
1290
- resp.rate_limit = Plumbing::rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1291
- resp
1248
+ req.id = (id)
1249
+ tries = 0
1250
+ plumbing_response = nil
1251
+ loop do
1252
+ begin
1253
+ plumbing_response = @stub.delete(req, metadata: @parent.get_metadata("Roles.Delete", req), deadline: deadline)
1254
+ rescue => exception
1255
+ if (@parent.shouldRetry(tries, exception))
1256
+ tries + +@parent.jitterSleep(tries)
1257
+ next
1258
+ end
1259
+ raise Plumbing::convert_error_to_porcelain(exception)
1292
1260
  end
1293
- # List gets a list of Roles matching a given set of criteria.
1294
- def list(
1295
- filter \
1296
- ,
1297
- *args,
1298
- deadline:nil)
1299
- req = V1::RoleListRequest.new()
1300
- req.meta = V1::ListRequestMetadata.new()
1301
- page_size_option = @parent._test_options['PageSize']
1302
- if page_size_option.is_a? Integer
1303
- req.meta.limit = page_size_option
1261
+ break
1262
+ end
1263
+
1264
+ resp = RoleDeleteResponse.new()
1265
+ resp.meta = Plumbing::convert_delete_response_metadata_to_porcelain(plumbing_response.meta)
1266
+ resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)
1267
+ resp
1268
+ end
1269
+
1270
+ # List gets a list of Roles matching a given set of criteria.
1271
+ def list(
1272
+ filter,
1273
+ *args,
1274
+ deadline: nil
1275
+ )
1276
+ req = V1::RoleListRequest.new()
1277
+ req.meta = V1::ListRequestMetadata.new()
1278
+ page_size_option = @parent._test_options["PageSize"]
1279
+ if page_size_option.is_a? Integer
1280
+ req.meta.limit = page_size_option
1281
+ end
1282
+
1283
+ req.filter = Plumbing::quote_filter_args(filter, *args)
1284
+ resp = Enumerator::Generator.new { |g|
1285
+ tries = 0
1286
+ loop do
1287
+ begin
1288
+ plumbing_response = @stub.list(req, metadata: @parent.get_metadata("Roles.List", req), deadline: deadline)
1289
+ rescue => exception
1290
+ if (@parent.shouldRetry(tries, exception))
1291
+ tries + +@parent.jitterSleep(tries)
1292
+ next
1304
1293
  end
1305
-
1306
- req.filter = Plumbing::quote_filter_args(filter, *args)
1307
- resp = Enumerator::Generator.new { |g|
1308
- tries = 0
1309
- loop do
1310
- begin
1311
- plumbing_response = @stub.list(req, metadata: @parent.get_metadata('Roles.List', req), deadline:deadline)
1312
- rescue => exception
1313
- if (@parent.shouldRetry(tries, exception))
1314
- tries++
1315
- @parent.jitterSleep(tries)
1316
- next
1317
- end
1318
- raise Plumbing::error_to_porcelain(exception)
1319
- end
1320
- tries = 0
1321
- plumbing_response.roles.each do |plumbing_item|
1322
- g.yield Plumbing::role_to_porcelain(plumbing_item)
1323
- end
1324
- break if plumbing_response.meta.next_cursor == ""
1325
- req.meta.cursor = plumbing_response.meta.next_cursor
1326
- end
1327
- }
1328
- resp
1294
+ raise Plumbing::convert_error_to_porcelain(exception)
1295
+ end
1296
+ tries = 0
1297
+ plumbing_response.roles.each do |plumbing_item|
1298
+ g.yield Plumbing::convert_role_to_porcelain(plumbing_item)
1299
+ end
1300
+ break if plumbing_response.meta.next_cursor == ""
1301
+ req.meta.cursor = plumbing_response.meta.next_cursor
1329
1302
  end
1303
+ }
1304
+ resp
1330
1305
  end
1306
+ end
1331
1307
  end