/// <summary> /// PublishVersion接口的同步版本,该接口用于用户发布新版本函数。 /// </summary> /// <param name="req">参考<see cref="PublishVersionRequest"/></param> /// <returns>参考<see cref="PublishVersionResponse"/>实例</returns> public PublishVersionResponse PublishVersionSync(PublishVersionRequest req) { JsonResponseModel <PublishVersionResponse> rsp = null; try { var strResp = this.InternalRequestSync(req, "PublishVersion"); rsp = JsonConvert.DeserializeObject <JsonResponseModel <PublishVersionResponse> >(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return(rsp.Response); }
/// <summary> /// Publishes a version of your function from the current snapshot of $LATEST. /// </summary> /// <param name="functionName">The name of an AWS Lambda function.</param> /// <param name="settings">The <see cref="PublishVersionSettings"/> used during the request to AWS.</param> /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> public async Task <string> PublishVersion(string functionName, PublishVersionSettings settings, CancellationToken cancellationToken = default(CancellationToken)) { if (String.IsNullOrEmpty(functionName)) { throw new ArgumentNullException(nameof(functionName)); } // Create Request AmazonLambdaClient client = this.CreateClient(settings); PublishVersionRequest request = new PublishVersionRequest() { FunctionName = functionName, CodeSha256 = settings.CodeSha256, Description = settings.Description }; // Check Response PublishVersionResponse response = await client.PublishVersionAsync(request, cancellationToken); if (response.HttpStatusCode == HttpStatusCode.OK) { _Log.Verbose("Successfully published function '{0}'", functionName); return(response.Version); } else { _Log.Error("Failed to published function '{0}'", functionName); return(""); } }
public void PublishVersionAsync(PublishVersionRequest request, AmazonServiceCallback <PublishVersionRequest, PublishVersionResponse> callback, AsyncOptions options = null) { throw new System.NotImplementedException(); }
/// <summary> /// Publishs the version. /// </summary> /// <returns>The version.</returns> /// <param name="publishVersionRequest">Publish version request.</param> public PublishVersionResponse PublishVersion(PublishVersionRequest publishVersionRequest) { return(this.DoRequestCommon <PublishVersionResponse>(publishVersionRequest.GenHttpRequest(Config))); }