Generates the meta descriptor for the resource item api.
322980
def get_delete_api(self, resource):
        

        parameters = self.delete_item_parameters(resource)

        get_item_api = {
            'path': '/%s/{id}/' % resource.get_api_name(),
            'description': 'Operations on %s' % resource.model.__name__,
            "responseClass": "void",
            'operations': [
                {
                    'httpMethod': 'DELETE',
                    'nickname': 'delete%s' % resource.model.__name__,
                    'summary': 'Delete %s by its unique ID' %
                               resource.model.__name__,
                    'parameters': parameters,
                }
            ]
        }

        return get_item_api
740131
def _init_metadata(self):
        """"""
        ItemTextsFormRecord._init_metadata(self)
        ItemFilesFormRecord._init_metadata(self)
        edXBaseFormRecord._init_metadata(self)
        IRTItemFormRecord._init_metadata(self)
        TimeValueFormRecord._init_metadata(self)
        ProvenanceFormRecord._init_metadata(self)
        super(edXItemFormRecord, self)._init_metadata()
968697
def get_table_metadata(self, resource, resource_class):
        
        return self._make_metadata_request(meta_id=resource + ':' + resource_class, metadata_type='METADATA-TABLE')
478438
def extract_meta(cls, serializer, resource):
        
        if hasattr(serializer, 'child'):
            meta = getattr(serializer.child, 'Meta', None)
        else:
            meta = getattr(serializer, 'Meta', None)
        meta_fields = getattr(meta, 'meta_fields', [])
        data = OrderedDict()
        for field_name in meta_fields:
            data.update({
                field_name: resource.get(field_name)
            })
        return data
276771
def set_meta(self, **kwargs):
        """"""
        for param in self.to_list():
            for k, v in kwargs.items():
                # Here we'll set the attributes (_context, _qualifier, etc)
                if getattr(param, '_{}'.format(k)) is None:
                    setattr(param, '_{}'.format(k), v)
513880
def generate_IR(self):
        """"""

        raw_api = []
        for partial_ast in self._partial_asts:
            namespace_ast_node = self._extract_namespace_ast_node(partial_ast)
            namespace = self.api.ensure_namespace(namespace_ast_node.name)
            base_name = self._get_base_name(namespace.name, namespace.name)
            self._item_by_canonical_name[base_name] = namespace_ast_node
            if namespace_ast_node.doc is not None:
                namespace.add_doc(namespace_ast_node.doc)
            raw_api.append((namespace, partial_ast))
            self._add_data_types_and_routes_to_api(namespace, partial_ast)

        self._add_imports_to_env(raw_api)
        self._merge_patches()
        self._populate_type_attributes()
        self._populate_field_defaults()
        self._populate_enumerated_subtypes()
        self._populate_route_attributes()
        self._populate_examples()
        self._validate_doc_refs()
        self._validate_annotations()
        if self._routes is not None:
            self._filter_namespaces_by_route_whitelist()

        self.api.normalize()

        return self.api
744720
def determine_metadata(self, request, view):
        """"""
        metadata = super(
            DynamicMetadata,
            self).determine_metadata(
            request,
            view)
        metadata['features'] = getattr(view, 'features', [])
        if hasattr(view, 'get_serializer'):
            serializer = view.get_serializer(dynamic=False)
            if hasattr(serializer, 'get_name'):
                metadata['resource_name'] = serializer.get_name()
            if hasattr(serializer, 'get_plural_name'):
                metadata['resource_name_plural'] = serializer.get_plural_name()
        metadata['properties'] = self.get_serializer_info(serializer)
        return metadata
951906
def py2dict(elements):
    """"""
    metadata_dict = {}
    # Loop through all elements in the Python object.
    for element in elements.children:
        # Start an empty element list if an entry for the element
        # list hasn't been made in the dictionary.
        if element.tag not in metadata_dict:
            metadata_dict[element.tag] = []
        element_dict = {}
        if hasattr(element, 'qualifier') and element.qualifier is not None:
            element_dict['qualifier'] = element.qualifier
        # Set the element's content as a dictionary
        # of children elements.
        if len(element.children) > 0:
            child_dict = {}
            for child in element.children:
                if child.content is not None:
                    child_dict[child.tag] = child.content
            element_dict['content'] = child_dict
        # Set element content that is not children.
        elif element.content is not None:
            if element.content.strip() != '':
                element_dict['content'] = element.content
        # Append the dictionary to the element list
        # if the element has content or children.
        if element_dict.get('content', False):
            metadata_dict[element.tag].append(element_dict)

    return metadata_dict
