def __init__(self, api: GrocyApiClient, endpoint: str, parsed_json): self.__product_id = parse_int(parsed_json.get('product_id'), None) self.__note = parsed_json.get('note', None) self.__amount = parse_float(parsed_json.get('amount'), 0) self.__shopping_list_id = parse_int( parsed_json.get('shopping_list_id')) self.__done = parse_bool(parsed_json.get('done'), False) super().__init__(api, endpoint, parsed_json)
def __init__(self, api: GrocyApiClient, endpoint: str, parsed_json): self.__name = parsed_json.get('name') self.__description = parsed_json.get('description', None) self.__location_id = parse_int(parsed_json.get('location_id')) self.__qu_id_purchase = parse_int(parsed_json.get('qu_id_purchase')) self.__qu_id_stock = parse_int(parsed_json.get('qu_id_stock')) self.__enable_tare_weight_handling = parse_int( parsed_json.get('enable_tare_weight_handling', None)) self.__not_check_stock_fulfillment_for_recipes = parse_int( parsed_json.get('not_check_stock_fulfillment_for_recipes'), None) self.__product_group_id = parse_int( parsed_json.get('product_group_id'), None) self.__qu_factor_purchase_to_stock = parse_float( parsed_json.get('qu_factor_purchase_to_stock')) self.__tare_weight = parse_float(parsed_json.get('tare_weight', None)) barcodes_raw = parsed_json.get('barcode', "") if barcodes_raw: self.__barcodes = barcodes_raw.split(",") else: self.__barcodes = None self.__min_stock_amount = parse_int( parsed_json.get('min_stock_amount', None), 0) self.__default_best_before_days = parse_int( parsed_json.get('default_best_before_days', None)) self.__default_best_before_days_after_open = parse_int( parsed_json.get('default_best_before_days_after_open', None)) self.__picture_file_name = parsed_json.get('picture_file_name', None) self.__allow_partial_units_in_stock = parse_bool( parsed_json.get('allow_partial_units_in_stock', False), False) super().__init__(api, endpoint, parsed_json)
def __init__(self, api: GrocyApiClient, endpoint: str, parsed_json): self.__name = parsed_json.get('name') self.__description = parsed_json.get('description', None) self.__due_date = parse_date(parsed_json.get('due_date', None)) self.__done = parse_bool(parsed_json.get('done'), False) self.__done_timestamp = parse_date( parsed_json.get('done_timestamp', None)) self.__category_id = parse_int(parsed_json.get('category_id'), None) self.__assigned_to_user_id = parse_int( parsed_json.get('assigned_to_user_id')) super().__init__(api, endpoint, parsed_json)
def __init__(self, api: GrocyApiClient, endpoint: str, parsed_json): self.__name = parsed_json.get('name') self.__description = parsed_json.get('description', None) self.__picture_file_name = parsed_json.get('picture_file_name', None) self.__base_servings = parse_int(parsed_json.get('base_servings')) self.__desired_servings = parse_int( parsed_json.get('desired_servings')) self.__not_check_shoppinglist = parse_bool( parsed_json.get('not_check_shoppinglist'), False) self.__type = parsed_json.get('type') self.__product_id = parse_int(parsed_json.get('product_id'), None) super().__init__(api, endpoint, parsed_json)
def __init__(self, api: GrocyApiClient, endpoint: str, parsed_json): self.__day = parse_date(parsed_json.get('day')) self.__type = parsed_json.get('type') self.__recipe_id = parse_int(parsed_json.get('recipe_id'), None) self.__recipe_servings = parse_int(parsed_json.get('recipe_servings'), None) self.__note = parsed_json.get('note', None) self.__product_id = parse_int(parsed_json.get('product_id'), None) self.__product_amount = parse_float(parsed_json.get('product_amount'), 0) self.__product_qu_id = parse_int(parsed_json.get('product_qu_id'), None) super().__init__(api, endpoint, parsed_json)
def __init__(self, api: GrocyApiClient, endpoint: str, parsed_json): self.__name = parsed_json.get('name') self.__description = parsed_json.get('description', None) self.__period_type = parsed_json.get('period_type') self.__period_config = parsed_json.get('period_config', None) self.__period_days = parse_int(parsed_json.get('period_days'), None) self.__track_date_only = parse_bool(parsed_json.get('track_date_only'), False) self.__rollover = parse_bool(parsed_json.get('rollover'), False) self.__assignment_type = parsed_json.get('assignment_type', None) self.__assignment_config = parsed_json.get('assignment_config', None) self.__next_execution_assigned_to_user_id = parse_int( parsed_json.get('next_execution_assigned_to_user_id'), None) super().__init__(api, endpoint, parsed_json)
def __init__(self, api: GrocyApiClient, endpoint: str, parsed_json): self.__recipe_id = parse_int(parsed_json.get('recipe_id')) self.__product_id = parse_int(parsed_json.get('product_id')) self.__amount = parse_float(parsed_json.get('amount')) self.__note = parsed_json.get('note', None) self.__qu_id = parse_int(parsed_json.get('qu_id')) self.__only_check_single_unit_in_stock = parse_bool( parsed_json.get('only_check_single_unit_in_stock'), False) self.__ingredient_group = parsed_json.get('ingredient_group', None) self.__not_check_stock_fulfillment = parse_bool( parsed_json.get('not_check_stock_fulfillment'), False) self.__variable_amount = parsed_json.get('variable_amount', None) self.__price_factor = parse_float(parsed_json.get('price_factor')) super().__init__(api, endpoint, parsed_json)
def __init__(self, api: GrocyApiClient, endpoint: str, parsed_json): self.__name = parsed_json.get('name') self.__description = parsed_json.get('description', None) self.__used_in = parsed_json.get('used_in', None) self.__charge_interval_days = parse_int( parsed_json.get('charge_interval_days'), 0) super().__init__(api, endpoint, parsed_json)
def __init__(self, api: GrocyApiClient, endpoint: str, parsed_json): self.__recipe_id = parse_int(parsed_json.get('recipe_id')) self.__includes_recipe_id = parse_int( parsed_json.get('includes_recipe_id')) self.__servings = parse_int(parsed_json.get('servings')) super().__init__(api, endpoint, parsed_json)
def __init__(self, api: GrocyApiClient, endpoint: str, parsed_json): self.__from_qu_id = parse_int(parsed_json.get('from_qu_id')) self.__to_qu_id = parse_int(parsed_json.get('to_qu_id')) self.__factor = parse_float(parsed_json.get('factor')) self.__product_id = parse_int(parsed_json.get('product_id')) super().__init__(api, endpoint, parsed_json)
def __init__(self, api: GrocyApiClient, endpoint: str, parsed_json): self.__userentity_id = parse_int(parsed_json.get('userentity_id')) super().__init__(api, endpoint, parsed_json)