static async Task <List <InlineResponse2003> > TestBuildTargetApi(Configuration config, string orgId, string projectId) { #region BuildTarget Api // Add Build Target var buildTargetApi = new UnityCloudBuildApi.IO.Swagger.Api.BuildtargetsApi(config); var option2 = new Options2 { Platform = "android", Name = "Test", Enabled = false, Settings = new OrgsorgidprojectsprojectidbuildtargetsSettings { Platform = new OrgsorgidprojectsprojectidbuildtargetsSettingsPlatform { BundleId = "com.hoge.fuga" }, AutoBuild = true, Scm = new OrgsorgidprojectsprojectidbuildtargetsSettingsScm { Branch = "master", Type = "git" }, UnityVersion = "latest", }, }; var newBuildTarget = await buildTargetApi.AddBuildTargetAsync(orgId, projectId, option2); var hoge = newBuildTarget.ToJson(); // Get BuildTargets for list BuildTargetId var buildTargets = await buildTargetApi.GetBuildTargetsAsync(orgId, projectId); var fuga = buildTargets.Select(x => x.ToJson()).ToArray(); // Get BuildTarget Info var buildTarget = await buildTargetApi.GetBuildTargetAsync(orgId, projectId, buildTargets.FirstOrDefault().Buildtargetid); var piyo = buildTarget.ToJson(); #endregion return(buildTargets); }
public static List <Options2> MakeBuildTargetAPIOptions() { var optionList = new List <Options2>(); foreach (var platform in Platforms) { foreach (var branch in Branches) { foreach (var unityVer in UnityVersions) { var symbolList = new List <string>(); Recurse(DefineSymbolsList.First, symbolList, (symbols_) => { var symbolsStr = string.Join(";", symbols_); var develop = symbols_.Contains("RELEASE") == false; var buildOptions = new List <string>(); if (develop) { buildOptions = new List <string> { "Development", "AllowDebugging", }; } var credentialId = CredentialByPlatform[platform]; var option2 = new Options2 { Platform = platform, Name = string.Format(NamePrefix + "{0}_{1}_{2}", develop ? "debug" : "release", platform, optionList.Count), Enabled = true, Settings = new OrgsorgidprojectsprojectidbuildtargetsSettings { AutoBuild = false, UnityVersion = unityVer, Platform = new OrgsorgidprojectsprojectidbuildtargetsSettingsPlatform { BundleId = BundleId, XcodeVersion = XcodeVersion, }, Scm = new OrgsorgidprojectsprojectidbuildtargetsSettingsScm { Branch = branch, Type = "git" }, Advanced = new OrgsorgidprojectsprojectidbuildtargetsSettingsAdvanced { Unity = new OrgsorgidprojectsprojectidbuildtargetsSettingsAdvancedUnity { ScriptingDefineSymbols = symbolsStr, PlayerExporter = new OrgsorgidprojectsprojectidbuildtargetsSettingsAdvancedUnityPlayerExporter() { BuildOptions = buildOptions, }, } } }, Credentials = new OrgsorgidprojectsprojectidbuildtargetsCredentials1 { Signing = new OrgsorgidprojectsprojectidbuildtargetsCredentials1Signing { Credentialid = credentialId, } } }; optionList.Add(option2); }); } } } return(optionList); }
public ActionResult Example2(Options2 options) { this.options2.Value.CompanyPrefix = options.CompanyPrefix; return(this.Process <Model2>(this.options2.Value)); }
/// <summary> /// Create build target for a project /// </summary> /// <param name="orgid">Organization identifier</param> /// <param name="projectid">Project identifier</param> /// <param name="options">Options for build target create/update</param> /// <returns>Task of ApiResponse (InlineResponse2003)</returns> public async System.Threading.Tasks.Task<ApiResponse<InlineResponse2003>> AddBuildTargetAsyncWithHttpInfo (string orgid, string projectid, Options2 options) { // verify the required parameter 'orgid' is set if (orgid == null) throw new ApiException(400, "Missing required parameter 'orgid' when calling AddBuildTarget"); // verify the required parameter 'projectid' is set if (projectid == null) throw new ApiException(400, "Missing required parameter 'projectid' when calling AddBuildTarget"); // verify the required parameter 'options' is set if (options == null) throw new ApiException(400, "Missing required parameter 'options' when calling AddBuildTarget"); var path_ = "/orgs/{orgid}/projects/{projectid}/buildtargets"; var pathParams = new Dictionary<String, String>(); var queryParams = new Dictionary<String, String>(); var headerParams = new Dictionary<String, String>(Configuration.DefaultHeader); var formParams = new Dictionary<String, String>(); var fileParams = new Dictionary<String, FileParameter>(); Object postBody = null; // to determine the Content-Type header String[] httpContentTypes = new String[] { "application/json" }; String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header String[] httpHeaderAccepts = new String[] { "application/json", "text/plain", "text/html" }; String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); if (httpHeaderAccept != null) headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json pathParams.Add("format", "json"); if (orgid != null) pathParams.Add("orgid", Configuration.ApiClient.ParameterToString(orgid)); // path parameter if (projectid != null) pathParams.Add("projectid", Configuration.ApiClient.ParameterToString(projectid)); // path parameter postBody = Configuration.ApiClient.Serialize(options); // http body (model) parameter // authentication (apikey) required // http basic authentication required if (!String.IsNullOrEmpty(Configuration.Username) || !String.IsNullOrEmpty(Configuration.Password)) { headerParams["Authorization"] = "Basic " + Base64Encode(Configuration.Username + ":" + Configuration.Password); } // authentication (permissions) required // oauth required if (!String.IsNullOrEmpty(Configuration.AccessToken)) { headerParams["Authorization"] = "Bearer " + Configuration.AccessToken; } // make the HTTP request IRestResponse response = (IRestResponse) await Configuration.ApiClient.CallApiAsync(path_, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams, httpContentType); int statusCode = (int) response.StatusCode; if (statusCode >= 400) throw new ApiException (statusCode, "Error calling AddBuildTarget: " + response.Content, response.Content); else if (statusCode == 0) throw new ApiException (statusCode, "Error calling AddBuildTarget: " + response.ErrorMessage, response.ErrorMessage); return new ApiResponse<InlineResponse2003>(statusCode, response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (InlineResponse2003) Configuration.ApiClient.Deserialize(response, typeof(InlineResponse2003))); }
/// <summary> /// Create build target for a project /// </summary> /// <param name="orgid">Organization identifier</param> /// <param name="projectid">Project identifier</param> /// <param name="options">Options for build target create/update</param> /// <returns>Task of InlineResponse2003</returns> public async System.Threading.Tasks.Task<InlineResponse2003> AddBuildTargetAsync (string orgid, string projectid, Options2 options) { ApiResponse<InlineResponse2003> response = await AddBuildTargetAsyncWithHttpInfo(orgid, projectid, options); return response.Data; }
/// <summary> /// Create build target for a project /// </summary> /// <param name="orgid">Organization identifier</param> /// <param name="projectid">Project identifier</param> /// <param name="options">Options for build target create/update</param> /// <returns>InlineResponse2003</returns> public InlineResponse2003 AddBuildTarget (string orgid, string projectid, Options2 options) { ApiResponse<InlineResponse2003> response = AddBuildTargetWithHttpInfo(orgid, projectid, options); return response.Data; }