コード例 #1
0
        public string GetListUrl(AvmObjectType objectType)
        {
            string url;

            switch (objectType)
            {
            case AvmObjectType.Build:
            case AvmObjectType.BuildVariables:
                url = $"https://dev.azure.com/{_variables.Organization}/{_variables.Project}/_apis/build/definitions?api-version=5.0";
                break;

            case AvmObjectType.Release:
            case AvmObjectType.ReleaseVariables:
                url = $"https://vsrm.dev.azure.com/{_variables.Organization}/{_variables.Project}/_apis/release/definitions?api-version=5.0";
                break;

            case AvmObjectType.VariableGroup:
            case AvmObjectType.VariableGroupVariables:
                url = $"https://dev.azure.com/{_variables.Organization}/{_variables.Project}/_apis/distributedtask/variablegroups?api-version=5.0-preview.1";
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            return(url);
        }
コード例 #2
0
 private ListOptions CreateValidListOptions(AvmObjectType type)
 {
     return(new ListOptions
     {
         Type = type
     });
 }
コード例 #3
0
 private SetOptions CreateValidSetOptions(AvmObjectType type)
 {
     return(new SetOptions
     {
         Id = "1",
         Type = type,
         SourceFilePath = "source.json"
     });
 }