GetRestrictions
Get current community restrictions.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const GetCommunityRestrictionsRequest =
cloudApi.datasphere.community_service.GetCommunityRestrictionsRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.CommunityServiceClient);
const result = await client.getRestrictions(
GetCommunityRestrictionsRequest.fromPartial({
communityId: "communityId",
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.datasphere.v2.community_service_pb2_grpc import CommunityServiceStub
from yandex.cloud.datasphere.v2.community_service_pb2 import GetCommunityRestrictionsRequest
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(CommunityServiceStub)
response = service.GetRestrictions(GetCommunityRestrictionsRequest(community_id="communityId"))
print(response)
GetCommunityRestrictionsRequest
communityId
: string
ID of the community.
RestrictionsResponse
restrictions
: Restriction
List of restrictions.
Restriction
name
: string
Name of restriction.
boolValue
: bool
List of boolean restriction values. Empty if value type is not boolean.
longValue
: int64
List of long restriction values. Empty if value type is not long.
stringValue
: string
List of string restriction values. Empty if value type is not string.