// [START job_search_create_job_beta] public static object CreateJob(string projectId, string tenantId, string companyId, string requisitionId, string jobApplicationUrl) { JobServiceClient jobServiceClient = JobServiceClient.Create(); TenantName tenantName = TenantName.FromProjectTenant(projectId, tenantId); ApplicationInfo applicationInfo = new ApplicationInfo(); applicationInfo.Uris.Add(jobApplicationUrl); Job job = new Job { Company = companyId, RequisitionId = requisitionId, Title = "Software Developer", Description = "Develop, maintain the software solutions.", ApplicationInfo = applicationInfo, LanguageCode = "en-US" }; string[] addresses = { "1600 Amphitheatre Parkway, Mountain View, CA 94043", "111 8th Avenue, New York, NY 10011" }; job.Addresses.Add(addresses); CreateJobRequest request = new CreateJobRequest { ParentAsTenantName = tenantName, Job = job }; Job response = jobServiceClient.CreateJob(request); Console.WriteLine($"Created Job: {response.Name}"); return(0); }
/// <summary>Snippet for CreateJob</summary> public void CreateJob() { // Snippet: CreateJob(TenantOrProjectNameOneof,Job,CallSettings) // Create client JobServiceClient jobServiceClient = JobServiceClient.Create(); // Initialize request argument(s) TenantOrProjectNameOneof parent = TenantOrProjectNameOneof.From(new TenantName("[PROJECT]", "[TENANT]")); Job job = new Job(); // Make the request Job response = jobServiceClient.CreateJob(parent, job); // End snippet }
/// <summary>Snippet for CreateJob</summary> public void CreateJob() { // Snippet: CreateJob(ProjectName,Job,CallSettings) // Create client JobServiceClient jobServiceClient = JobServiceClient.Create(); // Initialize request argument(s) ProjectName parent = new ProjectName("[PROJECT]"); Job job = new Job(); // Make the request Job response = jobServiceClient.CreateJob(parent, job); // End snippet }
public bool PostJob(JobDAO job) { JobServiceClient client = new JobServiceClient(); try { bool result = client.CreateJob(job); return result; } catch (FaultException<KaskServiceException> e) { throw new HttpException(e.Message); } }
/// <summary>Snippet for CreateJob</summary> public void CreateJob_RequestObject() { // Snippet: CreateJob(CreateJobRequest,CallSettings) // Create client JobServiceClient jobServiceClient = JobServiceClient.Create(); // Initialize request argument(s) CreateJobRequest request = new CreateJobRequest { ParentAsTenantOrProjectNameOneof = TenantOrProjectNameOneof.From(new TenantName("[PROJECT]", "[TENANT]")), Job = new Job(), }; // Make the request Job response = jobServiceClient.CreateJob(request); // End snippet }
public async Task<ActionResult> Create([Bind(Include = "Position,Description,FullPartTime,SalaryRange")] Job job) { if (ModelState.IsValid) { using (var client = new JobServiceClient()) { await client.CreateJob(job); } return RedirectToAction("Details", job.JobId); } return View(job); }
/// <summary>Snippet for CreateJob</summary> public void CreateJob_RequestObject() { // Snippet: CreateJob(CreateJobRequest,CallSettings) // Create client JobServiceClient jobServiceClient = JobServiceClient.Create(); // Initialize request argument(s) CreateJobRequest request = new CreateJobRequest { Parent = new ProjectName("[PROJECT]").ToString(), Job = new Job(), }; // Make the request Job response = jobServiceClient.CreateJob(request); // End snippet }
// [START job_search_create_job_custom_attributes] public static object CreateJobCustomAttributes(string projectId, string tenantId, string companyId, string requisitionId) { JobServiceClient jobServiceClient = JobServiceClient.Create(); TenantName tenantName = TenantName.FromProjectTenant(projectId, tenantId); // Custom attribute can be string or numeric value, and can be filtered in search queries. // https://cloud.google.com/talent-solution/job-search/docs/custom-attributes CustomAttribute customAttributes = new CustomAttribute { Filterable = true }; customAttributes.StringValues.Add("Internship"); customAttributes.StringValues.Add("Intern"); customAttributes.StringValues.Add("Apprenticeship"); Job job = new Job { Company = companyId, RequisitionId = requisitionId, Title = "Software Developer I", Description = "This is a description of this <i>wonderful</i> job!", LanguageCode = "en-US" }; job.CustomAttributes.Add("FOR_STUDENTS", customAttributes); CreateJobRequest request = new CreateJobRequest { ParentAsTenantName = tenantName, Job = job }; Job response = jobServiceClient.CreateJob(request); Console.WriteLine($"Created Job: {response.Name}"); return(0); }