# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function

from marshmallow import fields, validate

from polyaxon_schemas.ops.run import BaseRunConfig, BaseRunSchema
from polyaxon_schemas.ops.run_exec import RunSchema


class JobSchema(BaseRunSchema):
    kind = fields.Str(allow_none=None, validate=validate.Equal('job'))
    declarations = fields.Raw(allow_none=True)
    run = fields.Nested(RunSchema, allow_none=True)

    @staticmethod
    def schema_config():
        return JobConfig


class JobConfig(BaseRunConfig):
    SCHEMA = JobSchema
    IDENTIFIER = 'job'

    def __init__(self,
                 kind=None,
                 version=None,
                 logging=None,
                 tags=None,
                 declarations=None,
                 environment=None,
                 build=None,
                 run=None,
                 ):
        super(JobConfig, self).__init__(kind=kind,
                                        version=version,
                                        logging=logging,
                                        tags=tags,
                                        environment=environment,
                                        build=build)
        self.declarations = declarations
        self.run = run

@@ -446,16 +446,102 @@
 ne=True)
+%0A    backend = fields.Str(allow_none=True)%0A    framework = fields.Str(allow_none=True)
 %0A%0A    @s
@@ -968,16 +968,61 @@
         
+backend=None,%0A                 framework=None
 ):%0A     
@@ -1350,16 +1350,17 @@
 =build)%0A
+%0A
         
@@ -1392,16 +1392,16 @@
 rations%0A
-
         
@@ -1415,8 +1415,74 @@
 n = run%0A
+        self.backend = backend%0A        self.framework = framework%0A

Update job ops