Create an operation that will retrieve the content key authorization
policy at the given link

@param link
the link
@return the operation
966711
public static EntityGetOperation<ContentKeyAuthorizationPolicyInfo> get(
            LinkInfo<ContentKeyAuthorizationPolicyInfo> link) {
        return new DefaultGetOperation<ContentKeyAuthorizationPolicyInfo>(link.getHref(),
                ContentKeyAuthorizationPolicyInfo.class);
    }
607855
public static EntityUnlinkOperation unlinkOptions(String contentKeyAuthorizationPolicyId,
            String contentKeyAuthorizationPolicyOptionId) {
        return new EntityUnlinkOperation(ENTITY_SET, contentKeyAuthorizationPolicyId, "Options", contentKeyAuthorizationPolicyOptionId);
    }
159929
public static DefaultListOperation<LocatorInfo> list(
            LinkInfo<LocatorInfo> link) {
        return new DefaultListOperation<LocatorInfo>(link.getHref(),
                new GenericType<ListResult<LocatorInfo>>() {
                });
    }
582371
public Content getDocLink(LinkInfoImpl.Kind context, MemberDoc doc, String label) {
        return getDocLink(context, doc.containingClass(), doc,
                new StringContent(label));
    }
492180
public static DefaultListOperation<AssetFileInfo> list(
            LinkInfo<AssetFileInfo> link) {
        return new DefaultListOperation<AssetFileInfo>(link.getHref(),
                new GenericType<ListResult<AssetFileInfo>>() {
                });
    }
60884
public static String link(Key k, String content, Key cp, String response, Key val) {
    DeepLearning req = new DeepLearning();
    RString rs = new RString("<a href='" + req.href() + ".query?source=%$key" +
            (cp == null ? "" : "&checkpoint=%$cp") +
            (response == null ? "" : "&response=%$resp") +
            (val == null ? "" : "&validation=%$valkey") +
            "'>%content</a>");
    rs.replace("key", k.toString());
    rs.replace("content", content);
    if (cp != null) rs.replace("cp", cp.toString());
    if (response != null) rs.replace("resp", response);
    if (val != null) rs.replace("valkey", val);
    return rs.toString();
  }
990060
public static DefaultListOperation<TaskInfo> list(LinkInfo<TaskInfo> link) {
        return new DefaultListOperation<TaskInfo>(link.getHref(),
                new GenericType<ListResult<TaskInfo>>() {
                });
    }
1074559
public static Link link(String href, String rel) {
        return link(href, rel, null, null, null);
    }
484969
public String getUrl(String htmlLink) {
        String result = htmlLink;
        if (htmlLink != null) {
            Matcher linkMatcher = LINKPATTERN.matcher(htmlLink);
            Matcher imgMatcher = IMAGEPATTERN.matcher(htmlLink);
            if (linkMatcher.matches()) {
                String href = linkMatcher.group(2);
                href = StringEscapeUtils.unescapeHtml4(href);
                result = href + linkMatcher.group(4);
            } else if (imgMatcher.matches()) {
                String src = imgMatcher.group(2);
                result = StringEscapeUtils.unescapeHtml4(src);
            }
        }
        return result;
    }
1200003
protected void getLinkForWildcard(Content link, LinkInfo linkInfo, Type type) {
		linkInfo.isTypeBound = true;
		link.addContent("?"); //$NON-NLS-1$
		final WildcardType wildcardType = type.asWildcardType();
		final Type[] extendsBounds = wildcardType.extendsBounds();
		final SARLFeatureAccess kw = Utils.getKeywords();
		for (int i = 0; i < extendsBounds.length; i++) {
			link.addContent(i > 0 ? kw.getCommaKeyword() + " " //$NON-NLS-1$
					: " " + kw.getExtendsKeyword() + " "); //$NON-NLS-1$ //$NON-NLS-2$
			setBoundsLinkInfo(linkInfo, extendsBounds[i]);
			link.addContent(getLink(linkInfo));
		}
		final Type[] superBounds = wildcardType.superBounds();
		for (int i = 0; i < superBounds.length; i++) {
			link.addContent(i > 0 ? kw.getCommaKeyword() + " " //$NON-NLS-1$
					: " " + kw.getSuperKeyword() + " "); //$NON-NLS-1$ //$NON-NLS-2$
			setBoundsLinkInfo(linkInfo, superBounds[i]);
			link.addContent(getLink(linkInfo));
		}
	}
