Example #1
0
 public async Task CreateOrUpdateVersionSetAsync(
     string setName, string displayName, string description, ApiVersionSchemes scheme)
 {
     var path = $"{GetBasePath()}/api-version-sets/{setName}?api-version=2018-06-01-preview";
     await Constants.Azure
     .PutRestAsync(path, new
     {
         Properties = new
         {
             DisplayName      = displayName,
             Description      = description,
             VersioningScheme = scheme.ToString()
         }
     }, (_tokenLambda).AddIfMatch());
 }
Example #2
0
 public async Task CreateVersionFromRevisionAsync(
     string apiId, string revision, string versionName,
     string versionDescription, string newApiId,
     ApiVersionSchemes scheme)
 {
     var path   = $"{GetBasePath()}/apis/{newApiId}?api-version=2017-03-01";
     var lambda = (_tokenLambda)
                  .AddIfMatch()
                  .AddSpecialContentType("application/vnd.ms-azure-apim.revisioninfo+json");
     await Constants.Azure.PutRestAsync(path,
                                        new
     {
         SourceApiId           = $"/apis/{apiId}[{revision}]",
         ApiVersionName        = versionName,
         Name                  = apiId,
         Path                  = newApiId,
         Protocols             = new string[] { "https" },
         ApiVersionDescription = versionDescription,
         ApiVersionSet         = new
         {
             VersioningScheme = scheme.ToString()
         }
     }, lambda);
 }