예제 #1
0
        internal static void ChangeBranchAttribute(
            RestApi restApi,
            string repoName, string branchName, string attributeName, string attributeValue)
        {
            ChangeAttributeRequest request = new ChangeAttributeRequest()
            {
                TargetType = AttributeTargetType.Branch,
                TargetName = branchName,
                Value      = attributeValue
            };

            restApi.ChangeAttribute(repoName, attributeName, request);
        }
예제 #2
0
        public void ChangeAttribute(
            string repoName, string attributeName, ChangeAttributeRequest request)
        {
            Uri endpoint = ApiUris.GetFullUri(
                mBaseUri, ApiEndpoints.ChangeAttribute,
                repoName, attributeName);

            string actionDescription = string.Format(
                "set attribute '{0}@{1}' applied to {2} '{3}' to value '{4}'",
                attributeName,
                repoName,
                request.TargetType,
                request.TargetName,
                request.Value);

            Internal.MakeApiRequest <ChangeAttributeRequest>(
                endpoint, HttpMethod.Put, request, actionDescription, mApiKey);
        }
예제 #3
0
        public void UpdateBranchAttribute(string repository, string branchFullName, string attrName, string attrValue)
        {
            string actionDescription = string.Format(
                "update attribute {0}={1} of branch {2}", attrName, attrValue, branchFullName);

            ChangeAttributeRequest request = new ChangeAttributeRequest()
            {
                TargetType = ChangeAttributeRequest.AttributeTargetType.Branch,
                TargetName = branchFullName,
                Value      = attrValue
            };

            Uri endpoint = ApiUris.GetFullUri(
                mBaseUri, ApiEndpoints.ChangeAttribute,
                repository, attrName);

            Internal.MakeApiRequest <ChangeAttributeRequest>(
                endpoint, HttpMethod.Put, request, actionDescription, mPlasticBotUserToken);
        }