Beispiel #1
0
        public async static Task Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            Environment.SetEnvironmentVariable(
                "GOOGLE_APPLICATION_CREDENTIALS",
                Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "My First Project-065d320bab2e.json"));
            CompanyServiceClient companyServiceClient = CompanyServiceClient.Create();

            // GoogleCredential credential = GoogleCredential.GetApplicationDefault();
            Google.Cloud.Talent.V4Beta1.Company c = new Google.Cloud.Talent.V4Beta1.Company
            {
                Name        = "ADI",
                DisplayName = "ADI",

                ExternalId = "123"
            };
            Google.Cloud.Talent.V4Beta1.CreateCompanyRequest request = new Google.Cloud.Talent.V4Beta1.CreateCompanyRequest
            {
                Company = c
            };

            Google.Cloud.Talent.V4Beta1.Company response = companyServiceClient.CreateCompany(request);
            Console.WriteLine("Created Company");
            Console.WriteLine($"Name: {response.Name}");
            Console.WriteLine($"Display Name: {response.DisplayName}");
            Console.WriteLine($"External ID: {response.ExternalId}");

            //JobServiceClient jobServiceClient = JobServiceClient.Create();
            // TenantName tenantName = TenantName.FromProjectTenant(projectId, tenantId);
            PublisherClient publisher = await PublisherClient.CreateAsync(topicName, null, null);

            var pubsubMessage = new PubsubMessage()
            {
                Data = ByteString.CopyFromUtf8("this is new  sample message")
            };
            string messageId = await publisher.PublishAsync(pubsubMessage);

            var subscriptionName = new SubscriptionName(ProjectId, SubscriptionId);
            var subscription     = await SubscriberClient.CreateAsync(subscriptionName);

            try
            {
                // PullResponse response = subscription.(subscriptionName, true, 10);
                await subscription.StartAsync((pubsubMessage, cancellationToken) =>
                {
                    // Process the message here.
                    var all = Task.FromResult(SubscriberClient.Reply.Ack);
                    return(all);
                });
            }
            catch (Exception e)
            {
                Console.WriteLine("Something went wrong: {0}", e.Message);
            }
        }
Beispiel #2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (ExternalId.Length != 0)
            {
                hash ^= ExternalId.GetHashCode();
            }
            if (Profile.Length != 0)
            {
                hash ^= Profile.GetHashCode();
            }
            if (Job.Length != 0)
            {
                hash ^= Job.GetHashCode();
            }
            if (Company.Length != 0)
            {
                hash ^= Company.GetHashCode();
            }
            if (applicationDate_ != null)
            {
                hash ^= ApplicationDate.GetHashCode();
            }
            if (Stage != 0)
            {
                hash ^= Stage.GetHashCode();
            }
            if (State != 0)
            {
                hash ^= State.GetHashCode();
            }
            hash ^= interviews_.GetHashCode();
            if (referral_ != null)
            {
                hash ^= Referral.GetHashCode();
            }
            if (createTime_ != null)
            {
                hash ^= CreateTime.GetHashCode();
            }
            if (updateTime_ != null)
            {
                hash ^= UpdateTime.GetHashCode();
            }
            if (OutcomeNotes.Length != 0)
            {
                hash ^= OutcomeNotes.GetHashCode();
            }
            if (Outcome != 0)
            {
                hash ^= Outcome.GetHashCode();
            }
            if (isMatch_ != null)
            {
                hash ^= IsMatch.GetHashCode();
            }
            if (JobTitleSnippet.Length != 0)
            {
                hash ^= JobTitleSnippet.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }