Source code for models.reducer_info

# -*- coding: utf-8 -*-
# Copyright 2021 Cohesity Inc.


[docs]class ReducerInfo(object): """Implementation of the 'ReducerInfo' model. Information about a reducer. Attributes: code (string):The code of the reducer in the specified language. id (int): Reduced ID generated by system. Absent when user is creating a new reducer. Mandatory for all other use cases. is_system_defined (bool): Whether the mapper is system defined. jar_name (string): User can write their own mapper/reducer or upload jar files containing mappers and reducers. If this reducer was part of a jar file, then this field will have the JAR name. jar_path (string): path of JAR in which this reducer was found. This is applicable only when this reducer was uploaded via JAR. language (int): Programming language used by the reducer. name (string): Name of the reducer. """ # Create a mapping from Model property names to API property names _names = { "code": 'code', "id": 'id', "is_system_defined": 'isSystemDefined', "jar_name": 'jarName', "jar_path":'jarPath', "language":'language', "name":'name' } def __init__(self, code=None, id=None, is_system_defined=None, jar_name=None, jar_path=None, language=None, name=None): """Constructor for the ReducerInfo class""" # Initialize members of the class self.code = code self.id = id self.is_system_defined = is_system_defined self.jar_name = jar_name self.jar_path = jar_path self.language = language self.name = name
[docs] @classmethod def from_dictionary(cls, dictionary): """Creates an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary representation of the object as obtained from the deserialization of the server's response. The keys MUST match property names in the API description. Returns: object: An instance of this structure class. """ if dictionary is None: return None # Extract variables from the dictionary code = dictionary.get('code') id = dictionary.get('id') is_system_defined = dictionary.get('isSystemDefined') jar_name = dictionary.get('jarName') jar_path = dictionary.get('jarPath') language = dictionary.get('language') name = dictionary.get('name') # Return an object of this model return cls(code, id, is_system_defined, jar_name, jar_path, language, name)