/// <summary>Snippet for DeleteSshPublicKeyAsync</summary>
        public async Task DeleteSshPublicKeyAsync()
        {
            // Snippet: DeleteSshPublicKeyAsync(string, CallSettings)
            // Additional: DeleteSshPublicKeyAsync(string, CancellationToken)
            // Create client
            OsLoginServiceClient osLoginServiceClient = await OsLoginServiceClient.CreateAsync();

            // Initialize request argument(s)
            string name = "users/[USER]/sshPublicKeys/[FINGERPRINT]";
            // Make the request
            await osLoginServiceClient.DeleteSshPublicKeyAsync(name);

            // End snippet
        }
        /// <summary>Snippet for DeletePosixAccountAsync</summary>
        public async Task DeletePosixAccountAsync()
        {
            // Snippet: DeletePosixAccountAsync(string, CallSettings)
            // Additional: DeletePosixAccountAsync(string, CancellationToken)
            // Create client
            OsLoginServiceClient osLoginServiceClient = await OsLoginServiceClient.CreateAsync();

            // Initialize request argument(s)
            string name = "users/[USER]/projects/[PROJECT]";
            // Make the request
            await osLoginServiceClient.DeletePosixAccountAsync(name);

            // End snippet
        }
        /// <summary>Snippet for DeleteSshPublicKeyAsync</summary>
        public async Task DeleteSshPublicKeyResourceNamesAsync()
        {
            // Snippet: DeleteSshPublicKeyAsync(SshPublicKeyName, CallSettings)
            // Additional: DeleteSshPublicKeyAsync(SshPublicKeyName, CancellationToken)
            // Create client
            OsLoginServiceClient osLoginServiceClient = await OsLoginServiceClient.CreateAsync();

            // Initialize request argument(s)
            SshPublicKeyName name = SshPublicKeyName.FromUserFingerprint("[USER]", "[FINGERPRINT]");
            // Make the request
            await osLoginServiceClient.DeleteSshPublicKeyAsync(name);

            // End snippet
        }
Exemple #4
0
 /// <summary>Snippet for GetSshPublicKey</summary>
 public void GetSshPublicKey_RequestObject()
 {
     // Snippet: GetSshPublicKey(GetSshPublicKeyRequest,CallSettings)
     // Create client
     OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.Create();
     // Initialize request argument(s)
     GetSshPublicKeyRequest request = new GetSshPublicKeyRequest
     {
         FingerprintName = new FingerprintName("[USER]", "[FINGERPRINT]"),
     };
     // Make the request
     SshPublicKey response = osLoginServiceClient.GetSshPublicKey(request);
     // End snippet
 }
        /// <summary>Snippet for DeletePosixAccountAsync</summary>
        public async Task DeletePosixAccountResourceNamesAsync()
        {
            // Snippet: DeletePosixAccountAsync(PosixAccountName, CallSettings)
            // Additional: DeletePosixAccountAsync(PosixAccountName, CancellationToken)
            // Create client
            OsLoginServiceClient osLoginServiceClient = await OsLoginServiceClient.CreateAsync();

            // Initialize request argument(s)
            PosixAccountName name = PosixAccountName.FromUserProject("[USER]", "[PROJECT]");
            // Make the request
            await osLoginServiceClient.DeletePosixAccountAsync(name);

            // End snippet
        }
Exemple #6
0
        /// <summary>Snippet for GetSshPublicKeyAsync</summary>
        public async Task GetSshPublicKeyAsync()
        {
            // Snippet: GetSshPublicKeyAsync(FingerprintName,CallSettings)
            // Additional: GetSshPublicKeyAsync(FingerprintName,CancellationToken)
            // Create client
            OsLoginServiceClient osLoginServiceClient = await OsLoginServiceClient.CreateAsync();

            // Initialize request argument(s)
            FingerprintName name = new FingerprintName("[USER]", "[FINGERPRINT]");
            // Make the request
            SshPublicKey response = await osLoginServiceClient.GetSshPublicKeyAsync(name);

            // End snippet
        }
Exemple #7
0
 /// <summary>Snippet for GetLoginProfile</summary>
 public void GetLoginProfile_RequestObject()
 {
     // Snippet: GetLoginProfile(GetLoginProfileRequest,CallSettings)
     // Create client
     OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.Create();
     // Initialize request argument(s)
     GetLoginProfileRequest request = new GetLoginProfileRequest
     {
         UserName = new UserName("[USER]"),
     };
     // Make the request
     LoginProfile response = osLoginServiceClient.GetLoginProfile(request);
     // End snippet
 }
