<s> from __future__ import absolute_import <EOL> from . . base import BaseObj , FieldMeta <EOL> from ... utils import final <EOL> from ... io import SwaggerRequest , SwaggerResponse <EOL> from ... primitives import Array <EOL> import six <EOL> import copy <EOL> class BaseObj_v2_0 ( BaseObj ) : <EOL> __swagger_version__ = '<STR_LIT>' <EOL> class XMLObject ( BaseObj_v2_0 ) : <EOL> """<STR_LIT>""" <EOL> __swagger_fields__ = { <EOL> '<STR_LIT:name>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> } <EOL> class BaseSchema ( BaseObj_v2_0 ) : <EOL> """<STR_LIT>""" <EOL> __swagger_fields__ = { <EOL> '<STR_LIT:type>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT:default>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> } <EOL> class Items ( six . with_metaclass ( FieldMeta , BaseSchema ) ) : <EOL> """<STR_LIT>""" <EOL> __swagger_fields__ = { <EOL> '<STR_LIT>' : None , <EOL> } <EOL> def _prim_ ( self , v , prim_factory ) : <EOL> return prim_factory . produce ( self , v ) <EOL> class Schema ( six . with_metaclass ( FieldMeta , BaseSchema ) ) : <EOL> """<STR_LIT>""" <EOL> __swagger_fields__ = { <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : [ ] , <EOL> '<STR_LIT>' : [ ] , <EOL> '<STR_LIT>' : { } , <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT:title>' : None , <EOL> '<STR_LIT:description>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> } <EOL> __internal_fields__ = { <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT:name>' : None , <EOL> } <EOL> def _prim_ ( self , v , prim_factory ) : <EOL> return prim_factory . produce ( self , v ) <EOL> class Swagger ( six . with_metaclass ( FieldMeta , BaseObj_v2_0 ) ) : <EOL> """<STR_LIT>""" <EOL> __swagger_fields__ = { <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT:info>' : None , <EOL> '<STR_LIT:host>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : [ ] , <EOL> '<STR_LIT>' : [ ] , <EOL> '<STR_LIT:produces>' : [ ] , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> } <EOL> class Contact ( six . with_metaclass ( FieldMeta , BaseObj_v2_0 ) ) : <EOL> """<STR_LIT>""" <EOL> __swagger_fields__ = { <EOL> '<STR_LIT:name>' : None , <EOL> '<STR_LIT:url>' : None , <EOL> '<STR_LIT:email>' : None , <EOL> } <EOL> class License ( six . with_metaclass ( FieldMeta , BaseObj_v2_0 ) ) : <EOL> """<STR_LIT>""" <EOL> __swagger_fields__ = { <EOL> '<STR_LIT:name>' : None , <EOL> '<STR_LIT:url>' : None , <EOL> } <EOL> class Info ( six . with_metaclass ( FieldMeta , BaseObj_v2_0 ) ) : <EOL> """<STR_LIT>""" <EOL> __swagger_fields__ = { <EOL> '<STR_LIT:version>' : None , <EOL> '<STR_LIT:title>' : None , <EOL> '<STR_LIT:description>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> } <EOL> class Parameter ( six . with_metaclass ( FieldMeta , BaseSchema ) ) : <EOL> """<STR_LIT>""" <EOL> __swagger_fields__ = { <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT:name>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT:description>' : None , <EOL> '<STR_LIT>' : False , <EOL> } <EOL> __internal_fields__ = { <EOL> '<STR_LIT>' : None , <EOL> } <EOL> def _prim_ ( self , v , prim_factory ) : <EOL> i = getattr ( self , '<STR_LIT>' ) <EOL> return prim_factory . produce ( self . schema , v ) if i == '<STR_LIT:body>' else prim_factory . produce ( self , v ) <EOL> class Header ( six . with_metaclass ( FieldMeta , BaseSchema ) ) : <EOL> """<STR_LIT>""" <EOL> __swagger_fields__ = { <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT:description>' : None , <EOL> } <EOL> def _prim_ ( self , v , prim_factory ) : <EOL> return prim_factory . produce ( self , v ) <EOL> class Response ( six . with_metaclass ( FieldMeta , BaseObj_v2_0 ) ) : <EOL> """<STR_LIT>""" <EOL> __swagger_fields__ = { <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : { } , <EOL> '<STR_LIT:description>' : None , <EOL> '<STR_LIT>' : None , <EOL> } <EOL> __internal_fields__ = { <EOL> '<STR_LIT>' : None , <EOL> } <EOL> class Operation ( six . with_metaclass ( FieldMeta , BaseObj_v2_0 ) ) : <EOL> """<STR_LIT>""" <EOL> __swagger_fields__ = { <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : [ ] , <EOL> '<STR_LIT:produces>' : [ ] , <EOL> '<STR_LIT>' : [ ] , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : False , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT:description>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> } <EOL> __internal_fields__ = { <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT:url>' : None , <EOL> '<STR_LIT:path>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : [ ] , <EOL> } <EOL> def __call__ ( self , ** k ) : <EOL> params = dict ( header = { } , query = [ ] , path = { } , body = { } , formData = [ ] , file = { } ) <EOL> names = [ ] <EOL> def _convert_parameter ( p ) : <EOL> if p . name not in k and not p . is_set ( "<STR_LIT:default>" ) and p . required : <EOL> raise ValueError ( '<STR_LIT>' + p . name ) <EOL> if p . is_set ( "<STR_LIT:default>" ) : <EOL> v = k . get ( p . name , p . default ) <EOL> else : <EOL> if p . name in k : <EOL> v = k [ p . name ] <EOL> else : <EOL> return <EOL> c = p . _prim_ ( v , self . _prim_factory ) <EOL> i = getattr ( p , '<STR_LIT>' ) <EOL> if p . type == '<STR_LIT:file>' : <EOL> params [ '<STR_LIT:file>' ] [ p . name ] = c <EOL> elif i in ( '<STR_LIT>' , '<STR_LIT>' ) : <EOL> if isinstance ( c , Array ) : <EOL> params [ i ] . extend ( [ tuple ( [ p . name , v ] ) for v in c . to_url ( ) ] ) <EOL> else : <EOL> params [ i ] . append ( ( p . name , str ( c ) , ) ) <EOL> else : <EOL> params [ i ] [ p . name ] = str ( c ) if i != '<STR_LIT:body>' else c <EOL> names . append ( p . name ) <EOL> for p in self . parameters : <EOL> _convert_parameter ( final ( p ) ) <EOL> unknown = set ( six . iterkeys ( k ) ) - set ( names ) <EOL> if len ( unknown ) > <NUM_LIT:0> : <EOL> raise ValueError ( '<STR_LIT>' . format ( unknown ) ) <EOL> return SwaggerRequest ( op = self , params = params ) , SwaggerResponse ( self ) <EOL> class PathItem ( six . with_metaclass ( FieldMeta , BaseObj_v2_0 ) ) : <EOL> """<STR_LIT>""" <EOL> __swagger_fields__ = { <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : [ ] , <EOL> } <EOL> class SecurityScheme ( six . with_metaclass ( FieldMeta , BaseObj_v2_0 ) ) : <EOL> """<STR_LIT>""" <EOL> __swagger_fields__ = { <EOL> '<STR_LIT:type>' : None , <EOL> '<STR_LIT:name>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT:description>' : None , <EOL> } <EOL> class Tag ( six . with_metaclass ( FieldMeta , BaseObj_v2_0 ) ) : <EOL> """<STR_LIT>""" <EOL> __swagger_fields__ = { <EOL> '<STR_LIT:name>' : None , <EOL> '<STR_LIT:description>' : None , <EOL> '<STR_LIT>' : None , <EOL> } <EOL> class ExternalDocumentation ( six . with_metaclass ( FieldMeta , BaseObj_v2_0 ) ) : <EOL> """<STR_LIT>""" <EOL> __swagger_fields__ = { <EOL> '<STR_LIT:description>' : None , <EOL> '<STR_LIT:url>' : None , <EOL> } </s>