321507
def parse_meta(meta):
    
    resources = {}
    for name in meta:
        if name.startswith("$"):
            continue
        resources[name] = resource = {}
        for action in meta[name]:
            if action.startswith("$"):
                continue
            url, httpmethod = res_to_url(name, action)
            resource[action] = {
                "url": url,
                "method": httpmethod
            }
    url_prefix = meta.get("$url_prefix", "").rstrip("/")
    return url_prefix, meta["$auth"]["header"].lower(), resources
1353662
private Metadata createMetadata(String resource) {
    Metadata metadata = new Metadata();
    if (resource != null) {
      metadata.put(GRPC_RESOURCE_PREFIX_KEY, resource);
    }
    return metadata;
  }
69848
def get_metadata(self, loadbalancer, node=None, raw=False):
        
        if node:
            uri = "/loadbalancers/%s/nodes/%s/metadata" % (
                    utils.get_id(loadbalancer), utils.get_id(node))
        else:
            uri = "/loadbalancers/%s/metadata" % utils.get_id(loadbalancer)
        resp, body = self.api.method_get(uri)
        meta = body.get("metadata", [])
        if raw:
            return meta
        ret = dict([(itm["key"], itm["value"]) for itm in meta])
        return ret
1020981
def get_resource_metadata(self, resource=None):
        
        result = self._make_metadata_request(meta_id=0, metadata_type='METADATA-RESOURCE')
        if resource:
            result = next((item for item in result if item['ResourceID'] == resource), None)
        return result
469241
def metadata(ctx, archive_name):
    '''
    
    '''

    _generate_api(ctx)
    var = ctx.obj.api.get_archive(archive_name)
    click.echo(pprint.pformat(var.get_metadata()))
344284
def get_meta_type_by_name(name):
    data = get_default_metadata_data()
    child_data = get_child_metadata_data()
    for item in data["metadataObjects"]:
        if 'xmlName' in item and item['xmlName'] == name:
            return item
    for item in child_data:
        if 'xmlName' in item and item['xmlName'] == name:
            return item
    '''
        
    '''
    try:
        if config.describe_data != None:
            project_org_describe = config.describe_data
        if config.project != None and os.path.isfile(os.path.join(config.project.location,'config','.describe')):
            project_org_describe = parse_json_from_file(os.path.join(config.project.location,'config','.describe'))
        if project_org_describe != None and 'metadataObjects' in project_org_describe:
            for item in project_org_describe["metadataObjects"]:
                if 'xmlName' in item and item['xmlName'] == name:
                    return item
    except:
        pass
334421
private URL generateMetatypePropertiesName(String metatypeName, String locale) {
        String lookupName;
        if (locale != null && locale.length() > 0) {
            lookupName = metatypeName + LOCALE_SEPARATOR + locale + PROP_EXT;
        } else {
            lookupName = metatypeName + PROP_EXT;
        }

        URL url = bundle.getEntry(lookupName);

        if (url == null) {
            int pos = locale == null ? -1 : locale.lastIndexOf(LOCALE_SEPARATOR);
            if (pos != -1) {
                url = generateMetatypePropertiesName(metatypeName, locale.substring(0, pos));
            }
        }
        return url;
    }
8634
def process_metadata(meta):
    
    mvgds = []

    metadata = meta[0]

    for mvgd in meta:
        if isinstance(mvgd['mv_grid_districts'], list):
            mvgds.extend(mvgd['mv_grid_districts'])
        else:
            mvgds.append(mvgd['mv_grid_districts'])

    metadata['mv_grid_districts'] = mvgds

    return metadata
299548
def to_api_repr(self):
        
        value = self.value
        converter = _SCALAR_VALUE_TO_JSON_PARAM.get(self.type_)
        if converter is not None:
            value = converter(value)
        resource = {
            "parameterType": {"type": self.type_},
            "parameterValue": {"value": value},
        }
        if self.name is not None:
            resource["name"] = self.name
        return resource