Exemple #8
0
        /// <summary>Snippet for GetLoginProfileAsync</summary>
        public async Task GetLoginProfileAsync()
        {
            // Snippet: GetLoginProfileAsync(UserName,CallSettings)
            // Additional: GetLoginProfileAsync(UserName,CancellationToken)
            // Create client
            OsLoginServiceClient osLoginServiceClient = await OsLoginServiceClient.CreateAsync();

            // Initialize request argument(s)
            UserName name = new UserName("[USER]");
            // Make the request
            LoginProfile response = await osLoginServiceClient.GetLoginProfileAsync(name);

            // End snippet
        }
        /// <summary>Snippet for UpdateSshPublicKeyAsync</summary>
        public async Task UpdateSshPublicKey1ResourceNamesAsync()
        {
            // Snippet: UpdateSshPublicKeyAsync(SshPublicKeyName, SshPublicKey, CallSettings)
            // Additional: UpdateSshPublicKeyAsync(SshPublicKeyName, SshPublicKey, CancellationToken)
            // Create client
            OsLoginServiceClient osLoginServiceClient = await OsLoginServiceClient.CreateAsync();

            // Initialize request argument(s)
            SshPublicKeyName name         = SshPublicKeyName.FromUserFingerprint("[USER]", "[FINGERPRINT]");
            SshPublicKey     sshPublicKey = new SshPublicKey();
            // Make the request
            SshPublicKey response = await osLoginServiceClient.UpdateSshPublicKeyAsync(name, sshPublicKey);

            // End snippet
        }
        /// <summary>Snippet for UpdateSshPublicKeyAsync</summary>
        public async Task UpdateSshPublicKey1Async()
        {
            // Snippet: UpdateSshPublicKeyAsync(string, SshPublicKey, CallSettings)
            // Additional: UpdateSshPublicKeyAsync(string, SshPublicKey, CancellationToken)
            // Create client
            OsLoginServiceClient osLoginServiceClient = await OsLoginServiceClient.CreateAsync();

            // Initialize request argument(s)
            string       name         = "users/[USER]/sshPublicKeys/[FINGERPRINT]";
            SshPublicKey sshPublicKey = new SshPublicKey();
            // Make the request
            SshPublicKey response = await osLoginServiceClient.UpdateSshPublicKeyAsync(name, sshPublicKey);

            // End snippet
        }
Exemple #11
0
 /// <summary>Snippet for ImportSshPublicKey</summary>
 public void ImportSshPublicKey_RequestObject()
 {
     // Snippet: ImportSshPublicKey(ImportSshPublicKeyRequest,CallSettings)
     // Create client
     OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.Create();
     // Initialize request argument(s)
     ImportSshPublicKeyRequest request = new ImportSshPublicKeyRequest
     {
         ParentAsUserName = new UserName("[USER]"),
         SshPublicKey     = new SshPublicKey(),
     };
     // Make the request
     ImportSshPublicKeyResponse response = osLoginServiceClient.ImportSshPublicKey(request);
     // End snippet
 }
Exemple #12
0
        /// <summary>Snippet for DeletePosixAccount</summary>
        public void DeletePosixAccount_RequestObject()
        {
            // Snippet: DeletePosixAccount(DeletePosixAccountRequest,CallSettings)
            // Create client
            OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.Create();
            // Initialize request argument(s)
            DeletePosixAccountRequest request = new DeletePosixAccountRequest
            {
                ProjectName = new ProjectName("[USER]", "[PROJECT]"),
            };

            // Make the request
            osLoginServiceClient.DeletePosixAccount(request);
            // End snippet
        }
        /// <summary>Snippet for DeleteSshPublicKey</summary>
        public void DeleteSshPublicKeyRequestObject()
        {
            // Snippet: DeleteSshPublicKey(DeleteSshPublicKeyRequest, CallSettings)
            // Create client
            OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.Create();
            // Initialize request argument(s)
            DeleteSshPublicKeyRequest request = new DeleteSshPublicKeyRequest
            {
                SshPublicKeyName = SshPublicKeyName.FromUserFingerprint("[USER]", "[FINGERPRINT]"),
            };

            // Make the request
            osLoginServiceClient.DeleteSshPublicKey(request);
            // End snippet
        }
