GooglePlayInstant/Editor/QuickDeploy/GcpClient.cs
/// <summary>
/// Sends an HTTP request to GCP to create a bucket with the configured name, and invokes the response
/// handler on the HTTP response.
/// </summary>
/// <param name="onCreateBucketResponseAction">An action to be invoked on the www instance holding the HTTP request
/// once the response to the request to create bucket is available.</param>
Sends an HTTP request to GCP to create a bucket with the configured name, and invokes the response
handler on the HTTP response.
Sends an HTTP request to GCP to create a bucket with the configured name and invokes the response handler on the HTTP response .
private static void CreateBucket(Action<WWW> onCreateBucketResponseAction)
        {
            var credentials = OAuth2Credentials.GetCredentials();
            var createBucketEndPoint = string.Format("https://www.googleapis.com/storage/v1/b?project={0}",
                credentials.project_id);
            var createBucketRequest = new CreateBucketRequest
            {
                name = QuickDeployWindow.Config.CloudStorageBucketName
            };
            var jsonBytes = Encoding.UTF8.GetBytes(JsonUtility.ToJson(createBucketRequest));
            var createBucketWww = SendAuthenticatedPostRequest(createBucketEndPoint, jsonBytes, "application/json");
            WwwRequestInProgress.TrackProgress(
                createBucketWww,
                string.Format("Creating bucket with name \"{0}\"", createBucketRequest.name),
                onCreateBucketResponseAction);
        }
private static void CreateBucket ( Action < WWW > onCreateBucketResponseAction ) { var credentials = OAuth2Credentials . GetCredentials ( ) ; var createBucketEndPoint = string . Format ( " " , credentials . project_id ) ; var createBucketRequest = new CreateBucketRequest { name = QuickDeployWindow . Config . CloudStorageBucketName } ; var jsonBytes = Encoding . UTF8 . GetBytes ( JsonUtility . ToJson ( createBucketRequest ) ) ; var createBucketWww = SendAuthenticatedPostRequest ( createBucketEndPoint , jsonBytes , " " ) ; WwwRequestInProgress . TrackProgress ( createBucketWww , string . Format ( " \" \" " , createBucketRequest . name ) , onCreateBucketResponseAction ) ; }
Sends an HTTP request to GCP to create a bucket with the configured name, and invokes the response
handler on the HTTP response.
Sends an HTTP request to GCP to create a bucket with the configured name and invokes the response handler on the HTTP response .
// see https://cloud.google.com/storage/docs/creating-buckets on creating buckets.
onCreateBucketResponseAction
Action<WWW>
An action to be invoked on the www instance holding the HTTP request
once the response to the request to create bucket is available.
An action to be invoked on the www instance holding the HTTP request once the response to the request to create bucket is available .