def get_item_by_gtin( requested_gtin, # type: Union[Sequence[str], str] requested_language=None, # type: Optional[Union[str, LanguageCode]] requester_gln='0000000000000', # type: Optional[str] on_behalf_of_gln=None, # type: Optional[str] is_authenticated=None, # type: Optional[bool] cascade=9, # type: Optional[bool] timeout=None # type: Optional[int] ): # type: (...) -> Envelope if requested_language is not None: if isinstance(requested_language, str): requested_language = LanguageCode( text=requested_language, tag='requestedLanguage' ) elif isinstance(requested_language, LanguageCode): requested_language = copy(requested_language) requested_language.tag = 'requestedLanguage' request_envelope = Envelope( header=Header( request_header=RequestHeader( requester_gln=requester_gln, on_behalf_of_gln=on_behalf_of_gln, is_authenticated=is_authenticated, cascade=cascade ) ), body=Body( get_item_by_gtin=GetItemByGTIN( requested_gtin=requested_gtin, requested_language=requested_language ) ) ) response_envelope = request( request_envelope, timeout=timeout ) return response_envelope
def get_key_licensee( requested_key_code=None, # type: Optional[RequestedKeyCode] requested_key_value=None, # type: Optional[str] requested_language=None, # type: Optional[Union[str, LanguageCode]] requested_keys=None, # type: Union[GEPIRRequestedKey, Sequence[GEPIRRequestedKey]] requester_gln='0000000000000', # type: Optional[str] on_behalf_of_gln=None, # type: Optional[str] is_authenticated=None, # type: Optional[bool] cascade=9, # type: Optional[bool] timeout=None, # type: Optional[int] _type=GetKeyLicensee # type: type ): if requested_language is not None: if isinstance(requested_language, str): requested_language = LanguageCode( text=requested_language, tag='requestedLanguage' ) elif isinstance(requested_language, LanguageCode): requested_language = copy(requested_language) requested_language.tag = 'requestedLanguage' if requested_keys is None: requested_keys = [] if ( requested_key_code is not None or requested_key_value is not None or requested_language is not None ): if isinstance(requested_key_code, str): requested_key_code = RequestedKeyCode( text=requested_key_code ) requested_keys.append( GEPIRRequestedKey( requested_key_code=requested_key_code, requested_key_value=requested_key_value, requested_language=requested_language ) ) request_envelope = Envelope( header=Header( request_header=RequestHeader( requester_gln=requester_gln, on_behalf_of_gln=on_behalf_of_gln, is_authenticated=is_authenticated, cascade=cascade ) ), body=( Body( get_prefix_licensee=GetPrefixLicensee( requested_key=requested_keys ) ) if (_type is GetPrefixLicensee) else Body( get_key_licensee=GetKeyLicensee( requested_key=requested_keys ) ) ) ) #return request_envelope response_envelope = request( request_envelope, timeout=timeout ) return response_envelope
def get_party_by_name( requested_country=None, # type: Optional[Union[str, CountryCode]] requested_party_name=None, # type: Optional[str] requested_street_address=None, # type: Optional[str] requested_city=None, # type: Optional[str] requested_postal_code=None, # type: Optional[str] requested_language=None, # type: Optional[Union[str, LanguageCode]] requester_gln='0000000000000', # type: Optional[str] on_behalf_of_gln=None, # type: Optional[str] is_authenticated=None, # type: Optional[bool] cascade=9, # type: Optional[bool] timeout=None # type: Optional[int] ): # type: (...) -> Envelope if requested_country is not None: if isinstance(requested_country, str): requested_country = CountryCode( text=requested_country, tag='requestedCountry' ) elif ( isinstance(requested_country, LanguageCode) and requested_country.tag != 'requestedCountry' ): requested_country = copy(requested_country) requested_country.tag = 'requestedCountry' if requested_language is not None: if isinstance(requested_language, str): requested_language = LanguageCode( text=requested_language, tag='requestedLanguage' ) elif ( isinstance(requested_language, LanguageCode) and requested_language.tag != 'requestedLanguage' ): requested_language = copy(requested_language) requested_language.tag = 'requestedLanguage' request_envelope = Envelope( header=Header( request_header=RequestHeader( requester_gln=requester_gln, on_behalf_of_gln=on_behalf_of_gln, is_authenticated=is_authenticated, cascade=cascade ) ), body=Body( get_item_by_gtin=GetPartyByName( gepir_get_party_request_parameters=GEPIRGetPartyRequestParameters( requested_city=requested_city, requested_country=requested_country, requested_language=requested_language, requested_party_name=requested_party_name, requested_postal_code=requested_postal_code, requested_street_address=requested_street_address ) ) ) ) response_envelope = request( request_envelope, timeout=timeout ) return response_envelope