Exemple #14
0
        /// <summary>Snippet for ImportSshPublicKeyAsync</summary>
        public async Task ImportSshPublicKeyAsync1()
        {
            // Snippet: ImportSshPublicKeyAsync(UserName,SshPublicKey,CallSettings)
            // Additional: ImportSshPublicKeyAsync(UserName,SshPublicKey,CancellationToken)
            // Create client
            OsLoginServiceClient osLoginServiceClient = await OsLoginServiceClient.CreateAsync();

            // Initialize request argument(s)
            UserName     parent       = new UserName("[USER]");
            SshPublicKey sshPublicKey = new SshPublicKey();
            // Make the request
            ImportSshPublicKeyResponse response = await osLoginServiceClient.ImportSshPublicKeyAsync(parent, sshPublicKey);

            // End snippet
        }
 /// <summary>Snippet for UpdateSshPublicKey</summary>
 public void UpdateSshPublicKeyRequestObject()
 {
     // Snippet: UpdateSshPublicKey(UpdateSshPublicKeyRequest, CallSettings)
     // Create client
     OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.Create();
     // Initialize request argument(s)
     UpdateSshPublicKeyRequest request = new UpdateSshPublicKeyRequest
     {
         SshPublicKeyName = SshPublicKeyName.FromUserFingerprint("[USER]", "[FINGERPRINT]"),
         SshPublicKey     = new SshPublicKey(),
         UpdateMask       = new FieldMask(),
     };
     // Make the request
     SshPublicKey response = osLoginServiceClient.UpdateSshPublicKey(request);
     // End snippet
 }
        /// <summary>Snippet for ImportSshPublicKeyAsync</summary>
        public async Task ImportSshPublicKey2ResourceNamesAsync()
        {
            // Snippet: ImportSshPublicKeyAsync(UserName, SshPublicKey, string, CallSettings)
            // Additional: ImportSshPublicKeyAsync(UserName, SshPublicKey, string, CancellationToken)
            // Create client
            OsLoginServiceClient osLoginServiceClient = await OsLoginServiceClient.CreateAsync();

            // Initialize request argument(s)
            UserName     parent       = UserName.FromUser("[USER]");
            SshPublicKey sshPublicKey = new SshPublicKey();
            string       projectId    = "";
            // Make the request
            ImportSshPublicKeyResponse response = await osLoginServiceClient.ImportSshPublicKeyAsync(parent, sshPublicKey, projectId);

            // End snippet
        }
        /// <summary>Snippet for DeleteSshPublicKeyAsync</summary>
        public async Task DeleteSshPublicKeyAsync_RequestObject()
        {
            // Snippet: DeleteSshPublicKeyAsync(DeleteSshPublicKeyRequest,CallSettings)
            // Create client
            OsLoginServiceClient osLoginServiceClient = await OsLoginServiceClient.CreateAsync();

            // Initialize request argument(s)
            DeleteSshPublicKeyRequest request = new DeleteSshPublicKeyRequest
            {
                FingerprintName = new FingerprintName("[USER]", "[FINGERPRINT]"),
            };
            // Make the request
            await osLoginServiceClient.DeleteSshPublicKeyAsync(request);

            // End snippet
        }
Exemple #18
0
        /// <summary>Snippet for UpdateSshPublicKeyAsync</summary>
        public async Task UpdateSshPublicKeyAsync2()
        {
            // Snippet: UpdateSshPublicKeyAsync(FingerprintName,SshPublicKey,FieldMask,CallSettings)
            // Additional: UpdateSshPublicKeyAsync(FingerprintName,SshPublicKey,FieldMask,CancellationToken)
            // Create client
            OsLoginServiceClient osLoginServiceClient = await OsLoginServiceClient.CreateAsync();

            // Initialize request argument(s)
            FingerprintName name         = new FingerprintName("[USER]", "[FINGERPRINT]");
            SshPublicKey    sshPublicKey = new SshPublicKey();
            FieldMask       updateMask   = new FieldMask();
            // Make the request
            SshPublicKey response = await osLoginServiceClient.UpdateSshPublicKeyAsync(name, sshPublicKey, updateMask);

            // End snippet
        }