776178
public Content getLink(LinkInfo linkInfo) {
        if (linkInfo.type != null) {
            Type type = linkInfo.type;
            Content link = newContent();
            if (type.isPrimitive()) {
                //Just a primitive.
                link.addContent(type.typeName());
            } else if (type.asAnnotatedType() != null && type.dimension().length() == 0) {
                link.addContent(getTypeAnnotationLinks(linkInfo));
                linkInfo.type = type.asAnnotatedType().underlyingType();
                link.addContent(getLink(linkInfo));
                return link;
            } else if (type.asWildcardType() != null) {
                //Wildcard type.
                linkInfo.isTypeBound = true;
                link.addContent("?");
                WildcardType wildcardType = type.asWildcardType();
                Type[] extendsBounds = wildcardType.extendsBounds();
                for (int i = 0; i < extendsBounds.length; i++) {
                    link.addContent(i > 0 ? ", " : " extends ");
                    setBoundsLinkInfo(linkInfo, extendsBounds[i]);
                    link.addContent(getLink(linkInfo));
                }
                Type[] superBounds = wildcardType.superBounds();
                for (int i = 0; i < superBounds.length; i++) {
                    link.addContent(i > 0 ? ", " : " super ");
                    setBoundsLinkInfo(linkInfo, superBounds[i]);
                    link.addContent(getLink(linkInfo));
                }
            } else if (type.asTypeVariable()!= null) {
                link.addContent(getTypeAnnotationLinks(linkInfo));
                linkInfo.isTypeBound = true;
                //A type variable.
                Doc owner = type.asTypeVariable().owner();
                if ((! linkInfo.excludeTypeParameterLinks) &&
                        owner instanceof ClassDoc) {
                    linkInfo.classDoc = (ClassDoc) owner;
                    Content label = newContent();
                    label.addContent(type.typeName());
                    linkInfo.label = label;
                    link.addContent(getClassLink(linkInfo));
                } else {
                    //No need to link method type parameters.
                    link.addContent(type.typeName());
                }

                Type[] bounds = type.asTypeVariable().bounds();
                if (! linkInfo.excludeTypeBounds) {
                    linkInfo.excludeTypeBounds = true;
                    for (int i = 0; i < bounds.length; i++) {
                        link.addContent(i > 0 ? " & " : " extends ");
                        setBoundsLinkInfo(linkInfo, bounds[i]);
                        link.addContent(getLink(linkInfo));
                    }
                }
            } else if (type.asClassDoc() != null) {
                //A class type.
                if (linkInfo.isTypeBound &&
                        linkInfo.excludeTypeBoundsLinks) {
                    //Since we are excluding type parameter links, we should not
                    //be linking to the type bound.
                    link.addContent(type.typeName());
                    link.addContent(getTypeParameterLinks(linkInfo));
                    return link;
                } else {
                    linkInfo.classDoc = type.asClassDoc();
                    link = newContent();
                    link.addContent(getClassLink(linkInfo));
                    if (linkInfo.includeTypeAsSepLink) {
                        link.addContent(getTypeParameterLinks(linkInfo, false));
                    }
                }
            }

            if (linkInfo.isVarArg) {
                if (type.dimension().length() > 2) {
                    //Javadoc returns var args as array.
                    //Strip out the first [] from the var arg.
                    link.addContent(type.dimension().substring(2));
                }
                link.addContent("...");
            } else {
                while (type != null && type.dimension().length() > 0) {
                    if (type.asAnnotatedType() != null) {
                        linkInfo.type = type;
                        link.addContent(" ");
                        link.addContent(getTypeAnnotationLinks(linkInfo));
                        link.addContent("[]");
                        type = type.asAnnotatedType().underlyingType().getElementType();
                    } else {
                        link.addContent("[]");
                        type = type.getElementType();
                    }
                }
                linkInfo.type = type;
                Content newLink = newContent();
                newLink.addContent(getTypeAnnotationLinks(linkInfo));
                newLink.addContent(link);
                link = newLink;
            }
            return link;
        } else if (linkInfo.classDoc != null) {
            //Just a class link
            Content link = newContent();
            link.addContent(getClassLink(linkInfo));
            if (linkInfo.includeTypeAsSepLink) {
                link.addContent(getTypeParameterLinks(linkInfo, false));
            }
            return link;
        } else {
            return null;
        }
    }
747033
public HalResource setLink(String relation, Link link) {
    if (link == null) {
      return this;
    }
    return addResources(HalResourceType.LINKS, relation, false, new Link[] {
        link
    });
  }
183260
public static EntityTypeActionOperation<String> rebind(String contentKeyId,
            String x509Certificate) {
        return new RebindContentKeyActionOperation(contentKeyId,
                x509Certificate);
    }
941119
def create_contentkey_authorization_policy(access_token, content):
    '''
    '''
    path = '/ContentKeyAuthorizationPolicies'
    endpoint = ''.join([ams_rest_endpoint, path])
    body = content
    return do_ams_post(endpoint, path, body, access_token)
706387
private Link parseLinkHeader(final String link) throws ExternalMessageBodyException {
        final Link realLink = Link.valueOf(link);

        try {
            final String handling = realLink.getParams().get(HANDLING);
            if (handling == null || !handling.matches("(?i)" + PROXY + "|" + COPY + "|" + REDIRECT)) {
                // error
                throw new ExternalMessageBodyException(
                        "Link header formatted incorrectly: 'handling' parameter incorrect or missing");
            }
        } catch (final Exception e) {
            throw new ExternalMessageBodyException("External content link header url is malformed");
        }
        return realLink;
    }
81181
public BoxSharedLink.Access getAccess() {
        return mBodyMap.containsKey(BoxItem.FIELD_SHARED_LINK) ?
                ((BoxSharedLink) mBodyMap.get(BoxItem.FIELD_SHARED_LINK)).getAccess() :
                null;
    }
789004
protected void getLinkForAnnotationType(Content link, LinkInfo linkInfo, Type type) {
		link.addContent(getTypeAnnotationLinks(linkInfo));
		linkInfo.type = type.asAnnotatedType().underlyingType();
		link.addContent(getLink(linkInfo));
	}