Exemple #1
0
    def _set_properties(self, resource):
        """Update properties from resource in body of ``api_response``

        :type resource: dict
        :param resource: variable representation returned from the API.
        """
        self._properties.clear()
        cleaned = resource.copy()
        if "name" in cleaned:
            self.name = variable_name_from_full_name(cleaned.pop("name"))
        self._properties.update(cleaned)
Exemple #2
0
    def _set_properties(self, resource):
        """Update properties from resource in body of ``api_response``

        :type resource: dict
        :param resource: variable representation returned from the API.
        """
        self._properties.clear()
        cleaned = resource.copy()
        if 'name' in cleaned:
            self.name = variable_name_from_full_name(cleaned.pop('name'))
        self._properties.update(cleaned)
Exemple #3
0
    def from_api_repr(cls, resource, config):
        """Factory:  construct a Variable given its API representation

        :type resource: dict
        :param resource: change set representation returned from the API.

        :type config: :class:`google.cloud.runtimeconfig.config.Config`
        :param config: The config to which this variable belongs.

        :rtype: :class:`google.cloud.runtimeconfig.variable.Variable`
        :returns: Variable parsed from ``resource``.
        """
        name = variable_name_from_full_name(resource.get("name"))
        variable = cls(name=name, config=config)
        variable._set_properties(resource=resource)
        return variable
Exemple #4
0
    def from_api_repr(cls, resource, config):
        """Factory:  construct a Variable given its API representation

        :type resource: dict
        :param resource: change set representation returned from the API.

        :type config: :class:`google.cloud.runtimeconfig.config.Config`
        :param config: The config to which this variable belongs.

        :rtype: :class:`google.cloud.runtimeconfig.variable.Variable`
        :returns: Variable parsed from ``resource``.
        """
        name = variable_name_from_full_name(resource.get('name'))
        variable = cls(name=name, config=config)
        variable._set_properties(resource=resource)
        return variable
 def _call_fut(self, full_name):
     from google.cloud.runtimeconfig._helpers import (
         variable_name_from_full_name)
     return variable_name_from_full_name(full_name)
    def _call_fut(self, full_name):
        from google.cloud.runtimeconfig._helpers import (
            variable_name_from_full_name)

        return variable_name_from_full_name(full_name)