yandex-cloud
Version:
Yandex Cloud SDK
1,287 lines • 93.4 kB
JavaScript
module.exports = (function() {
const $protobuf = require('protobufjs');
const grpc = require('grpc');
const registar = require('../../../lib/registar.js');
const util = require('../../../lib/util.js');
const yc = require('../../../index.js');
const $Reader = $protobuf.Reader;
const $Writer = $protobuf.Writer;
const $util = $protobuf.util;
let root = {};
require('../../../api/operation');
require('../../../api/access');
(function($root) {
$root.ApiKey = (function() {
function ApiKey(p) {
if (p) for (let ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]];
}
ApiKey.prototype.id = '';
ApiKey.prototype.serviceAccountId = '';
ApiKey.prototype.createdAt = null;
ApiKey.prototype.description = '';
ApiKey.encode = function encode(m, w) {
if (!w) w = $Writer.create();
if (m.id != null && m.hasOwnProperty('id')) w.uint32(10).string(m.id);
if (m.serviceAccountId != null && m.hasOwnProperty('serviceAccountId')) w.uint32(18).string(m.serviceAccountId);
if (m.createdAt != null && m.hasOwnProperty('createdAt')) $root.contrib.google.protobuf.Timestamp.encode(m.createdAt, w.uint32(26).fork()).ldelim();
if (m.description != null && m.hasOwnProperty('description')) w.uint32(34).string(m.description);
return w;
};
ApiKey.decode = function decode(r, l) {
if (!(r instanceof $Reader)) r = $Reader.create(r);
let c = l === undefined ? r.len : r.pos + l,
m = new $root.api.iam.v1.ApiKey();
while (r.pos < c) {
let t = r.uint32();
switch (t >>> 3) {
case 1:
m.id = r.string();
break;
case 2:
m.serviceAccountId = r.string();
break;
case 3:
m.createdAt = $root.contrib.google.protobuf.Timestamp.decode(r, r.uint32());
break;
case 4:
m.description = r.string();
break;
default:
r.skipType(t & 7);
break;
}
}
return m;
};
return ApiKey;
})();
})(root);
(function($root) {
$root.ApiKeyService = function(session) {
if (session === undefined) {
session = new yc.Session();
}
return session.client($root.ApiKeyService.makeGrpcConstructor());
};
$root.ApiKeyService.makeGrpcConstructor = () => {
let ctor = grpc.makeGenericClientConstructor({
list: {
path: '/yandex.cloud.iam.v1.ApiKeyService/List',
requestStream: false,
responseStream: false,
requestType: $root.api.iam.v1.ListApiKeysRequest,
responseType: $root.api.iam.v1.ListApiKeysResponse,
requestSerialize: r => {
return $root.api.iam.v1.ListApiKeysRequest.encode(r).finish();
},
requestDeserialize: $root.api.iam.v1.ListApiKeysRequest.decode,
responseSerialize: r => {
return $root.api.iam.v1.ListApiKeysResponse.encode(r).finish();
},
responseDeserialize: $root.api.iam.v1.ListApiKeysResponse.decode
},
get: {
path: '/yandex.cloud.iam.v1.ApiKeyService/Get',
requestStream: false,
responseStream: false,
requestType: $root.api.iam.v1.GetApiKeyRequest,
responseType: $root.api.iam.v1.ApiKey,
requestSerialize: r => {
return $root.api.iam.v1.GetApiKeyRequest.encode(r).finish();
},
requestDeserialize: $root.api.iam.v1.GetApiKeyRequest.decode,
responseSerialize: r => {
return $root.api.iam.v1.ApiKey.encode(r).finish();
},
responseDeserialize: $root.api.iam.v1.ApiKey.decode
},
create: {
path: '/yandex.cloud.iam.v1.ApiKeyService/Create',
requestStream: false,
responseStream: false,
requestType: $root.api.iam.v1.CreateApiKeyRequest,
responseType: $root.api.iam.v1.CreateApiKeyResponse,
requestSerialize: r => {
return $root.api.iam.v1.CreateApiKeyRequest.encode(r).finish();
},
requestDeserialize: $root.api.iam.v1.CreateApiKeyRequest.decode,
responseSerialize: r => {
return $root.api.iam.v1.CreateApiKeyResponse.encode(r).finish();
},
responseDeserialize: $root.api.iam.v1.CreateApiKeyResponse.decode
},
update: {
path: '/yandex.cloud.iam.v1.ApiKeyService/Update',
requestStream: false,
responseStream: false,
requestType: $root.api.iam.v1.UpdateApiKeyRequest,
responseType: $root.api.operation.Operation,
requestSerialize: r => {
return $root.api.iam.v1.UpdateApiKeyRequest.encode(r).finish();
},
requestDeserialize: $root.api.iam.v1.UpdateApiKeyRequest.decode,
responseSerialize: r => {
return $root.api.operation.Operation.encode(r).finish();
},
responseDeserialize: $root.api.operation.Operation.decode
},
delete: {
path: '/yandex.cloud.iam.v1.ApiKeyService/Delete',
requestStream: false,
responseStream: false,
requestType: $root.api.iam.v1.DeleteApiKeyRequest,
responseType: $root.api.operation.Operation,
requestSerialize: r => {
return $root.api.iam.v1.DeleteApiKeyRequest.encode(r).finish();
},
requestDeserialize: $root.api.iam.v1.DeleteApiKeyRequest.decode,
responseSerialize: r => {
return $root.api.operation.Operation.encode(r).finish();
},
responseDeserialize: $root.api.operation.Operation.decode
},
listOperations: {
path: '/yandex.cloud.iam.v1.ApiKeyService/ListOperations',
requestStream: false,
responseStream: false,
requestType: $root.api.iam.v1.ListApiKeyOperationsRequest,
responseType: $root.api.iam.v1.ListApiKeyOperationsResponse,
requestSerialize: r => {
return $root.api.iam.v1.ListApiKeyOperationsRequest.encode(r).finish();
},
requestDeserialize: $root.api.iam.v1.ListApiKeyOperationsRequest.decode,
responseSerialize: r => {
return $root.api.iam.v1.ListApiKeyOperationsResponse.encode(r).finish();
},
responseDeserialize: $root.api.iam.v1.ListApiKeyOperationsResponse.decode
}
});
ctor.__endpointId = 'iam';
return ctor;
};
})(root);
(function($root) {
$root.GetApiKeyRequest = (function() {
function GetApiKeyRequest(p) {
if (p) for (let ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]];
}
GetApiKeyRequest.prototype.apiKeyId = '';
GetApiKeyRequest.encode = function encode(m, w) {
if (!w) w = $Writer.create();
if (m.apiKeyId != null && m.hasOwnProperty('apiKeyId')) w.uint32(10).string(m.apiKeyId);
return w;
};
GetApiKeyRequest.decode = function decode(r, l) {
if (!(r instanceof $Reader)) r = $Reader.create(r);
let c = l === undefined ? r.len : r.pos + l,
m = new $root.api.iam.v1.GetApiKeyRequest();
while (r.pos < c) {
let t = r.uint32();
switch (t >>> 3) {
case 1:
m.apiKeyId = r.string();
break;
default:
r.skipType(t & 7);
break;
}
}
return m;
};
return GetApiKeyRequest;
})();
})(root);
(function($root) {
$root.ListApiKeysRequest = (function() {
function ListApiKeysRequest(p) {
if (p) for (let ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]];
}
ListApiKeysRequest.prototype.serviceAccountId = '';
ListApiKeysRequest.prototype.pageSize = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;
ListApiKeysRequest.prototype.pageToken = '';
ListApiKeysRequest.encode = function encode(m, w) {
if (!w) w = $Writer.create();
if (m.serviceAccountId != null && m.hasOwnProperty('serviceAccountId')) w.uint32(10).string(m.serviceAccountId);
if (m.pageSize != null && m.hasOwnProperty('pageSize')) w.uint32(16).int64(m.pageSize);
if (m.pageToken != null && m.hasOwnProperty('pageToken')) w.uint32(26).string(m.pageToken);
return w;
};
ListApiKeysRequest.decode = function decode(r, l) {
if (!(r instanceof $Reader)) r = $Reader.create(r);
let c = l === undefined ? r.len : r.pos + l,
m = new $root.api.iam.v1.ListApiKeysRequest();
while (r.pos < c) {
let t = r.uint32();
switch (t >>> 3) {
case 1:
m.serviceAccountId = r.string();
break;
case 2:
m.pageSize = r.int64();
break;
case 3:
m.pageToken = r.string();
break;
default:
r.skipType(t & 7);
break;
}
}
return m;
};
return ListApiKeysRequest;
})();
})(root);
(function($root) {
$root.ListApiKeysResponse = (function() {
function ListApiKeysResponse(p) {
this.apiKeys = [];
if (p) for (let ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]];
}
ListApiKeysResponse.prototype.apiKeys = $util.emptyArray;
ListApiKeysResponse.prototype.nextPageToken = '';
ListApiKeysResponse.encode = function encode(m, w) {
if (!w) w = $Writer.create();
if (m.apiKeys != null && m.apiKeys.length) {
for (let i = 0; i < m.apiKeys.length; ++i) $root.api.iam.v1.ApiKey.encode(m.apiKeys[i], w.uint32(10).fork()).ldelim();
}
if (m.nextPageToken != null && m.hasOwnProperty('nextPageToken')) w.uint32(18).string(m.nextPageToken);
return w;
};
ListApiKeysResponse.decode = function decode(r, l) {
if (!(r instanceof $Reader)) r = $Reader.create(r);
let c = l === undefined ? r.len : r.pos + l,
m = new $root.api.iam.v1.ListApiKeysResponse();
while (r.pos < c) {
let t = r.uint32();
switch (t >>> 3) {
case 1:
if (!(m.apiKeys && m.apiKeys.length)) m.apiKeys = [];
m.apiKeys.push($root.api.iam.v1.ApiKey.decode(r, r.uint32()));
break;
case 2:
m.nextPageToken = r.string();
break;
default:
r.skipType(t & 7);
break;
}
}
return m;
};
return ListApiKeysResponse;
})();
})(root);
(function($root) {
$root.CreateApiKeyRequest = (function() {
function CreateApiKeyRequest(p) {
if (p) for (let ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]];
}
CreateApiKeyRequest.prototype.serviceAccountId = '';
CreateApiKeyRequest.prototype.description = '';
CreateApiKeyRequest.encode = function encode(m, w) {
if (!w) w = $Writer.create();
if (m.serviceAccountId != null && m.hasOwnProperty('serviceAccountId')) w.uint32(10).string(m.serviceAccountId);
if (m.description != null && m.hasOwnProperty('description')) w.uint32(18).string(m.description);
return w;
};
CreateApiKeyRequest.decode = function decode(r, l) {
if (!(r instanceof $Reader)) r = $Reader.create(r);
let c = l === undefined ? r.len : r.pos + l,
m = new $root.api.iam.v1.CreateApiKeyRequest();
while (r.pos < c) {
let t = r.uint32();
switch (t >>> 3) {
case 1:
m.serviceAccountId = r.string();
break;
case 2:
m.description = r.string();
break;
default:
r.skipType(t & 7);
break;
}
}
return m;
};
return CreateApiKeyRequest;
})();
})(root);
(function($root) {
$root.CreateApiKeyResponse = (function() {
function CreateApiKeyResponse(p) {
if (p) for (let ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]];
}
CreateApiKeyResponse.prototype.apiKey = null;
CreateApiKeyResponse.prototype.secret = '';
CreateApiKeyResponse.encode = function encode(m, w) {
if (!w) w = $Writer.create();
if (m.apiKey != null && m.hasOwnProperty('apiKey')) $root.api.iam.v1.ApiKey.encode(m.apiKey, w.uint32(10).fork()).ldelim();
if (m.secret != null && m.hasOwnProperty('secret')) w.uint32(18).string(m.secret);
return w;
};
CreateApiKeyResponse.decode = function decode(r, l) {
if (!(r instanceof $Reader)) r = $Reader.create(r);
let c = l === undefined ? r.len : r.pos + l,
m = new $root.api.iam.v1.CreateApiKeyResponse();
while (r.pos < c) {
let t = r.uint32();
switch (t >>> 3) {
case 1:
m.apiKey = $root.api.iam.v1.ApiKey.decode(r, r.uint32());
break;
case 2:
m.secret = r.string();
break;
default:
r.skipType(t & 7);
break;
}
}
return m;
};
return CreateApiKeyResponse;
})();
})(root);
(function($root) {
$root.UpdateApiKeyRequest = (function() {
function UpdateApiKeyRequest(p) {
if (p) for (let ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]];
}
UpdateApiKeyRequest.prototype.apiKeyId = '';
UpdateApiKeyRequest.prototype.updateMask = null;
UpdateApiKeyRequest.prototype.description = '';
UpdateApiKeyRequest.encode = function encode(m, w) {
if (!w) w = $Writer.create();
if (m.apiKeyId != null && m.hasOwnProperty('apiKeyId')) w.uint32(10).string(m.apiKeyId);
if (m.updateMask != null && m.hasOwnProperty('updateMask')) $root.contrib.google.protobuf.FieldMask.encode(m.updateMask, w.uint32(18).fork()).ldelim();
if (m.description != null && m.hasOwnProperty('description')) w.uint32(26).string(m.description);
return w;
};
UpdateApiKeyRequest.decode = function decode(r, l) {
if (!(r instanceof $Reader)) r = $Reader.create(r);
let c = l === undefined ? r.len : r.pos + l,
m = new $root.api.iam.v1.UpdateApiKeyRequest();
while (r.pos < c) {
let t = r.uint32();
switch (t >>> 3) {
case 1:
m.apiKeyId = r.string();
break;
case 2:
m.updateMask = $root.contrib.google.protobuf.FieldMask.decode(r, r.uint32());
break;
case 3:
m.description = r.string();
break;
default:
r.skipType(t & 7);
break;
}
}
return m;
};
return UpdateApiKeyRequest;
})();
})(root);
(function($root) {
$root.UpdateApiKeyMetadata = (function() {
function UpdateApiKeyMetadata(p) {
if (p) for (let ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]];
}
UpdateApiKeyMetadata.prototype.apiKeyId = '';
UpdateApiKeyMetadata.encode = function encode(m, w) {
if (!w) w = $Writer.create();
if (m.apiKeyId != null && m.hasOwnProperty('apiKeyId')) w.uint32(10).string(m.apiKeyId);
return w;
};
UpdateApiKeyMetadata.decode = function decode(r, l) {
if (!(r instanceof $Reader)) r = $Reader.create(r);
let c = l === undefined ? r.len : r.pos + l,
m = new $root.api.iam.v1.UpdateApiKeyMetadata();
while (r.pos < c) {
let t = r.uint32();
switch (t >>> 3) {
case 1:
m.apiKeyId = r.string();
break;
default:
r.skipType(t & 7);
break;
}
}
return m;
};
return UpdateApiKeyMetadata;
})();
})(root);
(function($root) {
$root.DeleteApiKeyRequest = (function() {
function DeleteApiKeyRequest(p) {
if (p) for (let ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]];
}
DeleteApiKeyRequest.prototype.apiKeyId = '';
DeleteApiKeyRequest.encode = function encode(m, w) {
if (!w) w = $Writer.create();
if (m.apiKeyId != null && m.hasOwnProperty('apiKeyId')) w.uint32(10).string(m.apiKeyId);
return w;
};
DeleteApiKeyRequest.decode = function decode(r, l) {
if (!(r instanceof $Reader)) r = $Reader.create(r);
let c = l === undefined ? r.len : r.pos + l,
m = new $root.api.iam.v1.DeleteApiKeyRequest();
while (r.pos < c) {
let t = r.uint32();
switch (t >>> 3) {
case 1:
m.apiKeyId = r.string();
break;
default:
r.skipType(t & 7);
break;
}
}
return m;
};
return DeleteApiKeyRequest;
})();
})(root);
(function($root) {
$root.DeleteApiKeyMetadata = (function() {
function DeleteApiKeyMetadata(p) {
if (p) for (let ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]];
}
DeleteApiKeyMetadata.prototype.apiKeyId = '';
DeleteApiKeyMetadata.encode = function encode(m, w) {
if (!w) w = $Writer.create();
if (m.apiKeyId != null && m.hasOwnProperty('apiKeyId')) w.uint32(10).string(m.apiKeyId);
return w;
};
DeleteApiKeyMetadata.decode = function decode(r, l) {
if (!(r instanceof $Reader)) r = $Reader.create(r);
let c = l === undefined ? r.len : r.pos + l,
m = new $root.api.iam.v1.DeleteApiKeyMetadata();
while (r.pos < c) {
let t = r.uint32();
switch (t >>> 3) {
case 1:
m.apiKeyId = r.string();
break;
default:
r.skipType(t & 7);
break;
}
}
return m;
};
return DeleteApiKeyMetadata;
})();
})(root);
(function($root) {
$root.ListApiKeyOperationsRequest = (function() {
function ListApiKeyOperationsRequest(p) {
if (p) for (let ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]];
}
ListApiKeyOperationsRequest.prototype.apiKeyId = '';
ListApiKeyOperationsRequest.prototype.pageSize = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;
ListApiKeyOperationsRequest.prototype.pageToken = '';
ListApiKeyOperationsRequest.encode = function encode(m, w) {
if (!w) w = $Writer.create();
if (m.apiKeyId != null && m.hasOwnProperty('apiKeyId')) w.uint32(10).string(m.apiKeyId);
if (m.pageSize != null && m.hasOwnProperty('pageSize')) w.uint32(16).int64(m.pageSize);
if (m.pageToken != null && m.hasOwnProperty('pageToken')) w.uint32(26).string(m.pageToken);
return w;
};
ListApiKeyOperationsRequest.decode = function decode(r, l) {
if (!(r instanceof $Reader)) r = $Reader.create(r);
let c = l === undefined ? r.len : r.pos + l,
m = new $root.api.iam.v1.ListApiKeyOperationsRequest();
while (r.pos < c) {
let t = r.uint32();
switch (t >>> 3) {
case 1:
m.apiKeyId = r.string();
break;
case 2:
m.pageSize = r.int64();
break;
case 3:
m.pageToken = r.string();
break;
default:
r.skipType(t & 7);
break;
}
}
return m;
};
return ListApiKeyOperationsRequest;
})();
})(root);
(function($root) {
$root.ListApiKeyOperationsResponse = (function() {
function ListApiKeyOperationsResponse(p) {
this.operations = [];
if (p) for (let ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]];
}
ListApiKeyOperationsResponse.prototype.operations = $util.emptyArray;
ListApiKeyOperationsResponse.prototype.nextPageToken = '';
ListApiKeyOperationsResponse.encode = function encode(m, w) {
if (!w) w = $Writer.create();
if (m.operations != null && m.operations.length) {
for (let i = 0; i < m.operations.length; ++i) $root.api.operation.Operation.encode(m.operations[i], w.uint32(10).fork()).ldelim();
}
if (m.nextPageToken != null && m.hasOwnProperty('nextPageToken')) w.uint32(18).string(m.nextPageToken);
return w;
};
ListApiKeyOperationsResponse.decode = function decode(r, l) {
if (!(r instanceof $Reader)) r = $Reader.create(r);
let c = l === undefined ? r.len : r.pos + l,
m = new $root.api.iam.v1.ListApiKeyOperationsResponse();
while (r.pos < c) {
let t = r.uint32();
switch (t >>> 3) {
case 1:
if (!(m.operations && m.operations.length)) m.operations = [];
m.operations.push($root.api.operation.Operation.decode(r, r.uint32()));
break;
case 2:
m.nextPageToken = r.string();
break;
default:
r.skipType(t & 7);
break;
}
}
return m;
};
return ListApiKeyOperationsResponse;
})();
})(root);
(function($root) {
$root.IamTokenService = function(session) {
if (session === undefined) {
session = new yc.Session();
}
return session.client($root.IamTokenService.makeGrpcConstructor());
};
$root.IamTokenService.makeGrpcConstructor = () => {
let ctor = grpc.makeGenericClientConstructor({
create: {
path: '/yandex.cloud.iam.v1.IamTokenService/Create',
requestStream: false,
responseStream: false,
requestType: $root.api.iam.v1.CreateIamTokenRequest,
responseType: $root.api.iam.v1.CreateIamTokenResponse,
requestSerialize: r => {
return $root.api.iam.v1.CreateIamTokenRequest.encode(r).finish();
},
requestDeserialize: $root.api.iam.v1.CreateIamTokenRequest.decode,
responseSerialize: r => {
return $root.api.iam.v1.CreateIamTokenResponse.encode(r).finish();
},
responseDeserialize: $root.api.iam.v1.CreateIamTokenResponse.decode
}
});
ctor.__endpointId = 'iam';
return ctor;
};
})(root);
(function($root) {
$root.CreateIamTokenRequest = (function() {
function CreateIamTokenRequest(p) {
if (p) for (let ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]];
}
CreateIamTokenRequest.prototype.yandexPassportOauthToken = '';
CreateIamTokenRequest.prototype.jwt = '';
let $oneOfFields;
Object.defineProperty(CreateIamTokenRequest.prototype, 'identity', {
get: $util.oneOfGetter(($oneOfFields = ['yandexPassportOauthToken', 'jwt'])),
set: $util.oneOfSetter($oneOfFields)
});
CreateIamTokenRequest.encode = function encode(m, w) {
if (!w) w = $Writer.create();
if (m.yandexPassportOauthToken != null && m.hasOwnProperty('yandexPassportOauthToken')) w.uint32(10).string(m.yandexPassportOauthToken);
if (m.jwt != null && m.hasOwnProperty('jwt')) w.uint32(18).string(m.jwt);
return w;
};
CreateIamTokenRequest.decode = function decode(r, l) {
if (!(r instanceof $Reader)) r = $Reader.create(r);
let c = l === undefined ? r.len : r.pos + l,
m = new $root.api.iam.v1.CreateIamTokenRequest();
while (r.pos < c) {
let t = r.uint32();
switch (t >>> 3) {
case 1:
m.yandexPassportOauthToken = r.string();
break;
case 2:
m.jwt = r.string();
break;
default:
r.skipType(t & 7);
break;
}
}
return m;
};
return CreateIamTokenRequest;
})();
})(root);
(function($root) {
$root.CreateIamTokenResponse = (function() {
function CreateIamTokenResponse(p) {
if (p) for (let ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]];
}
CreateIamTokenResponse.prototype.iamToken = '';
CreateIamTokenResponse.prototype.expiresAt = null;
CreateIamTokenResponse.encode = function encode(m, w) {
if (!w) w = $Writer.create();
if (m.iamToken != null && m.hasOwnProperty('iamToken')) w.uint32(10).string(m.iamToken);
if (m.expiresAt != null && m.hasOwnProperty('expiresAt')) $root.contrib.google.protobuf.Timestamp.encode(m.expiresAt, w.uint32(18).fork()).ldelim();
return w;
};
CreateIamTokenResponse.decode = function decode(r, l) {
if (!(r instanceof $Reader)) r = $Reader.create(r);
let c = l === undefined ? r.len : r.pos + l,
m = new $root.api.iam.v1.CreateIamTokenResponse();
while (r.pos < c) {
let t = r.uint32();
switch (t >>> 3) {
case 1:
m.iamToken = r.string();
break;
case 2:
m.expiresAt = $root.contrib.google.protobuf.Timestamp.decode(r, r.uint32());
break;
default:
r.skipType(t & 7);
break;
}
}
return m;
};
return CreateIamTokenResponse;
})();
})(root);
(function($root) {
$root.Key = (function() {
function Key(p) {
if (p) for (let ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]];
}
Key.prototype.id = '';
Key.prototype.userAccountId = '';
Key.prototype.serviceAccountId = '';
Key.prototype.createdAt = null;
Key.prototype.description = '';
Key.prototype.keyAlgorithm = 0;
Key.prototype.publicKey = '';
let $oneOfFields;
Object.defineProperty(Key.prototype, 'subject', {
get: $util.oneOfGetter(($oneOfFields = ['userAccountId', 'serviceAccountId'])),
set: $util.oneOfSetter($oneOfFields)
});
Key.encode = function encode(m, w) {
if (!w) w = $Writer.create();
if (m.id != null && m.hasOwnProperty('id')) w.uint32(10).string(m.id);
if (m.userAccountId != null && m.hasOwnProperty('userAccountId')) w.uint32(18).string(m.userAccountId);
if (m.serviceAccountId != null && m.hasOwnProperty('serviceAccountId')) w.uint32(26).string(m.serviceAccountId);
if (m.createdAt != null && m.hasOwnProperty('createdAt')) $root.contrib.google.protobuf.Timestamp.encode(m.createdAt, w.uint32(34).fork()).ldelim();
if (m.description != null && m.hasOwnProperty('description')) w.uint32(42).string(m.description);
if (m.keyAlgorithm != null && m.hasOwnProperty('keyAlgorithm')) w.uint32(48).int32(m.keyAlgorithm);
if (m.publicKey != null && m.hasOwnProperty('publicKey')) w.uint32(58).string(m.publicKey);
return w;
};
Key.decode = function decode(r, l) {
if (!(r instanceof $Reader)) r = $Reader.create(r);
let c = l === undefined ? r.len : r.pos + l,
m = new $root.api.iam.v1.Key();
while (r.pos < c) {
let t = r.uint32();
switch (t >>> 3) {
case 1:
m.id = r.string();
break;
case 2:
m.userAccountId = r.string();
break;
case 3:
m.serviceAccountId = r.string();
break;
case 4:
m.createdAt = $root.contrib.google.protobuf.Timestamp.decode(r, r.uint32());
break;
case 5:
m.description = r.string();
break;
case 6:
m.keyAlgorithm = r.int32();
break;
case 7:
m.publicKey = r.string();
break;
default:
r.skipType(t & 7);
break;
}
}
return m;
};
let Algorithm = (function() {
let valuesById = {},
values = Object.create(valuesById);
values[(valuesById[0] = 'ALGORITHM_UNSPECIFIED')] = 0;
values[(valuesById[1] = 'RSA_2048')] = 1;
values[(valuesById[2] = 'RSA_4096')] = 2;
return values;
})();
Key.Algorithm = Algorithm;
return Key;
})();
})(root);
(function($root) {
$root.KeyService = function(session) {
if (session === undefined) {
session = new yc.Session();
}
return session.client($root.KeyService.makeGrpcConstructor());
};
$root.KeyService.makeGrpcConstructor = () => {
let ctor = grpc.makeGenericClientConstructor({
get: {
path: '/yandex.cloud.iam.v1.KeyService/Get',
requestStream: false,
responseStream: false,
requestType: $root.api.iam.v1.GetKeyRequest,
responseType: $root.api.iam.v1.Key,
requestSerialize: r => {
return $root.api.iam.v1.GetKeyRequest.encode(r).finish();
},
requestDeserialize: $root.api.iam.v1.GetKeyRequest.decode,
responseSerialize: r => {
return $root.api.iam.v1.Key.encode(r).finish();
},
responseDeserialize: $root.api.iam.v1.Key.decode
},
list: {
path: '/yandex.cloud.iam.v1.KeyService/List',
requestStream: false,
responseStream: false,
requestType: $root.api.iam.v1.ListKeysRequest,
responseType: $root.api.iam.v1.ListKeysResponse,
requestSerialize: r => {
return $root.api.iam.v1.ListKeysRequest.encode(r).finish();
},
requestDeserialize: $root.api.iam.v1.ListKeysRequest.decode,
responseSerialize: r => {
return $root.api.iam.v1.ListKeysResponse.encode(r).finish();
},
responseDeserialize: $root.api.iam.v1.ListKeysResponse.decode
},
create: {
path: '/yandex.cloud.iam.v1.KeyService/Create',
requestStream: false,
responseStream: false,
requestType: $root.api.iam.v1.CreateKeyRequest,
responseType: $root.api.iam.v1.CreateKeyResponse,
requestSerialize: r => {
return $root.api.iam.v1.CreateKeyRequest.encode(r).finish();
},
requestDeserialize: $root.api.iam.v1.CreateKeyRequest.decode,
responseSerialize: r => {
return $root.api.iam.v1.CreateKeyResponse.encode(r).finish();
},
responseDeserialize: $root.api.iam.v1.CreateKeyResponse.decode
},
update: {
path: '/yandex.cloud.iam.v1.KeyService/Update',
requestStream: false,
responseStream: false,
requestType: $root.api.iam.v1.UpdateKeyRequest,
responseType: $root.api.operation.Operation,
requestSerialize: r => {
return $root.api.iam.v1.UpdateKeyRequest.encode(r).finish();
},
requestDeserialize: $root.api.iam.v1.UpdateKeyRequest.decode,
responseSerialize: r => {
return $root.api.operation.Operation.encode(r).finish();
},
responseDeserialize: $root.api.operation.Operation.decode
},
delete: {
path: '/yandex.cloud.iam.v1.KeyService/Delete',
requestStream: false,
responseStream: false,
requestType: $root.api.iam.v1.DeleteKeyRequest,
responseType: $root.api.operation.Operation,
requestSerialize: r => {
return $root.api.iam.v1.DeleteKeyRequest.encode(r).finish();
},
requestDeserialize: $root.api.iam.v1.DeleteKeyRequest.decode,
responseSerialize: r => {
return $root.api.operation.Operation.encode(r).finish();
},
responseDeserialize: $root.api.operation.Operation.decode
},
listOperations: {
path: '/yandex.cloud.iam.v1.KeyService/ListOperations',
requestStream: false,
responseStream: false,
requestType: $root.api.iam.v1.ListKeyOperationsRequest,
responseType: $root.api.iam.v1.ListKeyOperationsResponse,
requestSerialize: r => {
return $root.api.iam.v1.ListKeyOperationsRequest.encode(r).finish();
},
requestDeserialize: $root.api.iam.v1.ListKeyOperationsRequest.decode,
responseSerialize: r => {
return $root.api.iam.v1.ListKeyOperationsResponse.encode(r).finish();
},
responseDeserialize: $root.api.iam.v1.ListKeyOperationsResponse.decode
}
});
ctor.__endpointId = 'iam';
return ctor;
};
})(root);
(function($root) {
$root.GetKeyRequest = (function() {
function GetKeyRequest(p) {
if (p) for (let ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]];
}
GetKeyRequest.prototype.keyId = '';
GetKeyRequest.prototype.format = 0;
GetKeyRequest.encode = function encode(m, w) {
if (!w) w = $Writer.create();
if (m.keyId != null && m.hasOwnProperty('keyId')) w.uint32(10).string(m.keyId);
if (m.format != null && m.hasOwnProperty('format')) w.uint32(16).int32(m.format);
return w;
};
GetKeyRequest.decode = function decode(r, l) {
if (!(r instanceof $Reader)) r = $Reader.create(r);
let c = l === undefined ? r.len : r.pos + l,
m = new $root.api.iam.v1.GetKeyRequest();
while (r.pos < c) {
let t = r.uint32();
switch (t >>> 3) {
case 1:
m.keyId = r.string();
break;
case 2:
m.format = r.int32();
break;
default:
r.skipType(t & 7);
break;
}
}
return m;
};
return GetKeyRequest;
})();
})(root);
(function($root) {
$root.ListKeysRequest = (function() {
function ListKeysRequest(p) {
if (p) for (let ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]];
}
ListKeysRequest.prototype.format = 0;
ListKeysRequest.prototype.serviceAccountId = '';
ListKeysRequest.prototype.pageSize = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;
ListKeysRequest.prototype.pageToken = '';
ListKeysRequest.encode = function encode(m, w) {
if (!w) w = $Writer.create();
if (m.format != null && m.hasOwnProperty('format')) w.uint32(8).int32(m.format);
if (m.serviceAccountId != null && m.hasOwnProperty('serviceAccountId')) w.uint32(18).string(m.serviceAccountId);
if (m.pageSize != null && m.hasOwnProperty('pageSize')) w.uint32(24).int64(m.pageSize);
if (m.pageToken != null && m.hasOwnProperty('pageToken')) w.uint32(34).string(m.pageToken);
return w;
};
ListKeysRequest.decode = function decode(r, l) {
if (!(r instanceof $Reader)) r = $Reader.create(r);
let c = l === undefined ? r.len : r.pos + l,
m = new $root.api.iam.v1.ListKeysRequest();
while (r.pos < c) {
let t = r.uint32();
switch (t >>> 3) {
case 1:
m.format = r.int32();
break;
case 2:
m.serviceAccountId = r.string();
break;
case 3:
m.pageSize = r.int64();
break;
case 4:
m.pageToken = r.string();
break;
default:
r.skipType(t & 7);
break;
}
}
return m;
};
return ListKeysRequest;
})();
})(root);
(function($root) {
$root.ListKeysResponse = (function() {
function ListKeysResponse(p) {
this.keys = [];
if (p) for (let ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]];
}
ListKeysResponse.prototype.keys = $util.emptyArray;
ListKeysResponse.prototype.nextPageToken = '';
ListKeysResponse.encode = function encode(m, w) {
if (!w) w = $Writer.create();
if (m.keys != null && m.keys.length) {
for (let i = 0; i < m.keys.length; ++i) $root.api.iam.v1.Key.encode(m.keys[i], w.uint32(10).fork()).ldelim();
}
if (m.nextPageToken != null && m.hasOwnProperty('nextPageToken')) w.uint32(18).string(m.nextPageToken);
return w;
};
ListKeysResponse.decode = function decode(r, l) {
if (!(r instanceof $Reader)) r = $Reader.create(r);
let c = l === undefined ? r.len : r.pos + l,
m = new $root.api.iam.v1.ListKeysResponse();
while (r.pos < c) {
let t = r.uint32();
switch (t >>> 3) {
case 1:
if (!(m.keys && m.keys.length)) m.keys = [];
m.keys.push($root.api.iam.v1.Key.decode(r, r.uint32()));
break;
case 2:
m.nextPageToken = r.string();
break;
default:
r.skipType(t & 7);
break;
}
}
return m;
};
return ListKeysResponse;
})();
})(root);
(function($root) {
$root.CreateKeyRequest = (function() {
function CreateKeyRequest(p) {
if (p) for (let ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]];
}
CreateKeyRequest.prototype.serviceAccountId = '';
CreateKeyRequest.prototype.description = '';
CreateKeyRequest.prototype.format = 0;
CreateKeyRequest.prototype.keyAlgorithm = 0;
CreateKeyRequest.encode = function encode(m, w) {
if (!w) w = $Writer.create();
if (m.serviceAccountId != null && m.hasOwnProperty('serviceAccountId')) w.uint32(10).string(m.serviceAccountId);
if (m.description != null && m.hasOwnProperty('description')) w.uint32(18).string(m.description);
if (m.format != null && m.hasOwnProperty('format')) w.uint32(24).int32(m.format);
if (m.keyAlgorithm != null && m.hasOwnProperty('keyAlgorithm')) w.uint32(32).int32(m.keyAlgorithm);
return w;
};
CreateKeyRequest.decode = function decode(r, l) {
if (!(r instanceof $Reader)) r = $Reader.create(r);
let c = l === undefined ? r.len : r.pos + l,
m = new $root.api.iam.v1.CreateKeyRequest();
while (r.pos < c) {
let t = r.uint32();
switch (t >>> 3) {
case 1:
m.serviceAccountId = r.string();
break;
case 2:
m.description = r.string();
break;
case 3:
m.format = r.int32();
break;
case 4:
m.keyAlgorithm = r.int32();
break;
default:
r.skipType(t & 7);
break;
}
}
return m;
};
return CreateKeyRequest;
})();
})(root);
(function($root) {
$root.CreateKeyResponse = (function() {
function CreateKeyResponse(p) {
if (p) for (let ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]];
}
CreateKeyResponse.prototype.key = null;
CreateKeyResponse.prototype.privateKey = '';
CreateKeyResponse.encode = function encode(m, w) {
if (!w) w = $Writer.create();
if (m.key != null && m.hasOwnProperty('key')) $root.api.iam.v1.Key.encode(m.key, w.uint32(10).fork()).ldelim();
if (m.privateKey != null && m.hasOwnProperty('privateKey')) w.uint32(18).string(m.privateKey);
return w;
};
CreateKeyResponse.decode = function decode(r, l) {
if (!(r instanceof $Reader)) r = $Reader.create(r);
let c = l === undefined ? r.len : r.pos + l,
m = new $root.api.iam.v1.CreateKeyResponse();
while (r.pos < c) {
let t = r.uint32();
switch (t >>> 3) {
case 1:
m.key = $root.api.iam.v1.Key.decode(r, r.uint32());
break;
case 2:
m.privateKey = r.string();
break;
default:
r.skipType(t & 7);
break;
}
}
return m;
};
return CreateKeyResponse;
})();
})(root);
(function($root) {
$root.UpdateKeyRequest = (function() {
function UpdateKeyRequest(p) {
if (p) for (let ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]];
}
UpdateKeyRequest.prototype.keyId = '';
UpdateKeyRequest.prototype.updateMask = null;
UpdateKeyRequest.prototype.description = '';
UpdateKeyRequest.encode = function encode(m, w) {
if (!w) w = $Writer.create();
if (m.keyId != null && m.hasOwnProperty('keyId')) w.uint32(10).string(m.keyId);
if (m.updateMask != null && m.hasOwnProperty('updateMask')) $root.contrib.google.protobuf.FieldMask.encode(m.updateMask, w.uint32(18).fork()).ldelim();
if (m.description != null && m.hasOwnProperty('description')) w.uint32(26).string(m.description);
return w;
};
UpdateKeyRequest.decode = function decode(r, l) {
if (!(r instanceof $Reader)) r = $Reader.create(r);
let c = l === undefined ? r.len : r.pos + l,
m = new $root.api.iam.v1.UpdateKeyRequest();
while (r.pos < c) {
let t = r.uint32();
switch (t >>> 3) {
case 1:
m.keyId = r.string();
break;
case 2:
m.updateMask = $root.contrib.google.protobuf.FieldMask.decode(r, r.uint32());
break;
case 3:
m.description = r.string();
break;
default:
r.skipType(t & 7);
break;
}
}
return m;
};
return UpdateKeyRequest;
})();
})(root);
(function($root) {
$root.UpdateKeyMetadata = (function() {
function UpdateKeyMetadata(p) {
if (p) for (let ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]];
}
UpdateKeyMetadata.prototype.keyId = '';
UpdateKeyMetadata.encode = function encode(m, w) {
if (!w) w = $Writer.create();
if (m.keyId != null && m.hasOwnProperty('keyId')) w.uint32(10).string(m.keyId);
return w;
};
UpdateKeyMetadata.decode = function decode(r, l) {
if (!(r instanceof $Reader)) r = $Reader.create(r);
let c = l === undefined ? r.len : r.pos + l,
m = new $root.api.iam.v1.UpdateKeyMetadata();
while (r.pos < c) {
let t = r.uint32();
switch (t >>> 3) {
case 1:
m.keyId = r.string();
break;
default:
r.skipType(t & 7);
break;
}
}
return m;
};
return UpdateKeyMetadata;
})();
})(root);
(function($root) {
$root.DeleteKeyRequest = (function() {
function DeleteKeyRequest(p) {
if (p) for (let ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]];
}
DeleteKeyRequest.prototype.keyId = '';
DeleteKeyRequest.encode = function encode(m, w) {
if (!w) w = $Writer.create();
if (m.keyId != null && m.hasOwnProperty('keyId')) w.uint32(10).string(m.keyId);
return w;
};
DeleteKeyRequest.decode = function decode(r, l) {
if (!(r instanceof $Reader)) r = $Reader.create(r);
let c = l === undefined ? r.len : r.pos + l,
m = new $root.api.iam.v1.DeleteKeyRequest();
while (r.pos < c) {
let t = r.uint32();
switch (t >>> 3) {
case 1:
m.keyId = r.string();
break;
default:
r.skipType(t & 7);
break;
}
}
return m;
};
return DeleteKeyRequest;
})();
})(root);
(function($root) {
$root.DeleteKeyMetadata = (function() {
function DeleteKeyMetadata(p) {
if (p) for (let ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]];
}
DeleteKeyMetadata.prototype.keyId = '';
DeleteKeyMetadata.encode = function encode(m, w) {
if (!w) w = $Writer.create();
if (m.keyId != null && m.hasOwnProperty('keyId')) w.uint32(10).string(m.keyId);
return w;
};
DeleteKeyMetadata.decode = function decode(r, l) {
if (!(r instanceof $Reader)) r = $Reader.create(r);
let c = l === undefined ? r.len : r.pos + l,
m = new $root.api.iam.v1.DeleteKeyMetadata();
while (r.pos < c) {
let t = r.uint32();
switch (t >>> 3) {
case 1:
m.keyId = r.string();
break;
default:
r.skipType(t & 7);
break;
}
}
return m;
};
return DeleteKeyMetadata;
})();
})(root);
(function($root) {
$root.ListKeyOperationsRequest = (function() {
function ListKeyOperationsRequest(p) {
if (p) for (let ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]];
}
ListKeyOperationsRequest.prototype.keyId = '';
ListKeyOperationsRequest.prototype.pageSize = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;
ListKeyOperationsRequest.prototype.pageToken = '';
ListKeyOperationsRequest.encode = function encode(m, w) {
if (!w) w = $Writer.create();
if (m.keyId != null && m.hasOwnProperty('keyId')) w.uint32(10).string(m.keyId);
if (m.pageSize != null && m.hasOwnProperty('pageSize')) w.uint32(16).int64(m.pageSize);
if (m.pageToken != null && m.hasOwnProperty('pageToken')) w.uint32(26).string(m.pageToken);
return w;
};
ListKeyOperationsRequest.decode = function decode(r, l) {
if (!(r instanceof $Reader)) r = $Reader.create(r);
let c = l === undefined ? r.len : r.pos + l,
m = new $root.api.iam.v1.ListKeyOperationsRequest();
while (r.pos < c) {
let t = r.uint32();
switch (t >>> 3) {
case 1:
m.keyId = r.string();
break;
case 2:
m.pageSize = r.int64();
break;
case 3:
m.pageToken = r.string();
break;
default:
r.skipType(t & 7);
break;
}
}
return m;
};
return ListKeyOperationsRequest;
})();
})(root);
(function($root) {
$root.ListKeyOperationsResponse = (function() {
function ListKeyOperationsResponse(p) {
this.operations = [];
if (p) for (let ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]];
}
ListKeyOperationsResponse.prototype.operations = $util.emptyArray;
ListKeyOperationsResponse.prototype.nextPageToken = '';
ListKeyOperationsResponse.encode = function encode(m, w) {
if (!w) w = $Writer.create();
if (m.operations != null && m.operations.length) {
for (let i = 0; i < m.operations.length; ++i) $root.api.operation.Operation.encode(m.operations[i], w.uint32(10).fork()).ldelim();
}
if (m.nextPageToken != null && m.hasOwnProperty('nextPageToken')) w.uint32(18).string(m.nextPageToken);
return w;
};
ListKeyOperationsResponse.decode = function decode(r, l) {
if (!(r instanceof $Reader)) r = $Reader.create(r);
let c = l === undefined ? r.len : r.pos + l,
m = new $root.api.iam.v1.ListKeyOperationsResponse();
while (r.pos < c) {
let t = r.uint32();
switch (t >>> 3) {
case 1:
if (!(m.operations && m.operations.length)) m.operations = [];
m.operations.push($root.api.operation.Operation.decode(r, r.uint32()));
break;
case 2:
m.nextPageToken = r.string();
break;
default:
r.skipType(t & 7);
break;
}
}
return m;
};
return ListKeyOperationsResponse;
})();
})(root);
(function($root) {
$root.KeyFormat = (function() {
let KeyFormat = (function() {
let valuesById = {},
values = Object.create(valuesById);
values[(valuesById[0] = 'PEM_FILE')] = 0;
return values;
})();
return KeyFormat;
})();
})(root);
(function($root) {
$root.Role = (function() {
function Role(p) {
if (p) for (let ks = Object.keys(p), i = 0; i < ks.length; ++i) if (p[ks[i]] != null) this[ks[i]] = p[ks[i]];
}
Role.prototype.id = '';
Role.prototype.description = '';
Role.encode = function encode(m, w) {
if (!w) w = $Writer.create();
if (m.id != null && m.hasOwnProperty('id')) w.uint32(10).string(m.id);
if (m.description != null && m.hasOwnProperty('descri