Exemple #19
0
        /// <summary>Snippet for DeletePosixAccountAsync</summary>
        public async Task DeletePosixAccountAsync_RequestObject()
        {
            // Snippet: DeletePosixAccountAsync(DeletePosixAccountRequest,CallSettings)
            // Additional: DeletePosixAccountAsync(DeletePosixAccountRequest,CancellationToken)
            // Create client
            OsLoginServiceClient osLoginServiceClient = await OsLoginServiceClient.CreateAsync();

            // Initialize request argument(s)
            DeletePosixAccountRequest request = new DeletePosixAccountRequest
            {
                ProjectName = new ProjectName("[USER]", "[PROJECT]"),
            };
            // Make the request
            await osLoginServiceClient.DeletePosixAccountAsync(request);

            // End snippet
        }
        /// <summary>Snippet for GetSshPublicKeyAsync</summary>
        public async Task GetSshPublicKeyRequestObjectAsync()
        {
            // Snippet: GetSshPublicKeyAsync(GetSshPublicKeyRequest, CallSettings)
            // Additional: GetSshPublicKeyAsync(GetSshPublicKeyRequest, CancellationToken)
            // Create client
            OsLoginServiceClient osLoginServiceClient = await OsLoginServiceClient.CreateAsync();

            // Initialize request argument(s)
            GetSshPublicKeyRequest request = new GetSshPublicKeyRequest
            {
                SshPublicKeyName = SshPublicKeyName.FromUserFingerprint("[USER]", "[FINGERPRINT]"),
            };
            // Make the request
            SshPublicKey response = await osLoginServiceClient.GetSshPublicKeyAsync(request);

            // End snippet
        }
Exemple #21
0
        /// <summary>Snippet for UpdateSshPublicKeyAsync</summary>
        public async Task UpdateSshPublicKeyAsync_RequestObject()
        {
            // Snippet: UpdateSshPublicKeyAsync(UpdateSshPublicKeyRequest,CallSettings)
            // Additional: UpdateSshPublicKeyAsync(UpdateSshPublicKeyRequest,CancellationToken)
            // Create client
            OsLoginServiceClient osLoginServiceClient = await OsLoginServiceClient.CreateAsync();

            // Initialize request argument(s)
            UpdateSshPublicKeyRequest request = new UpdateSshPublicKeyRequest
            {
                FingerprintName = new FingerprintName("[USER]", "[FINGERPRINT]"),
                SshPublicKey    = new SshPublicKey(),
            };
            // Make the request
            SshPublicKey response = await osLoginServiceClient.UpdateSshPublicKeyAsync(request);

            // End snippet
        }
Exemple #22
0
        /// <summary>Snippet for ImportSshPublicKeyAsync</summary>
        public async Task ImportSshPublicKeyAsync_RequestObject()
        {
            // Snippet: ImportSshPublicKeyAsync(ImportSshPublicKeyRequest,CallSettings)
            // Additional: ImportSshPublicKeyAsync(ImportSshPublicKeyRequest,CancellationToken)
            // Create client
            OsLoginServiceClient osLoginServiceClient = await OsLoginServiceClient.CreateAsync();

            // Initialize request argument(s)
            ImportSshPublicKeyRequest request = new ImportSshPublicKeyRequest
            {
                ParentAsUserName = new UserName("[USER]"),
                SshPublicKey     = new SshPublicKey(),
            };
            // Make the request
            ImportSshPublicKeyResponse response = await osLoginServiceClient.ImportSshPublicKeyAsync(request);

            // End snippet
        }
        /// <summary>Snippet for GetLoginProfileAsync</summary>
        public async Task GetLoginProfileRequestObjectAsync()
        {
            // Snippet: GetLoginProfileAsync(GetLoginProfileRequest, CallSettings)
            // Additional: GetLoginProfileAsync(GetLoginProfileRequest, CancellationToken)
            // Create client
            OsLoginServiceClient osLoginServiceClient = await OsLoginServiceClient.CreateAsync();

            // Initialize request argument(s)
            GetLoginProfileRequest request = new GetLoginProfileRequest
            {
                UserName  = UserName.FromUser("[USER]"),
                ProjectId = "",
                SystemId  = "",
            };
            // Make the request
            LoginProfile response = await osLoginServiceClient.GetLoginProfileAsync(request);

            // End snippet
        }
Exemple #24
0
        public static int Main(string[] args)
        {
            var credential = GoogleCredential.GetApplicationDefault();

            if (!(credential.UnderlyingCredential is ServiceAccountCredential serviceAccount))
            {
                Console.WriteLine("Skipping smoke test; requires service account.");
                // Don't cause test automation to fail.
                return(0);
            }

            // Create client
            OsLoginServiceClient client = OsLoginServiceClient.Create();

            UserName userName = new UserName(serviceAccount.Id);
            var      response = client.GetLoginProfile(userName);

            // Show the result
            Console.WriteLine(response);

            // Success
            Console.WriteLine("Smoke test passed OK");
            return(0);
        }