diff --git a/webxml/__init__.py b/webxml/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/webxml/fedex/AddressValidationService_XML.xsd b/webxml/fedex/AddressValidationService_XML.xsd new file mode 100644 index 0000000..b1b55a9 --- /dev/null +++ b/webxml/fedex/AddressValidationService_XML.xsd @@ -0,0 +1,524 @@ + + + + + + + + + The descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + Descriptive data identifying the client submitting the transaction. + + + + + Descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Used in authentication of the sender's identity. + + + + + Credential used to authenticate a specific software application. This value is provided by FedEx after registration. + + + + + + + Two part authentication string used for the sender's identity. + + + + + Identifying part of the authentication key. This value is provided by FedEx after registration. + + 16 + + + + + + Secret part of authentication key used for authentication. This value is provided by FedEx after registration. + + 25 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (EAS 100) Apartment number not found for this address. + + + + + (EAS 101) Address requires apartment number. + + + + + (EAS 102) Address normalized - abbreviations applied. + + + + + (EAS 103) Dropped data. + + + + + (EAS 104) Address requires box number. + + + + + (EAS 200) Match - no changes applied to input address. + + + + + (EAS 201) Address modified to achieve match. + + + + + (EAS 202) Match to street range. + + + + + (EAS 203) Match to box number. + + + + + (EAS 204) Match to Rural Route (RR) / Highway Contract (HC) address. + + + + + (EAS 205) Match to city (non-US, non-Canada). + + + + + (EAS 206) Match to postal code only (non-street) + + + + + (EAS 207) Need box number for Rural Route / Highway Contract (HC) match. + + + + + (EAS 208) Formatting performed for country (non-US, non-Canada). + + + + + (EAS 209) Match to military address (e.g. APO/FPO). + + + + + (EAS 210) Match to general delivery. + + + + + (EAS 211) Address exceeded 35 character plug-in limit. + + + + + (EAS 212) Unable to append non-address; data 35 character limit imposed. + + + + + (EAS 300) Insufficient data for address verification. + + + + + (EAS 301) Address (house or box number) not found. + + + + + (EAS 303) Postal code not found. + + + + + (EAS 305) Invalid country. + + + + + (EAS 400) Service unavailable for request address. + + + + + + + The descriptive data identifying the client submitting the transaction. + + + + + The FedEx account number assigned to the customer initiating the request. + + 12 + + + + + + Identifies the unique client device submitting the request. This number is assigned by FedEx and identifies the unique device from which the request is originating. + + 10 + + + + + + Governs any future language/translations used for human-readable Notification.localizedMessages in responses to the request containing this ClientDetail object. Different requests from the same client may contain different Localization data. (Contrast with TransactionDetail.localization, which governs data payload language/translation.) + + + + + + + Governs any future language/translations used for human-readable text. + + + + + Identifies the language to use for human-readable messages. + + 2 + + + + + + Identifies the locale (i.e. country code) associated with the language. + + 2 + + + + + + + + Descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies a customer-supplied unique identifier for this transaction. It is returned in the reply message to aid in matching requests to replies. + + 40 + + + + + + Governs any future language/translations applied to the data payload(contrasted with ClientDetail.localization, which governs Notification.localizedMessage language selection). + + + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + Identifies a system or sub-system which performs an operation. + + + + + Identifies the service business level. For the initial FedEx Web Service release this value should be set to 1. + + + + + Identifies the service interface level. For the initial FedEx Web Service release this value should be set to 0. + + + + + Identifies the service code level. For the initial FedEx Web Service release this value should be set to 0. + + + + + + + Identifies the set of severity values for a Notification. + + + + + + + + + + + + The descriptive data regarding the results of the submitted transaction. + + + + + The severity of this notification. this can indicate success or failure or some other information about the request such as errors or notes. + + + + + Indicates the source of the notification. Combined with Code, it uniqely identifies this message. + + + + + A code that represents this notification. Combined with Source, it uniqely identifies this message. + + 8 + + + + + + Text that explains this notification. + + 255 + + + + + + A translated message. The translation is based on the Localization element of the ClientDetail element of the request. + + TBD + + + + + + If the message used parameter replacement to be specific as to the meaning of the message, this is the list of parameters that were used. + + TBD + + + + + + + + + + Name identifiying the type of the data in the element 'Value' + + + + + The value that was used as the replacement parameter. + + + + + + + The descriptive data for a physical location. + + + + + Combination of number, street name, etc. At least one line is required for a valid physical address; empty lines should not be included. + + 35 + + + + + + Name of city, town, etc. + + + 35 + 20 + + + + + + + Identifying abbreviation for US state, Canada province, etc. Format and presence of this field will vary, depending on country. + + 14 + + + + + + Identification of a region (usually small) for mail/package delivery. Format and presence of this field will vary, depending on country. This element is required if both the City and StateOrProvinceCode are not present. + + 16 + + + + + + Relevant only to addresses in Puerto Rico. In Puerto Rico, multiple addresses within the same ZIP code can have the same house number and street name. When this is the case, the urbanization code is needed to distinguish them. + + 100 + + + + + + Identification of a country. + + 2 + + + + + + Indicates whether this address is residential (as opposed to commercial). + + + + + diff --git a/webxml/fedex/CloseService_XML.xsd b/webxml/fedex/CloseService_XML.xsd new file mode 100644 index 0000000..1f206f4 --- /dev/null +++ b/webxml/fedex/CloseService_XML.xsd @@ -0,0 +1,727 @@ + + + + + + + + + + + + + + Identification of a FedEx operating company (transportation). + + + + + + + + + + + + + Descriptive data for the client submitting a transaction. + + + + + + + Only used in transactions which require identification of the Fed Ex Office integrator. + + + + + The language to be used for human-readable Notification.localizedMessages in responses to the request containing this ClientDetail object. Different requests from the same client may contain different Localization data. (Contrast with TransactionDetail.localization, which governs data payload language/translation.) + + + + + + + + + + The client's shipping cycle to which this shipment belongs. + + + + + + The name under which a STORED or DEFERRED document is written. + + + + + Specifies the image resolution in DPI (dots per inch). + + + + + Number of copies to print. + + + + + One or more document parts which make up a single logical document, such as multiple pages of a single form. + + + + + + + Specifies characteristics of a shipping document to be produced. + + + + + Specifies how to create, organize, and return the document. + + + + + Specifies how far down the page to move the beginning of the image; allows for printing on letterhead and other pre-printed stock. + + + + + The type of image or printer commands the image is to be formatted in. + + + + + + For those shipping document types which have both a "form" and "instructions" component (e.g. NAFTA Certificate of Origin and General Agency Agreement), this field indicates whether to provide the instructions. + + + + + Governs the language to be used for this individual document, independently from other content returned for the same shipment. + + + + + + + Contains all data required for close-time documents to be produced in conjunction with a specific set of shipments. For January 2010, there are no applicable options for the COD report, the Manifest, or the Multiweight Report (they will only be available in TEXT format). Detail specifications will be added for those report types when customer-selectable options are implemented. + + + + + Indicates the types of close documents requested by the caller. + + + + + Specifies the production of the OP-950 document for hazardous materials. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Internal Id used by INET to identify customer provided images during documents generation. Ex COO etc ... + + + + + Internal image type used by INET to identify customer provided images during documents generation. Ex COO etc .. + + + + + + + + + + + + + Identifies the set of valid email notification recipient types. For SHIPPER, RECIPIENT and BROKER the email address asssociated with their definitions will be used, any email address sent with the email notification for these three email notification recipient types will be ignored. + + + + + + + + + + + + + + This indicates the highest level of severity of all the notifications returned in this reply. + + + + + The descriptive data regarding the results of the submitted transaction. + + + + + Descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + The actual document contents for all provided reports. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + + + + + + + + + + + The descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + + + + Identifies the date and time up to which unclosed shipments are to be closed. Both the date and time portions of the string are expected to be used. The time is the local time based on the shipper's time zone. The date component must be in the format: YYYY-MM-DD (e.g. 2009-04-26). The time component must be in the format: HH:MM:SS using a 24 hour clock (e.g. 11:00 a.m. is 11:00:00, whereas 5:00 p.m. is 17:00:00). The date and time parts are separated by a T (e.g. 2009-04-26T17:00:00). + + + + + + + + + The descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + Descriptive data identifying the client submitting the transaction. + + + + + Descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + Date on which shipments were closed. + + + + + Specifies characteristics of document(s) to be returned for this request. + + + + + + + + + + + + + + + + + + + + + + Represents a one-dimensional measurement in small units (e.g. suitable for measuring a package or document), contrasted with Distance, which represents a large one-dimensional measurement (e.g. distance between cities). + + + + + The numerical quantity of this measurement. + + + + + The units for this measurement. + + + + + + + CM = centimeters, IN = inches + + + + + + + + + + + + + + + + + + + + + + + + + + + + A collection of name/value pairs that provide specific data to help the client determine the nature of an error (or warning, etc.) witout having to parse the message string. + + + + + + + + + + + + + + + + + + + + + + The instructions indicating how to print the OP-950 form for hazardous materials. + + + + + Specifies characteristics of a shipping document to be produced. + + + + + Specifies the usage and identification of a customer supplied image to be used on this document. + + + + + Data field to be used when a name is to be printed in the document instead of (or in addition to) a signature image. + + + + + + + Identifies the requested options to reprinting Ground Close Documents + + + + + + + + + + + The descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + Descriptive data identifying the client submitting the transaction. + + + + + Descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + + Date on which shipments were closed. + + + + + + Specifies characteristics of document(s) to be returned for this request. + + + + + + + Each occurrence of this class specifies a particular way in which a kind of shipping document is to be produced and provided. + + + + + Values in this field specify how to create and return the document. + + + + + Specifies how to organize all documents of this type. + + + + + Specifies how to store document images. + + + + + Specifies how to e-mail document images. + + + + + Specifies how a queued document is to be printed. + + + + + + + Specifies how to return a shipping document to the caller. + + + + + + + + + + + + + Specifies how to e-mail shipping documents. + + + + + Provides the roles and email addresses for e-mail recipients. + + + + + Identifies the convention by which documents are to be grouped as e-mail attachments. + + + + + + + Identifies the convention by which documents are to be grouped as e-mail attachments. + + + + + + + + + Specifies an individual recipient of e-mailed shipping document(s). + + + + + Identifies the relationship of this recipient in the shipment. + + + + + Address to which the document is to be sent. + + + + + + + Specifies how to organize all shipping documents of the same type. + + + + + + + + + Specifies the image format used for a shipping document. + + + + + + + + + + + + + + + + + Identifies the convention by which file names are constructed for STORED or DEFERRED documents. + + + + + + + + + A single part of a shipping document, such as one page of a multiple-page document whose format requires a separate image per page. + + + + + The one-origin position of this part within a document. + + + + + Graphic or printer commands for this image within a document. + + + + + + + Specifies printing options for a shipping document. + + + + + Provides environment-specific printer identification. + + + + + + + Specifies the type of paper (stock) on which a document will be printed. + + + + + + + + + + + + + + + + + + Specifies how to store shipping documents. + + + + + Provides the path to be used for STORED or DEFERRED documents. + + + + + Identifies the convention by which file names are constructed for STORED or DEFERRED documents. + + + + + Suffix to be placed at the end of the file name; required on some platforms to determine file type. + + + + + + + + + + + + + + + + + The descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + + + + + + + + + + + + + Governs data payload language/translations (contrasted with ClientDetail.localization, which governs Notification.localizedMessage language selection). + + + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + + Service business level. + + + + + Service interface level. + + + + + Service code level. + + + + + + + The descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + Credential used to authenticate a specific software application. This value is provided by FedEx after registration. + + + + + + + Two part authentication string used for the sender's identity. + + + + + Publicly known part of authentication key used for authentication. This value is provided by FedEx after registration. + + 16 + + + + + + Secret part of authentication key used for authentication. This value is provided by FedEx after registration. + + 25 + + + + + + diff --git a/webxml/fedex/LocatorService_XML.xsd b/webxml/fedex/LocatorService_XML.xsd new file mode 100644 index 0000000..eb39f63 --- /dev/null +++ b/webxml/fedex/LocatorService_XML.xsd @@ -0,0 +1,638 @@ + + + + + The descriptive data sent to search for the nearest FedEx location. + + + + + The descriptive data returned for a drop off locator request. It is limited to a maximum of ten locations returned within a 50-mile radius. + + + + + + + The descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + The descriptive data identifying the client submitting the transaction. + + + + + The descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + The index of first location to be returned from among all matching locations. Defauls to 1. + + + + + The maximum number of locations to be returned. Maximum count allowed is 25. Defaults to 10. + + + + + + + + Units in which Distance to location is to be expressed. See DistanceUnits for list of returned values. + + + + + Phone number for which nearby FedEx locations are to be found. This element is required if NearToAddress is not present. + + 10 + + + + + + The descriptive data of a physical location for which nearby FedEx locations are to be found. This element is required if NearToPhoneNumber is not present. Both City and StateOrProvinceCode child elements are required if PostalCode is not present. + + + + + The descriptive data about the various drop off services that must be available at the locations returned. + + + + + + + Used in authentication of the sender's identity. + + + + + Credential used to authenticate a specific software application. This value is provided by FedEx after registration. + + + + + + + Two part authentication string used for the sender's identity. + + + + + Publicly known part of authentication key used for authentication. This value is provided by FedEx after registration. + + 16 + + + + + + Secret part of authentication key used for authentication. This value is provided by FedEx after registration. + + 25 + + + + + + + + The descriptive data identifying the client submitting the transaction. + + + + + Identifies the FedEx account number assigned to the customer. + + 12 + + + + + + Identifies the unique client device submitting the request. + + 10 + + + + + + Governs any future language/translations used for human-readable Notification.localizedMessages in responses to the request containing this ClientDetail object. Different requests from the same client may contain different Localization data. (Contrast with TransactionDetail.localization, which governs data payload language/translation.) + + + + + + + The descriptive data about the various drop off services. + + + + + Locations that accept FedEx Express shipments. + + + + + Locations that accept FedEx Ground shipments. + + + + + Locations that are FedEx staffed. + + + + + Locations that are FedEx self-service. + + + + + Locations that are FedEx Authorized Shipping Centers. + + + + + Locations with the latest Express drop-off time. + + + + + Locations that are open after this local time. + + + + + Locations that support Express Hold at Location. + + + + + Locations that support Ground Hold at Location. + + + + + Locations that accept FedEx Express shipments containing hazardous materials. + + + + + Locations open on Saturdays. + + + + + Locations that make packaging supplies available. + + + + + Locations that provide Pack and Ship services. + + + + + Locations that support FedEx Return System. + + + + + Locations that support Redirect to Hold of shipments. + + + + + Locations in the same state that support Redirect to Hold of shipments. + + + + + + + + + Identifies the highest severity encountered when executing the request; in order from high to low: FAILURE, ERROR, WARNING, NOTE, SUCCESS. + + + + + The descriptive data detailing the status of a sumbitted transaction. + + + + + Descriptive data that governs data payload language/translations. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + Descriptive data for each of the drop-off locations matches found. + + + + + The total number of locations that matched the request criteria. + + + + + + + The descriptive data regarding the results of the submitted transaction. + + + + + Identifies the severity of the Notification item. See NotificationSeverityType for list of returned values. + + + + + Identifies the source - what FedEx system, sub-system, or component generated the Notification item. + + + + + Identifies the error code generated by the FedEx system, sub-system or component. + + 8 + + + + + + Identifies the error message text. + + 255 + + + + + + Identifies the error message text in the localization requested. Currently not supported. + + + + + Used internally by FedEx systems for message translation. + + + + + + + + + Name identifiying the type of the data in the element 'Value' + + + + + The value that was used as the replacement parameter. + + + + + + + The descriptive data that governs data payload language/translations. + + + + + Identifies a customer-supplied unique identifier for this transaction. It is returned in the reply message to aid in matching requests to replies. + + 40 + + + + + + Governs any future language/translations applied to the data payload (contrasted with ClientDetail.localization, which governs Notification.localizedMessage language selection). + + + + + + + The descriptive data for the local language and locale (i.e. country). + + + + + Identifies the language to use for human-readable messages. + + 2 + + + + + + Identifies the locale (i.e. country code). + + 2 + + + + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + Fixed value. + + + + + Fixed value. + + + + + Fixed value. + + + + + Fixed value. + + + + + + + The descriptive data of locations matching the criteria provided in the drop of locator request. A maximum of ten different locations can be returned. + + + + + Name of the business at this location. + + 35 + + + + + + Identifier that can be used by IVR Attendant to look up directions to this location. + + + + + A textual description of the type of business, such as "FedEx Authorized Ship Center". + + 35 + + + + + + The descriptive data of the physical location. + + + + + The descriptive data of the distance. + + + + + The descriptive data of the services offered at this location. + + + + + Of the Total locations available this is the individual location identifier. + + + + + + + + + + The descriptive data for a physical location. + + + + + Combination of number, street name, etc. Empty lines should not be included. + + 35 + + + + + + Name of city, town, etc. + + 35 + + + + + + Identifying abbreviation for US state, Canada province, etc. Format and presence of this field will vary, depending on country. + + 2 + + + + + + Identification of a region (usually small) for mail/package delivery. Format and presence of this field will vary, depending on country. + + 16 + + + + + + Relevant only to addresses in Puerto Rico. In Puerto Rico, multiple addresses within the same ZIP code can have the same house number and street name. When this is the case, the urbanization code is needed to distinguish them. + + 100 + + + + + + Identification of a country. Defaults to "US". Valid values: US - United States, CA - Canada. + + 2 + + + + + + Indicates whether this address is residential (as opposed to commercial). + + + + + + + The descriptive data for distance. + + + + + Identifies the value of distance from the point indicated by the search location (e.g. "12.5"). + + + + + Identifies the unit of distance from the point indicated by the search location (e.g. "MI"). See DistanceUnits for list of returned values. + + + + + + + The descriptive data about the various drop off services. + + + + + Identifies if this location offers FedEx Express services. + + + + + Identifies if this location offers FedEx Ground service. + + + + + This location's weekday (Monday-Friday) hours of operation. + + 35 + + + + + + This location's Saturday hours of operation. + + 35 + + + + + + The time of day on weekdays by which FedEx Express packages must be dropped off for shipment that day. + + 35 + + + + + + The time of day on Saturdays by which FedEx Express packages must be dropped off for shipment that day. + + 35 + + + + + + The time of day on weekdays by which FedEx Ground packages must be dropped off for shipment that day. + + 35 + + + + + + The time of day on Saturdays by which FedEx Ground packages must be dropped off for shipment that day. + + 35 + + + + + + Identifies if this location offers Express HAL (Hold at Location) service. + + + + + Identifies if this location offers Ground HAL (Hold at Location) service. + + + + + Identifies if this location accepts Hazardous materials. + + + + + Identifies if this location makes packaging supplies available. + + + + + Identifies if this location provides Pack and Ship services. + + + + + Identifies if this location supports FedEx Return System. + + + + + + + Identifies the set of severity values for a Notification. + + + + + + + + + + + + The type of Redirect to Hold FedEx location. + + + + + + + + + + Identifies the set of distance units for a Distance. + + + + + + + diff --git a/webxml/fedex/PackageMovementInfo_XML.xsd b/webxml/fedex/PackageMovementInfo_XML.xsd new file mode 100644 index 0000000..b13d117 --- /dev/null +++ b/webxml/fedex/PackageMovementInfo_XML.xsd @@ -0,0 +1,494 @@ + + + + + + + + + Descriptive data for a physical location. May be used as an actual physical address (place to which one could go), or as a container of "address parts" which should be handled as a unit (such as a city-state-ZIP combination within the US). + + + + + Identification of a region (usually small) for mail/package delivery. Format and presence of this field will vary, depending on country. + + + + + The two-letter code used to identify a country. + + + + + + + Identification of a FedEx operating company (transportation). + + + + + + + + + Descriptive data for the client submitting a transaction. + + + + + The FedEx account number associated with this transaction. + + + + + This number is assigned by FedEx and identifies the unique device from which the request is originating + + + + + The language to be used for human-readable Notification.localizedMessages in responses to the request containing this ClientDetail object. Different requests from the same client may contain different Localization data. (Contrast with TransactionDetail.localization, which governs data payload language/translation.) + + + + + + + Identifies the set of valid day of week abbreviated values. + + + + + + + + + + + + + + Identifies the representation of human-readable text. + + + + + Two-letter code for language (e.g. EN, FR, etc.) + + + + + Two-letter code for the region (e.g. us, ca, etc..). + + + + + + + The descriptive data regarding the result of the submitted transaction. + + + + + The severity of this notification. This can indicate success or failure or some other information about the request. The values that can be returned are SUCCESS - Your transaction succeeded with no other applicable information. NOTE - Additional information that may be of interest to you about your transaction. WARNING - Additional information that you need to know about your transaction that you may need to take action on. ERROR - Information about an error that occurred while processing your transaction. FAILURE - FedEx was unable to process your transaction at this time due to a system failure. Please try again later + + + + + Indicates the source of this notification. Combined with the Code it uniquely identifies this notification + + + + + A code that represents this notification. Combined with the Source it uniquely identifies this notification. + + + + + Human-readable text that explains this notification. + + + + + The translated message. The language and locale specified in the ClientDetail. Localization are used to determine the representation. Currently only supported in a TrackReply. + + + + + A collection of name/value pairs that provide specific data to help the client determine the nature of an error (or warning, etc.) witout having to parse the message string. + + + + + + + + + Identifies the type of data contained in Value (e.g. SERVICE_TYPE, PACKAGE_SEQUENCE, etc..). + + + + + The value of the parameter (e.g. PRIORITY_OVERNIGHT, 2, etc..). + + + + + + + Identifies the set of severity values for a Notification. + + + + + + + + + + + + Identifies the collection of available FedEx packaging options. + + + + + + + + + + + + + + FedEx Postal Code Inquiry reply. + + + + + Identifies the highest severity encountered when executing the request; in order from high to low: FAILURE, ERROR, WARNING, NOTE, SUCCESS. + + + + + The descriptive data detailing the status of a sumbitted transaction. + + + + + Descriptive data that governs data payload language/translations. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + Flag identifying whether Express Freight Contractor Delivery Area. + + + + + Postal code service area description for Express. + + + + + Only service area field is currently provided for Express Freight. + + + + + + + FedEx Postal Code Inquiry request. + + + + + Descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + The descriptive data identifying the client submitting the transaction. + + + + + The descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + Only used with postal-aware countries. + + + + + Identifies the country code. + + + + + + + Postal Code Service Area description. + + + + + Location ID + + + + + State or Province code + + + + + Postal Code + + + + + Service area code + + + + + + + The descriptive data which identifies an available FedEx Service. + + + + + Identifies a FedEx Service that is available between the origin and destination provided in the request. + + + + + Identifies the delivery date of the available service. + + + + + Identifies the delivery day of week of the available service. See DayOfWeekType for valid values. + + + + + Identifies the FedEx location identifier of the package destination. + + 4 + + + + + + Identification of an airport, using standard three-letter abbreviations. + + + + + + + The descriptive data returned for a FedEx service availability request. + + + + + Identifies the highest severity encountered when executing the request; in order from high to low: FAILURE, ERROR, WARNING, NOTE, SUCCESS. + + + + + The descriptive data detailing the status of a sumbitted transaction. + + + + + Descriptive data that governs data payload language/translations. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + The descriptive data for the collection of available FedEx Services returned for the request. + + + + + + + The descriptive data which is used to determine which FedEx Express services are available between an origin and destination. To check the availability of one particular FedEx Express service and packaging type, include the Service and Packaging elements in the request message. Only information regarding that single service and packaging type will be returned from the request. To obtain a list of all available services for a given origin and destination, omit the Service and Packaging elements from the request. In this case the reply will contain every available service. + + + + + Descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + The descriptive data identifying the client submitting the transaction. + + + + + The descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + The descriptive data for the physical location from which the shipment originates. + + + + + The descriptive data for the physical location to which the shipment is destined. + + + + + The date on which the package will be shipped. The date should not be a past date or a date more than 10 days in the future. The date format must be YYYY-MM-DD. + + + + + Optionally supplied instead of service to restrict reply to services for a specific carrier. + + + + + Restricts reply to single service, if supplied. + + + + + Identifies the FedEx packaging type used by the requestor for the package. See PackagingType for valid values. Omit this element and the Service element to get a list of every available service. + + + + + + + Identifies the collection of available FedEx transportation service options. + + + + + + + + + + + + + + + + + + + + + + + + + + + + The descriptive data that governs data payload language/translations. + + + + + Free form text to be echoed back in the reply. Used to match requests and replies. + + + + + Governs data payload language/translations (contrasted with ClientDetail.localization, which governs Notification.localizedMessage language selection). + + + + + + + Used in authentication of the sender's identity. + + + + + Credential used to authenticate a specific software application. This value is provided by FedEx after registration. + + + + + + + Two part authentication string used for the sender's identity + + + + + Identifying part of authentication credential. This value is provided by FedEx after registration + + + + + Secret part of authentication key. This value is provided by FedEx after registration. + + + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + Identifies a system or sub-system which performs an operation. + + + + + Identifies the service business level. + + + + + Identifies the service interface level. + + + + + Identifies the service code level. + + + + + diff --git a/webxml/fedex/PickupService_XML.xsd b/webxml/fedex/PickupService_XML.xsd new file mode 100644 index 0000000..a804ca7 --- /dev/null +++ b/webxml/fedex/PickupService_XML.xsd @@ -0,0 +1,2682 @@ + + + + + + + + + + + Descriptive data for a physical location. May be used as an actual physical address (place to which one could go), or as a container of "address parts" which should be handled as a unit (such as a city-state-ZIP combination within the US). + + + + + Combination of number, street name, etc. At least one line is required for a valid physical address; empty lines should not be included. + + + + + Name of city, town, etc. + + + + + Identifying abbreviation for US state, Canada province, etc. Format and presence of this field will vary, depending on country. + + + + + Identification of a region (usually small) for mail/package delivery. Format and presence of this field will vary, depending on country. + + + + + Relevant only to addresses in Puerto Rico. + + + + + The two-letter code used to identify a country. + + + + + Indicates whether this address residential (as opposed to commercial). + + + + + + + + + + + + + This enumeration represents a kind of "legacy" account number from a FedEx operating entity. + + + + + + + + + + + + Identifies the valid set of building part types when requesting a package pickup. + + + + + + + + + + + + + The descriptive data returned to a client in response to a cancel dispatch request. + + + + + Identifies the highest severity encountered when executing the request; in order from high to low: FAILURE, ERROR, WARNING, NOTE, SUCCESS. + + + + + The descriptive data detailing the status of a sumbitted transaction. + + + + + Descriptive data that governs data payload language/translations. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + Human readable message from dispatch system. + + + + + + + The descriptive data to cancel a shipment pickup request. + + + + + Descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + The descriptive data identifying the client submitting the transaction. + + + + + The descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + Identifies the FedEx operating company (transportation) that was sent the pickup that is being canceled. + + + + + Identifies the pickup confirmation number that is being canceled. The pickup confirmation number was returned to the client when the pickup was requested. + + 30 + + + + + + Identifies the scheduled date for the pickup that is being canceled. The scheduled date was provided by the client when the pickup was requested. + + + + + + Identifies the FedEx location identifier responsible for processing the package pickup that is being canceled. The FedEx location identifier was returned to the client when the pickup was requested. Required for Express service type. + + 5 + + + + + + Identifies comments the customer wants to convey to the FedEx courier regarding the package pickup. + + 60 + + + + + + + The reason for canceling the pickup request. + + + + + Identifies the name of the person that requested pickup cancellation. + + + + + Identifies the phone number of the person that requested pickup cancellation. + + + + + Identifies the phone extension of the person that requested pickup cancellation. + + + + + + + Identification of a FedEx operating company (transportation). + + + + + + + + + + + + + + + + + + + Descriptive data for the client submitting a transaction. + + + + + The FedEx account number associated with this transaction. + + + + + This number is assigned by FedEx and identifies the unique device from which the request is originating + + + + + + Only used in transactions which require identification of the Fed Ex Office integrator. + + + + + Indicates the region from which the transaction is submitted. + + + + + The language to be used for human-readable Notification.localizedMessages in responses to the request containing this ClientDetail object. Different requests from the same client may contain different Localization data. (Contrast with TransactionDetail.localization, which governs data payload language/translation.) + + + + + + + + + + + + + + + + + + + + + + + + + + + + Identifies the type of funds FedEx should collect upon shipment delivery. + + + + + + + + + + + + Descriptive data required for a FedEx COD (Collect-On-Delivery) shipment. + + + + + + Specifies the details of the charges are to be added to the COD collect amount. + + + + + Identifies the type of funds FedEx should collect upon package delivery + + + + + For Express this is the descriptive data that is used for the recipient of the FedEx Letter containing the COD payment. For Ground this is the descriptive data for the party to receive the payment that prints the COD receipt. + + + + + Indicates which type of reference information to include on the COD return shipping label. + + + + + + + Indicates which type of reference information to include on the COD return shipping label. + + + + + + + + + + + Data resulting from the processing of an LTL Freight pickup request. + + + + + Describes the origin service center handling the pickup. + + + + + Describes the results for each line item in the original request. + + + + + Total number of pieces from all line items from request. + + + + + Total weight from all line items from request. + + + + + Total handling units from all line items from request. + + + + + Resulting status of pickup. + + + + + + + Data resulting from the processing of an individual line item in a LTL Freight pickup request. + + + + + Identifies the line item, to match reply line with request line. + + + + + Describes the destination service center handling the delivery of this line item. + + + + + Total travel time for this line item. + + + + + Identifies estimated delivery date and time for each line item. + + + + + + + The descriptive data for a point-of-contact person. + + + + + Client provided identifier corresponding to this contact information. + + + + + Identifies the contact person's name. + + + + + Identifies the contact person's title. + + + + + Identifies the company this contact is associated with. + + + + + Identifies the phone number associated with this contact. + + + + + Identifies the phone extension associated with this contact. + + + + + Identifies the pager number associated with this contact. + + + + + Identifies the fax number associated with this contact. + + + + + Identifies the email address associated with this contact. + + + + + + + The descriptive data for a person or company entitiy doing business with FedEx. + + + + + Descriptive data identifying the point-of-contact person. + + + + + The descriptive data for a physical location. + + + + + + + Describes relationship between origin and destination countries. + + + + + + + + + The descriptive data returned to a client in response to a shipment pickup request. + + + + + Identifies the highest severity encountered when executing the request; in order from high to low: FAILURE, ERROR, WARNING, NOTE, SUCCESS. + + + + + The descriptive data detailing the status of a sumbitted transaction. + + + + + Descriptive data that governs data payload language/translations. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + Identifies the confirmation number assigned by FedEx for the request. + + 30 + + + + + + Identifies the FedEx Location identifier responsible for processing the pickup of the package. + + 5 + + + + + + Coded value supplied by dispatch system. + + + + + Message supplied by dispatch system. + + + + + Package Return Program control number + + + + + Used with "stay late" requests; postal-code specific. + + + + + Data resulting from the processing of an LTL Freight pickup request. + + + + + + + The descriptive data to schedule a FedEx package pickup request. + + + + + Descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + The descriptive data identifying the client submitting the transaction. + + + + + The descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + + Descriptive data about the origin of the shipment being picked up by FedEx. + + + + + Descriptive data for a freight shipment being picked up by FedEx. This is element is only required when requesting a freight service pickup and should not be used for other types of pickups including express freight pickups. + + + + + Descriptive data for an express freight shipment being picked up by FedEx. This is element is only required when requesting a express freight service pickup and should not be used for other types of pickups. + + + + + Identifies the number of packages that are being tendered to FedEx for this pickup request. + + + + + Identifies the total weight of the package or packages being tendered to FedEx for this pickup request. + + + + + Identifies the FedEx operating company (transportation) that is being sent the package pickup request. + + + + + Identifies the number of oversize packages that are being tendered to FedEx for this pickup request. Please refer to the FedEx Service Guide for package size limits to determine if a package is oversized for the service being shipped. + + + + + Identifies any remarks or comments to be passed to the FedEx courier picking up the shipment. + + 60 + + + + + + Identifies the type of commodity being shipped. This element is required for an international shipment. + + 20 + + + + + + Describes the country relationship (domestic and/or international) among the shipments being picked up. + + + + + + + + + + + Must be in one of the following formats: YYMM, YYYYMM, or YYYYMMDD. + + + + + + + + + + + + + + + + This class represents data tied to the use of a credit card in a specific transaction. + + + + + + + + + + + + + + + + + + + This class is a rename of the previous VerifyCreditFraudDetail; the name change reflects the fact that it is no longer tied to a "verify" usage. + + + + + + + + + + + + Indicates the type of custom delivery being requested. + + + + + Time by which delivery is requested. + + + + + Range of dates for custom delivery request; only used if type is BETWEEN. + + + + + Date for custom delivery request; only used for types of ON, BETWEEN, or AFTER. + + + + + + + + + + + + + + + + + The beginning date in a date range. + + + + + The end date in a date range. + + + + + + + + + + + + + + + + + + Specifications for pup/set or vehicle delayed for loading or unloading. + + + + + Amount of time involved in the detention. + + + + + + + Descriptive data detailing the length, width, and height of a package. + + + + + Identifies the length of the package. + + + + + Identifies the width of the package. + + + + + Identifies the height of the package. + + + + + Identifies the unit of measure associated with a dimensional values. See LinearUnits for valid values. + + + + + + + Driving or other transportation distances, distinct from dimension measurements. + + + + + Identifies the distance quantity. + + + + + Identifies the unit of measure for the distance value. + + + + + + + Identifies the unit of measure for the distance value. + + + + + + + + + Describes specific information about the email label shipment. + + + + + Notification email will be sent to this email address + + + + + Message to be sent in the notification email + + + + + + + + + + + + + Information describing email notifications that will be sent in relation to events that occur during package movement + + + + + Specifies whether/how email notifications are grouped. + + + + + A message that will be included in the email notifications + + + + + Information describing the destination of the email, format of the email and events to be notified on + + + + + + + + + + + + + + + The format of the email + + + + + + + + + + The descriptive data for a FedEx email notification recipient. + + + + + Identifies the relationship this email recipient has to the shipment. + + + + + The email address to send the notification to + + + + + The types of email notifications being requested for this recipient. + + + + + The format of the email notification. + + + + + The language/locale to be used in this email notification. + + + + + + + Identifies the set of valid email notification recipient types. For SHIPPER, RECIPIENT and BROKER the email address asssociated with their definitions will be used, any email address sent with the email notification for these three email notification recipient types will be ignored. + + + + + + + + + + + + Specifies whether to confirm documents prior to processing a shipment with the ELECTRONIC_TRADE_DOCUMENTS special service. + + + + + + + + + Electronic Trade document references used with the ETD special service. + + + + + Specifies client's intent for whether all documents must be confirmed before shipment processing. + + + + + Indicates the types of shipping documents produced for the shipper by FedEx (see ShippingDocumentSpecification) which should be copied back to the shipper in the shipment result data. + + + + + + + + + Descriptive data regarding an express freight service pickup request. + + + + + Identifies the collection of available FedEx transportation service options. Must be a valid FedEx freight service identifier. + + + + + Identifies the FedEx freight booking number. This element should contain numeric values only. + + 8 + + + + + + Descriptive data detailing the length, width, and height of the freight package or shipment being picked up by FedEx. + + + + + Identifies the type of truck that is needed for FedEx to pick up the freight shipment. See TruckType for valid values. + + + + + Identifies the tailer size needed for FedEx to pick up a freight shipment. See TrailerSizeType for valid values. + + + + + + + Indicates a FedEx Express operating region. + + + + + + + + + + + + Specification for labor time spent handling shipment. + + + + + Total labor time. + + + + + + + Identifies a kind of FedEx facility. + + + + + + + + + + Specifies the optional features/characteristics requested for a Freight shipment utilizing a flatbed trailer. + + + + + Specifies the optional features/characteristics requested for a Freight shipment utilizing a flatbed trailer. + + + + + + + Optional features/characteristics requested for a Freight shipment utilizing a flatbed trailer. + + + + + + + + + Identifies the type of payment to be tendered for the pickup. + + + + + + + + + Descriptive data regarding a FedEx freight service pickup request. + + + + + Description of Guarantee + + + + + Date for all Freight guarantee types. + + + + + + + Identifies the type of Delivery Guarantee made. + + + + + + + + + Descriptive data regarding a FedEx freight service pickup request. + + + + + Contact Information of origin service center representative that authorized the pickup + + + + + Identifies the type of payment to be tendered for the pickup. + + + + + Indicates the role of the party submitting the transaction. + + + + + Contact Information of the person submitting the pickup. + + + + + Identifies the details about the contents of the shipments to be picked up. + + + + + + + Identifies details about the contents of the shipment to be picked up. + + + + + + Identifies the line item, to match reply line with request line. + + + + + Identifies the destination of the shipment. + + + + + Identifies the physical packaging of the shipment. + + + + + Identifies number of items contained in the packaging. + + + + + Identifies the total weight of the item being tendered to FedEx for this pickup request. + + + + + Identifies number of items to be moved. + + + + + + + These special services are available at the shipment level for some or all service types. If the shipper is requesting a special service which requires additional data (such as the COD amount), the shipment special service type must be present in the specialServiceTypes collection, and the supporting detail must be provided in the appropriate sub-object below. + + + + + Identifies the delivery guarantee information. + + + + + Describes the contents of the package. + + + + + + + This class describes the relationship between a customer-specified address and the FedEx Freight / FedEx National Freight Service Center that supports that address. + + + + + Freight Industry standard non-FedEx carrier identification + + + + + The name of the Interline carrier. + + + + + Additional time it might take at the origin or destination to pickup or deliver the freight. This is usually due to the remoteness of the location. This time is included in the total transit time. + + + + + Service branding which may be used for local pickup or delivery, distinct from service used for line-haul of customer's shipment. + + + + + Distance between customer address (pickup or delivery) and the supporting Freight / National Freight service center. + + + + + Time to travel between customer address (pickup or delivery) and the supporting Freight / National Freight service center. + + + + + Specifies when/how the customer can arrange for pickup or delivery. + + + + + Specifies days of operation if localServiceScheduling is LIMITED. + + + + + Freight service center that is a gateway on the border of Canada or Mexico. + + + + + Alphabetical code identifying a Freight Service Center + + + + + Freight service center Contact and Address + + + + + + + Specifies the type of service scheduling offered from a Freight or National Freight Service Center to a customer-supplied address. + + + + + + + + + + Indicates the role of the party submitting the transaction. + + + + + + + + + + Descriptive data required for a FedEx shipment that is to be held at the destination FedEx location for pickup by the recipient. + + + + + Contact phone number for recipient of shipment. + + + + + Contact and address of FedEx facility at which shipment is to be held. + + + + + Type of facility at which package/shipment is to be held. + + + + + Location identification (for facilities identified by an alphanumeric location code). + + + + + Location identification (for facilities identified by an numeric location code). + + + + + + + The descriptive data required by FedEx for home delivery services. + + + + + The type of Home Delivery Premium service being requested. + + + + + Required for Date Certain Home Delivery. + + + + + Required for Date Certain and Appointment Home Delivery. + + 15 + + + + + + + + The type of Home Delivery Premium service being requested. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Identifies the collection of linear units of measure for a package dimension. + + + + + + + + + Identifies the representation of human-readable text. + + + + + Two-letter code for language (e.g. EN, FR, etc.) + + + + + Two-letter code for the region (e.g. us, ca, etc..). + + + + + + + Specification for marking or tagging of pieces in shipment. + + + + + Number of pieces to be marked or tagged by FedEx. + + + + + + + The descriptive data for the medium of exchange for FedEx services. + + + + + Identifies the currency of the monetary amount. + + 3 + + + + + + Identifies the monetary amount. + + + + + + + Specification for services performed during non-business hours and/or days. + + + + + Total number of person days for full non-business days. + + + + + Total number of person hours (whole or partial hours) for non-business hours. + + + + + + + The descriptive data regarding the result of the submitted transaction. + + + + + The severity of this notification. This can indicate success or failure or some other information about the request. The values that can be returned are SUCCESS - Your transaction succeeded with no other applicable information. NOTE - Additional information that may be of interest to you about your transaction. WARNING - Additional information that you need to know about your transaction that you may need to take action on. ERROR - Information about an error that occurred while processing your transaction. FAILURE - FedEx was unable to process your transaction at this time due to a system failure. Please try again later + + + + + Indicates the source of this notification. Combined with the Code it uniquely identifies this notification + + + + + A code that represents this notification. Combined with the Source it uniquely identifies this notification. + + + + + Human-readable text that explains this notification. + + + + + The translated message. The language and locale specified in the ClientDetail. Localization are used to determine the representation. Currently only supported in a TrackReply. + + + + + A collection of name/value pairs that provide specific data to help the client determine the nature of an error (or warning, etc.) witout having to parse the message string. + + + + + + + + + Identifies the type of data contained in Value (e.g. SERVICE_TYPE, PACKAGE_SEQUENCE, etc..). + + + + + The value of the parameter (e.g. PRIORITY_OVERNIGHT, 2, etc..). + + + + + + + Identifies the set of severity values for a Notification. + + + + + + + + + + + + + + + + + + + + + + + Specifications for pallets to be shrinkwrapped as part of a Freight shipment. + + + + + Number of pallets to be shrinkwrapped. + + + + + + + Specifications for pallets to be provided on Freight shipment. + + + + + Number of pallets to be provided. + + + + + + + This type contains equivalent data to Contact, but uses a form of person name with separate first and last names. + + + + + The name of the person. + + + + + The title of the person. + + + + + The name of the company, this person is working for. + + + + + Phone number of the person. + + + + + Pager number of the person. + + + + + Fax number of the person. + + + + + Email address information. + + + + + + + This type contains equivalent data to ContactAndAddress, but uses a form of person name with separate first, middle and last names. + + + + + + + + + Middle name added to support credit card fraud detection. + + + + + The First name of the person. + + + + + The middle name of the person. + + + + + The last name of the person. + + + + + + + The descriptive data for a person or company entitiy doing business with FedEx. + + + + + Identifies the FedEx account number assigned to the customer. + + 12 + + + + + + + Descriptive data identifying the point-of-contact person. + + + + + The descriptive data for a physical location. + + + + + + + The descriptive data for the monetary compensation given to FedEx for services rendered to the customer. + + + + + Identifies the method of payment for a service. See PaymentType for list of valid enumerated values. + + + + + Descriptive data identifying the party responsible for payment for a service. + + + + + + + Descriptive data for the payor's cash payment. + + + + + + + Identifies the method of payment for a service. + + + + + + + + + + + + + + The descriptive data identifying the party responsible for payment for a service. + + + + + Identifies the FedEx account number assigned to the payor. + + 12 + + + + + + Identifies the country of the payor. + 2` + + + + + + + + This information describes the kind of pending shipment being requested. + + + + + Identifies the type of FedEx pending shipment + + + + + Date after which the pending shipment will no longer be available for completion. + + + + + Only used with type of EMAIL. + + + + + + + Identifies the type of service for a pending shipment. + + + + + + + + This enumeration rationalizes the former FedEx Express international "admissibility package" types (based on ANSI X.12) and the FedEx Freight packaging types. The values represented are those common to both carriers. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The descriptive data returned to a client in response to a cancel dispatch request. + + + + + Identifies the highest severity encountered when executing the request; in order from high to low: FAILURE, ERROR, WARNING, NOTE, SUCCESS. + + + + + The descriptive data detailing the status of a sumbitted transaction. + + + + + Descriptive data that governs data payload language/translations. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + the point in time when the request was processed + + + + + Identifies the options for picking up the shipment. + + + + + Identifies whether the close time is specified by the customer or is the default time. + + + + + Close time corresponding to the above specified type + + + + + Local time of the service center that will service the pickup + + + + + + + The descriptive data to request availability of pickup. + + + + + Descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + The descriptive data identifying the client submitting the transaction. + + + + + The descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + Identifies the account number for Freight Pickup Availability + + + + + Descriptive data providing information about address to pickup from. + + + + + An array of PickupRequestType. If SAME_DAY is included, Options with ScheduleDay of SAME_DAY will be included in the reply. If FUTURE_DAY is included, Options with ScheduleDay of FUTURE_DAY will be included in the reply. + + + + + The dispatch date (in the local time zone) for the pickup whose availability is being requested. + + + + + Number of business days to consider when checking availability. + + + + + The time when the package will be ready to be picked up. The time is local to the pickup postal code, in 24-hour form (e.g. 13:00:00). It should not contain a TZD. If a TZD is included, it will be ignored + + + + + The lastest time at which the courier will be able to gain access to pick up the package(s). The time is local to the pickup postal code, in 24-hour form (e.g. 17:00:00). It should not contain a TZD. If a TZD is included, it will be ignored + + + + + The FedEx carrier(s) for which availability is requested. + + + + + Descriptive information about the shipment. + + + + + + + Identifies the valid set of valid building locations for package pickup. + + + + + + + + + + + Status of the pickup + + + + + + + + + + + + Descriptive data about the origin of the shipment being picked up by FedEx. + + + + + Flag identifies if customer wants to use Account address or send and alternate address for pickup. + + + + + FedEx USE ONLY (with IVR client) + + + + + Descriptive data about the physical location of the package being picked up by FedEx. + + + + + Identifies the physical location where the courier should pick up the shipment. See CourierDispatchBuildingLocationType for valid values. + + + + + + Identifies additional descriptive information associated with the BuildingPartCode to assist the FedEx courier in finding the pickup location. + + + + + Identifies the date and time the package will be ready for pickup by FedEx. Both the date and time portions of the string are expected to be used. The date should not be a past date or a date more than 10 days in the future. The time is the local time of the pickup based on the shipper's time zone. The date component must be in the format: YYYY-MM-DD (e.g. 2006-06-26). The time component must be in the format: HH:MM:SS in 24-hour form. The date and time parts are separated by the letter T (e.g. 2006-06-26T17:00:00). Because this is a local time, no TZD should be included. If a TZD is included, it will be ignored, and the time treated as local to the pickup postal code. + + + + + Identifies the close time of the company requesting the pickup. The time is the local time of the pickup based on the shipper's time zone. The time component must be in the format: HH:MM:SS in 24-hour form (e.g. 17:00:00). Because this is a local time, no TZD should be included. If a TZD is included, it will be ignored, and the time treated as local to the pickup postal code. + + + + + FedEx IVR Only. Customer is willing to stay late for pickup. + + + + + FedEx USE ONLY (with IVR client) + + + + + FedEx IVR Only + + + + + Alternate postal code tied to pickup location (European pickups) + + + + + FedEx USE ONLY + + + + + FedEx USE ONLY (with IVR client) + + + + + + Applies only to Europe + + + + + + + Describes the relationship between the date on which a dispatch occurs and the date on which it is created (scheduled) by means of a CourierDispatchRequest. FUTURE_DAY means that the dispatch date is later than the date on which it is created. SAME_DAY means that the dispatch is to occur on the date on which it is created. + + + + + + + + + The constraints on the scheduling of a dispatch, where that dispatch would be made by the Carrier, occur on the PickupDate, and would be scheduled (created by means of a CourierDispatchRequest) on a date related to the PickupDate as described by the "ScheduleDay" (SAME_DAY meaning that the creation would occur on the PickupDate, and FUTURE_DAY meaning that the creation would occur on a date prior to the PickupDate). + + + + + the carrier to which this PickupScheduleOption applies + + + + + Descriptive information about the shipment. + + + + + Tells whether this option describes a dispatch created on the dispatch date (SAME_DAY), or on a prior date (FUTURE_DAY) + + + + + True if this pickup option is available. + + + + + Identifies the date (in the postal code's time zone) to which this PickupScheduleOption refers. + + + + + Identifies the latest allowed ready time (in the postal code's time zone) for a postal code. As a local time, it will not include a Time Zone Designator + + + + + Identifies the minimum required length of the window of time between the ReadyTime and the CustomerCloseTime. + + + + + Indicates whether residential pickup is available for the requested postal code. + + + + + Describes the country relationship (domestic and/or international) among the shipments being picked up. + + + + + + + Descriptive information about the shipment. + + + + + + + Descriptive information about the dimensions of the package. + + + + + Descriptive information about the weight of the package. + + + + + + + Select the type of rate from which the element is to be selected. + + + + + + + + + + + + + + + + + + + + + + + + + + + + These values are used to control the availability of certain special services at the time when a customer uses the e-mail label link to create a return shipment. + + + + + + + + + Return Email Details + + + + + Phone number of the merchant + + + + + Identifies the allowed (merchant-authorized) special services which may be selected when the subsequent shipment is created. Only services represented in EMailLabelAllowedSpecialServiceType will be controlled by this list. + + + + + + + Information relating to a return shipment. + + + + + The type of return shipment that is being requested. + + + + + Return Merchant Authorization + + + + + Describes specific information about the email label shipment. + + + + + + + The type of return shipment that is being requested. + + + + + + + + + + + + Return Merchant Authorization + + + + + The RMA number. + + 20 + + + + + + The reason for the return. + + 60 + + + + + + + + Identifies the collection of available FedEx transportation service options. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Specification for assembly performed on shipment. + + + + + Number of pieces or packages to be assembled + + + + + Total weight of pieces or packages to be assembled + + + + + + + Shipment-level totals of dry ice data across all packages. + + + + + Total number of packages in the shipment that contain dry ice. + + + + + Total shipment dry ice weight for all packages. + + + + + + + Identifies the collection of special service offered by FedEx. BROKER_SELECT_OPTION should be used for Express shipments only. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + These special services are available at the shipment level for some or all service types. If the shipper is requesting a special service which requires additional data (such as the COD amount), the shipment special service type must be present in the specialServiceTypes collection, and the supporting detail must be provided in the appropriate sub-object below. + + + + + The types of all special services requested for the enclosing shipment (or other shipment-level transaction). + + + + + Descriptive data required for a FedEx COD (Collect-On-Delivery) shipment. This element is required when SpecialServiceType.COD is present in the SpecialServiceTypes collection. + + + + + Descriptive data required for a FedEx shipment that is to be held at the destination FedEx location for pickup by the recipient. This element is required when SpecialServiceType.HOLD_AT_LOCATION is present in the SpecialServiceTypes collection. + + + + + Descriptive data required for FedEx to provide email notification to the customer regarding the shipment. This element is required when SpecialServiceType.EMAIL_NOTIFICATION is present in the SpecialServiceTypes collection. + + + + + The descriptive data required for FedEx Printed Return Label. This element is required when SpecialServiceType.PRINTED_RETURN_LABEL is present in the SpecialServiceTypes collection + + + + + This field should be populated for pending shipments (e.g. e-mail label) It is required by a PENDING_SHIPMENT special service type. + + + + + + Number of packages in this shipment which contain dry ice and the total weight of the dry ice for this shipment. + + + + + The descriptive data required for FedEx Home Delivery options. This element is required when SpecialServiceType.HOME_DELIVERY_PREMIUM is present in the SpecialServiceTypes collection + + + + + Identifies the delivery guarantee information. + + + + + Identifies the delivery guarantee information. + + + + + Electronic Trade document references. + + + + + Specification for labor to be performed with the shipment. + + + + + Specifications for pallets to be shrinkwrapped as part of a Freight shipment. + + + + + Specifications for pallets to be provided on Freight shipment. + + + + + Specifications for pup/set or vehicle delayed for loading or unloading. + + + + + Specification for marking or tagging of pieces in shipment. + + + + + Specification for services performed during non-business hours and/or days. + + + + + Specification for assembly performed on shipment. + + + + + Specification for sorting and/or segregating performed on shipment. + + + + + Specification for special equipment used in loading/unloading shipment. + + + + + Specification for storage provided for shipment. + + + + + Specification for weighing services provided for shipment. + + + + + Specification for date or range of dates on which delivery is to be attempted. + + + + + + + Specification for sorting and/or segregating performed on shipment. + + + + + Number of pieces or packages to be sorted/segregated + + + + + Total weight of pieces or packages to be sorted/segregated + + + + + + + Specification for special equipment used in loading/unloading shipment. + + + + + Contains an entry for each type of special equipment used with shipment + + + + + + + Specifies the usage of a single type of special equipment while loading/unloading a shipment + + + + + Type of equipment used + + + + + Total amount of time the equipment was used + + + + + + + Identifies types of special equipment used in loading/unloading Freight shipments + + + + + + + + Specification for storage provided for shipment. + + + + + Total time shipment is held by carrier. + + + + + + + The descriptive data for taxpayer identification information. + + + + + Identifies the category of the taxpayer identification number. See TinType for the list of values. + + + + + Identifies the taxpayer identification number. + + 15 + + + + + + Identifies the usage of Tax Identification Number in Shipment processing + + + + + + + Identifies the category of the taxpayer identification number. + + + + + + + + + + + + Identifies the valid set of tractor tailer sizes supported by FedEx. This type is appropriate only for freight pickup requests. + + + + + + + + + + The descriptive data that governs data payload language/translations. + + + + + Free form text to be echoed back in the reply. Used to match requests and replies. + + + + + Governs data payload language/translations (contrasted with ClientDetail.localization, which governs Notification.localizedMessage language selection). + + + + + + + Identifies the valid set of truck types supported by FedEx. This type is appropriate only for freight pickup requests. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Specifies a single type of weighing performed on a shipment + + + + + Type of scale used + + + + + + + Identifies types of scales used in weighing Freight shipments + + + + + + + + + The descriptive data for the heaviness of an object. + + + + + Identifies the unit of measure associated with a weight value. + + + + + Identifies the weight value of a package/shipment. + + + + + + + Identifies the collection of units of measure that can be associated with a weight value. + + + + + + + + + Used in authentication of the sender's identity. + + + + + Credential used to authenticate a specific software application. This value is provided by FedEx after registration. + + + + + + + Two part authentication string used for the sender's identity + + + + + Identifying part of authentication credential. This value is provided by FedEx after registration + + + + + Secret part of authentication key. This value is provided by FedEx after registration. + + + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + Identifies a system or sub-system which performs an operation. + + + + + Identifies the service business level. + + + + + Identifies the service interface level. + + + + + Identifies the service code level. + + + + + diff --git a/webxml/fedex/Rate_XML.xsd b/webxml/fedex/Rate_XML.xsd new file mode 100644 index 0000000..cf17f24 --- /dev/null +++ b/webxml/fedex/Rate_XML.xsd @@ -0,0 +1,4782 @@ + + + + + + + Specifies additional labels to be produced. All required labels for shipments will be produced without the need to request additional labels. These are only available as thermal labels. + + + + + The type of additional labels to return. + + + + + The number of this type label to return + + + + + + + Identifies the type of additional labels. + + + + + + + + + + + + + + + Descriptive data for a physical location. May be used as an actual physical address (place to which one could go), or as a container of "address parts" which should be handled as a unit (such as a city-state-ZIP combination within the US). + + + + + Combination of number, street name, etc. At least one line is required for a valid physical address; empty lines should not be included. + + + + + Name of city, town, etc. + + + + + Identifying abbreviation for US state, Canada province, etc. Format and presence of this field will vary, depending on country. + + + + + Identification of a region (usually small) for mail/package delivery. Format and presence of this field will vary, depending on country. + + + + + Relevant only to addresses in Puerto Rico. + + + + + The two-letter code used to identify a country. + + + + + Indicates whether this address residential (as opposed to commercial). + + + + + + + Specifies which filing option is being exercised by the customer. Required for non-document shipments originating in Canada destined for any country other than Canada, the United States, Puerto Rico or the U.S. Virgin Islands. + + + + + + + + + + + Identification of the type of barcode (symbology) used on FedEx documents and labels. + + + + + + + + + + + + + + + + + + Identification of a FedEx operating company (transportation). + + + + + + + + + + + + + The instructions indicating how to print the Certificate of Origin ( e.g. whether or not to include the instructions, image type, etc ...) + + + + + Specifies characteristics of a shipping document to be produced. + + + + + Specifies the usage and identification of customer supplied images to be used on this document. + + + + + + + + + + + + + Specifies the type of brokerage to be applied to a shipment. + + + + + + + + + + + + Descriptive data for the client submitting a transaction. + + + + + The FedEx account number associated with this transaction. + + + + + This number is assigned by FedEx and identifies the unique device from which the request is originating + + + + + Only used in transactions which require identification of the Fed Ex Office integrator. + + + + + Indicates the region from which the transaction is submitted. + + + + + The language to be used for human-readable Notification.localizedMessages in responses to the request containing this ClientDetail object. Different requests from the same client may contain different Localization data. (Contrast with TransactionDetail.localization, which governs data payload language/translation.) + + + + + + + + + + + + + + + + + + + + + + Identifies the type of funds FedEx should collect upon shipment delivery. + + + + + + + + + + Descriptive data required for a FedEx COD (Collect-On-Delivery) shipment. + + + + + + Specifies the details of the charges are to be added to the COD collect amount. + + + + + Identifies the type of funds FedEx should collect upon package delivery + + + + + For Express this is the descriptive data that is used for the recipient of the FedEx Letter containing the COD payment. For Ground this is the descriptive data for the party to receive the payment that prints the COD receipt. + + + + + Indicates which type of reference information to include on the COD return shipping label. + + + + + + + Indicates which type of reference information to include on the COD return shipping label. + + + + + + + + + + + CommercialInvoice element is required for electronic upload of CI data. It will serve to create/transmit an Electronic Commercial Invoice through the FedEx Systems. Customers are responsible for printing their own Commercial Invoice.If you would likeFedEx to generate a Commercial Invoice and transmit it to Customs. for clearance purposes, you need to specify that in the ShippingDocumentSpecification element. If you would like a copy of the Commercial Invoice that FedEx generated returned to you in reply it needs to be specified in the ETDDetail/RequestedDocumentCopies element. Commercial Invoice support consists of maximum of 99 commodity line items. + + + + + Any comments that need to be communicated about this shipment. + + + + + Any freight charges that are associated with this shipment. + + + + + Any taxes or miscellaneous charges(other than Freight charges or Insurance charges) that are associated with this shipment. + + + + + Specifies which kind of charge is being recorded in the preceding field. + + + + + Any packing costs that are associated with this shipment. + + + + + Any handling costs that are associated with this shipment. + + + + + Free-form text. + + + + + Free-form text. + + + + + Free-form text. + + + + + The reason for the shipment. Note: SOLD is not a valid purpose for a Proforma Invoice. + + + + + Customer assigned Invoice number + + + + + Name of the International Expert that completed the Commercial Invoice different from Sender. + + + + + Required for dutiable international Express or Ground shipment. This field is not applicable to an international PIB(document) or a non-document which does not require a Commercial Invoice + + + + + + + The instructions indicating how to print the Commercial Invoice( e.g. image type) Specifies characteristics of a shipping document to be produced. + + + + + + Specifies the usage and identification of a customer supplied image to be used on this document. + + + + + + + Information about the transit time and delivery commitment date and time. + + + + + The Commodity applicable to this commitment. + + + + + The FedEx service type applicable to this commitment. + + + + + Shows the specific combination of service options combined with the service type that produced this committment in the set returned to the caller. + + + + + Supporting detail for applied options identified in preceding field. + + + + + THe delivery commitment date/time. Express Only. + + + + + The delivery commitment day of the week. + + + + + The number of transit days; applies to Ground and LTL Freight; indicates minimum transit time for SmartPost. + + + + + Maximum number of transit days, for SmartPost shipments. + + + + + The service area code for the destination of this shipment. Express only. + + + + + The address of the broker to be used for this shipment. + + + + + The FedEx location identifier for the broker. + + + + + The delivery commitment date/time the shipment will arrive at the border. + + + + + The delivery commitment day of the week the shipment will arrive at the border. + + + + + The number of days it will take for the shipment to make it from broker to destination + + + + + The delivery commitment date for shipment served by GSP (Global Service Provider) + + + + + The delivery commitment day of the week for the shipment served by GSP (Global Service Provider) + + + + + Messages concerning the ability to provide an accurate delivery commitment on an International commit quote. These could be messages providing information about why a commitment could not be returned or a successful message such as "REQUEST COMPLETED" + + + + + Messages concerning the delivery commitment on an International commit quote such as "0:00 A.M. IF NO CUSTOMS DELAY" + + + + + Information about why a shipment delivery is delayed and at what level (country/service etc.). + + + + + + Required documentation for this shipment. + + + + + Freight origin and destination city center information and total distance between origin and destination city centers. + + + + + + + The type of delay this shipment will encounter. + + + + + + + + + + + + + + + + + + For international multiple piece shipments, commodity information must be passed in the Master and on each child transaction. If this shipment cotains more than four commodities line items, the four highest valued should be included in the first 4 occurances for this request. + + + + + total number of pieces of this commodity + + + + + total number of pieces of this commodity + + + + + Complete and accurate description of this commodity. + + 450 + + + + + + Country code where commodity contents were produced or manufactured in their final form. + + 2 + + + + + + Unique alpha/numeric representing commodity item. At least one occurrence is required for US Export shipments if the Customs Value is greater than $2500 or if a valid US Export license is required. + + 14 + + + + + + Total weight of this commodity. 1 explicit decimal position. Max length 11 including decimal. + + + + + Number of units of a commodity in total number of pieces for this line item. Max length is 9 + + + + + Unit of measure used to express the quantity of this commodity line item. + + 3 + + + + + + Contains only additional quantitative information other than weight and quantity to calculate duties and taxes. + + + + + Value of each unit in Quantity. Six explicit decimal positions, Max length 18 including decimal. + + + + + Total customs value for this line item. It should equal the commodity unit quantity times commodity unit value. Six explicit decimal positions, max length 18 including decimal. + + + + + Defines additional characteristic of commodity used to calculate duties and taxes + + + + + Applicable to US export shipping only. + + 12 + + + + + + + An identifying mark or number used on the packaging of a shipment to help customers identify a particular shipment. + + 15 + + + + + + All data required for this commodity in NAFTA Certificate of Origin. + + + + + + + Defines additional data to print in the Configurable portion of the label, this allows you to print the same type information on the label that can also be printed on the doc tab. + + + + + 1 of 12 possible zones to position data. + + + + + The identifiying text for the data in this zone. + + + + + A reference to a field in either the request or reply to print in this zone following the header. + + + + + A literal value to print after the header in this zone. + + + + + + + The descriptive data for a point-of-contact person. + + + + + Client provided identifier corresponding to this contact information. + + + + + Identifies the contact person's name. + + + + + Identifies the contact person's title. + + + + + Identifies the company this contact is associated with. + + + + + Identifies the phone number associated with this contact. + + + + + Identifies the phone extension associated with this contact. + + + + + Identifies the pager number associated with this contact. + + + + + Identifies the fax number associated with this contact. + + + + + Identifies the email address associated with this contact. + + + + + + + + + + + + + + + + + + + + + Specifies the currency exchange performed on financial amounts for this rate. + + + + + The currency code for the original (converted FROM) currency. + + + + + The currency code for the final (converted INTO) currency. + + + + + Multiplier used to convert fromCurrency units to intoCurrency units. + + + + + + + + + Indicates the type of custom delivery being requested. + + + + + Time by which delivery is requested. + + + + + Range of dates for custom delivery request; only used if type is BETWEEN. + + + + + Date for custom delivery request; only used for types of ON, BETWEEN, or AFTER. + + + + + + + + + + + + + + + Data required to produce a custom-specified document, either at shipment or package level. + + + + + Common information controlling document production. + + + + + Applicable only to documents produced on thermal printers with roll stock. + + + + + Applicable only to documents produced on thermal printers with roll stock. + + + + + Identifies the formatting specification used to construct this custom document. + + + + + + + Constructed string, based on format and zero or more data fields, printed in specified barcode symbology. + + + + + + + + + Width of thinnest bar/space element in the barcode. + + + + + + + + Solid (filled) rectangular area on label. + + + + + + + + + + + + + + + + + + + + + + + + Image to be included from printer's memory, or from a local file for offline clients. + + + + + + Printer-specific index of graphic image to be printed. + + + + + Fully-qualified path and file name for graphic image to be printed. + + + + + + + + + Horizontal position, relative to left edge of custom area. + + + + + Vertical position, relative to top edge of custom area. + + + + + + + Constructed string, based on format and zero or more data fields, printed in specified printer font (for thermal labels) or generic font/size (for plain paper labels). + + + + + + + + Printer-specific font name for use with thermal printer labels. + + + + + Generic font name for use with plain paper labels. + + + + + Generic font size for use with plain paper labels. + + + + + + + + + + + + + + + + + + + Reference information to be associated with this package. + + + + + + + + + + + + + + + + + + + + + + + Allows customer-specified control of label content. + + + + + If omitted, no doc tab will be produced (i.e. default = former NONE type). + + + + + Defines any custom content to print on the label. + + + + + Defines additional data to print in the Configurable portion of the label, this allows you to print the same type information on the label that can also be printed on the doc tab. + + + + + Controls which data/sections will be suppressed. + + + + + For customers producing their own Ground labels, this field specifies which secondary barcode will be printed on the label; so that the primary barcode produced by FedEx has the corect SCNC. + + + + + The language to use when printing the terms and conditions on the label. + + + + + Controls the number of additional copies of supplemental labels. + + + + + This value reduces the default quantity of destination/consignee air waybill labels. A value of zero indicates no change to default. A minimum of one copy will always be produced. + + + + + + + + + Descriptive data identifying the Broker responsible for the shipmet. Required if BROKER_SELECT_OPTION is requested in Special Services. + + + + + Interacts both with properties of the shipment and contractual relationship with the shipper. + + + + + Applicable only for Commercial Invoice. If the consignee and importer are not the same, the Following importer fields are required. Importer/Contact/PersonName Importer/Contact/CompanyName Importer/Contact/PhoneNumber Importer/Address/StreetLine[0] Importer/Address/City Importer/Address/StateOrProvinceCode - if Importer Country Code is US or CA Importer/Address/PostalCode - if Importer Country Code is US or CA Importer/Address/CountryCode + + + + + Specifies how the recipient is identified for customs purposes; the requirements on this information vary with destination country. + + + + + Indicates how payment of duties for the shipment will be made. + + + + + Indicates whether this shipment contains documents only or non-documents. + + + + + The total customs value for the shipment. This total will rrepresent th esum of the values of all commodities, and may include freight, miscellaneous, and insurance charges. Must contain 2 explicit decimal positions with a max length of 17 including the decimal. For Express International MPS, the Total Customs Value is in the master transaction and all child transactions + + + + + Identifies responsibilities with respect to loss, damage, etc. + + + + + Documents amount paid to third party for coverage of shipment content. + + + + + + CommercialInvoice element is required for electronic upload of CI data. It will serve to create/transmit an Electronic Commercial Invoice through FedEx System. Customers are responsible for printing their own Commercial Invoice. Commercial Invoice support consists of a maximum of 20 commodity line items. + + + + + For international multiple piece shipments, commodity information must be passed in the Master and on each child transaction. If this shipment cotains more than four commodities line items, the four highest valued should be included in the first 4 occurances for this request. + + + + + Country specific details of an International shipment. + + + + + FOOD_OR_PERISHABLE is required by FDA/BTA; must be true for food/perishable items coming to US or PR from non-US/non-PR origin. + + + + + + + Identifies whether or not the products being shipped are required to be accessible during delivery. + + + + + + + + + The descriptive data required for a FedEx shipment containing dangerous goods (hazardous materials). + + + + + Identifies whether or not the products being shipped are required to be accessible during delivery. + + + + + Shipment is packaged/documented for movement ONLY on cargo aircraft. + + + + + Indicates which kinds of hazardous content are in the current package. + + + + + Documents the kinds and quantities of all hazardous commodities in the current package. + + + + + Description of the packaging of this commodity, suitable for use on OP-900 and OP-950 forms. + + + + + Telephone number to use for contact in the event of an emergency. + + + + + Offeror's name or contract number, per DOT regulation. + + + + + + + + + + + + + + + + + + + + + + + + Information about why a shipment delivery is delayed and at what level( country/service etc.). + + + + + The date of the delay + + + + + + The attribute of the shipment that caused the delay(e.g. Country, City, LocationId, Zip, service area, special handling ) + + + + + The point where the delay is occurring (e.g. Origin, Destination, Broker location) + + + + + The reason for the delay (e.g. holiday, weekend, etc.). + + + + + The name of the holiday in that country that is causing the delay. + + + + + + + The attribute of the shipment that caused the delay(e.g. Country, City, LocationId, Zip, service area, special handling ) + + + + + + + + + + + + + + The point where the delay is occurring ( e.g. Origin, Destination, Broker location). + + + + + + + + + + + + Data required to complete the Destionation Control Statement for US exports. + + + + + + Comma-separated list of up to four country codes, required for DEPARTMENT_OF_STATE statement. + + + + + Name of end user, required for DEPARTMENT_OF_STATE statement. + + + + + + + Used to indicate whether the Destination Control Statement is of type Department of Commerce, Department of State or both. + + + + + + + + + The dimensions of this package and the unit type used for the measurements. + + + + + + + + + + + Driving or other transportation distances, distinct from dimension measurements. + + + + + Identifies the distance quantity. + + + + + Identifies the unit of measure for the distance value. + + + + + + + + + + + + + + + The DocTabContentType options available. + + + + + The DocTabContentType should be set to ZONE001 to specify additional Zone details. + + + + + The DocTabContentType should be set to BARCODED to specify additional BarCoded details. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Zone number can be between 1 and 12. + + + + + Header value on this zone. + + + + + Reference path to the element in the request/reply whose value should be printed on this zone. + + + + + Free form-text to be printed in this zone. + + + + + Justification for the text printed on this zone. + + + + + + + Identifies the method by which the package is to be tendered to FedEx. This element does not dispatch a courier for package pickup. + + + + + + + + + + + + Specific information about the delivery of the email and options for the shipment. + + + + + Email address to send the URL to. + + + + + A message to be inserted into the email. + + + + + + + Information describing email notifications that will be sent in relation to events that occur during package movement + + + + + A message that will be included in the email notifications + + + + + Information describing the destination of the email, format of the email and events to be notified on + + + + + + + + + + + + + + + The format of the email + + + + + + + + + + The descriptive data for a FedEx email notification recipient. + + + + + Identifies the relationship this email recipient has to the shipment. + + + + + The email address to send the notification to + + + + + The types of email notifications being requested for this recipient. + + + + + The format of the email notification. + + + + + The language/locale to be used in this email notification. + + + + + + + Identifies the set of valid email notification recipient types. For SHIPPER, RECIPIENT and BROKER the email address asssociated with their definitions will be used, any email address sent with the email notification for these three email notification recipient types will be ignored. + + + + + + + + + + + + + + + + + + + + Customer-declared value, with data type and legal values depending on excise condition, used in defining the taxable value of the item. + + + + + + + Specifies the types of Estimated Duties and Taxes to be included in a rate quotation for an international shipment. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Electronic Trade document references used with the ETD special service. + + + + + Indicates the types of shipping documents produced for the shipper by FedEx (see ShippingDocumentSpecification) which should be copied back to the shipper in the shipment result data. + + + + + Currently not supported. + + + + + + + + Country specific details of an International shipment. + + + + + Specifies which filing option is being exercised by the customer. Required for non-document shipments originating in Canada destined for any country other than Canada, the United States, Puerto Rico or the U.S. Virgin Islands. + + + + + General field for exporting-country-specific export data (e.g. B13A for CA, FTSR Exemption or AES Citation for US). + + + + + This field is applicable only to Canada export non-document shipments of any value to any destination. No special characters allowed. + + 10 + + + + + + Department of Commerce/Department of State information about this shipment. + + + + + + + Details specific to an Express freight shipment. + + + + + Indicates whether or nor a packing list is enclosed. + + + + + Total shipment pieces. ie. 3 boxes and 3 pallets of 100 pieces each = Shippers Load and Count of 303. Applicable to International Priority Freight and International Economy Freight. Values must be in the range of 1 - 99999 + + + + + Required for International Freight shipping. Values must be 8- 12 characters in length. + + 12 + + + + + + Currently not supported. + + + + + Currently not supported. + + + + + Currently not supported. + + + + + + + Currently not supported. Delivery contact information for an Express freight shipment. + + + + + + + + + Indicates a FedEx Express operating region. + + + + + + + + + + + + Identifies a kind of FedEx facility. + + + + + + + + + + Specifies the optional features/characteristics requested for a Freight shipment utilizing a flatbed trailer. + + + + + + + + + + + + + + + + + + + + Individual charge which contributes to the total base charge for the shipment. + + + + + Freight class for this line item. + + + + + Effective freight class used for rating this line item. + + + + + NMFC Code for commodity. + + + + + Customer-provided description for this commodity or class line. + + + + + Weight for this commodity or class line. + + + + + Rate or factor applied to this line item. + + + + + Identifies the manner in which the chargeRate for this line item was applied. + + + + + The net or extended charge for this line item. + + + + + + + Specifies the way in which base charges for a Freight shipment or shipment leg are calculated. + + + + + + + + + + + + + + + + These values represent the industry-standard freight classes used for FedEx Freight and FedEx National Freight shipment description. (Note: The alphabetic prefixes are required to distinguish these values from decimal numbers on some client platforms.) + + + + + + + + + + + + + + + + + + + + + + + + + Information about the Freight Service Centers associated with this shipment. + + + + + Information about the origin Freight Service Center. + + + + + Information about the destination Freight Service Center. + + + + + The distance between the origin and destination FreightService Centers + + + + + + + + + + Date for all Freight guarantee types. + + + + + + + + + + + + + Identifies responsibilities with respect to loss, damage, etc. + + + + + + + + + Rate data specific to FedEx Freight or FedEx National Freight services. + + + + + A unique identifier for a specific rate quotation. + + + + + Specifies how total base charge is determined. + + + + + Freight charges which accumulate to the total base charge for the shipment. + + + + + Human-readable descriptions of additional information on this shipment rating. + + + + + + + Additional non-monetary data returned with Freight rates. + + + + + Unique identifier for notation. + + + + + Human-readable explanation of notation. + + + + + + + This class describes the relationship between a customer-specified address and the FedEx Freight / FedEx National Freight Service Center that supports that address. + + + + + Freight Industry standard non-FedEx carrier identification + + + + + The name of the Interline carrier. + + + + + Additional time it might take at the origin or destination to pickup or deliver the freight. This is usually due to the remoteness of the location. This time is included in the total transit time. + + + + + Service branding which may be used for local pickup or delivery, distinct from service used for line-haul of customer's shipment. + + + + + Distance between customer address (pickup or delivery) and the supporting Freight / National Freight service center. + + + + + Time to travel between customer address (pickup or delivery) and the supporting Freight / National Freight service center. + + + + + Specifies when/how the customer can arrange for pickup or delivery. + + + + + Specifies days of operation if localServiceScheduling is LIMITED. + + + + + Freight service center that is a gateway on the border of Canada or Mexico. + + + + + Alphabetical code identifying a Freight Service Center + + + + + Freight service center Contact and Address + + + + + + + Specifies the type of service scheduling offered from a Freight or National Freight Service Center to a customer-supplied address. + + + + + + + + + + Data applicable to shipments using FEDEX_FREIGHT and FEDEX_NATIONAL_FREIGHT services. + + + + + Account number used with FEDEX_FREIGHT service. + + + + + Used for validating FedEx Freight account number and (optionally) identifying third party payment on the bill of lading. + + + + + Account number used with FEDEX_NATIONAL_FREIGHT service. + + + + + Used for validating FedEx National Freight account number and (optionally) identifying third party payment on the bill of lading. + + + + + Indicates the role of the party submitting the transaction. + + + + + Designates which of the requester's tariffs will be used for rating. + + + + + Identifies the declared value for the shipment + + + + + Identifies the declared value units corresponding to the above defined declared value + + + + + + Identifiers for promotional discounts offered to customers. + + + + + Total number of individual handling units in the entire shipment (for unit pricing). + + + + + Estimated discount rate provided by client for unsecured rate quote. + + + + + Total weight of pallets used in shipment. + + + + + Overall shipment dimensions. + + + + + Description for the shipment. + + + + + Specifies which party will pay surcharges for any special services which support split billing. + + + + + Details of the commodities in the shipment. + + + + + + + Description of an individual commodity or class of content in a shipment. + + + + + Freight class for this line item. + + + + + Specification of handling-unit packaging for this commodity or class line. + + + + + Customer-provided description for this commodity or class line. + + + + + Weight for this commodity or class line. + + + + + FED EX INTERNAL USE ONLY - Individual line item dimensions. + + + + + Volume (cubic measure) for this commodity or class line. + + + + + + + Indicates the role of the party submitting the transaction. + + + + + + + + + + Specifies which party will be responsible for payment of any surcharges for Freight special services for which split billing is allowed. + + + + + Identifies the special service. + + + + + Indicates who will pay for the special service. + + + + + + + Data required to produce a General Agency Agreement document. Remaining content (business data) to be defined once requirements have been completed. + + + + + + + + Documents the kind and quantity of an individual hazardous commodity in a package. + + + + + Identifies and describes an individual hazardous commodity. + + + + + Specifies the amount of the commodity in alternate units. + + + + + Customer-provided specifications for handling individual commodities. + + + + + + + Identifies and describes an individual hazardous commodity. For 201001 load, this is based on data from the FedEx Ground Hazardous Materials Shipping Guide. + + + + + Regulatory identifier for a commodity (e.g. "UN ID" value). + + + + + + + + + + + + + Specifies how the commodity is to be labeled. + + + + + + + + + + Customer-provided specifications for handling individual commodities. + + + + + Specifies how the customer wishes the label text to be handled for this commodity in this package. + + + + + Text used in labeling the commodity under control of the labelTextOption field. + + + + + + + Indicates which kind of hazardous content (as defined by DOT) is being reported. + + + + + + + + + + + + Identifies number and type of packaging units for hazardous commodities. + + + + + Number of units of the type below. + + + + + Units in which the hazardous commodity is packaged. + + + + + + + Identifies DOT packing group for a hazardous commodity. + + + + + + + + + + Identifies amount and units for quantity of hazardous commodities. + + + + + Number of units of the type below. + + + + + Units by which the hazardous commodity is measured. + + + + + + + Descriptive data required for a FedEx shipment that is to be held at the destination FedEx location for pickup by the recipient. + + + + + Contact phone number for recipient of shipment. + + + + + Contact and address of FedEx facility at which shipment is to be held. + + + + + Type of facility at which package/shipment is to be held. + + + + + Location identification (for facilities identified by an alphanumeric location code). + + + + + Location identification (for facilities identified by an numeric location code). + + + + + + + The descriptive data required by FedEx for home delivery services. + + + + + + Required for Date Certain Home Delivery. + + + + + Required for Date Certain and Appointment Home Delivery. + + 15 + + + + + + + + + + + + + + + + + + + + + + + + The type of International shipment. + + + + + + + + + Specifies the type of label to be returned. + + + + + + + + + + + + + Names for data elements / areas which may be suppressed from printing on labels. + + + + + + + + + + + + + + + + + This indicates if the top or bottom of the label comes out of the printer first. + + + + + + + + + Relative to normal orientation for the printer. + + + + + + + + + + + Description of shipping label to be returned in the reply + + + + + Specify type of label to be returned + + + + + The type of image or printer commands the label is to be formatted in. DPL = Unimark thermal printer language EPL2 = Eltron thermal printer language PDF = a label returned as a pdf image PNG = a label returned as a png image ZPLII = Zebra thermal printer language + + + + + For thermal printer lables this indicates the size of the label and the location of the doc tab if present. + + + + + This indicates if the top or bottom of the label comes out of the printer first. + + + + + Relative to normal orientation for the printer. RIGHT=90 degrees clockwise, UPSIDE_DOWN=180 degrees, LEFT=90 degrees counterclockwise. + + + + + If present, this contact and address information will replace the return address information on the label. + + + + + Allows customer-specified control of label content. + + + + + + + For thermal printer labels this indicates the size of the label and the location of the doc tab if present. + + + + + + + + + + + + + + + + + + + + + + Identifies the Liability Coverage Amount. For Jan 2010 this value represents coverage amount per pound + + + + + + + + + + + + + Represents a one-dimensional measurement in small units (e.g. suitable for measuring a package or document), contrasted with Distance, which represents a large one-dimensional measurement (e.g. distance between cities). + + + + + The numerical quantity of this measurement. + + + + + The units for this measurement. + + + + + + + CM = centimeters, IN = inches + + + + + + + + + Identifies the representation of human-readable text. + + + + + Two-letter code for language (e.g. EN, FR, etc.) + + + + + Two-letter code for the region (e.g. us, ca, etc..). + + + + + + + + + + + + + Internal FedEx use only. + + + + + + + + + + + + + + + + + + Data required to produce a Certificate of Origin document. Remaining content (business data) to be defined once requirements have been completed. + + + + + + + Indicates which Party (if any) from the shipment is to be used as the source of importer data on the NAFTA COO form. + + + + + Contact information for "Authorized Signature" area of form. + + + + + + + + + + + + Defined by NAFTA regulations. + + + + + Defined by NAFTA regulations. + + + + + Identification of which producer is associated with this commodity (if multiple producers are used in a single shipment). + + + + + + Date range over which RVC net cost was calculated. + + + + + + + + + + + + + + + Net cost method used. + + + + + + + + + See instructions for NAFTA Certificate of Origin for code definitions. + + + + + + + + + + + + + + + + + + + See instructions for NAFTA Certificate of Origin for code definitions. + + + + + + + + + + + + + + + + + + + + The descriptive data regarding the result of the submitted transaction. + + + + + The severity of this notification. This can indicate success or failure or some other information about the request. The values that can be returned are SUCCESS - Your transaction succeeded with no other applicable information. NOTE - Additional information that may be of interest to you about your transaction. WARNING - Additional information that you need to know about your transaction that you may need to take action on. ERROR - Information about an error that occurred while processing your transaction. FAILURE - FedEx was unable to process your transaction at this time due to a system failure. Please try again later + + + + + Indicates the source of this notification. Combined with the Code it uniquely identifies this notification + + + + + A code that represents this notification. Combined with the Source it uniquely identifies this notification. + + + + + Human-readable text that explains this notification. + + + + + The translated message. The language and locale specified in the ClientDetail. Localization are used to determine the representation. Currently only supported in a TrackReply. + + + + + A collection of name/value pairs that provide specific data to help the client determine the nature of an error (or warning, etc.) witout having to parse the message string. + + + + + + + + + Identifies the type of data contained in Value (e.g. SERVICE_TYPE, PACKAGE_SEQUENCE, etc..). + + + + + The value of the parameter (e.g. PRIORITY_OVERNIGHT, 2, etc..). + + + + + + + Identifies the set of severity values for a Notification. + + + + + + + + + + + + The instructions indicating how to print the OP-900 form for hazardous materials packages. + + + + + Specifies characteristics of a shipping document to be produced. + + + + + Identifies which reference type (from the package's customer references) is to be used as the source for the reference on this OP-900. + + + + + Specifies the usage and identification of customer supplied images to be used on this document. + + + + + Data field to be used when a name is to be printed in the document instead of (or in addition to) a signature image. + + + + + + + The Oversize classification for a package. + + + + + + + + + + Data for a package's rates, as calculated per a specific rate type. + + + + + Type used for this specific set of rate data. + + + + + Indicates which weight was used. + + + + + INTERNAL FEDEX USE ONLY. + + + + + The weight that was used to calculate the rate. + + + + + The dimensional weight of this package (if greater than actual). + + + + + The oversize weight of this package (if the package is oversize). + + + + + The transportation charge only (prior to any discounts applied) for this package. + + + + + The sum of all discounts on this package. + + + + + This package's baseCharge - totalFreightDiscounts. + + + + + The sum of all surcharges on this package. + + + + + This package's netFreight + totalSurcharges (not including totalTaxes). + + + + + The sum of all taxes on this package. + + + + + This package's netFreight + totalSurcharges + totalTaxes. + + + + + The total sum of all rebates applied to this package. + + + + + All rate discounts that apply to this package. + + + + + All rebates that apply to this package. + + + + + All surcharges that apply to this package (either because of characteristics of the package itself, or because it is carrying per-shipment surcharges for the shipment of which it is a part). + + + + + All taxes applicable (or distributed to) this package. + + + + + The variable handling charges calculated based on the type variable handling charges requested. + + + + + + + Identifies the collection of special services offered by FedEx. + + + + + + + + + + + + + + + These special services are available at the package level for some or all service types. If the shipper is requesting a special service which requires additional data, the package special service type must be present in the specialServiceTypes collection, and the supporting detail must be provided in the appropriate sub-object below. + + + + + The types of all special services requested for the enclosing shipment or package. + + + + + For use with FedEx Ground services only; COD must be present in shipment's special services. + + + + + Descriptive data required for a FedEx shipment containing dangerous materials. This element is required when SpecialServiceType.DANGEROUS_GOODS or HAZARDOUS_MATERIAL is present in the SpecialServiceTypes collection. + + + + + Descriptive data required for a FedEx shipment containing dry ice. This element is required when SpecialServiceType.DRY_ICE is present in the SpecialServiceTypes collection. + + + + + The descriptive data required for FedEx signature services. This element is required when SpecialServiceType.SIGNATURE_OPTION is present in the SpecialServiceTypes collection. + + + + + To be filled. + + + + + + + Identifies the packaging used by the requestor for the package. See PackagingType for list of valid enumerated values. + + + + + + + + + + + + + + The descriptive data for a person or company entitiy doing business with FedEx. + + + + + Identifies the FedEx account number assigned to the customer. + + 12 + + + + + + Descriptive data for taxpayer identification information. + + + + + Descriptive data identifying the point-of-contact person. + + + + + The descriptive data for a physical location. + + + + + + + The descriptive data for the monetary compensation given to FedEx for services rendered to the customer. + + + + + Identifies the method of payment for a service. See PaymentType for list of valid enumerated values. + + + + + Descriptive data identifying the party responsible for payment for a service. + + + + + + + Identifies the method of payment for a service. + + + + + + + + Descriptive data identifying the party responsible for payment for a service. + + + + + Identifies the FedEx account number assigned to the payor. + + 12 + + + + + + Identifies the country of the payor. + + + + + + + This information describes the kind of pending shipment being requested. + + + + + + Date after which the pending shipment will no longer be available for completion. + + + + + Only used with type of EMAIL. + + + + + + + + + + + + This enumeration rationalizes the former FedEx Express international "admissibility package" types (based on ANSI X.12) and the FedEx Freight packaging types. The values represented are those common to both carriers. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This class describes the pickup characteristics of a shipment (e.g. for use in a tag request). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Currently not supported. + + + + + + + + + + + + + + + + + + Indicates the reason that a dim divisor value was chose. + + + + + + + + + + + + Identifies a discount applied to the shipment. + + + + + Identifies the type of discount applied to the shipment. + + + + + + The amount of the discount applied to the shipment. + + + + + The percentage of the discount applied to the shipment. + + + + + + + Identifies the type of discount applied to the shipment. + + + + + + + + + + + + Selects the value from a set of rate data to which the percentage is applied. + + + + + + + + + + + The response to a RateRequest. The Notifications indicate whether the request was successful or not. + + + + + This indicates the highest level of severity of all the notifications returned in this reply. + + + + + The descriptive data regarding the results of the submitted transaction. + + + + + Contains the CustomerTransactionId that was sent in the request. + + + + + The version of this reply. + + + + + Each element contains all rate data for a single service. If service was specified in the request, there will be a single entry in this array; if service was omitted in the request, there will be a separate entry in this array for each service being compared. + + + + + + + + + Identifies the FedEx service to use in shipping the package. See ServiceType for list of valid enumerated values. + + + + + Identifies the packaging used by the requestor for the package. See PackagingType for list of valid enumerated values. + + + + + Shows the specific combination of service options combined with the service type that produced this committment in the set returned to the caller. + + + + + Supporting detail for applied options identified in preceding field. + + + + + + + + + Identification of an airport, using standard three-letter abbreviations. + + + + + Indicates whether or not this shipment is eligible for a money back guarantee. + + + + + Commitment code for the origin. + + + + + Commitment code for the destination. + + + + + Time in transit from pickup to delivery. + + + + + Maximum expected transit time + + + + + The signature option for this package. + + + + + The actual rate type of the charges for this package. + + + + + Each element contains all rate data for a single rate type. + + + + + + + Descriptive data sent to FedEx by a customer in order to rate a package/shipment. + + + + + Descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + Descriptive data identifying the client submitting the transaction. + + + + + Descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + Allows the caller to specify that the transit time and commit data are to be returned in the reply. + + + + + Candidate carriers for rate-shopping use case. This field is only considered if requestedShipment/serviceType is omitted. + + + + + Contains zero or more service options whose combinations are to be considered when replying with available services. + + + + + The shipment for which a rate quote (or rate-shopping comparison) is desired. + + + + + + + Indicates the type of rates to be returned. + + + + + + + + + Select the type of rate from which the element is to be selected. + + + + + + + + + If requesting rates using the PackageDetails element (one package at a time) in the request, the rates for each package will be returned in this element. Currently total piece total weight rates are also retuned in this element. + + + + + Echoed from the corresponding package in the rate request (if provided). + + + + + Used with request containing PACKAGE_GROUPS, to identify which group of identical packages was used to produce a reply item. + + + + + The difference between "list" and "account" net charge. + + + + + Ground COD is shipment level. + + + + + + Rate data that are tied to a specific package and rate type combination. + + + + + + + This class groups the shipment and package rating data for a specific rate type for use in a rating reply, which groups result data by rate type. + + + + + The difference between "list" and "account" total net charge. + + + + + Express COD is shipment level. + + + + + The shipment-level totals for this rate type. + + + + + The package-level data for this rate type. + + + + + + + The method used to calculate the weight to be used in rating the package.. + + + + + + + + + + + + + + + + + + + Identifies a discount applied to the shipment. + + + + + + + The amount of the discount applied to the shipment. + + + + + The percentage of the discount applied to the shipment. + + + + + + + Identifies the type of discount applied to the shipment. + + + + + + + + + + Specifies how the recipient is identified for customs purposes; the requirements on this information vary with destination country. + + + + + Specifies the kind of identification being used. + + + + + Contains the actual ID value, of the type specified above. + + + + + + + Type of Brazilian taxpayer identifier provided in Recipient/TaxPayerIdentification/Number. For shipments bound for Brazil this overrides the value in Recipient/TaxPayerIdentification/TinType + + + + + + + + + + FOOD_OR_PERISHABLE is required by FDA/BTA; must be true for food/perishable items coming to US or PR from non-US/non-PR origin + + + + + + + + + + This class rationalizes RequestedPackage and RequestedPackageSummary from previous interfaces. The way in which it is uses within a RequestedShipment depends on the RequestedPackageDetailType value specified for that shipment. + + + + + Used only with INDIVIDUAL_PACKAGE, as a unique identifier of each requested package. + + + + + Used only with PACKAGE_GROUPS, as a unique identifier of each group of identical packages. + + + + + Used only with PACKAGE_GROUPS, as a count of packages within a group of identical packages. + + + + + + Only used for INDIVIDUAL_PACKAGES and PACKAGE_GROUPS. Ignored for PACKAGE_SUMMARY, in which case totalInsuredValue and packageCount on the shipment will be used to determine this value. + + + + + Only used for INDIVIDUAL_PACKAGES and PACKAGE_GROUPS. Ignored for PACKAGE_SUMMARY, in which case totalweight and packageCount on the shipment will be used to determine this value. + + + + + + Provides additional detail on how the customer has physically packaged this item. As of June 2009, required for packages moving under international and SmartPost services. + + + + + Human-readable text describing the package. + + + + + + + Only used for INDIVIDUAL_PACKAGES and PACKAGE_GROUPS. + + + + + + + The descriptive data for the shipment being tendered to FedEx. + + + + + Identifies the date and time the package is tendered to FedEx. Both the date and time portions of the string are expected to be used. The date should not be a past date or a date more than 10 days in the future. The time is the local time of the shipment based on the shipper's time zone. The date component must be in the format: YYYY-MM-DD (e.g. 2006-06-26). The time component must be in the format: HH:MM:SS using a 24 hour clock (e.g. 11:00 a.m. is 11:00:00, whereas 5:00 p.m. is 17:00:00). The date and time parts are separated by the letter T (e.g. 2006-06-26T17:00:00). There is also a UTC offset component indicating the number of hours/mainutes from UTC (e.g 2006-06-26T17:00:00-0400 is defined form June 26, 2006 5:00 pm Eastern Time). + + + + + Identifies the method by which the package is to be tendered to FedEx. This element does not dispatch a courier for package pickup. See DropoffType for list of valid enumerated values. + + + + + Identifies the FedEx service to use in shipping the package. See ServiceType for list of valid enumerated values. + + + + + Identifies the packaging used by the requestor for the package. See PackagingType for list of valid enumerated values. + + + + + Identifies the total weight of the shipment being conveyed to FedEx.This is only applicable to International shipments and should only be used on the first package of a mutiple piece shipment.This value contains 1 explicit decimal position + + + + + Total insured amount. + + + + + Descriptive data identifying the party responsible for shipping the package. Shipper and Origin should have the same address. + + + + + Descriptive data identifying the party receiving the package. + + + + + A unique identifier for a recipient location + + 10 + + + + + + Physical starting address for the shipment, if different from shipper's address. + + + + + Descriptive data indicating the method and means of payment to FedEx for providing shipping services. + + + + + Descriptive data regarding special services requested by the shipper for this shipment. If the shipper is requesting a special service which requires additional data (e.g. COD), the special service type must be present in the specialServiceTypes collection, and the supporting detail must be provided in the appropriate sub-object. For example, to request COD, "COD" must be included in the SpecialServiceTypes collection and the CodDetail object must contain the required data. + + + + + Details specific to an Express freight shipment. + + + + + Data applicable to shipments using FEDEX_FREIGHT and FEDEX_NATIONAL_FREIGHT services. + + + + + Used with Ground Home Delivery and Freight. + + + + + Details about how to calculate variable handling charges at the shipment level. + + + + + Customs clearance data, used for both international and intra-country shipping. + + + + + For use in "process tag" transaction. + + + + + Specifies the characteristics of a shipment pertaining to SmartPost services. + + + + + If true, only the shipper/payor will have visibility of this shipment. + + + + + Details about the image format and printer type the label is to returned in. + + + + + Contains data used to create additional (non-label) shipping documents. + + + + + Specifies whether and what kind of rates the customer wishes to have quoted on this shipment. The reply will also be constrained by other data on the shipment and customer. + + + + + Specifies whether the customer wishes to have Estimated Duties and Taxes provided with the rate quotation on this shipment. Only applies with shipments moving under international services. + + + + + The total number of packages in the entire shipment (even when the shipment spans multiple transactions.) + + + + + Specifies which package-level data values are provided at the shipment-level only. The package-level data values types specified here will not be provided at the package-level. + + + + + One or more package-attribute descriptions, each of which describes an individual package, a group of identical packages, or (for the total-piece-total-weight case) common characteristics all packages in the shipment. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + These values are used to control the availability of certain special services at the time when a customer uses the e-mail label link to create a return shipment. + + + + + + + + + + + + Identifies the allowed (merchant-authorized) special services which may be selected when the subsequent shipment is created. Only services represented in EMailLabelAllowedSpecialServiceType will be controlled by this list. + + + + + + + Information relating to a return shipment. + + + + + The type of return shipment that is being requested. At present the only type of retrun shipment that is supported is PRINT_RETURN_LABEL. With this option you can print a return label to insert into the box of an outbound shipment. This option can not be used to print an outbound label. + + + + + Return Merchant Authorization + + + + + Specific information about the delivery of the email and options for the shipment. + + + + + + + The type of return shipment that is being requested. + + + + + + + + + + The "PAYOR..." rates are expressed in the currency identified in the payor's rate table(s). The "RATED..." rates are expressed in the currency of the origin country. Former "...COUNTER..." values have become "...RETAIL..." values, except for PAYOR_COUNTER and RATED_COUNTER, which have been removed. + + + + + + + + + + + + + + + Return Merchant Authorization + + + + + Return Merchant Authorization Number + + 20 + + + + + + The reason for the return. + + 60 + + + + + + + + + + + + + + + + These values control the optional features of service that may be combined in a commitment/rate comparision transaction. + + + + + + + + + + + Supporting detail for applied options identified in a rate quote. + + + + + Identifies the type of Freight Guarantee applied, if FREIGHT_GUARANTEE is applied to the rate quote. + + + + + Identifies the smartPostHubId used during rate quote, if SMART_POST_HUB_ID is a variable option on the rate request. + + + + + Identifies the indicia used during rate quote, if SMART_POST_ALLOWED_INDICIA is a variable option on the rate request. + + + + + + + Identifies the FedEx service to use in shipping the package. See ServiceType for list of valid enumerated values. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Shipment-level totals of dry ice data across all packages. + + + + + Total number of packages in the shipment that contain dry ice. + + + + + Total shipment dry ice weight for all packages. + + + + + + + Data for a single leg of a shipment's total/summary rates, as calculated per a specific rate type. + + + + + Human-readable text describing the shipment leg. + + + + + Origin for this leg. + + + + + Destination for this leg. + + + + + Type used for this specific set of rate data. + + + + + Indicates the rate scale used. + + + + + Indicates the rate zone used (based on origin and destination). + + + + + + Indicates which weight was used. + + + + + INTERNAL FEDEX USE ONLY. + + + + + Specifies the currency exchange performed on financial amounts for this rate. + + + + + Indicates which special rating cases applied to this shipment. + + + + + + Identifies the type of dim divisor that was applied. + + + + + + + Sum of dimensional weights for all packages. + + + + + + + + + This shipment's totalNetFreight + totalSurcharges (not including totalTaxes). + + + + + Total of the transportation-based taxes. + + + + + + + Total of all values under this shipment's dutiesAndTaxes; only provided if estimated duties and taxes were calculated for this shipment. + + + + + This shipment's totalNetCharge + totalDutiesAndTaxes; only provided if estimated duties and taxes were calculated for this shipment AND duties, taxes and transportation charges are all paid by the same sender's account. + + + + + Rate data specific to FedEx Freight and FedEx National Freight services. + + + + + All rate discounts that apply to this shipment. + + + + + All rebates that apply to this shipment. + + + + + All surcharges that apply to this shipment. + + + + + All transportation-based taxes applicable to this shipment. + + + + + All commodity-based duties and taxes applicable to this shipment. + + + + + The "order level" variable handling charges. + + + + + The total of all variable handling charges at both shipment (order) and package level. + + + + + + + These values identify which package-level data values will be provided at the shipment-level. + + + + + + + + + + Data for a shipment's total/summary rates, as calculated per a specific rate type. The "total..." fields may differ from the sum of corresponding package data for Multiweight or Express MPS. + + + + + Type used for this specific set of rate data. + + + + + Indicates the rate scale used. + + + + + Indicates the rate zone used (based on origin and destination). + + + + + Indicates the type of pricing used for this shipment. + + + + + Indicates which weight was used. + + + + + INTERNAL FEDEX USE ONLY. + + + + + Specifies the currency exchange performed on financial amounts for this rate. + + + + + Indicates which special rating cases applied to this shipment. + + + + + The value used to calculate the weight based on the dimensions. + + + + + Identifies the type of dim divisor that was applied. + + + + + + The weight used to calculate these rates. + + + + + Sum of dimensional weights for all packages. + + + + + + The total discounts used in the rate calculation. + + + + + The freight charge minus discounts. + + + + + The total amount of all surcharges applied to this shipment. + + + + + This shipment's totalNetFreight + totalSurcharges (not including totalTaxes). + + + + + Total of the transportation-based taxes. + + + + + The net charge after applying all discounts and surcharges. + + + + + The total sum of all rebates applied to this shipment. + + + + + Total of all values under this shipment's dutiesAndTaxes; only provided if estimated duties and taxes were calculated for this shipment. + + + + + This shipment's totalNetCharge + totalDutiesAndTaxes; only provided if estimated duties and taxes were calculated for this shipment AND duties, taxes and transportation charges are all paid by the same sender's account. + + + + + Identifies the Rate Details per each leg in a Freight Shipment + + + + + Rate data specific to FedEx Freight and FedEx National Freight services. + + + + + All rate discounts that apply to this shipment. + + + + + All rebates that apply to this shipment. + + + + + All surcharges that apply to this shipment. + + + + + All transportation-based taxes applicable to this shipment. + + + + + All commodity-based duties and taxes applicable to this shipment. + + + + + The "order level" variable handling charges. + + + + + The total of all variable handling charges at both shipment (order) and package level. + + + + + + + Identifies the collection of special service offered by FedEx. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + These special services are available at the shipment level for some or all service types. If the shipper is requesting a special service which requires additional data (such as the COD amount), the shipment special service type must be present in the specialServiceTypes collection, and the supporting detail must be provided in the appropriate sub-object below. + + + + + The types of all special services requested for the enclosing shipment (or other shipment-level transaction). + + + + + Descriptive data required for a FedEx COD (Collect-On-Delivery) shipment. This element is required when SpecialServiceType.COD is present in the SpecialServiceTypes collection. + + + + + Descriptive data required for a FedEx shipment that is to be held at the destination FedEx location for pickup by the recipient. This element is required when SpecialServiceType.HOLD_AT_LOCATION is present in the SpecialServiceTypes collection. + + + + + Descriptive data required for FedEx to provide email notification to the customer regarding the shipment. This element is required when SpecialServiceType.EMAIL_NOTIFICATION is present in the SpecialServiceTypes collection. + + + + + The descriptive data required for FedEx Printed Return Label. This element is required when SpecialServiceType.PRINTED_RETURN_LABEL is present in the SpecialServiceTypes collection + + + + + This field should be populated for pending shipments (e.g. e-mail label) It is required by a PENDING_SHIPMENT special service type. + + + + + The number of packages with dry ice and the total weight of the dry ice. + + + + + The descriptive data required for FedEx Home Delivery options. This element is required when SpecialServiceType.HOME_DELIVERY_PREMIUM is present in the SpecialServiceTypes collection + + + + + + + Electronic Trade document references. + + + + + Specification for date or range of dates on which delivery is to be attempted. + + + + + + + Each occurrence of this class specifies a particular way in which a kind of shipping document is to be produced and provided. + + + + + Values in this field specify how to create and return the document. + + + + + Specifies how to organize all documents of this type. + + + + + Specifies how to e-mail document images. + + + + + Specifies how a queued document is to be printed. + + + + + + + Specifies how to return a shipping document to the caller. + + + + + + + + + + + + + + Specifies how to e-mail shipping documents. + + + + + Provides the roles and email addresses for e-mail recipients. + + + + + Identifies the convention by which documents are to be grouped as e-mail attachments. + + + + + + + + + + + + + Specifies an individual recipient of e-mailed shipping document(s). + + + + + Identifies the relationship of this recipient in the shipment. + + + + + Address to which the document is to be sent. + + + + + + + Specifies characteristics of a shipping document to be produced. + + + + + Specifies how to create, organize, and return the document. + + + + + Specifies how far down the page to move the beginning of the image; allows for printing on letterhead and other pre-printed stock. + + + + + + + For those shipping document types which have both a "form" and "instructions" component (e.g. NAFTA Certificate of Origin and General Agency Agreement), this field indicates whether to provide the instructions. + + + + + Governs the language to be used for this individual document, independently from other content returned for the same shipment. + + + + + + + Specifies how to organize all shipping documents of the same type. + + + + + + + + + Specifies the image format used for a shipping document. + + + + + + + + + + + + Specifies printing options for a shipping document. + + + + + Provides environment-specific printer identification. + + + + + + + Contains all data required for additional (non-label) shipping documents to be produced in conjunction with a specific shipment. + + + + + Indicates the types of shipping documents requested by the shipper. + + + + + + + Specifies the production of each package-level custom document (the same specification is used for all packages). + + + + + Specifies the production of a shipment-level custom document. + + + + + Details pertaining to the GAA. + + + + + Details pertaining to NAFTA COO. + + + + + Specifies the production of the OP-900 document for hazardous materials packages. + + + + + + + Specifies the type of paper (stock) on which a document will be printed. + + + + + + + + + + + + + + + + + The descriptive data required for FedEx delivery signature services. + + + + + Identifies the delivery signature services option selected by the customer for this shipment. See OptionType for the list of valid values. + + + + + Identifies the delivery signature release authorization number. + + 10 + + + + + + + + Identifies the delivery signature services options offered by FedEx. + + + + + + + + + + + + These values are mutually exclusive; at most one of them can be attached to a SmartPost shipment. + + + + + + + + + + + + + + + + + + + + + Data required for shipments handled under the SMART_POST and GROUND_SMART_POST service types. + + + + + + + + + + + Indicates which special rating cases applied to this shipment. + + + + + + + + + Identifies each surcharge applied to the shipment. + + + + + The type of surcharge applied to the shipment. + + + + + + + The amount of the surcharge applied to the shipment. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Identifies each tax applied to the shipment. + + + + + + + + + + + + + + + + + + + + + Specifice the kind of tax or miscellaneous charge being reported on a Commercial Invoice. + + + + + + + + + + + + + The descriptive data for taxpayer identification information. + + + + + Identifies the category of the taxpayer identification number. See TinType for the list of values. + + + + + Identifies the taxpayer identification number. + + 18 + + + + + + Identifies the usage of Tax Identification Number in Shipment processing + + + + + + + Required for dutiable international express or ground shipment. This field is not applicable to an international PIB (document) or a non-document which does not require a commercial invoice express shipment. CFR_OR_CPT (Cost and Freight/Carriage Paid TO) CIF_OR_CIP (Cost Insurance and Freight/Carraige Insurance Paid) DDP (Delivered Duty Paid) DDU (Delivered Duty Unpaid) EXW (Ex Works) FOB_OR_FCA (Free On Board/Free Carrier) + + + + + + + + + + + + + Identifies the category of the taxpayer identification number. + + + + + + + + + + + + + + + + + + + + + + + + + + Descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Free form text to be echoed back in the reply. Used to match requests and replies. + + + + + Governs data payload language/translations (contrasted with ClientDetail.localization, which governs Notification.localizedMessage language selection). + + + + + + + Time in transit from pickup to delivery. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This definition of variable handling charge detail is intended for use in Jan 2011 corp load. + + + + + Used with Variable handling charge type of FIXED_VALUE. Contains the amount to be added to the freight charge. Contains 2 explicit decimal positions with a total max length of 10 including the decimal. + + + + + Actual percentage (10 means 10%, which is a mutiplier of 0.1) + + + + + Select the value from a set of rate data to which the percentage is applied. + + + + + Select the type of rate from which the element is to be selected. + + + + + + + The variable handling charges calculated based on the type variable handling charges requested. + + + + + The variable handling charge amount calculated based on the requested variable handling charge detail. + + + + + The calculated varibale handling charge plus the net charge. + + + + + + + Three-dimensional volume/cubic measurement. + + + + + + + + + Units of three-dimensional volume/cubic measure. + + + + + + + + + The descriptive data for the heaviness of an object. + + + + + Identifies the unit of measure associated with a weight value. + + + + + Identifies the weight value of a package/shipment. + + + + + + + Identifies the unit of measure associated with a weight value. See WeightUnits for the list of valid enumerated values. + + + + + + + + + Used in authentication of the sender's identity. + + + + + Credential used to authenticate a specific software application. This value is provided by FedEx after registration. + + + + + + + Two part authentication string used for the sender's identity + + + + + Identifying part of authentication credential. This value is provided by FedEx after registration + + + + + Secret part of authentication key. This value is provided by FedEx after registration. + + + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + Identifies a system or sub-system which performs an operation. + + + + + Identifies the service business level. + + + + + Identifies the service interface level. + + + + + Identifies the service code level. + + + + + diff --git a/webxml/fedex/ReturnTagService_XML.xsd b/webxml/fedex/ReturnTagService_XML.xsd new file mode 100644 index 0000000..1901775 --- /dev/null +++ b/webxml/fedex/ReturnTagService_XML.xsd @@ -0,0 +1,388 @@ + + + + + + + Used in authentication of the sender's identity. + + + + + Credential used to authenticate a specific software application. This value is provided by FedEx after registration. + + + + + + + Two part authentication string used for the sender's identity. + + + + + Identifying part of the authentication key. This value is provided by FedEx after registration. + + 16 + + + + + + Secret part of authentication key used for authentication. This value is provided by FedEx after registration. + + 25 + + + + + + + + The descriptive data identifying the client submitting the transaction. + + + + + Identifies the FedEx account number assigned to the customer. + + 12 + + + + + + Identifies the unique client device submitting the request. + + 10 + + + + + + Governs any future language/translations used for human-readable Notification.localizedMessages in responses to the request containing this ClientDetail object. Different requests from the same client may contain different Localization data. (Contrast with TransactionDetail.localization, which governs data payload language/translation.) + + + + + + + The descriptive data that governs data payload language/translations. + + + + + Identifies a customer-supplied unique identifier for this transaction. It is returned in the reply message to aid in matching requests to replies. + + 40 + + + + + + Governs any future language/translations applied to the data payload (contrasted with ClientDetail.localization, which governs Notification.localizedMessage language selection). + + + + + + + The descriptive data for the local language and locale (i.e. country). + + + + + Identifies the language to use for human-readable messages. + + 2 + + + + + + Identifies the locale (i.e. country code). + + 2 + + + + + + + + The descriptive data regarding the version/level of a service operation performed by the callee (in each reply). + + + + + Identifies a system or sub-system which performs an operation. + + + + + Identifies the service business level. + + + + + Identifies the service interface level. + + + + + Identifies the service code level. + + + + + + + Identifies the FedEx service to use in shipping the package. See ServiceType for list of valid enumerated values. + + + + + + + + + + + + + + + + + + + + + + + + + + + Identifies the packaging used by the requestor for the package. See PackagingType for list of valid enumerated values. + + + + + + + + + + + + + + The descriptive data for a physical location. + + + + + Combination of number, street name, etc. At least one line is required for a valid physical address; empty lines should not be included. + + + + + Name of city, town, etc. + + + + + Identifying abbreviation for US state, Canada province, etc. Format and presence of this field will vary, depending on country. + + + + + Identification of a region (usually small) for mail/package delivery. Format and presence of this field will vary, depending on country. First five characters will be accepted. + + + + + Relevant only to addresses in Puerto Rico. In Puerto Rico, multiple addresses within the same ZIP code can have the same house number and street name. When this is the case, the urbanization code is needed to distinguish them. + + + + + Identification of a country. + + + + + Indicates whether this address is residential (as opposed to commercial). + + + + + + + The descriptive data regarding the results of the submitted transaction. + + + + + Identifies the severity of the Notification item. See NotificationSeverityType for list of returned values. + + + + + Identifies the source - what FedEx system, sub-system, or component generated the Notification item. + + + + + Identifies the error code generated by the FedEx system, sub-system or component. + + 8 + + + + + + Identifies the error message text. + + 255 + + + + + + Identifies the error message text in the localization requested. Currently not supported. + + + + + Used internally by FedEx systems for message translation. + + + + + + + + + Name identifiying the type of the data in the element 'Value' + + + + + The value that was used as the replacement parameter. + + + + + + + Identifies the set of severity values for a Notification. + + + + + + + + + + + + FedEx Express Tag Availability request. + + + + + The descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + The descriptive data identifying the client submitting the transaction. + + + + + The descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + Package ready date and time. + + + + + Sender postal code and country. + + + + + FedEx Service type. + + + + + FedEx Packaging type. + + + + + + + FedEx Express Tag Availability reply. + + + + + Identifies the highest severity encountered when executing the request; in order from high to low: FAILURE, ERROR, WARNING, NOTE, SUCCESS. + + + + + The descriptive data detailing the status of a sumbitted transaction. + + + + + Descriptive data that governs data payload language/translations. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + This is the minimum time window that must be allocated for the FedEx courier to make the pickup. This is a length of time. The difference between the Business close time, (or the local Cutoff time if it is earlier than the Business Close time), and the Ready Time must be equal to or exceed the access time. + + + + + Latest time a FedEx courier will be available to pick up the package from the Sender. + + + + + Indicates the Express Tag Service availability at the sender postal code indicated in the request. + + + + + + + Identifies the Express Tag Service availability. + + + + + + + diff --git a/webxml/fedex/ShipService_XML.xsd b/webxml/fedex/ShipService_XML.xsd new file mode 100644 index 0000000..22192aa --- /dev/null +++ b/webxml/fedex/ShipService_XML.xsd @@ -0,0 +1,5377 @@ + + + + + + + + + + + + + + + + + Specifies additional labels to be produced. All required labels for shipments will be produced without the need to request additional labels. These are only available as thermal labels. + + + + + The type of additional labels to return. + + + + + The number of this type label to return + + + + + + + Identifies the type of additional labels. + + + + + + + + + + + + + + + + Descriptive data for a physical location. May be used as an actual physical address (place to which one could go), or as a container of "address parts" which should be handled as a unit (such as a city-state-ZIP combination within the US). + + + + + Combination of number, street name, etc. At least one line is required for a valid physical address; empty lines should not be included. + + + + + Name of city, town, etc. + + + + + Identifying abbreviation for US state, Canada province, etc. Format and presence of this field will vary, depending on country. + + + + + Identification of a region (usually small) for mail/package delivery. Format and presence of this field will vary, depending on country. + + + + + Relevant only to addresses in Puerto Rico. + + + + + The two-letter code used to identify a country. + + + + + Indicates whether this address residential (as opposed to commercial). + + + + + + + Specifies which filing option is being exercised by the customer. Required for non-document shipments originating in Canada destined for any country other than Canada, the United States, Puerto Rico or the U.S. Virgin Islands. + + + + + + + + + + + Identification of the type of barcode (symbology) used on FedEx documents and labels. + + + + + + + + + + Each instance of this data type represents a barcode whose content must be represented as binary data (i.e. not ASCII text). + + + + + The kind of barcode data in this instance. + + + + + The data content of this instance. + + + + + + + + + + + + + + + + + + + + Descriptive data sent to FedEx by a customer in order to Cancel a Pending shipment. + + + + + Descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + Descriptive data identifying the client submitting the transaction. + + + + + Descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + + + + Identification of a FedEx operating company (transportation). + + + + + + + + + + + + + The instructions indicating how to print the Certificate of Origin ( e.g. whether or not to include the instructions, image type, etc ...) + + + + + Specifies characteristics of a shipping document to be produced. + + + + + Specifies the usage and identification of customer supplied images to be used on this document. + + + + + + + + + + + + + Specifies the type of brokerage to be applied to a shipment. + + + + + + + + + + + + Descriptive data for the client submitting a transaction. + + + + + The FedEx account number associated with this transaction. + + + + + This number is assigned by FedEx and identifies the unique device from which the request is originating + + + + + Only used in transactions which require identification of the Fed Ex Office integrator. + + + + + The language to be used for human-readable Notification.localizedMessages in responses to the request containing this ClientDetail object. Different requests from the same client may contain different Localization data. (Contrast with TransactionDetail.localization, which governs data payload language/translation.) + + + + + + + + + + + + + + + + + + + + + + Identifies the type of funds FedEx should collect upon shipment delivery. + + + + + + + + + + + + Descriptive data required for a FedEx COD (Collect-On-Delivery) shipment. + + + + + + Specifies the details of the charges are to be added to the COD collect amount. + + + + + Identifies the type of funds FedEx should collect upon package delivery + + + + + For Express this is the descriptive data that is used for the recipient of the FedEx Letter containing the COD payment. For Ground this is the descriptive data for the party to receive the payment that prints the COD receipt. + + + + + Indicates which type of reference information to include on the COD return shipping label. + + + + + + + + + The COD amount (after any accumulations) that must be collected upon delivery of a package shipped using the COD special service. + + + + + + Contains the data which form the Astra and 2DCommon barcodes that print on the COD return label. + + + + + The label image or printer commands to print the label. + + + + + + + Indicates which type of reference information to include on the COD return shipping label. + + + + + + + + + + + + + The COD amount (after any accumulations) that must be collected upon delivery of a package shipped using the COD special service. + + + + + Currently not supported. + + + + + Currently not supported. + + + + + + Specifies the tracking id for the payment on the COD return. + + + + + Specifies the information for COD payment on an Express COD shipment. This information is not tied to any outbound package. + + + + + The label image or printer commands to print the label. + + + + + + + CommercialInvoice element is required for electronic upload of CI data. It will serve to create/transmit an Electronic Commercial Invoice through the FedEx Systems. Customers are responsible for printing their own Commercial Invoice.If you would likeFedEx to generate a Commercial Invoice and transmit it to Customs. for clearance purposes, you need to specify that in the ShippingDocumentSpecification element. If you would like a copy of the Commercial Invoice that FedEx generated returned to you in reply it needs to be specified in the ETDDetail/RequestedDocumentCopies element. Commercial Invoice support consists of maximum of 99 commodity line items. + + + + + Any comments that need to be communicated about this shipment. + + + + + Any freight charges that are associated with this shipment. + + + + + Any taxes or miscellaneous charges(other than Freight charges or Insurance charges) that are associated with this shipment. + + + + + Any packing costs that are associated with this shipment. + + + + + Any handling costs that are associated with this shipment. + + + + + Free-form text. + + + + + Free-form text. + + + + + Free-form text. + + + + + The reason for the shipment. Note: SOLD is not a valid purpose for a Proforma Invoice. + + + + + Customer assigned Invoice number + + + + + Name of the International Expert that completed the Commercial Invoice different from Sender. + + + + + Required for dutiable international Express or Ground shipment. This field is not applicable to an international PIB(document) or a non-document which does not require a Commercial Invoice + + + + + + + The instructions indicating how to print the Commercial Invoice( e.g. image type) Specifies characteristics of a shipping document to be produced. + + + + + + Specifies the usage and identification of a customer supplied image to be used on this document. + + + + + + + For international multiple piece shipments, commodity information must be passed in the Master and on each child transaction. If this shipment cotains more than four commodities line items, the four highest valued should be included in the first 4 occurances for this request. + + + + + Name of this commodity. + + + + + Total number of pieces of this commodity + + + + + Complete and accurate description of this commodity. + + 450 + + + + + + Country code where commodity contents were produced or manufactured in their final form. + + 2 + + + + + + Unique alpha/numeric representing commodity item. At least one occurrence is required for US Export shipments if the Customs Value is greater than $2500 or if a valid US Export license is required. + + 14 + + + + + + Total weight of this commodity. 1 explicit decimal position. Max length 11 including decimal. + + + + + Number of units of a commodity in total number of pieces for this line item. Max length is 9 + + + + + Unit of measure used to express the quantity of this commodity line item. + + 3 + + + + + + Contains only additional quantitative information other than weight and quantity to calculate duties and taxes. + + + + + Value of each unit in Quantity. Six explicit decimal positions, Max length 18 including decimal. + + + + + Total customs value for this line item. It should equal the commodity unit quantity times commodity unit value. Six explicit decimal positions, max length 18 including decimal. + + + + + Defines additional characteristic of commodity used to calculate duties and taxes + + + + + Applicable to US export shipping only. + + 12 + + + + + + Date of expiration. Must be at least 1 day into future. The date that the Commerce Export License expires. Export License commodities may not be exported from the U.S. on an expired license. Applicable to US Export shipping only. Required only if commodity is shipped on commerce export license, and Export License Number is supplied. + + + + + An identifying mark or number used on the packaging of a shipment to help customers identify a particular shipment. + + 15 + + + + + + All data required for this commodity in NAFTA Certificate of Origin. + + + + + + + + + The identifier for all clearance documents associated with this shipment. + + + + + + + + + + Identifies the branded location name, the hold at location phone number and the address of the location. + + + + + Identifies the type of FedEx location. + + + + + + + + + The package sequence number of this package in a multiple piece shipment. + + + + + The Tracking number and form id for this package. + + + + + Used with request containing PACKAGE_GROUPS, to identify which group of identical packages was used to produce a reply item. + + + + + Oversize class for this package. + + + + + All package-level rating data for this package, which may include data for multiple rate types. + + + + + + The label image or printer commands to print the label. + + + + + All package-level shipping documents (other than labels and barcodes). For use in loads after January, 2008. + + + + + Information about the COD return shipment. + + + + + Actual signature option applied, to allow for cases in which the original value conflicted with other service features in the shipment. + + + + + Documents the kinds and quantities of all hazardous commodities in the current package, using updated hazardous commodity description data. + + + + + + + + + Indicates whether or not this is a US Domestic shipment. + + + + + Indicates the carrier that will be used to deliver this shipment. + + + + + The master tracking number and form id of this multiple piece shipment. This information is to be provided for each subsequent of a multiple piece shipment. + + + + + Description of the FedEx service used for this shipment. Currently not supported. + + 70 + + + + + + Description of the packaging used for this shipment. Currently not supported. + + 40 + + + + + + + Only used with pending shipments. + + + + + Only used in the reply to tag requests. + + + + + Provides reply information specific to SmartPost shipments. + + + + + All shipment-level rating data for this shipment, which may include data for multiple rate types. + + + + + Information about the COD return shipment. + + + + + Returns the default holding location information when HOLD_AT_LOCATION special service is requested and the client does not specify the hold location address. + + + + + Indicates whether or not this shipment is eligible for a money back guarantee. + + + + + Returns any defaults or updates applied to RequestedShipment.exportDetail.exportComplianceStatement. + + + + + + All shipment-level shipping documents (other than labels and barcodes). + + + + + Package level details about this package. + + + + + + + Provides reply information specific to SmartPost shipments. + + + + + Identifies the carrier that will pick up the SmartPost shipment. + + + + + Indicates whether the shipment is deemed to be machineable, based on dimensions, weight, and packaging. + + + + + + + Provides reply information specific to a tag request. + + + + + . + + + + + As of June 2007, returned only for FedEx Express services. + + + + + As of June 2007, returned only for FedEx Express services. + + + + + As of June 2007, returned only for FedEx Express services. + + + + + As of June 2007, returned only for FedEx Express services. + + + + + FEDEX INTERNAL USE ONLY: for use by INET. + + + + + + + Defines additional data to print in the Configurable portion of the label, this allows you to print the same type information on the label that can also be printed on the doc tab. + + + + + 1 of 12 possible zones to position data. + + + + + The identifiying text for the data in this zone. + + + + + A reference to a field in either the request or reply to print in this zone following the header. + + + + + A literal value to print after the header in this zone. + + + + + + + The descriptive data for a point-of-contact person. + + + + + Client provided identifier corresponding to this contact information. + + + + + Identifies the contact person's name. + + + + + Identifies the contact person's title. + + + + + Identifies the company this contact is associated with. + + + + + Identifies the phone number associated with this contact. + + + + + Identifies the phone extension associated with this contact. + + + + + Identifies the pager number associated with this contact. + + + + + Identifies the fax number associated with this contact. + + + + + Identifies the email address associated with this contact. + + + + + + + + + + + + + Content Record. + + + + + Part Number. + + + + + Item Number. + + + + + Received Quantity. + + + + + Description. + + + + + + + Reply to the Close Request transaction. The Close Reply bring back the ASCII data buffer which will be used to print the Close Manifest. The Manifest is essential at the time of pickup. + + + + + Identifies the highest severity encountered when executing the request; in order from high to low: FAILURE, ERROR, WARNING, NOTE, SUCCESS. + + + + + The descriptive data detailing the status of a sumbitted transaction. + + + + + Descriptive data that governs data payload language/translations. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + The reply payload. All of the returned information about this shipment/package. + + + + + + + Create Pending Shipment Request + + + + + Descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + The descriptive data identifying the client submitting the transaction. + + + + + The descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + Descriptive data about the shipment being sent by the requestor. + + + + + + + Currency exchange rate information. + + + + + The currency code for the original (converted FROM) currency. + + + + + The currency code for the final (converted INTO) currency. + + + + + Multiplier used to convert fromCurrency units to intoCurrency units. + + + + + + + + + Indicates the type of custom delivery being requested. + + + + + Time by which delivery is requested. + + + + + Range of dates for custom delivery request; only used if type is BETWEEN. + + + + + Date for custom delivery request; only used for types of ON, BETWEEN, or AFTER. + + + + + + + + + + + + + + + Data required to produce a custom-specified document, either at shipment or package level. + + + + + Common information controlling document production. + + + + + Applicable only to documents produced on thermal printers with roll stock. + + + + + Applicable only to documents produced on thermal printers with roll stock. + + + + + Identifies the formatting specification used to construct this custom document. + + + + + Identifies the individual document specified by the client. + + + + + If provided, thermal documents will include specified doc tab content. If omitted, document will be produced without doc tab content. + + + + + + + Constructed string, based on format and zero or more data fields, printed in specified barcode symbology. + + + + + + + + + Width of thinnest bar/space element in the barcode. + + + + + + + + Solid (filled) rectangular area on label. + + + + + + + + + Valid values for CustomLabelCoordinateUnits + + + + + + + + + + + + + + + + + + Image to be included from printer's memory, or from a local file for offline clients. + + + + + + Printer-specific index of graphic image to be printed. + + + + + Fully-qualified path and file name for graphic image to be printed. + + + + + + + + + Horizontal position, relative to left edge of custom area. + + + + + Vertical position, relative to top edge of custom area. + + + + + + + Constructed string, based on format and zero or more data fields, printed in specified printer font (for thermal labels) or generic font/size (for plain paper labels). + + + + + + + + Printer-specific font name for use with thermal printer labels. + + + + + Generic font name for use with plain paper labels. + + + + + Generic font size for use with plain paper labels. + + + + + + + + + + + + + + + + + + + Reference information to be associated with this package. + + + + + The reference type to be associated with this reference data. + + + + + + + + The types of references available for use. + + + + + + + + + + + + + + + + Allows customer-specified control of label content. + + + + + If omitted, no doc tab will be produced (i.e. default = former NONE type). + + + + + Defines any custom content to print on the label. + + + + + Defines additional data to print in the Configurable portion of the label, this allows you to print the same type information on the label that can also be printed on the doc tab. + + + + + Controls which data/sections will be suppressed. + + + + + For customers producing their own Ground labels, this field specifies which secondary barcode will be printed on the label; so that the primary barcode produced by FedEx has the corect SCNC. + + + + + + Controls the number of additional copies of supplemental labels. + + + + + This value reduces the default quantity of destination/consignee air waybill labels. A value of zero indicates no change to default. A minimum of one copy will always be produced. + + + + + + + + + + Interacts both with properties of the shipment and contractual relationship with the shipper. + + + + + + Specifies how the recipient is identified for customs purposes; the requirements on this information vary with destination country. + + + + + + + + Identifies responsibilities with respect to loss, damage, etc. + + + + + Documents amount paid to third party for coverage of shipment content. + + + + + + + + + + + + + + + + + + The descriptive data required for a FedEx shipment containing dangerous goods (hazardous materials). + + + + + Identifies whether or not the products being shipped are required to be accessible during delivery. + + + + + Shipment is packaged/documented for movement ONLY on cargo aircraft. + + + + + Indicates which kinds of hazardous content are in the current package. + + + + + Documents the kinds and quantities of all hazardous commodities in the current package. + + + + + Description of the packaging of this commodity, suitable for use on OP-900 and OP-950 forms. + + + + + Telephone number to use for contact in the event of an emergency. + + + + + Offeror's name or contract number, per DOT regulation. + + + + + + + + + The beginning date in a date range. + + + + + The end date in a date range. + + + + + + + Valid values for DayofWeekType + + + + + + + + + + + + + + Descriptive data sent to FedEx by a customer in order to delete a package. + + + + + Descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + Descriptive data identifying the client submitting the transaction. + + + + + Descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + The timestamp of the shipment request. + + + + + Identifies the FedEx tracking number of the package being cancelled. + + + + + Determines the type of deletion to be performed in relation to package level vs shipment level. + + + + + + + + + Descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + Descriptive data identifying the client submitting the transaction. + + + + + Descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + Only used for tags which had FedEx Express services. + + + + + Only used for tags which had FedEx Express services. + + + + + If the original ProcessTagRequest specified third-party payment, then the delete request must contain the same pay type and payor account number for security purposes. + + + + + Also known as Pickup Confirmation Number or Dispatch Number + + + + + + + Specifies the type of deletion to be performed on a shipment. + + + + + + + + + + Data required to complete the Destionation Control Statement for US exports. + + + + + List of applicable Statment types. + + + + + Comma-separated list of up to four country codes, required for DEPARTMENT_OF_STATE statement. + + + + + Name of end user, required for DEPARTMENT_OF_STATE statement. + + + + + + + Used to indicate whether the Destination Control Statement is of type Department of Commerce, Department of State or both. + + + + + + + + + The dimensions of this package and the unit type used for the measurements. + + + + + + + + + + + + + The DocTabContentType options available. + + + + + The DocTabContentType should be set to ZONE001 to specify additional Zone details. + + + + + The DocTabContentType should be set to BARCODED to specify additional BarCoded details. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Zone number can be between 1 and 12. + + + + + Header value on this zone. + + + + + Reference path to the element in the request/reply whose value should be printed on this zone. + + + + + Free form-text to be printed in this zone. + + + + + Justification for the text printed on this zone. + + + + + + + Identifies the method by which the package is to be tendered to FedEx. This element does not dispatch a courier for package pickup. + + + + + + + + + + + + Describes specific information about the email label shipment. + + + + + Notification email will be sent to this email address + + + + + Message to be sent in the notification email + + + + + + + + + + + + + Information describing email notifications that will be sent in relation to events that occur during package movement + + + + + Specifies whether/how email notifications are grouped. + + + + + A message that will be included in the email notifications + + + + + Information describing the destination of the email, format of the email and events to be notified on + + + + + + + + + + + + + + + The format of the email + + + + + + + + + + The descriptive data for a FedEx email notification recipient. + + + + + Identifies the relationship this email recipient has to the shipment. + + + + + The email address to send the notification to + + + + + The types of email notifications being requested for this recipient. + + + + + The format of the email notification. + + + + + The language/locale to be used in this email notification. + + + + + + + Identifies the set of valid email notification recipient types. For SHIPPER, RECIPIENT and BROKER the email address asssociated with their definitions will be used, any email address sent with the email notification for these three email notification recipient types will be ignored. + + + + + + + + + + + + + + + + + + + + + Customer-declared value, with data type and legal values depending on excise condition, used in defining the taxable value of the item. + + + + + + + Specifies the types of Estimated Duties and Taxes to be included in a rate quotation for an international shipment. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Specifies the client-requested response in the event of errors within shipment. PACKAGE_ERROR_LABELS : Return per-package error label in addition to error Notifications. STANDARD : Return error Notifications only. + + + + + + + + + Electronic Trade document references used with the ETD special service. + + + + + Indicates the types of shipping documents produced for the shipper by FedEx (see ShippingDocumentSpecification) which should be copied back to the shipper in the shipment result data. + + + + + + + + Country specific details of an International shipment. + + + + + Specifies which filing option is being exercised by the customer. Required for non-document shipments originating in Canada destined for any country other than Canada, the United States, Puerto Rico or the U.S. Virgin Islands. + + + + + General field for exporting-country-specific export data (e.g. B13A for CA, FTSR Exemption or AES Citation for US). + + + + + This field is applicable only to Canada export non-document shipments of any value to any destination. No special characters allowed. + + 10 + + + + + + Department of Commerce/Department of State information about this shipment. + + + + + + + Details specific to an Express freight shipment. + + + + + Indicates whether or nor a packing list is enclosed. + + + + + Total shipment pieces. e.g. 3 boxes and 3 pallets of 100 pieces each = Shippers Load and Count of 303. Applicable to International Priority Freight and International Economy Freight. Values must be in the range of 1 - 99999 + + + + + Required for International Freight shipping. Values must be 8- 12 characters in length. + + 12 + + + + + + + + Identifies a kind of FedEx facility. + + + + + + + + + + + + + + + + Data required to produce the Freight handling-unit-level address labels. Note that the number of UNIQUE labels (the N as in 1 of N, 2 of N, etc.) is determined by total handling units. + + + + + + Indicates the number of copies to be produced for each unique label. + + + + + If omitted, no doc tab will be produced (i.e. default = former NONE type). + + + + + + + Individual charge which contributes to the total base charge for the shipment. + + + + + Freight class for this line item. + + + + + Effective freight class used for rating this line item. + + + + + NMFC Code for commodity. + + + + + Customer-provided description for this commodity or class line. + + + + + Weight for this commodity or class line. + + + + + Rate or factor applied to this line item. + + + + + Identifies the manner in which the chargeRate for this line item was applied. + + + + + The net or extended charge for this line item. + + + + + + + Specifies the way in which base charges for a Freight shipment or shipment leg are calculated. + + + + + + + + + + + + + + + + + These values represent the industry-standard freight classes used for FedEx Freight and FedEx National Freight shipment description. (Note: The alphabetic prefixes are required to distinguish these values from decimal numbers on some client platforms.) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Date for all Freight guarantee types. + + + + + + + + + + + + + Identifies responsibilities with respect to loss, damage, etc. + + + + + + + + + Rate data specific to FedEx Freight or FedEx National Freight services. + + + + + A unique identifier for a specific rate quotation. + + + + + Specifies how total base charge is determined. + + + + + Freight charges which accumulate to the total base charge for the shipment. + + + + + Human-readable descriptions of additional information on this shipment rating. + + + + + + + Additional non-monetary data returned with Freight rates. + + + + + Unique identifier for notation. + + + + + Human-readable explanation of notation. + + + + + + + Data applicable to shipments using FEDEX_FREIGHT and FEDEX_NATIONAL_FREIGHT services. + + + + + Account number used with FEDEX_FREIGHT service. + + + + + Used for validating FedEx Freight account number and (optionally) identifying third party payment on the bill of lading. + + + + + Identification values to be printed during creation of a Freight bill of lading. + + + + + Indicates the role of the party submitting the transaction. + + + + + Designates which of the requester's tariffs will be used for rating. + + + + + Designates the terms of the "collect" payment for a Freight Shipment. + + + + + Identifies the declared value for the shipment + + + + + Identifies the declared value units corresponding to the above defined declared value + + + + + + Identifiers for promotional discounts offered to customers. + + + + + Total number of individual handling units in the entire shipment (for unit pricing). + + + + + Estimated discount rate provided by client for unsecured rate quote. + + + + + Total weight of pallets used in shipment. + + + + + Overall shipment dimensions. + + + + + Description for the shipment. + + + + + Specifies which party will pay surcharges for any special services which support split billing. + + + + + Must be populated if any line items contain hazardous materials. + + + + + Details of the commodities in the shipment. + + + + + + + Description of an individual commodity or class of content in a shipment. + + + + + Freight class for this line item. + + + + + FEDEX INTERNAL USE ONLY: for FedEx system that estimate freight class from customer-provided dimensions and weight. + + + + + Number of individual handling units to which this line applies. (NOTE: Total of line-item-level handling units may not balance to shipment-level total handling units.) + + + + + Specification of handling-unit packaging for this commodity or class line. + + + + + Number of pieces for this commodity or class line. + + + + + NMFC Code for commodity. + + + + + Indicates the kind of hazardous material content in this line item. + + + + + For printed reference per line item. + + + + + For printed reference per line item. + + + + + Customer-provided description for this commodity or class line. + + + + + Weight for this commodity or class line. + + + + + FED EX INTERNAL USE ONLY - Individual line item dimensions. + + + + + Volume (cubic measure) for this commodity or class line. + + + + + + + Indicates the role of the party submitting the transaction. + + + + + + + + + + Specifies which party will be responsible for payment of any surcharges for Freight special services for which split billing is allowed. + + + + + Identifies the special service. + + + + + Indicates who will pay for the special service. + + + + + + + Data required to produce a General Agency Agreement document. Remaining content (business data) to be defined once requirements have been completed. + + + + + + + + Represents features of FedEx Ground delivery for which the shipment is eligible. + + + + + + + + + + + Documents the kind and quantity of an individual hazardous commodity in a package. + + + + + Identifies and describes an individual hazardous commodity. + + + + + Specifies the amount of the commodity in alternate units. + + + + + Customer-provided specifications for handling individual commodities. + + + + + + + Identifies and describes an individual hazardous commodity. For 201001 load, this is based on data from the FedEx Ground Hazardous Materials Shipping Guide. + + + + + Regulatory identifier for a commodity (e.g. "UN ID" value). + + + + + + + + + + + + + Specifies how the commodity is to be labeled. + + + + + + + + + + Customer-provided specifications for handling individual commodities. + + + + + Specifies how the customer wishes the label text to be handled for this commodity in this package. + + + + + Text used in labeling the commodity under control of the labelTextOption field. + + + + + + + Indicates which kind of hazardous content (as defined by DOT) is being reported. + + + + + + + + + + + + Identifies number and type of packaging units for hazardous commodities. + + + + + Number of units of the type below. + + + + + Units in which the hazardous commodity is packaged. + + + + + + + Identifies DOT packing group for a hazardous commodity. + + + + + + + + + + Identifies amount and units for quantity of hazardous commodities. + + + + + Number of units of the type below. + + + + + Units by which the hazardous commodity is measured. + + + + + + + Descriptive data required for a FedEx shipment that is to be held at the destination FedEx location for pickup by the recipient. + + + + + Contact phone number for recipient of shipment. + + + + + Contact and address of FedEx facility at which shipment is to be held. + + + + + Type of facility at which package/shipment is to be held. + + + + + + + The descriptive data required by FedEx for home delivery services. + + + + + The type of Home Delivery Premium service being requested. + + + + + Required for Date Certain Home Delivery. + + + + + Required for Date Certain and Appointment Home Delivery. + + 15 + + + + + + + + The type of Home Delivery Premium service being requested. + + + + + + + + + + + + + + + + + + + The type of International shipment. + + + + + + + + + + Specifies the type of label to be returned. + + + + + + + + + + + Names for data elements / areas which may be suppressed from printing on labels. + + + + + + + + + + + + This indicates if the top or bottom of the label comes out of the printer first. + + + + + + + + + Relative to normal orientation for the printer. + + + + + + + + + + + Description of shipping label to be returned in the reply + + + + + Specifies how to create, organize, and return the document. + + + + + Specify type of label to be returned + + + + + Specifies the image format used for a shipping document. + + + + + For thermal printer lables this indicates the size of the label and the location of the doc tab if present. + + + + + This indicates if the top or bottom of the label comes out of the printer first. + + + + + If present, this contact and address information will replace the return address information on the label. + + + + + Allows customer-specified control of label content. + + + + + + + For thermal printer labels this indicates the size of the label and the location of the doc tab if present. + + + + + + + + + + + + + + + + + + + + + + + Identifies the Liability Coverage Amount. For Jan 2010 this value represents coverage amount per pound + + + + + + + + + + + + + Represents a one-dimensional measurement in small units (e.g. suitable for measuring a package or document), contrasted with Distance, which represents a large one-dimensional measurement (e.g. distance between cities). + + + + + The numerical quantity of this measurement. + + + + + The units for this measurement. + + + + + + + CM = centimeters, IN = inches + + + + + + + + + Identifies the representation of human-readable text. + + + + + Two-letter code for language (e.g. EN, FR, etc.) + + + + + Two-letter code for the region (e.g. us, ca, etc..). + + + + + + + + + + + + + Identifies which type minimum charge was applied. + + + + + + + + + + + + The descriptive data for the medium of exchange for FedEx services. + + + + + Identifies the currency of the monetary amount. + + 3 + + + + + + Identifies the monetary amount. + + + + + + + Data required to produce a Certificate of Origin document. Remaining content (business data) to be defined once requirements have been completed. + + + + + + + Indicates which Party (if any) from the shipment is to be used as the source of importer data on the NAFTA COO form. + + + + + Contact information for "Authorized Signature" area of form. + + + + + + + + + + This element is currently not supported and is for the future use. + + + + + Defined by NAFTA regulations. + + + + + Defined by NAFTA regulations. + + + + + Identification of which producer is associated with this commodity (if multiple producers are used in a single shipment). + + + + + + Date range over which RVC net cost was calculated. + + + + + + + + + + + + + + + Net cost method used. + + + + + + + + + See instructions for NAFTA Certificate of Origin for code definitions. + + + + + + + + + + + + + This element is currently not supported and is for the future use. + + + + + + + + + See instructions for NAFTA Certificate of Origin for code definitions. + + + + + + + + + + + This element is currently not supported and is for the future use. + + + + + + + + + + + + The descriptive data regarding the result of the submitted transaction. + + + + + The severity of this notification. This can indicate success or failure or some other information about the request. The values that can be returned are SUCCESS - Your transaction succeeded with no other applicable information. NOTE - Additional information that may be of interest to you about your transaction. WARNING - Additional information that you need to know about your transaction that you may need to take action on. ERROR - Information about an error that occurred while processing your transaction. FAILURE - FedEx was unable to process your transaction at this time due to a system failure. Please try again later + + + + + Indicates the source of this notification. Combined with the Code it uniquely identifies this notification + + + + + A code that represents this notification. Combined with the Source it uniquely identifies this notification. + + + + + Human-readable text that explains this notification. + + + + + The translated message. The language and locale specified in the ClientDetail. Localization are used to determine the representation. Currently only supported in a TrackReply. + + + + + A collection of name/value pairs that provide specific data to help the client determine the nature of an error (or warning, etc.) witout having to parse the message string. + + + + + + + + + Identifies the type of data contained in Value (e.g. SERVICE_TYPE, PACKAGE_SEQUENCE, etc..). + + + + + The value of the parameter (e.g. PRIORITY_OVERNIGHT, 2, etc..). + + + + + + + Identifies the set of severity values for a Notification. + + + + + + + + + + + + The instructions indicating how to print the OP-900 form for hazardous materials packages. + + + + + Specifies characteristics of a shipping document to be produced. + + + + + Identifies which reference type (from the package's customer references) is to be used as the source for the reference on this OP-900. + + + + + Specifies the usage and identification of customer supplied images to be used on this document. + + + + + Data field to be used when a name is to be printed in the document instead of (or in addition to) a signature image. + + + + + + + + + Position of operational instruction element. + + + + + Content corresponding to the operational instruction. + + + + + + + The oversize class types. + + + + + + + + + + Each instance of this data type represents the set of barcodes (of all types) which are associated with a specific package. + + + + + Binary-style barcodes for this package. + + + + + String-style barcodes for this package. + + + + + + + Package-level data required for labeling and/or movement. + + + + + Human-readable text for pre-January 2011 clients. + + + + + Human-readable content for use on a label. + + + + + The operational barcodes pertaining to the current package. + + + + + The FedEx internal code that represents the service and/or features of service for the current package moving under a FedEx Ground service. + + + + + + + Data for a package's rates, as calculated per a specific rate type. + + + + + Type used for this specific set of rate data. + + + + + Indicates which weight was used. + + + + + INTERNAL FEDEX USE ONLY. + + + + + The weight that was used to calculate the rate. + + + + + The dimensional weight of this package (if greater than actual). + + + + + The oversize weight of this package (if the package is oversize). + + + + + The transportation charge only (prior to any discounts applied) for this package. + + + + + The sum of all discounts on this package. + + + + + This package's baseCharge - totalFreightDiscounts. + + + + + The sum of all surcharges on this package. + + + + + This package's netFreight + totalSurcharges (not including totalTaxes). + + + + + The sum of all taxes on this package. + + + + + This package's netFreight + totalSurcharges + totalTaxes. + + + + + The total sum of all rebates applied to this package. + + + + + All rate discounts that apply to this package. + + + + + All rebates that apply to this package. + + + + + All surcharges that apply to this package (either because of characteristics of the package itself, or because it is carrying per-shipment surcharges for the shipment of which it is a part). + + + + + All taxes applicable (or distributed to) this package. + + + + + The variable handling charges calculated based on the type variable handling charges requested. + + + + + + + This class groups together for a single package all package-level rate data (across all rate types) as part of the response to a shipping request, which groups shipment-level data together and groups package-level data by package. + + + + + This rate type identifies which entry in the following array is considered as presenting the "actual" rates for the package. + + + + + The "list" net charge minus "actual" net charge. + + + + + Each element of this field provides package-level rate data for a specific rate type. + + + + + + + Identifies the collection of special service offered by FedEx. BROKER_SELECT_OPTION should be used for Ground shipments only. + + + + + + + + + + + + + + + These special services are available at the package level for some or all service types. If the shipper is requesting a special service which requires additional data, the package special service type must be present in the specialServiceTypes collection, and the supporting detail must be provided in the appropriate sub-object below. + + + + + The types of all special services requested for the enclosing shipment or package. + + + + + For use with FedEx Ground services only; COD must be present in shipment's special services. + + + + + Descriptive data required for a FedEx shipment containing dangerous materials. This element is required when SpecialServiceType.DANGEROUS_GOODS or HAZARDOUS_MATERIAL is present in the SpecialServiceTypes collection. + + + + + Descriptive data required for a FedEx shipment containing dry ice. This element is required when SpecialServiceType.DRY_ICE is present in the SpecialServiceTypes collection. + + + + + The descriptive data required for FedEx signature services. This element is required when SpecialServiceType.SIGNATURE_OPTION is present in the SpecialServiceTypes collection. + + + + + The descriptive data required for FedEx Priority Alert service. This element is required when SpecialServiceType.PRIORITY_ALERT is present in the SpecialServiceTypes collection. + + + + + + + Identifies the collection of available FedEx or customer packaging options. + + + + + + + + + + + + + + The descriptive data for a person or company entitiy doing business with FedEx. + + + + + Identifies the FedEx account number assigned to the customer. + + 12 + + + + + + + Descriptive data identifying the point-of-contact person. + + + + + The descriptive data for a physical location. + + + + + + + The descriptive data for the monetary compensation given to FedEx for services rendered to the customer. + + + + + Identifies the method of payment for a service. See PaymentType for list of valid enumerated values. + + + + + Descriptive data identifying the party responsible for payment for a service. + + + + + + + Identifies the method of payment for a service. + + + + + + + + + + + + The descriptive data identifying the party responsible for payment for a service. + + + + + Identifies the FedEx account number assigned to the payor. + + 12 + + + + + + Identifies the country of the payor. + + 2 + + + + + + + + This information describes how and when a pending shipment may be accessed for completion. + + + + + Only for pending shipment type of "EMAIL" + + + + + Only for pending shipment type of "EMAIL" + + + + + Only for pending shipment type of "EMAIL" + + + + + This element is currently not supported and is for the future use. + + + + + + + This information describes the kind of pending shipment being requested. + + + + + Identifies the type of FedEx pending shipment + + + + + Date after which the pending shipment will no longer be available for completion. + + + + + Only used with type of EMAIL. + + + + + + + Identifies the type of service for a pending shipment. + + + + + + + + This enumeration rationalizes the former FedEx Express international "admissibility package" types (based on ANSI X.12) and the FedEx Freight packaging types. The values represented are those common to both carriers. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This class describes the pickup characteristics of a shipment (e.g. for use in a tag request). + + + + + + + + Identifies the type of Pickup request + + + + + Identifies the type of source for Pickup request + + + + + + + Identifies the type of source for pickup request service. + + + + + + + + + Identifies the type of pickup request service. + + + + + + + + + Identifies the type of pricing used for this shipment. + + + + + + + + + + + + + + + + + + + + Represents a reference identifier printed on Freight bills of lading + + + + + + + + + Identifies a particular reference identifier printed on a Freight bill of lading. + + + + + + + + + + + + + + + + This indicates the highest level of severity of all the notifications returned in this reply + + + + + The descriptive data regarding the results of the submitted transaction. + + + + + Descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + The reply payload. All of the returned information about this shipment/package. + + + + + Empty unless error label behavior is PACKAGE_ERROR_LABELS and one or more errors occured during transaction processing. + + + + + + + Descriptive data sent to FedEx by a customer in order to ship a package. + + + + + Descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + Descriptive data identifying the client submitting the transaction. + + + + + Descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + Descriptive data about the shipment being sent by the requestor. + + + + + + + + + + + + + + + + Descriptive data sent to FedEx by a customer in order to ship a package. + + + + + Descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + Descriptive data identifying the client submitting the transaction. + + + + + Descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + Descriptive data about the shipment being sent by the requestor. + + + + + + + Test for the Commercial Invoice. Note that Sold is not a valid Purpose for a Proforma Invoice. + + + + + + + + + + + + + Indicates the reason that a dim divisor value was chose. + + + + + + + + + + + + Identifies a discount applied to the shipment. + + + + + Identifies the type of discount applied to the shipment. + + + + + + The amount of the discount applied to the shipment. + + + + + The percentage of the discount applied to the shipment. + + + + + + + The type of the discount. + + + + + + + + + + + + + Selects the value from a set of rate data to which the percentage is applied. + + + + + + + + + + + Identifies the type(s) of rates to be returned in the reply. + + + + + + + + + + Select the type of rate from which the element is to be selected. + + + + + + + + + The weight method used to calculate the rate. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Specifies how the recipient is identified for customs purposes; the requirements on this information vary with destination country. + + + + + Specifies the kind of identification being used. + + + + + Contains the actual ID value, of the type specified above. + + + + + + + Type of Brazilian taxpayer identifier provided in Recipient/TaxPayerIdentification/Number. For shipments bound for Brazil this overrides the value in Recipient/TaxPayerIdentification/TinType + + + + + + + + + + FOOD_OR_PERISHABLE is required by FDA/BTA; must be true for food/perishable items coming to US or PR from non-US/non-PR origin + + + + + + + + + + This class rationalizes RequestedPackage and RequestedPackageSummary from previous interfaces. The way in which it is uses within a RequestedShipment depends on the RequestedPackageDetailType value specified for that shipment. + + + + + Used only with INDIVIDUAL_PACKAGE, as a unique identifier of each requested package. + + + + + Used only with PACKAGE_GROUPS, as a unique identifier of each group of identical packages. + + + + + Used only with PACKAGE_GROUPS, as a count of packages within a group of identical packages. + + + + + + Used for INDIVIDUAL_PACKAGES, PACKAGE_GROUPS and PACKAGE_SUMMARY. + + + + + Used for INDIVIDUAL_PACKAGES, PACKAGE_GROUPS and PACKAGE_SUMMARY. + + + + + + Provides additional detail on how the customer has physically packaged this item. As of June 2009, required for packages moving under international and SmartPost services. + + + + + Human-readable text describing the package. + + + + + + + Only used for INDIVIDUAL_PACKAGES and PACKAGE_GROUPS. + + + + + + + The descriptive data for the shipment being tendered to FedEx. + + + + + Identifies the date and time the package is tendered to FedEx. Both the date and time portions of the string are expected to be used. The date should not be a past date or a date more than 10 days in the future. The time is the local time of the shipment based on the shipper's time zone. The date component must be in the format: YYYY-MM-DD (e.g. 2006-06-26). The time component must be in the format: HH:MM:SS using a 24 hour clock (e.g. 11:00 a.m. is 11:00:00, whereas 5:00 p.m. is 17:00:00). The date and time parts are separated by the letter T (e.g. 2006-06-26T17:00:00). There is also a UTC offset component indicating the number of hours/mainutes from UTC (e.g 2006-06-26T17:00:00-0400 is defined form June 26, 2006 5:00 pm Eastern Time). + + + + + Identifies the method by which the package is to be tendered to FedEx. This element does not dispatch a courier for package pickup. See DropoffType for list of valid enumerated values. + + + + + Identifies the FedEx service to use in shipping the package. See ServiceType for list of valid enumerated values. + + + + + Identifies the packaging used by the requestor for the package. See PackagingType for list of valid enumerated values. + + + + + Identifies the total weight of the shipment being conveyed to FedEx.This is only applicable to International shipments and should only be used on the first package of a mutiple piece shipment.This value contains 1 explicit decimal position + + + + + Total insured amount. + + + + + This attribute indicates the currency the caller requests to have used in all returned monetary values (when a choice is possible). + + + + + Descriptive data identifying the party responsible for shipping the package. Shipper and Origin should have the same address. + + + + + Descriptive data identifying the party receiving the package. + + + + + A unique identifier for a recipient location + + 10 + + + + + + Physical starting address for the shipment, if different from shipper's address. + + + + + Descriptive data indicating the method and means of payment to FedEx for providing shipping services. + + + + + Descriptive data regarding special services requested by the shipper for this shipment. If the shipper is requesting a special service which requires additional data (e.g. COD), the special service type must be present in the specialServiceTypes collection, and the supporting detail must be provided in the appropriate sub-object. For example, to request COD, "COD" must be included in the SpecialServiceTypes collection and the CodDetail object must contain the required data. + + + + + Details specific to an Express freight shipment. + + + + + Data applicable to shipments using FEDEX_FREIGHT and FEDEX_NATIONAL_FREIGHT services. + + + + + Used with Ground Home Delivery and Freight. + + + + + Details about how to calculate variable handling charges at the shipment level. + + + + + Customs clearance data, used for both international and intra-country shipping. + + + + + For use in "process tag" transaction. + + + + + + If true, only the shipper/payor will have visibility of this shipment. + + + + + Specifies the client-requested response in the event of errors within shipment. + + + + + Details about the image format and printer type the label is to returned in. + + + + + Contains data used to create additional (non-label) shipping documents. + + + + + Specifies whether and what kind of rates the customer wishes to have quoted on this shipment. The reply will also be constrained by other data on the shipment and customer. + + + + + Specifies whether the customer wishes to have Estimated Duties and Taxes provided with the rate quotation on this shipment. Only applies with shipments moving under international services. + + + + + Only used with multiple-transaction shipments. + + + + + Only used with multi-piece COD shipments sent in multiple transactions. Required on last transaction only. + + + + + The total number of packages in the entire shipment (even when the shipment spans multiple transactions.) + + + + + One or more package-attribute descriptions, each of which describes an individual package, a group of identical packages, or (for the total-piece-total-weight case) common characteristics all packages in the shipment. + + + + + + + + + + + + + + + + + + + + + + + These values are used to control the availability of certain special services at the time when a customer uses the e-mail label link to create a return shipment. + + + + + + + + + Return Email Details + + + + + Phone number of the merchant + + + + + Identifies the allowed (merchant-authorized) special services which may be selected when the subsequent shipment is created. Only services represented in EMailLabelAllowedSpecialServiceType will be controlled by this list. + + + + + + + Information relating to a return shipment. + + + + + The type of return shipment that is being requested. + + + + + Return Merchant Authorization + + + + + Describes specific information about the email label for return shipment. + + + + + + + The type of return shipment that is being requested. + + + + + + + + + + The "PAYOR..." rates are expressed in the currency identified in the payor's rate table(s). The "RATED..." rates are expressed in the currency of the origin country. Former "...COUNTER..." values have become "...RETAIL..." values, except for PAYOR_COUNTER and RATED_COUNTER, which have been removed. + + + + + + + + + + + + + + + + Shipping document type. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Return Merchant Authorization + + + + + The RMA number. + + 20 + + + + + + The reason for the return. + + 60 + + + + + + + + + + + + + + + + Identifies the collection of available FedEx service options. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Shipment-level totals of dry ice data across all packages. + + + + + Total number of packages in the shipment that contain dry ice. + + + + + Total shipment dry ice weight for all packages. + + + + + + + Data for a single leg of a shipment's total/summary rates, as calculated per a specific rate type. + + + + + Human-readable text describing the shipment leg. + + + + + Origin for this leg. + + + + + Destination for this leg. + + + + + Type used for this specific set of rate data. + + + + + Indicates the rate scale used. + + + + + Indicates the rate zone used (based on origin and destination). + + + + + + Indicates which weight was used. + + + + + INTERNAL FEDEX USE ONLY. + + + + + Specifies the currency exchange performed on financial amounts for this rate. + + + + + Indicates which special rating cases applied to this shipment. + + + + + + Identifies the type of dim divisor that was applied. + + + + + + + Sum of dimensional weights for all packages. + + + + + + + + + This shipment's totalNetFreight + totalSurcharges (not including totalTaxes). + + + + + Total of the transportation-based taxes. + + + + + + + Total of all values under this shipment's dutiesAndTaxes; only provided if estimated duties and taxes were calculated for this shipment. + + + + + This shipment's totalNetCharge + totalDutiesAndTaxes; only provided if estimated duties and taxes were calculated for this shipment AND duties, taxes and transportation charges are all paid by the same sender's account. + + + + + Rate data specific to FedEx Freight and FedEx National Freight services. + + + + + All rate discounts that apply to this shipment. + + + + + All rebates that apply to this shipment. + + + + + All surcharges that apply to this shipment. + + + + + All transportation-based taxes applicable to this shipment. + + + + + All commodity-based duties and taxes applicable to this shipment. + + + + + The "order level" variable handling charges. + + + + + The total of all variable handling charges at both shipment (order) and package level. + + + + + + + + + + + + + + + + + This is the state of the destination location ID, and is not necessarily the same as the postal state. + + + + + Expected/estimated date of delivery. + + + + + Expected/estimated day of week of delivery. + + + + + Delivery time, as published in Service Guide. + + + + + Committed date of delivery. + + + + + Committed day of week of delivery. + + + + + Standard transit time per origin, destination, and service. + + + + + Maximum expected transit time + + + + + Transit time based on customer eligibility. + + + + + Indicates that this shipment is not eligible for money back guarantee. + + + + + FedEx Ground delivery features for which this shipment may be eligible. + + + + + Text describing planned delivery. + + + + + + + + + + + + + Data for a shipment's total/summary rates, as calculated per a specific rate type. The "total..." fields may differ from the sum of corresponding package data for Multiweight or Express MPS. + + + + + Type used for this specific set of rate data. + + + + + Indicates the rate scale used. + + + + + Indicates the rate zone used (based on origin and destination). + + + + + Identifies the type of pricing used for this shipment. + + + + + Indicates which weight was used. + + + + + INTERNAL FEDEX USE ONLY. + + + + + Specifies the currency exchange performed on financial amounts for this rate. + + + + + Indicates which special rating cases applied to this shipment. + + + + + The value used to calculate the weight based on the dimensions. + + + + + Identifies the type of dim divisor that was applied. + + + + + Specifies a fuel surcharge percentage. + + + + + The weight used to calculate these rates. + + + + + Sum of dimensional weights for all packages. + + + + + The total freight charge that was calculated for this package before surcharges, discounts and taxes. + + + + + The total discounts used in the rate calculation. + + + + + The freight charge minus discounts. + + + + + The total amount of all surcharges applied to this shipment. + + + + + This shipment's totalNetFreight + totalSurcharges (not including totalTaxes). + + + + + Total of the transportation-based taxes. + + + + + The net charge after applying all discounts and surcharges. + + + + + The total sum of all rebates applied to this shipment. + + + + + Total of all values under this shipment's dutiesAndTaxes; only provided if estimated duties and taxes were calculated for this shipment. + + + + + This shipment's totalNetCharge + totalDutiesAndTaxes; only provided if estimated duties and taxes were calculated for this shipment AND duties, taxes and transportation charges are all paid by the same sender's account. + + + + + Identifies the Rate Details per each leg in a Freight Shipment + + + + + Rate data specific to FedEx Freight and FedEx National Freight services. + + + + + All rate discounts that apply to this shipment. + + + + + All rebates that apply to this shipment. + + + + + All surcharges that apply to this shipment. + + + + + All transportation-based taxes applicable to this shipment. + + + + + All commodity-based duties and taxes applicable to this shipment. + + + + + The "order level" variable handling charges. + + + + + The total of all variable handling charges at both shipment (order) and package level. + + + + + + + This class groups together all shipment-level rate data (across all rate types) as part of the response to a shipping request, which groups shipment-level data together and groups package-level data by package. + + + + + This rate type identifies which entry in the following array is considered as presenting the "actual" rates for the shipment. + + + + + The "list" total net charge minus "actual" total net charge. + + + + + Each element of this field provides shipment-level rate totals for a specific rate type. + + + + + + + + + This indicates the highest level of severity of all the notifications returned in this reply + + + + + The descriptive data regarding the results of the submitted transaction. + + + + + Descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + + + Identifies the collection of special service offered by FedEx. BROKER_SELECT_OPTION should be used for Express shipments only. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + These special services are available at the shipment level for some or all service types. If the shipper is requesting a special service which requires additional data (such as the COD amount), the shipment special service type must be present in the specialServiceTypes collection, and the supporting detail must be provided in the appropriate sub-object below. + + + + + The types of all special services requested for the enclosing shipment (or other shipment-level transaction). + + + + + Descriptive data required for a FedEx COD (Collect-On-Delivery) shipment. This element is required when SpecialServiceType.COD is present in the SpecialServiceTypes collection. + + + + + Descriptive data required for a FedEx shipment that is to be held at the destination FedEx location for pickup by the recipient. This element is required when SpecialServiceType.HOLD_AT_LOCATION is present in the SpecialServiceTypes collection. + + + + + Descriptive data required for FedEx to provide email notification to the customer regarding the shipment. This element is required when SpecialServiceType.EMAIL_NOTIFICATION is present in the SpecialServiceTypes collection. + + + + + The descriptive data required for FedEx Printed Return Label. This element is required when SpecialServiceType.PRINTED_RETURN_LABEL is present in the SpecialServiceTypes collection + + + + + This field should be populated for pending shipments (e.g. e-mail label) It is required by a PENDING_SHIPMENT special service type. + + + + + Number of packages in this shipment which contain dry ice and the total weight of the dry ice for this shipment. + + + + + The descriptive data required for FedEx Home Delivery options. This element is required when SpecialServiceType.HOME_DELIVERY_PREMIUM is present in the SpecialServiceTypes collection + + + + + + Electronic Trade document references. + + + + + Specification for date or range of dates on which delivery is to be attempted. + + + + + + + All package-level shipping documents (other than labels and barcodes). + + + + + Shipping Document Type + + + + + Specifies how this document image/file is organized. + + + + + + The name under which a STORED or DEFERRED document is written. + + + + + Specifies the image resolution in DPI (dots per inch). + + + + + Can be zero for documents whose disposition implies that no content is included. + + + + + One or more document parts which make up a single logical document, such as multiple pages of a single form. + + + + + + + Each occurrence of this class specifies a particular way in which a kind of shipping document is to be produced and provided. + + + + + Values in this field specify how to create and return the document. + + + + + Specifies how to organize all documents of this type. + + + + + Specifies how to e-mail document images. + + + + + Specifies how a queued document is to be printed. + + + + + + + Specifies how to return a shipping document to the caller. + + + + + + + + + + + + + + Specifies how to e-mail shipping documents. + + + + + Provides the roles and email addresses for e-mail recipients. + + + + + Identifies the convention by which documents are to be grouped as e-mail attachments. + + + + + + + + + + + + + Specifies an individual recipient of e-mailed shipping document(s). + + + + + Identifies the relationship of this recipient in the shipment. + + + + + Address to which the document is to be sent. + + + + + + + Specifies characteristics of a shipping document to be produced. + + + + + Specifies how to create, organize, and return the document. + + + + + Specifies how far down the page to move the beginning of the image; allows for printing on letterhead and other pre-printed stock. + + + + + + + For those shipping document types which have both a "form" and "instructions" component (e.g. NAFTA Certificate of Origin and General Agency Agreement), this field indicates whether to provide the instructions. + + + + + Governs the language to be used for this individual document, independently from other content returned for the same shipment. + + + + + Identifies the individual document specified by the client. + + + + + + + Specifies how to organize all shipping documents of the same type. + + + + + + + + + Specifies the image format used for a shipping document. + + + + + + + + + + + + + + + A single part of a shipping document, such as one page of a multiple-page document whose format requires a separate image per page. + + + + + The one-origin position of this part within a document. + + + + + Graphic or printer commands for this image within a document. + + + + + + + Specifies printing options for a shipping document. + + + + + Provides environment-specific printer identification. + + + + + + + Contains all data required for additional (non-label) shipping documents to be produced in conjunction with a specific shipment. + + + + + Indicates the types of shipping documents requested by the shipper. + + + + + + + Specifies the production of each package-level custom document (the same specification is used for all packages). + + + + + Specifies the production of a shipment-level custom document. + + + + + This element is currently not supported and is for the future use. (Details pertaining to the GAA.) + + + + + + Specifies the production of the OP-900 document for hazardous materials packages. + + + + + Specifies the production of the OP-900 document for hazardous materials. + + + + + + + Specifies the type of paper (stock) on which a document will be printed. + + + + + + + + + + + + + + + + + + The descriptive data required for FedEx delivery signature services. + + + + + Identifies the delivery signature services option selected by the customer for this shipment. See OptionType for the list of valid values. + + + + + Identifies the delivery signature release authorization number. + + 10 + + + + + + + + Identifies the delivery signature services options offered by FedEx. + + + + + + + + + + + + These values are mutually exclusive; at most one of them can be attached to a SmartPost shipment. + + + + + + + + + + + + + + + + + + + + + Data required for shipments handled under the SMART_POST and GROUND_SMART_POST service types. + + + + + + + + The CustomerManifestId is used to group Smart Post packages onto a manifest for each trailer that is being prepared. If you do not have multiple trailers this field can be omitted. If you have multiple trailers, you must assign the same Manifest Id to each SmartPost package as determined by its trailer. In other words, all packages on a trailer must have the same Customer Manifest Id. The manifest Id must be unique to your account number for a minimum of 6 months and cannot exceed 8 characters in length. We recommend you use the day of year + the trailer id (this could simply be a sequential number for that trailer). So if you had 3 trailers that you started loading on Feb 10 the 3 manifest ids would be 041001, 041002, 041003 (in this case we used leading zeros on the trailer numbers). + + + + + + + Special circumstance rating used for this shipment. + + + + + + + + + Each instance of this data type represents a barcode whose content must be represented as ASCII text (i.e. not binary data). + + + + + The kind of barcode data in this instance. + + + + + The data content of this instance. + + + + + + + + + + + + + + + + + Identifies each surcharge applied to the shipment. + + + + + The type of surcharge applied to the shipment. + + + + + + + The amount of the surcharge applied to the shipment. + + + + + + + + + + + + + The type of the surcharge. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Identifies each tax applied to the shipment. + + + + + The type of tax applied to the shipment. + + + + + + The amount of the tax applied to the shipment. + + + + + + + The type of the tax. + + + + + + + + + + + + + + The descriptive data for taxpayer identification information. + + + + + Identifies the category of the taxpayer identification number. See TinType for the list of values. + + + + + Identifies the taxpayer identification number. + + 15 + + + + + + Identifies the usage of Tax Identification Number in Shipment processing + + + + + + + Required for dutiable international express or ground shipment. This field is not applicable to an international PIB (document) or a non-document which does not require a commercial invoice express shipment. CFR_OR_CPT (Cost and Freight/Carriage Paid TO) CIF_OR_CIP (Cost Insurance and Freight/Carraige Insurance Paid) DDP (Delivered Duty Paid) DDU (Delivered Duty Unpaid) EXW (Ex Works) FOB_OR_FCA (Free On Board/Free Carrier) + + + + + + + + + + + + + Identifies the category of the taxpayer identification number. + + + + + + + + + + + + + + + + For use with SmartPost tracking IDs only + + + + + + + + TrackingIdType + + + + + + + + + + + + Descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Free form text to be echoed back in the reply. Used to match requests and replies. + + + + + Governs data payload language/translations (contrasted with ClientDetail.localization, which governs Notification.localizedMessage language selection). + + + + + + + Identifies the set of valid shipment transit time values. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Descriptive data sent to FedEx by a customer in order to validate a shipment. + + + + + Descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + Descriptive data identifying the client submitting the transaction. + + + + + Descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + Descriptive data about the shipment being sent by the requestor. + + + + + + + Documents the kind and quantity of an individual hazardous commodity in a package. + + + + + Identifies and describes an individual hazardous commodity. + + + + + Specifies the amount of the commodity in alternate units. + + + + + Customer-provided specifications for handling individual commodities. + + + + + + + Identifies and describes an individual hazardous commodity. For 201001 load, this is based on data from the FedEx Ground Hazardous Materials Shipping Guide. + + + + + Regulatory identifier for a commodity (e.g. "UN ID" value). + + + + + + + Fully-expanded descriptive text for a hazardous commodity. + + + + + + + + Coded indications for special requirements or constraints. + + + + + + + + Details about how to calculate variable handling charges at the shipment level. + + + + + Used with Variable handling charge type of FIXED_VALUE. Contains the amount to be added to the freight charge. Contains 2 explicit decimal positions with a total max length of 10 including the decimal. + + + + + Actual percentage (10 means 10%, which is a mutiplier of 0.1) + + + + + Select the value from a set of rate data to which the percentage is applied. + + + + + Select the type of rate from which the element is to be selected. + + + + + + + The variable handling charges calculated based on the type variable handling charges requested. + + + + + The variable handling charge amount calculated based on the requested variable handling charge detail. + + + + + The calculated varibale handling charge plus the net charge. + + + + + + + Three-dimensional volume/cubic measurement. + + + + + + + + + Units of three-dimensional volume/cubic measure. + + + + + + + + + The descriptive data for the heaviness of an object. + + + + + Identifies the unit of measure associated with a weight value. + + + + + Identifies the weight value of a package/shipment. + + + + + + + Identifies the unit of measure associated with a weight value. See the list of enumerated types for valid values. + + + + + + + + + Used in authentication of the sender's identity. + + + + + Credential used to authenticate a specific software application. This value is provided by FedEx after registration. + + + + + + + Two part authentication string used for the sender's identity + + + + + Identifying part of authentication credential. This value is provided by FedEx after registration + + + + + Secret part of authentication key. This value is provided by FedEx after registration. + + + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + Identifies a system or sub-system which performs an operation. + + + + + Identifies the service business level. + + + + + Identifies the service interface level. + + + + + Identifies the service code level. + + + + + diff --git a/webxml/fedex/TrackService_XML.xsd b/webxml/fedex/TrackService_XML.xsd new file mode 100644 index 0000000..2315afb --- /dev/null +++ b/webxml/fedex/TrackService_XML.xsd @@ -0,0 +1,1421 @@ + + + + + + + + + + + + + Descriptive data for a physical location. May be used as an actual physical address (place to which one could go), or as a container of "address parts" which should be handled as a unit (such as a city-state-ZIP combination within the US). + + + + + Combination of number, street name, etc. At least one line is required for a valid physical address; empty lines should not be included. + + + + + Name of city, town, etc. + + + + + Identifying abbreviation for US state, Canada province, etc. Format and presence of this field will vary, depending on country. + + + + + Identification of a region (usually small) for mail/package delivery. Format and presence of this field will vary, depending on country. + + + + + Relevant only to addresses in Puerto Rico. + + + + + The two-letter code used to identify a country. + + + + + Indicates whether this address residential (as opposed to commercial). + + + + + + + Identifies where a tracking event occurs. + + + + + + + + + + + + + + + + + + + + + + + + + + + Identification of a FedEx operating company (transportation). + + + + + + + + + + + + + Descriptive data for the client submitting a transaction. + + + + + The FedEx account number associated with this transaction. + + + + + This number is assigned by FedEx and identifies the unique device from which the request is originating + + + + + Only used in transactions which require identification of the Fed Ex Office integrator. + + + + + The language to be used for human-readable Notification.localizedMessages in responses to the request containing this ClientDetail object. Different requests from the same client may contain different Localization data. (Contrast with TransactionDetail.localization, which governs data payload language/translation.) + + + + + + + The descriptive data for a point-of-contact person. + + + + + Identifies the contact person's name. + + + + + Identifies the contact person's title. + + + + + Identifies the company this contact is associated with. + + + + + Identifies the phone number associated with this contact. + + + + + Identifies the phone extension associated with this contact. + + + + + Identifies the pager number associated with this contact. + + + + + Identifies the fax number associated with this contact. + + + + + Identifies the email address associated with this contact. + + + + + + + + + + + + + The dimensions of this package and the unit type used for the measurements. + + + + + + + + + + + Driving or other transportation distances, distinct from dimension measurements. + + + + + Identifies the distance quantity. + + + + + Identifies the unit of measure for the distance value. + + + + + + + Identifies the collection of units of measure that can be associated with a distance value. + + + + + + + + + Information describing email notifications that will be sent in relation to events that occur during package movement + + + + + A message that will be included in the email notifications + + + + + Information describing the destination of the email, format of the email and events to be notified on + + + + + + + + + + + + + + + The format of the email + + + + + + + + + + + + Identifies the relationship this email recipient has to the shipment. + + + + + The email address to send the notification to + + + + + The types of email notifications being requested for this recipient. + + + + + The format of the email notification. + + + + + The language/locale to be used in this email notification. + + + + + + + + + + + + + + + CM = centimeters, IN = inches + + + + + + + + + Identifies the representation of human-readable text. + + + + + Two-letter code for language (e.g. EN, FR, etc.) + + + + + Two-letter code for the region (e.g. us, ca, etc..). + + + + + + + The descriptive data regarding the result of the submitted transaction. + + + + + The severity of this notification. This can indicate success or failure or some other information about the request. The values that can be returned are SUCCESS - Your transaction succeeded with no other applicable information. NOTE - Additional information that may be of interest to you about your transaction. WARNING - Additional information that you need to know about your transaction that you may need to take action on. ERROR - Information about an error that occurred while processing your transaction. FAILURE - FedEx was unable to process your transaction at this time due to a system failure. Please try again later + + + + + Indicates the source of this notification. Combined with the Code it uniquely identifies this notification + + + + + A code that represents this notification. Combined with the Source it uniquely identifies this notification. + + + + + Human-readable text that explains this notification. + + + + + The translated message. The language and locale specified in the ClientDetail. Localization are used to determine the representation. Currently only supported in a TrackReply. + + + + + A collection of name/value pairs that provide specific data to help the client determine the nature of an error (or warning, etc.) witout having to parse the message string. + + + + + + + + + Identifies the type of data contained in Value (e.g. SERVICE_TYPE, PACKAGE_SEQUENCE, etc..). + + + + + The value of the parameter (e.g. PRIORITY_OVERNIGHT, 2, etc..). + + + + + + + Identifies the set of severity values for a Notification. + + + + + + + + + + + + + + + + + + + + Identification for a FedEx operating company (transportation and non-transportation). + + + + + + + + The enumerated packaging type used for this package. + + + + + + + + + + + + + + Tracking number and additional shipment data used to identify a unique shipment for proof of delivery. + + + + + FedEx assigned identifier for a package/shipment. + + + + + The date the package was shipped. + + + + + If the account number used to ship the package is provided in the request the shipper and recipient information is included on the letter or fax. + + + + + FedEx operating company that delivered the package. + + + + + Only country is used for elimination of duplicate tracking numbers. + + + + + + + + + + + + + + The service type of the package/shipment. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + FedEx Signature Proof Of Delivery Fax reply. + + + + + This contains the severity type of the most severe Notification in the Notifications array. + + + + + Information about the request/reply such was the transaction successful or not, and any additional information relevant to the request and/or reply. There may be multiple Notifications in a reply. + + + + + Contains the CustomerTransactionDetail that is echoed back to the caller for matching requests and replies and a Localization element for defining the language/translation used in the reply data. + + + + + Contains the version of the reply being used. + + + + + Confirmation of fax transmission. + + + + + + + FedEx Signature Proof Of Delivery Fax request. + + + + + Descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + Descriptive data identifying the client submitting the transaction. + + + + + Contains a free form field that is echoed back in the reply to match requests with replies and data that governs the data payload language/translations. + + + + + The version of the request being used. + + + + + Tracking number and additional shipment data used to identify a unique shipment for proof of delivery. + + + + + Additional customer-supplied text to be added to the body of the letter. + + + + + Contact and address information about the person requesting the fax to be sent. + + + + + Contact and address information, including the fax number, about the person to receive the fax. + + + + + + + Identifies the set of SPOD image types. + + + + + + + + FedEx Signature Proof Of Delivery Letter reply. + + + + + This contains the severity type of the most severe Notification in the Notifications array. + + + + + Information about the request/reply such was the transaction successful or not, and any additional information relevant to the request and/or reply. There may be multiple Notifications in a reply. + + + + + Contains the CustomerTransactionDetail that is echoed back to the caller for matching requests and replies and a Localization element for defining the language/translation used in the reply data. + + + + + Image of letter encoded in Base64 format. + + + + + Image of letter encoded in Base64 format. + + + + + + + FedEx Signature Proof Of Delivery Letter request. + + + + + Descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + Descriptive data identifying the client submitting the transaction. + + + + + Contains a free form field that is echoed back in the reply to match requests with replies and data that governs the data payload language/translations. + + + + + The version of the request being used. + + + + + Tracking number and additional shipment data used to identify a unique shipment for proof of delivery. + + + + + Additional customer-supplied text to be added to the body of the letter. + + + + + Identifies the set of SPOD image types. + + + + + If provided this information will be print on the letter. + + + + + + + Each instance of this data type represents a barcode whose content must be represented as ASCII text (i.e. not binary data). + + + + + The kind of barcode data in this instance. + + + + + The data content of this instance. + + + + + + + + + + + + + + + + + The delivery location at the delivered to address. + + + + + + + + + + + + + + + + Detailed tracking information about a particular package. + + + + + To report soft error on an individual track detail. + + + + + The FedEx package identifier. + + + + + + When duplicate tracking numbers exist this data is returned with summary information for each of the duplicates. The summary information is used to determine which of the duplicates the intended tracking number is. This identifier is used on a subsequent track request to retrieve the tracking data for the desired tracking number. + + + + + A code that identifies this type of status. This is the most recent status. + + + + + A human-readable description of this status. + + + + + Used to report the status of a piece of a multiple piece shipment which is no longer traveling with the rest of the packages in the shipment or has not been accounted for. + + + + + Used to convey information such as. 1. FedEx has received information about a package but has not yet taken possession of it. 2. FedEx has handed the package off to a third party for final delivery. 3. The package delivery has been cancelled + + + + + Identifies a FedEx operating company (transportation). + + + + + Identifies operating transportation company that is the specific to the carrier code. + + + + + Specifies the FXO production centre contact and address. + + + + + Other related identifiers for this package such as reference numbers. + + + + + Retained for legacy compatibility only. User/screen friendly description of the Service type (e.g. Priority Overnight). + + + + + Strict representation of the Service type (e.g. PRIORITY_OVERNIGHT). + + + + + The weight of this package. + + + + + Physical dimensions of the package. + + + + + The dimensional weight of the package. + + + + + The weight of the entire shipment. + + + + + Retained for legacy compatibility only. + + + + + Strict representation of the Packaging type (e.g. FEDEX_BOX, YOUR_PACKAGING). + + + + + The sequence number of this package in a shipment. This would be 2 if it was package number 2 of 4. + + + + + The number of packages in this shipment. + + + + + + + The address information for the shipper. + + + + + The address of the FedEx pickup location/facility. + + + + + Estimated package pickup time for shipments that haven't been picked up. + + + + + Time package was shipped/tendered over to FedEx. Time portion will be populated if available, otherwise will be set to midnight. + + + + + The distance from the origin to the destination. Returned for Custom Critical shipments. + + + + + Total distance package still has to travel. Returned for Custom Critical shipments. + + + + + The address this package is to be (or has been) delivered. + + + + + The address of the FedEx delivery location/facility. + + + + + Projected package delivery time based on ship time stamp, service and destination. Not populated if delivery has already occurred. + + + + + The time the package was actually delivered. + + + + + Actual address where package was delivered. Differs from destinationAddress, which indicates where the package was to be delivered; This field tells where delivery actually occurred (next door, at station, etc.) + + + + + Identifies the method of office order delivery. + + + + + Strict text indicating the delivery location at the delivered to address. + + + + + User/screen friendly representation of the DeliveryLocationType (delivery location at the delivered to address). Can be returned in localized text. + + + + + This is either the name of the person that signed for the package or "Signature not requested" or "Signature on file". + + + + + True if signed for by signature image is available. + + + + + The types of email notifications that are available for the package. + + + + + Returned for cargo shipments only when they are currently split across vehicles. + + + + + Indicates redirection eligibility as determined by tracking service, subject to refinement/override by redirect-to-hold service. + + + + + Event information for a tracking number. + + + + + + + FedEx scanning information about a package. + + + + + The time this event occurred. + + + + + Carrier's scan code. Pairs with EventDescription. + + + + + Literal description that pairs with the EventType. + + + + + Further defines the Scan Type code's specific type (e.g., DEX08 business closed). Pairs with StatusExceptionDescription. + + + + + Literal description that pairs with the StatusExceptionCode. + + + + + Address information of the station that is responsible for the scan. + + + + + Indicates where the arrival actually occurred. + + + + + + + The type of track to be performed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + FedEx assigned identifier for a package/shipment. + + + + + When duplicate tracking numbers exist this data is returned with summary information for each of the duplicates. The summary information is used to determine which of the duplicates the intended tracking number is. This identifier is used on a subsequent track request to retrieve the tracking data for the desired tracking number. + + + + + Identification of a FedEx operating company (transportation). + + + + + The date the package was shipped (tendered to FedEx). + + + + + The destination address of this package. Only city, state/province, and country are returned. + + + + + Options available for a tracking notification recipient. + + + + + + + Options available for a tracking notification recipient. + + + + + The types of email notifications available for this recipient. + + + + + + + FedEx Track Notification reply. + + + + + This contains the severity type of the most severe Notification in the Notifications array. + + + + + Information about the request/reply such was the transaction successful or not, and any additional information relevant to the request and/or reply. There may be multiple Notifications in a reply. + + + + + Contains the CustomerTransactionDetail that is echoed back to the caller for matching requests and replies and a Localization element for defining the language/translation used in the reply data. + + + + + Contains the version of the reply being used. + + + + + True if duplicate packages (more than one package with the same tracking number) have been found, the packages array contains information about each duplicate. Use this information to determine which of the tracking numbers is the one you need and resend your request using the tracking number and TrackingNumberUniqueIdentifier for that package. + + + + + True if additional packages remain to be retrieved. + + + + + Value that must be passed in a TrackNotification request to retrieve the next set of packages (when MoreDataAvailable = true). + + + + + Information about the notifications that are available for this tracking number. If there are duplicates the ship date and destination address information is returned for determining which TrackingNumberUniqueIdentifier to use on a subsequent request. + + + + + + + FedEx Track Notification request. + + + + + Descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + Descriptive data identifying the client submitting the transaction. + + + + + Contains a free form field that is echoed back in the reply to match requests with replies and data that governs the data payload language/translations + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + The tracking number to which the notifications will be triggered from. + + + + + Indicates whether to return tracking information for all associated packages. + + + + + When the MoreDataAvailable field is true in a TrackNotificationReply the PagingToken must be sent in the subsequent TrackNotificationRequest to retrieve the next page of data. + + + + + Use this field when your original request informs you that there are duplicates of this tracking number. If you get duplicates you will also receive some information about each of the duplicate tracking numbers to enable you to chose one and resend that number along with the TrackingNumberUniqueId to get notifications for that tracking number. + + + + + To narrow the search to a period in time the ShipDateRangeBegin and ShipDateRangeEnd can be used to help eliminate duplicates. + + + + + To narrow the search to a period in time the ShipDateRangeBegin and ShipDateRangeEnd can be used to help eliminate duplicates. + + + + + Included in the email notification identifying the requester of this notification. + + + + + Included in the email notification identifying the requester of this notification. + + + + + Who to send the email notifications to and for which events. The notificationRecipientType and NotifyOnShipment fields are not used in this request. + + + + + + + The type and value of the package identifier that is to be used to retrieve the tracking information for a package. + + + + + The value to be used to retrieve tracking information for a package. + + + + + The type of the Value to be used to retrieve tracking information for a package (e.g. SHIPPER_REFERENCE, PURCHASE_ORDER, TRACKING_NUMBER_OR_DOORTAG, etc..) . + + + + + + + Used to report the status of a piece of a multiple piece shipment which is no longer traveling with the rest of the packages in the shipment or has not been accounted for. + + + + + An identifier for this type of status. + + + + + A human-readable description of this status. + + + + + + + The descriptive data returned from a FedEx package tracking request. + + + + + This contains the severity type of the most severe Notification in the Notifications array. + + + + + Information about the request/reply such was the transaction successful or not, and any additional information relevant to the request and/or reply. There may be multiple Notifications in a reply. + + + + + Contains the CustomerTransactionDetail that is echoed back to the caller for matching requests and replies and a Localization element for defining the language/translation used in the reply data. + + + + + Contains the version of the reply being used. + + + + + True if duplicate packages (more than one package with the same tracking number) have been found, and only limited data will be provided for each one. + + + + + True if additional packages remain to be retrieved. + + + + + Value that must be passed in a TrackNotification request to retrieve the next set of packages (when MoreDataAvailable = true). + + + + + Contains detailed tracking information for the requested packages(s). + + + + + + + The descriptive data sent by a client to track a FedEx package. + + + + + Descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + Descriptive data identifying the client submitting the transaction. + + + + + Contains a free form field that is echoed back in the reply to match requests with replies and data that governs the data payload language/translations. + + + + + The version of the request being used. + + + + + The FedEx operating company (transportation) used for this package's delivery. + + + + + Identifies operating transportation company that is the specific to the carrier code. + + + + + The type and value of the package identifier that is to be used to retrieve the tracking information for a package or group of packages. + + + + + Used to distinguish duplicate FedEx tracking numbers. + + + + + To narrow the search to a period in time the ShipDateRangeBegin and ShipDateRangeEnd can be used to help eliminate duplicates. + + + + + To narrow the search to a period in time the ShipDateRangeBegin and ShipDateRangeEnd can be used to help eliminate duplicates. + + + + + For tracking by references information either the account number or destination postal code and country must be provided. + + + + + For tracking by references information either the account number or destination postal code and country must be provided. + + + + + If false the reply will contain summary/profile data including current status. If true the reply contains profile + detailed scan activity for each package. + + + + + When the MoreData field = true in a TrackReply the PagingToken must be sent in the subsequent TrackRequest to retrieve the next page of data. + + + + + + + + + + + + + Used when a cargo shipment is split across vehicles. This is used to give the status of each part of the shipment. + + + + + The number of pieces in this part. + + + + + The date and time this status began. + + + + + A code that identifies this type of status. + + + + + A human-readable description of this status. + + + + + + + Descriptive data that governs data payload language/translations. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Free form text to be echoed back in the reply. Used to match requests and replies. + + + + + Governs data payload language/translations (contrasted with ClientDetail.localization, which governs Notification.localizedMessage language selection). + + + + + + + The descriptive data for the heaviness of an object. + + + + + Identifies the unit of measure associated with a weight value. + + + + + Identifies the weight value of a package/shipment. + + + + + + + Identifies the collection of units of measure that can be associated with a weight value. + + + + + + + + + Used in authentication of the sender's identity. + + + + + Credential used to authenticate a specific software application. This value is provided by FedEx after registration. + + + + + + + Two part authentication string used for the sender's identity + + + + + Identifying part of authentication credential. This value is provided by FedEx after registration + + + + + Secret part of authentication key. This value is provided by FedEx after registration. + + + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + Identifies a system or sub-system which performs an operation. + + + + + Identifies the service business level. + + + + + Identifies the service interface level. + + + + + Identifies the service code level. + + + + + diff --git a/webxml/fedex/UploadDocumentService_XML.xsd b/webxml/fedex/UploadDocumentService_XML.xsd new file mode 100644 index 0000000..aa9d1ff --- /dev/null +++ b/webxml/fedex/UploadDocumentService_XML.xsd @@ -0,0 +1,485 @@ + + + + + + + + + Descriptive data for the client submitting a transaction. + + + + + The FedEx account number assigned to the customer initiating the request. + + + + + Identifies the unique client device submitting the request. This number is assigned by FedEx and identifies the unique device from which the request is originating. + + + + + Only used in transactions which require identification of the FedEx Office integrator. + + + + + The language to be used for human-readable Notification.localizedMessages in responses to the request containing this ClientDetail object. Different requests from the same client may contain different Localization data. (Contrast with TransactionDetail.localization, which governs data payload language/translation.) + + + + + + + + + + + + + + + + + + + + + + + + Governs any future language/translations used for human-readable text. + + + + + Identifies the language to use for human-readable messages. + + 2 + + + + + + Identifies the locale (i.e. country code) associated with the language. + + 2 + + + + + + + + The descriptive data for the medium of exchange for FedEx services. + + + + + Identifies the currency of the monetary amount. + + 3 + + + + + + Identifies the monetary amount. + + + + + + + The descriptive data regarding the results of the submitted transaction. + + + + + The severity of this notification. This can indicate success or failure or some other information about the request such as errors or notes. + + + + + Indicates the source of the notification. Combined with Code, it uniqely identifies this message. + + + + + A code that represents this notification. Combined with Source, it uniqely identifies this message. + + + + + Text that explains this notification. + + + + + A translated message. The translation is based on the Localization element of the ClientDetail element of the request. Not currently supported. + + + + + A collection of name/value pairs that provide specific data to help the client determine the nature of an error (or warning, etc.) witout having to parse the message string. + + + + + + + + + Name identifiying the type of the data in the element 'Value'. + + + + + The value that was used as the replacement parameter. + + + + + + + Identifies the set of severity values for a Notification. + + + + + + + + + + + + Identifies the collection of available FedEx or customer packaging options. + + + + + + + + + + + + + + Identifies the collection of available FedEx service options. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies a customer-supplied unique identifier for this transaction. It is returned in the reply message to aid in matching requests to replies. + + + + + Governs data payload language/translations (contrasted with ClientDetail.localization, which governs Notification.localizedMessage language selection). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Distinct value for reason status was assigned. + + + + + Human-readable explanation of document status. + + + + + + + + + Each of these values identifies a specific reason why a document or reference could not be uploaded or associated with a shipment. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This indicates the highest level of severity of all the notifications returned in this reply + + + + + The descriptive data regarding the results of the submitted transaction. + + + + + Descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + + + + + + The descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + Descriptive data identifying the client submitting the transaction. + + + + + Descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Identifies the highest severity encountered when executing the request; in order from high to low: FAILURE, ERROR, WARNING, NOTE, SUCCESS. + + + + + The descriptive data detailing the status of a sumbitted transaction. + + + + + Descriptive data that governs data payload language/translations. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + + + + + + The descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + Descriptive data identifying the client submitting the transaction. + + + + + Descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply. + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + + + + Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply). + + + + + Identifies a system or sub-system which performs an operation. + + + + + Identifies the service business level. For this release this value should be set to 2. + + + + + Identifies the service interface level. For this release this value should be set to 0. + + + + + Identifies the service code level. For this release this value should be set to 0. + + + + + + + The descriptive data to be used in authentication of the sender's identity (and right to use FedEx web services). + + + + + Credential used to authenticate a specific software application. This value is provided by FedEx after registration. + + + + + + + Two part authentication string used for the sender's identity. + + + + + Publicly known part of authentication key used for authentication. This value is provided by FedEx after registration. + + 16 + + + + + + Secret part of authentication key used for authentication. This value is provided by FedEx after registration. + + 25 + + + + + + diff --git a/webxml/fedex/__init__.py b/webxml/fedex/__init__.py new file mode 100644 index 0000000..be738f2 --- /dev/null +++ b/webxml/fedex/__init__.py @@ -0,0 +1,79 @@ +import logging +logger = logging.getLogger(__name__) + +import avs +import rate +import ship + +class FedEx(object): + def __init__(self, credentials_dictionary={}, debug=True, key='', password='', account='', meter=''): + self.key = credentials_dictionary.get('key', key) + self.password = credentials_dictionary('password', password) + self.account = credentials_dictionary('account_number', account) + self.meter = credentials_dictionary('meter_number', meter) + self.debug = debug + self.request = None + + def add_auth(self): + self.request.WebAuthenticationDetail = ship.WebAuthenticationDetail() + self.request.WebAuthenticationDetail.UserCredential = ship.WebAuthenticationCredential() + self.request.WebAuthenticationDetail.UserCredential.Key = self.key + self.request.WebAuthenticationDetail.UserCredential.Password = self.password + self.request.ClientDetail = ship.ClientDetail() + self.request.ClientDetail.AccountNumber = self.account + self.request.ClientDetail.MeterNumber = self.meter + + def add_version(self, service, major, intermediate = 0, minor = 0) + self.request.Version = ship.VersionId() + self.request.Version.ServiceId = service + self.request.Version.Major = major + self.request.Version.Intermediate = intermediate + self.request.Version.Minor = minor + + def add_shipper(self, address): + pass + + def add_recipient(self, address): + pass + + def add_package(self, package): + pass + + def verify(self, address): + self.request = avs.AddressValidationRequest() + self.add_version('aval', 2, 0, 0) + # Timestamp format = YYYY-MM-DDTHH:MM:SS-xx:xx utc + self.request.RequestTimestamp = datetime.datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S-00:00') + + # Validation Address + self.request.AddressToValidate + + # Validation Options + self.request.Options = AddressValidationOptions() + self.request.Options. + self.request.Options.MaximumNumberOfMatches = 3 + self.request.Options.StreetAccuracy = 'MEDIUM' + self.request.Options.DirectionalAccuracy = 'MEDIUM' + self.request.Options.CompanyNameAccuracy = 'LOOSE' + self.request.Options.ConvertToUpperCase = True + self.request.Options.RecognizeAlternateCityNames = True + + self.send() + + def rate(self, package, packaging_type, from_address, to_address): + self.request = rate.RateRequest() + self.add_version('crs', 10, 0, 0) + + self.send() + + def label(self, packages, packaging_type, service_type, from_address, to_address, email_alert=None, evening=False, payment=None, delivery_instructions=''): + self.request = ship.ProcessShipmentRequest() + self.add_version('ship', 10, 0, 0) + + + self.send() + + def send(): + self.add_auth() + + \ No newline at end of file diff --git a/webxml/fedex/avs.py b/webxml/fedex/avs.py new file mode 100644 index 0000000..01da986 --- /dev/null +++ b/webxml/fedex/avs.py @@ -0,0 +1,2737 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# +# Generated Fri Nov 25 13:37:25 2011 by generateDS.py version 2.6a. +# + +import sys +import getopt +import re as re_ + +etree_ = None +Verbose_import_ = False +( XMLParser_import_none, XMLParser_import_lxml, + XMLParser_import_elementtree + ) = range(3) +XMLParser_import_library = None +try: + # lxml + from lxml import etree as etree_ + XMLParser_import_library = XMLParser_import_lxml + if Verbose_import_: + print("running with lxml.etree") +except ImportError: + try: + # cElementTree from Python 2.5+ + import xml.etree.cElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with cElementTree on Python 2.5+") + except ImportError: + try: + # ElementTree from Python 2.5+ + import xml.etree.ElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with ElementTree on Python 2.5+") + except ImportError: + try: + # normal cElementTree install + import cElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with cElementTree") + except ImportError: + try: + # normal ElementTree install + import elementtree.ElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with ElementTree") + except ImportError: + raise ImportError("Failed to import ElementTree from any known place") + +def parsexml_(*args, **kwargs): + if (XMLParser_import_library == XMLParser_import_lxml and + 'parser' not in kwargs): + # Use the lxml ElementTree compatible parser so that, e.g., + # we ignore comments. + kwargs['parser'] = etree_.ETCompatXMLParser() + doc = etree_.parse(*args, **kwargs) + return doc + +# +# User methods +# +# Calls to the methods in these classes are generated by generateDS.py. +# You can replace these methods by re-implementing the following class +# in a module named generatedssuper.py. + +try: + from generatedssuper import GeneratedsSuper +except ImportError, exp: + + class GeneratedsSuper(object): + def gds_format_string(self, input_data, input_name=''): + return input_data + def gds_validate_string(self, input_data, node, input_name=''): + return input_data + def gds_format_integer(self, input_data, input_name=''): + return '%d' % input_data + def gds_validate_integer(self, input_data, node, input_name=''): + return input_data + def gds_format_integer_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_integer_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + try: + fvalue = float(value) + except (TypeError, ValueError), exp: + raise_parse_error(node, 'Requires sequence of integers') + return input_data + def gds_format_float(self, input_data, input_name=''): + return '%f' % input_data + def gds_validate_float(self, input_data, node, input_name=''): + return input_data + def gds_format_float_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_float_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + try: + fvalue = float(value) + except (TypeError, ValueError), exp: + raise_parse_error(node, 'Requires sequence of floats') + return input_data + def gds_format_double(self, input_data, input_name=''): + return '%e' % input_data + def gds_validate_double(self, input_data, node, input_name=''): + return input_data + def gds_format_double_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_double_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + try: + fvalue = float(value) + except (TypeError, ValueError), exp: + raise_parse_error(node, 'Requires sequence of doubles') + return input_data + def gds_format_boolean(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_boolean(self, input_data, node, input_name=''): + return input_data + def gds_format_boolean_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_boolean_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + if value not in ('true', '1', 'false', '0', ): + raise_parse_error(node, 'Requires sequence of booleans ("true", "1", "false", "0")') + return input_data + def gds_str_lower(self, instring): + return instring.lower() + def get_path_(self, node): + path_list = [] + self.get_path_list_(node, path_list) + path_list.reverse() + path = '/'.join(path_list) + return path + Tag_strip_pattern_ = re_.compile(r'\{.*\}') + def get_path_list_(self, node, path_list): + if node is None: + return + tag = GeneratedsSuper.Tag_strip_pattern_.sub('', node.tag) + if tag: + path_list.append(tag) + self.get_path_list_(node.getparent(), path_list) + def get_class_obj_(self, node, default_class=None): + class_obj1 = default_class + if 'xsi' in node.nsmap: + classname = node.get('{%s}type' % node.nsmap['xsi']) + if classname is not None: + names = classname.split(':') + if len(names) == 2: + classname = names[1] + class_obj2 = globals().get(classname) + if class_obj2 is not None: + class_obj1 = class_obj2 + return class_obj1 + + +# +# If you have installed IPython you can uncomment and use the following. +# IPython is available from http://ipython.scipy.org/. +# + +## from IPython.Shell import IPShellEmbed +## args = '' +## ipshell = IPShellEmbed(args, +## banner = 'Dropping into IPython', +## exit_msg = 'Leaving Interpreter, back to program.') + +# Then use the following line where and when you want to drop into the +# IPython shell: +# ipshell(' -- Entering ipshell.\nHit Ctrl-D to exit') + +# +# Globals +# + +ExternalEncoding = 'ascii' +Tag_pattern_ = re_.compile(r'({.*})?(.*)') +String_cleanup_pat_ = re_.compile(r"[\n\r\s]+") +Namespace_extract_pat_ = re_.compile(r'{(.*)}(.*)') + +# +# Support/utility functions. +# + +def showIndent(outfile, level): + for idx in range(level): + outfile.write(' ') + +def quote_xml(inStr): + if not inStr: + return '' + s1 = (isinstance(inStr, basestring) and inStr or + '%s' % inStr) + s1 = s1.replace('&', '&') + s1 = s1.replace('<', '<') + s1 = s1.replace('>', '>') + return s1 + +def quote_attrib(inStr): + s1 = (isinstance(inStr, basestring) and inStr or + '%s' % inStr) + s1 = s1.replace('&', '&') + s1 = s1.replace('<', '<') + s1 = s1.replace('>', '>') + if '"' in s1: + if "'" in s1: + s1 = '"%s"' % s1.replace('"', """) + else: + s1 = "'%s'" % s1 + else: + s1 = '"%s"' % s1 + return s1 + +def quote_python(inStr): + s1 = inStr + if s1.find("'") == -1: + if s1.find('\n') == -1: + return "'%s'" % s1 + else: + return "'''%s'''" % s1 + else: + if s1.find('"') != -1: + s1 = s1.replace('"', '\\"') + if s1.find('\n') == -1: + return '"%s"' % s1 + else: + return '"""%s"""' % s1 + +def get_all_text_(node): + if node.text is not None: + text = node.text + else: + text = '' + for child in node: + if child.tail is not None: + text += child.tail + return text + +def find_attr_value_(attr_name, node): + attrs = node.attrib + attr_parts = attr_name.split(':') + value = None + if len(attr_parts) == 1: + value = attrs.get(attr_name) + elif len(attr_parts) == 2: + prefix, name = attr_parts + namespace = node.nsmap.get(prefix) + if namespace is not None: + value = attrs.get('{%s}%s' % (namespace, name, )) + return value + + +class GDSParseError(Exception): + pass + +def raise_parse_error(node, msg): + if XMLParser_import_library == XMLParser_import_lxml: + msg = '%s (element %s/line %d)' % (msg, node.tag, node.sourceline, ) + else: + msg = '%s (element %s)' % (msg, node.tag, ) + raise GDSParseError(msg) + + +class MixedContainer: + # Constants for category: + CategoryNone = 0 + CategoryText = 1 + CategorySimple = 2 + CategoryComplex = 3 + # Constants for content_type: + TypeNone = 0 + TypeText = 1 + TypeString = 2 + TypeInteger = 3 + TypeFloat = 4 + TypeDecimal = 5 + TypeDouble = 6 + TypeBoolean = 7 + def __init__(self, category, content_type, name, value): + self.category = category + self.content_type = content_type + self.name = name + self.value = value + def getCategory(self): + return self.category + def getContenttype(self, content_type): + return self.content_type + def getValue(self): + return self.value + def getName(self): + return self.name + def export(self, outfile, level, name, namespace): + if self.category == MixedContainer.CategoryText: + # Prevent exporting empty content as empty lines. + if self.value.strip(): + outfile.write(self.value) + elif self.category == MixedContainer.CategorySimple: + self.exportSimple(outfile, level, name) + else: # category == MixedContainer.CategoryComplex + self.value.export(outfile, level, namespace,name) + def exportSimple(self, outfile, level, name): + if self.content_type == MixedContainer.TypeString: + outfile.write('<%s>%s' % (self.name, self.value, self.name)) + elif self.content_type == MixedContainer.TypeInteger or \ + self.content_type == MixedContainer.TypeBoolean: + outfile.write('<%s>%d' % (self.name, self.value, self.name)) + elif self.content_type == MixedContainer.TypeFloat or \ + self.content_type == MixedContainer.TypeDecimal: + outfile.write('<%s>%f' % (self.name, self.value, self.name)) + elif self.content_type == MixedContainer.TypeDouble: + outfile.write('<%s>%g' % (self.name, self.value, self.name)) + def exportLiteral(self, outfile, level, name): + if self.category == MixedContainer.CategoryText: + showIndent(outfile, level) + outfile.write('model_.MixedContainer(%d, %d, "%s", "%s"),\n' % \ + (self.category, self.content_type, self.name, self.value)) + elif self.category == MixedContainer.CategorySimple: + showIndent(outfile, level) + outfile.write('model_.MixedContainer(%d, %d, "%s", "%s"),\n' % \ + (self.category, self.content_type, self.name, self.value)) + else: # category == MixedContainer.CategoryComplex + showIndent(outfile, level) + outfile.write('model_.MixedContainer(%d, %d, "%s",\n' % \ + (self.category, self.content_type, self.name,)) + self.value.exportLiteral(outfile, level + 1) + showIndent(outfile, level) + outfile.write(')\n') + + +class MemberSpec_(object): + def __init__(self, name='', data_type='', container=0): + self.name = name + self.data_type = data_type + self.container = container + def set_name(self, name): self.name = name + def get_name(self): return self.name + def set_data_type(self, data_type): self.data_type = data_type + def get_data_type_chain(self): return self.data_type + def get_data_type(self): + if isinstance(self.data_type, list): + if len(self.data_type) > 0: + return self.data_type[-1] + else: + return 'xs:string' + else: + return self.data_type + def set_container(self, container): self.container = container + def get_container(self): return self.container + +def _cast(typ, value): + if typ is None or value is None: + return value + return typ(value) + +# +# Data representation classes. +# + +class AddressValidationRequest(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, WebAuthenticationDetail=None, ClientDetail=None, TransactionDetail=None, Version=None, RequestTimestamp=None, Options=None, AddressesToValidate=None): + self.WebAuthenticationDetail = WebAuthenticationDetail + self.ClientDetail = ClientDetail + self.TransactionDetail = TransactionDetail + self.Version = Version + self.RequestTimestamp = RequestTimestamp + self.Options = Options + if AddressesToValidate is None: + self.AddressesToValidate = [] + else: + self.AddressesToValidate = AddressesToValidate + def factory(*args_, **kwargs_): + if AddressValidationRequest.subclass: + return AddressValidationRequest.subclass(*args_, **kwargs_) + else: + return AddressValidationRequest(*args_, **kwargs_) + factory = staticmethod(factory) + def get_WebAuthenticationDetail(self): return self.WebAuthenticationDetail + def set_WebAuthenticationDetail(self, WebAuthenticationDetail): self.WebAuthenticationDetail = WebAuthenticationDetail + def get_ClientDetail(self): return self.ClientDetail + def set_ClientDetail(self, ClientDetail): self.ClientDetail = ClientDetail + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_RequestTimestamp(self): return self.RequestTimestamp + def set_RequestTimestamp(self, RequestTimestamp): self.RequestTimestamp = RequestTimestamp + def get_Options(self): return self.Options + def set_Options(self, Options): self.Options = Options + def get_AddressesToValidate(self): return self.AddressesToValidate + def set_AddressesToValidate(self, AddressesToValidate): self.AddressesToValidate = AddressesToValidate + def add_AddressesToValidate(self, value): self.AddressesToValidate.append(value) + def insert_AddressesToValidate(self, index, value): self.AddressesToValidate[index] = value + def export(self, outfile, level, namespace_='ns:', name_='AddressValidationRequest', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='AddressValidationRequest') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='AddressValidationRequest'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='AddressValidationRequest', fromsubclass_=False): + if self.WebAuthenticationDetail: + self.WebAuthenticationDetail.export(outfile, level, namespace_, name_='WebAuthenticationDetail', ) + if self.ClientDetail: + self.ClientDetail.export(outfile, level, namespace_, name_='ClientDetail', ) + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.RequestTimestamp is not None: + showIndent(outfile, level) + outfile.write('<%sRequestTimestamp>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RequestTimestamp).encode(ExternalEncoding), input_name='RequestTimestamp'), namespace_)) + if self.Options: + self.Options.export(outfile, level, namespace_, name_='Options', ) + for AddressesToValidate_ in self.AddressesToValidate: + AddressesToValidate_.export(outfile, level, namespace_, name_='AddressesToValidate') + def hasContent_(self): + if ( + self.WebAuthenticationDetail is not None or + self.ClientDetail is not None or + self.TransactionDetail is not None or + self.Version is not None or + self.RequestTimestamp is not None or + self.Options is not None or + self.AddressesToValidate + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='AddressValidationRequest'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.WebAuthenticationDetail is not None: + showIndent(outfile, level) + outfile.write('WebAuthenticationDetail=model_.WebAuthenticationDetail(\n') + self.WebAuthenticationDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ClientDetail is not None: + showIndent(outfile, level) + outfile.write('ClientDetail=model_.ClientDetail(\n') + self.ClientDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.RequestTimestamp is not None: + showIndent(outfile, level) + outfile.write('RequestTimestamp=%s,\n' % quote_python(self.RequestTimestamp).encode(ExternalEncoding)) + if self.Options is not None: + showIndent(outfile, level) + outfile.write('Options=model_.AddressValidationOptions(\n') + self.Options.exportLiteral(outfile, level, name_='Options') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('AddressesToValidate=[\n') + level += 1 + for AddressesToValidate_ in self.AddressesToValidate: + showIndent(outfile, level) + outfile.write('model_.AddressToValidate(\n') + AddressesToValidate_.exportLiteral(outfile, level, name_='AddressToValidate') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'WebAuthenticationDetail': + obj_ = WebAuthenticationDetail.factory() + obj_.build(child_) + self.set_WebAuthenticationDetail(obj_) + elif nodeName_ == 'ClientDetail': + obj_ = ClientDetail.factory() + obj_.build(child_) + self.set_ClientDetail(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'RequestTimestamp': + RequestTimestamp_ = child_.text + RequestTimestamp_ = self.gds_validate_string(RequestTimestamp_, node, 'RequestTimestamp') + self.RequestTimestamp = RequestTimestamp_ + elif nodeName_ == 'Options': + obj_ = AddressValidationOptions.factory() + obj_.build(child_) + self.set_Options(obj_) + elif nodeName_ == 'AddressesToValidate': + obj_ = AddressToValidate.factory() + obj_.build(child_) + self.AddressesToValidate.append(obj_) +# end class AddressValidationRequest + + +class AddressValidationReply(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, HighestSeverity=None, Notifications=None, TransactionDetail=None, Version=None, ReplyTimestamp=None, AddressResults=None): + self.HighestSeverity = HighestSeverity + if Notifications is None: + self.Notifications = [] + else: + self.Notifications = Notifications + self.TransactionDetail = TransactionDetail + self.Version = Version + self.ReplyTimestamp = ReplyTimestamp + if AddressResults is None: + self.AddressResults = [] + else: + self.AddressResults = AddressResults + def factory(*args_, **kwargs_): + if AddressValidationReply.subclass: + return AddressValidationReply.subclass(*args_, **kwargs_) + else: + return AddressValidationReply(*args_, **kwargs_) + factory = staticmethod(factory) + def get_HighestSeverity(self): return self.HighestSeverity + def set_HighestSeverity(self, HighestSeverity): self.HighestSeverity = HighestSeverity + def validate_NotificationSeverityType(self, value): + # Validate type NotificationSeverityType, a restriction on xs:string. + pass + def get_Notifications(self): return self.Notifications + def set_Notifications(self, Notifications): self.Notifications = Notifications + def add_Notifications(self, value): self.Notifications.append(value) + def insert_Notifications(self, index, value): self.Notifications[index] = value + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_ReplyTimestamp(self): return self.ReplyTimestamp + def set_ReplyTimestamp(self, ReplyTimestamp): self.ReplyTimestamp = ReplyTimestamp + def get_AddressResults(self): return self.AddressResults + def set_AddressResults(self, AddressResults): self.AddressResults = AddressResults + def add_AddressResults(self, value): self.AddressResults.append(value) + def insert_AddressResults(self, index, value): self.AddressResults[index] = value + def export(self, outfile, level, namespace_='ns:', name_='AddressValidationReply', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='AddressValidationReply') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='AddressValidationReply'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='AddressValidationReply', fromsubclass_=False): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('<%sHighestSeverity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HighestSeverity).encode(ExternalEncoding), input_name='HighestSeverity'), namespace_)) + for Notifications_ in self.Notifications: + Notifications_.export(outfile, level, namespace_, name_='Notifications') + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version') + if self.ReplyTimestamp is not None: + showIndent(outfile, level) + outfile.write('<%sReplyTimestamp>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ReplyTimestamp).encode(ExternalEncoding), input_name='ReplyTimestamp'), namespace_)) + for AddressResults_ in self.AddressResults: + AddressResults_.export(outfile, level, namespace_, name_='AddressResults') + def hasContent_(self): + if ( + self.HighestSeverity is not None or + self.Notifications or + self.TransactionDetail is not None or + self.Version is not None or + self.ReplyTimestamp is not None or + self.AddressResults + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='AddressValidationReply'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('HighestSeverity=%s,\n' % quote_python(self.HighestSeverity).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Notifications=[\n') + level += 1 + for Notifications_ in self.Notifications: + showIndent(outfile, level) + outfile.write('model_.Notification(\n') + Notifications_.exportLiteral(outfile, level, name_='Notification') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.ReplyTimestamp is not None: + showIndent(outfile, level) + outfile.write('ReplyTimestamp=%s,\n' % quote_python(self.ReplyTimestamp).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('AddressResults=[\n') + level += 1 + for AddressResults_ in self.AddressResults: + showIndent(outfile, level) + outfile.write('model_.AddressValidationResult(\n') + AddressResults_.exportLiteral(outfile, level, name_='AddressValidationResult') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'HighestSeverity': + HighestSeverity_ = child_.text + HighestSeverity_ = self.gds_validate_string(HighestSeverity_, node, 'HighestSeverity') + self.HighestSeverity = HighestSeverity_ + self.validate_NotificationSeverityType(self.HighestSeverity) # validate type NotificationSeverityType + elif nodeName_ == 'Notifications': + obj_ = Notification.factory() + obj_.build(child_) + self.Notifications.append(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'ReplyTimestamp': + ReplyTimestamp_ = child_.text + ReplyTimestamp_ = self.gds_validate_string(ReplyTimestamp_, node, 'ReplyTimestamp') + self.ReplyTimestamp = ReplyTimestamp_ + elif nodeName_ == 'AddressResults': + obj_ = AddressValidationResult.factory() + obj_.build(child_) + self.AddressResults.append(obj_) +# end class AddressValidationReply + + +class AddressValidationOptions(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, VerifyAddresses=None, CheckResidentialStatus=None, MaximumNumberOfMatches=None, StreetAccuracy=None, DirectionalAccuracy=None, CompanyNameAccuracy=None, ConvertToUpperCase=None, RecognizeAlternateCityNames=None, ReturnParsedElements=None): + self.VerifyAddresses = VerifyAddresses + self.CheckResidentialStatus = CheckResidentialStatus + self.MaximumNumberOfMatches = MaximumNumberOfMatches + self.StreetAccuracy = StreetAccuracy + self.DirectionalAccuracy = DirectionalAccuracy + self.CompanyNameAccuracy = CompanyNameAccuracy + self.ConvertToUpperCase = ConvertToUpperCase + self.RecognizeAlternateCityNames = RecognizeAlternateCityNames + self.ReturnParsedElements = ReturnParsedElements + def factory(*args_, **kwargs_): + if AddressValidationOptions.subclass: + return AddressValidationOptions.subclass(*args_, **kwargs_) + else: + return AddressValidationOptions(*args_, **kwargs_) + factory = staticmethod(factory) + def get_VerifyAddresses(self): return self.VerifyAddresses + def set_VerifyAddresses(self, VerifyAddresses): self.VerifyAddresses = VerifyAddresses + def get_CheckResidentialStatus(self): return self.CheckResidentialStatus + def set_CheckResidentialStatus(self, CheckResidentialStatus): self.CheckResidentialStatus = CheckResidentialStatus + def get_MaximumNumberOfMatches(self): return self.MaximumNumberOfMatches + def set_MaximumNumberOfMatches(self, MaximumNumberOfMatches): self.MaximumNumberOfMatches = MaximumNumberOfMatches + def get_StreetAccuracy(self): return self.StreetAccuracy + def set_StreetAccuracy(self, StreetAccuracy): self.StreetAccuracy = StreetAccuracy + def validate_AddressValidationAccuracyType(self, value): + # Validate type AddressValidationAccuracyType, a restriction on xs:string. + pass + def get_DirectionalAccuracy(self): return self.DirectionalAccuracy + def set_DirectionalAccuracy(self, DirectionalAccuracy): self.DirectionalAccuracy = DirectionalAccuracy + def get_CompanyNameAccuracy(self): return self.CompanyNameAccuracy + def set_CompanyNameAccuracy(self, CompanyNameAccuracy): self.CompanyNameAccuracy = CompanyNameAccuracy + def get_ConvertToUpperCase(self): return self.ConvertToUpperCase + def set_ConvertToUpperCase(self, ConvertToUpperCase): self.ConvertToUpperCase = ConvertToUpperCase + def get_RecognizeAlternateCityNames(self): return self.RecognizeAlternateCityNames + def set_RecognizeAlternateCityNames(self, RecognizeAlternateCityNames): self.RecognizeAlternateCityNames = RecognizeAlternateCityNames + def get_ReturnParsedElements(self): return self.ReturnParsedElements + def set_ReturnParsedElements(self, ReturnParsedElements): self.ReturnParsedElements = ReturnParsedElements + def export(self, outfile, level, namespace_='ns:', name_='AddressValidationOptions', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='AddressValidationOptions') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='AddressValidationOptions'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='AddressValidationOptions', fromsubclass_=False): + if self.VerifyAddresses is not None: + showIndent(outfile, level) + outfile.write('<%sVerifyAddresses>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.VerifyAddresses)), input_name='VerifyAddresses'), namespace_)) + if self.CheckResidentialStatus is not None: + showIndent(outfile, level) + outfile.write('<%sCheckResidentialStatus>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.CheckResidentialStatus)), input_name='CheckResidentialStatus'), namespace_)) + if self.MaximumNumberOfMatches is not None: + showIndent(outfile, level) + outfile.write('<%sMaximumNumberOfMatches>%s\n' % (namespace_, self.gds_format_integer(self.MaximumNumberOfMatches, input_name='MaximumNumberOfMatches'), namespace_)) + if self.StreetAccuracy is not None: + showIndent(outfile, level) + outfile.write('<%sStreetAccuracy>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.StreetAccuracy).encode(ExternalEncoding), input_name='StreetAccuracy'), namespace_)) + if self.DirectionalAccuracy is not None: + showIndent(outfile, level) + outfile.write('<%sDirectionalAccuracy>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DirectionalAccuracy).encode(ExternalEncoding), input_name='DirectionalAccuracy'), namespace_)) + if self.CompanyNameAccuracy is not None: + showIndent(outfile, level) + outfile.write('<%sCompanyNameAccuracy>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CompanyNameAccuracy).encode(ExternalEncoding), input_name='CompanyNameAccuracy'), namespace_)) + if self.ConvertToUpperCase is not None: + showIndent(outfile, level) + outfile.write('<%sConvertToUpperCase>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.ConvertToUpperCase)), input_name='ConvertToUpperCase'), namespace_)) + if self.RecognizeAlternateCityNames is not None: + showIndent(outfile, level) + outfile.write('<%sRecognizeAlternateCityNames>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.RecognizeAlternateCityNames)), input_name='RecognizeAlternateCityNames'), namespace_)) + if self.ReturnParsedElements is not None: + showIndent(outfile, level) + outfile.write('<%sReturnParsedElements>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.ReturnParsedElements)), input_name='ReturnParsedElements'), namespace_)) + def hasContent_(self): + if ( + self.VerifyAddresses is not None or + self.CheckResidentialStatus is not None or + self.MaximumNumberOfMatches is not None or + self.StreetAccuracy is not None or + self.DirectionalAccuracy is not None or + self.CompanyNameAccuracy is not None or + self.ConvertToUpperCase is not None or + self.RecognizeAlternateCityNames is not None or + self.ReturnParsedElements is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='AddressValidationOptions'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.VerifyAddresses is not None: + showIndent(outfile, level) + outfile.write('VerifyAddresses=%s,\n' % self.VerifyAddresses) + if self.CheckResidentialStatus is not None: + showIndent(outfile, level) + outfile.write('CheckResidentialStatus=%s,\n' % self.CheckResidentialStatus) + if self.MaximumNumberOfMatches is not None: + showIndent(outfile, level) + outfile.write('MaximumNumberOfMatches=%d,\n' % self.MaximumNumberOfMatches) + if self.StreetAccuracy is not None: + showIndent(outfile, level) + outfile.write('StreetAccuracy=%s,\n' % quote_python(self.StreetAccuracy).encode(ExternalEncoding)) + if self.DirectionalAccuracy is not None: + showIndent(outfile, level) + outfile.write('DirectionalAccuracy=%s,\n' % quote_python(self.DirectionalAccuracy).encode(ExternalEncoding)) + if self.CompanyNameAccuracy is not None: + showIndent(outfile, level) + outfile.write('CompanyNameAccuracy=%s,\n' % quote_python(self.CompanyNameAccuracy).encode(ExternalEncoding)) + if self.ConvertToUpperCase is not None: + showIndent(outfile, level) + outfile.write('ConvertToUpperCase=%s,\n' % self.ConvertToUpperCase) + if self.RecognizeAlternateCityNames is not None: + showIndent(outfile, level) + outfile.write('RecognizeAlternateCityNames=%s,\n' % self.RecognizeAlternateCityNames) + if self.ReturnParsedElements is not None: + showIndent(outfile, level) + outfile.write('ReturnParsedElements=%s,\n' % self.ReturnParsedElements) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'VerifyAddresses': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'VerifyAddresses') + self.VerifyAddresses = ival_ + elif nodeName_ == 'CheckResidentialStatus': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'CheckResidentialStatus') + self.CheckResidentialStatus = ival_ + elif nodeName_ == 'MaximumNumberOfMatches': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ <= 0: + raise_parse_error(child_, 'requires positiveInteger') + ival_ = self.gds_validate_integer(ival_, node, 'MaximumNumberOfMatches') + self.MaximumNumberOfMatches = ival_ + elif nodeName_ == 'StreetAccuracy': + StreetAccuracy_ = child_.text + StreetAccuracy_ = self.gds_validate_string(StreetAccuracy_, node, 'StreetAccuracy') + self.StreetAccuracy = StreetAccuracy_ + self.validate_AddressValidationAccuracyType(self.StreetAccuracy) # validate type AddressValidationAccuracyType + elif nodeName_ == 'DirectionalAccuracy': + DirectionalAccuracy_ = child_.text + DirectionalAccuracy_ = self.gds_validate_string(DirectionalAccuracy_, node, 'DirectionalAccuracy') + self.DirectionalAccuracy = DirectionalAccuracy_ + self.validate_AddressValidationAccuracyType(self.DirectionalAccuracy) # validate type AddressValidationAccuracyType + elif nodeName_ == 'CompanyNameAccuracy': + CompanyNameAccuracy_ = child_.text + CompanyNameAccuracy_ = self.gds_validate_string(CompanyNameAccuracy_, node, 'CompanyNameAccuracy') + self.CompanyNameAccuracy = CompanyNameAccuracy_ + self.validate_AddressValidationAccuracyType(self.CompanyNameAccuracy) # validate type AddressValidationAccuracyType + elif nodeName_ == 'ConvertToUpperCase': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'ConvertToUpperCase') + self.ConvertToUpperCase = ival_ + elif nodeName_ == 'RecognizeAlternateCityNames': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'RecognizeAlternateCityNames') + self.RecognizeAlternateCityNames = ival_ + elif nodeName_ == 'ReturnParsedElements': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'ReturnParsedElements') + self.ReturnParsedElements = ival_ +# end class AddressValidationOptions + + +class MaximumNumberOfMatches(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self): + pass + def factory(*args_, **kwargs_): + if MaximumNumberOfMatches.subclass: + return MaximumNumberOfMatches.subclass(*args_, **kwargs_) + else: + return MaximumNumberOfMatches(*args_, **kwargs_) + factory = staticmethod(factory) + def export(self, outfile, level, namespace_='ns:', name_='MaximumNumberOfMatches', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='MaximumNumberOfMatches') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='MaximumNumberOfMatches'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='MaximumNumberOfMatches', fromsubclass_=False): + pass + def hasContent_(self): + if ( + + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='MaximumNumberOfMatches'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + pass + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + pass +# end class MaximumNumberOfMatches + + +class AddressToValidate(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, AddressId=None, CompanyName=None, Address=None): + self.AddressId = AddressId + self.CompanyName = CompanyName + self.Address = Address + def factory(*args_, **kwargs_): + if AddressToValidate.subclass: + return AddressToValidate.subclass(*args_, **kwargs_) + else: + return AddressToValidate(*args_, **kwargs_) + factory = staticmethod(factory) + def get_AddressId(self): return self.AddressId + def set_AddressId(self, AddressId): self.AddressId = AddressId + def get_CompanyName(self): return self.CompanyName + def set_CompanyName(self, CompanyName): self.CompanyName = CompanyName + def get_Address(self): return self.Address + def set_Address(self, Address): self.Address = Address + def export(self, outfile, level, namespace_='ns:', name_='AddressToValidate', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='AddressToValidate') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='AddressToValidate'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='AddressToValidate', fromsubclass_=False): + if self.AddressId is not None: + showIndent(outfile, level) + outfile.write('<%sAddressId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AddressId).encode(ExternalEncoding), input_name='AddressId'), namespace_)) + if self.CompanyName is not None: + showIndent(outfile, level) + outfile.write('<%sCompanyName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CompanyName).encode(ExternalEncoding), input_name='CompanyName'), namespace_)) + if self.Address: + self.Address.export(outfile, level, namespace_, name_='Address', ) + def hasContent_(self): + if ( + self.AddressId is not None or + self.CompanyName is not None or + self.Address is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='AddressToValidate'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.AddressId is not None: + showIndent(outfile, level) + outfile.write('AddressId=%s,\n' % quote_python(self.AddressId).encode(ExternalEncoding)) + if self.CompanyName is not None: + showIndent(outfile, level) + outfile.write('CompanyName=%s,\n' % quote_python(self.CompanyName).encode(ExternalEncoding)) + if self.Address is not None: + showIndent(outfile, level) + outfile.write('Address=model_.Address(\n') + self.Address.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'AddressId': + AddressId_ = child_.text + AddressId_ = self.gds_validate_string(AddressId_, node, 'AddressId') + self.AddressId = AddressId_ + elif nodeName_ == 'CompanyName': + CompanyName_ = child_.text + CompanyName_ = self.gds_validate_string(CompanyName_, node, 'CompanyName') + self.CompanyName = CompanyName_ + elif nodeName_ == 'Address': + obj_ = Address.factory() + obj_.build(child_) + self.set_Address(obj_) +# end class AddressToValidate + + +class AddressValidationResult(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, AddressId=None, ProposedAddressDetails=None): + self.AddressId = AddressId + if ProposedAddressDetails is None: + self.ProposedAddressDetails = [] + else: + self.ProposedAddressDetails = ProposedAddressDetails + def factory(*args_, **kwargs_): + if AddressValidationResult.subclass: + return AddressValidationResult.subclass(*args_, **kwargs_) + else: + return AddressValidationResult(*args_, **kwargs_) + factory = staticmethod(factory) + def get_AddressId(self): return self.AddressId + def set_AddressId(self, AddressId): self.AddressId = AddressId + def get_ProposedAddressDetails(self): return self.ProposedAddressDetails + def set_ProposedAddressDetails(self, ProposedAddressDetails): self.ProposedAddressDetails = ProposedAddressDetails + def add_ProposedAddressDetails(self, value): self.ProposedAddressDetails.append(value) + def insert_ProposedAddressDetails(self, index, value): self.ProposedAddressDetails[index] = value + def export(self, outfile, level, namespace_='ns:', name_='AddressValidationResult', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='AddressValidationResult') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='AddressValidationResult'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='AddressValidationResult', fromsubclass_=False): + if self.AddressId is not None: + showIndent(outfile, level) + outfile.write('<%sAddressId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AddressId).encode(ExternalEncoding), input_name='AddressId'), namespace_)) + for ProposedAddressDetails_ in self.ProposedAddressDetails: + ProposedAddressDetails_.export(outfile, level, namespace_, name_='ProposedAddressDetails') + def hasContent_(self): + if ( + self.AddressId is not None or + self.ProposedAddressDetails + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='AddressValidationResult'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.AddressId is not None: + showIndent(outfile, level) + outfile.write('AddressId=%s,\n' % quote_python(self.AddressId).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('ProposedAddressDetails=[\n') + level += 1 + for ProposedAddressDetails_ in self.ProposedAddressDetails: + showIndent(outfile, level) + outfile.write('model_.ProposedAddressDetail(\n') + ProposedAddressDetails_.exportLiteral(outfile, level, name_='ProposedAddressDetail') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'AddressId': + AddressId_ = child_.text + AddressId_ = self.gds_validate_string(AddressId_, node, 'AddressId') + self.AddressId = AddressId_ + elif nodeName_ == 'ProposedAddressDetails': + obj_ = ProposedAddressDetail.factory() + obj_.build(child_) + self.ProposedAddressDetails.append(obj_) +# end class AddressValidationResult + + +class WebAuthenticationDetail(GeneratedsSuper): + """Used in authentication of the sender's identity.""" + subclass = None + superclass = None + def __init__(self, UserCredential=None): + self.UserCredential = UserCredential + def factory(*args_, **kwargs_): + if WebAuthenticationDetail.subclass: + return WebAuthenticationDetail.subclass(*args_, **kwargs_) + else: + return WebAuthenticationDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_UserCredential(self): return self.UserCredential + def set_UserCredential(self, UserCredential): self.UserCredential = UserCredential + def export(self, outfile, level, namespace_='ns:', name_='WebAuthenticationDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='WebAuthenticationDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='WebAuthenticationDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='WebAuthenticationDetail', fromsubclass_=False): + if self.UserCredential: + self.UserCredential.export(outfile, level, namespace_, name_='UserCredential', ) + def hasContent_(self): + if ( + self.UserCredential is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='WebAuthenticationDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.UserCredential is not None: + showIndent(outfile, level) + outfile.write('UserCredential=model_.WebAuthenticationCredential(\n') + self.UserCredential.exportLiteral(outfile, level, name_='UserCredential') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'UserCredential': + obj_ = WebAuthenticationCredential.factory() + obj_.build(child_) + self.set_UserCredential(obj_) +# end class WebAuthenticationDetail + + +class WebAuthenticationCredential(GeneratedsSuper): + """Two part authentication string used for the sender's identity.""" + subclass = None + superclass = None + def __init__(self, Key=None, Password=None): + self.Key = Key + self.Password = Password + def factory(*args_, **kwargs_): + if WebAuthenticationCredential.subclass: + return WebAuthenticationCredential.subclass(*args_, **kwargs_) + else: + return WebAuthenticationCredential(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Key(self): return self.Key + def set_Key(self, Key): self.Key = Key + def get_Password(self): return self.Password + def set_Password(self, Password): self.Password = Password + def export(self, outfile, level, namespace_='ns:', name_='WebAuthenticationCredential', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='WebAuthenticationCredential') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='WebAuthenticationCredential'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='WebAuthenticationCredential', fromsubclass_=False): + if self.Key is not None: + showIndent(outfile, level) + outfile.write('<%sKey>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Key).encode(ExternalEncoding), input_name='Key'), namespace_)) + if self.Password is not None: + showIndent(outfile, level) + outfile.write('<%sPassword>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Password).encode(ExternalEncoding), input_name='Password'), namespace_)) + def hasContent_(self): + if ( + self.Key is not None or + self.Password is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='WebAuthenticationCredential'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Key is not None: + showIndent(outfile, level) + outfile.write('Key=%s,\n' % quote_python(self.Key).encode(ExternalEncoding)) + if self.Password is not None: + showIndent(outfile, level) + outfile.write('Password=%s,\n' % quote_python(self.Password).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Key': + Key_ = child_.text + Key_ = self.gds_validate_string(Key_, node, 'Key') + self.Key = Key_ + elif nodeName_ == 'Password': + Password_ = child_.text + Password_ = self.gds_validate_string(Password_, node, 'Password') + self.Password = Password_ +# end class WebAuthenticationCredential + + +class ProposedAddressDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Score=None, Changes=None, ResidentialStatus=None, DeliveryPointValidation=None, CompanyName=None, Address=None, ParsedCompanyName=None, ParsedAddress=None, RemovedNonAddressData=None): + self.Score = Score + if Changes is None: + self.Changes = [] + else: + self.Changes = Changes + self.ResidentialStatus = ResidentialStatus + self.DeliveryPointValidation = DeliveryPointValidation + self.CompanyName = CompanyName + self.Address = Address + self.ParsedCompanyName = ParsedCompanyName + self.ParsedAddress = ParsedAddress + self.RemovedNonAddressData = RemovedNonAddressData + def factory(*args_, **kwargs_): + if ProposedAddressDetail.subclass: + return ProposedAddressDetail.subclass(*args_, **kwargs_) + else: + return ProposedAddressDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Score(self): return self.Score + def set_Score(self, Score): self.Score = Score + def get_Changes(self): return self.Changes + def set_Changes(self, Changes): self.Changes = Changes + def add_Changes(self, value): self.Changes.append(value) + def insert_Changes(self, index, value): self.Changes[index] = value + def validate_AddressValidationChangeType(self, value): + # Validate type AddressValidationChangeType, a restriction on xs:string. + pass + def get_ResidentialStatus(self): return self.ResidentialStatus + def set_ResidentialStatus(self, ResidentialStatus): self.ResidentialStatus = ResidentialStatus + def validate_ResidentialStatusType(self, value): + # Validate type ResidentialStatusType, a restriction on xs:string. + pass + def get_DeliveryPointValidation(self): return self.DeliveryPointValidation + def set_DeliveryPointValidation(self, DeliveryPointValidation): self.DeliveryPointValidation = DeliveryPointValidation + def validate_DeliveryPointValidationType(self, value): + # Validate type DeliveryPointValidationType, a restriction on xs:string. + pass + def get_CompanyName(self): return self.CompanyName + def set_CompanyName(self, CompanyName): self.CompanyName = CompanyName + def get_Address(self): return self.Address + def set_Address(self, Address): self.Address = Address + def get_ParsedCompanyName(self): return self.ParsedCompanyName + def set_ParsedCompanyName(self, ParsedCompanyName): self.ParsedCompanyName = ParsedCompanyName + def get_ParsedAddress(self): return self.ParsedAddress + def set_ParsedAddress(self, ParsedAddress): self.ParsedAddress = ParsedAddress + def get_RemovedNonAddressData(self): return self.RemovedNonAddressData + def set_RemovedNonAddressData(self, RemovedNonAddressData): self.RemovedNonAddressData = RemovedNonAddressData + def export(self, outfile, level, namespace_='ns:', name_='ProposedAddressDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ProposedAddressDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ProposedAddressDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ProposedAddressDetail', fromsubclass_=False): + if self.Score is not None: + showIndent(outfile, level) + outfile.write('<%sScore>%s\n' % (namespace_, self.gds_format_integer(self.Score, input_name='Score'), namespace_)) + for Changes_ in self.Changes: + showIndent(outfile, level) + outfile.write('<%sChanges>%s\n' % (namespace_, self.gds_format_string(quote_xml(Changes_).encode(ExternalEncoding), input_name='Changes'), namespace_)) + if self.ResidentialStatus is not None: + showIndent(outfile, level) + outfile.write('<%sResidentialStatus>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ResidentialStatus).encode(ExternalEncoding), input_name='ResidentialStatus'), namespace_)) + if self.DeliveryPointValidation is not None: + showIndent(outfile, level) + outfile.write('<%sDeliveryPointValidation>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DeliveryPointValidation).encode(ExternalEncoding), input_name='DeliveryPointValidation'), namespace_)) + if self.CompanyName is not None: + showIndent(outfile, level) + outfile.write('<%sCompanyName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CompanyName).encode(ExternalEncoding), input_name='CompanyName'), namespace_)) + if self.Address: + self.Address.export(outfile, level, namespace_, name_='Address', ) + if self.ParsedCompanyName: + self.ParsedCompanyName.export(outfile, level, namespace_, name_='ParsedCompanyName') + if self.ParsedAddress: + self.ParsedAddress.export(outfile, level, namespace_, name_='ParsedAddress') + if self.RemovedNonAddressData is not None: + showIndent(outfile, level) + outfile.write('<%sRemovedNonAddressData>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RemovedNonAddressData).encode(ExternalEncoding), input_name='RemovedNonAddressData'), namespace_)) + def hasContent_(self): + if ( + self.Score is not None or + self.Changes or + self.ResidentialStatus is not None or + self.DeliveryPointValidation is not None or + self.CompanyName is not None or + self.Address is not None or + self.ParsedCompanyName is not None or + self.ParsedAddress is not None or + self.RemovedNonAddressData is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ProposedAddressDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Score is not None: + showIndent(outfile, level) + outfile.write('Score=%d,\n' % self.Score) + showIndent(outfile, level) + outfile.write('Changes=[\n') + level += 1 + for Changes_ in self.Changes: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(Changes_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.ResidentialStatus is not None: + showIndent(outfile, level) + outfile.write('ResidentialStatus=%s,\n' % quote_python(self.ResidentialStatus).encode(ExternalEncoding)) + if self.DeliveryPointValidation is not None: + showIndent(outfile, level) + outfile.write('DeliveryPointValidation=%s,\n' % quote_python(self.DeliveryPointValidation).encode(ExternalEncoding)) + if self.CompanyName is not None: + showIndent(outfile, level) + outfile.write('CompanyName=%s,\n' % quote_python(self.CompanyName).encode(ExternalEncoding)) + if self.Address is not None: + showIndent(outfile, level) + outfile.write('Address=model_.Address(\n') + self.Address.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ParsedCompanyName is not None: + showIndent(outfile, level) + outfile.write('ParsedCompanyName=model_.ParsedAddressPart(\n') + self.ParsedCompanyName.exportLiteral(outfile, level, name_='ParsedCompanyName') + showIndent(outfile, level) + outfile.write('),\n') + if self.ParsedAddress is not None: + showIndent(outfile, level) + outfile.write('ParsedAddress=model_.ParsedAddress(\n') + self.ParsedAddress.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.RemovedNonAddressData is not None: + showIndent(outfile, level) + outfile.write('RemovedNonAddressData=%s,\n' % quote_python(self.RemovedNonAddressData).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Score': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'Score') + self.Score = ival_ + elif nodeName_ == 'Changes': + Changes_ = child_.text + Changes_ = self.gds_validate_string(Changes_, node, 'Changes') + self.Changes.append(Changes_) + self.validate_AddressValidationChangeType(self.Changes) # validate type AddressValidationChangeType + elif nodeName_ == 'ResidentialStatus': + ResidentialStatus_ = child_.text + ResidentialStatus_ = self.gds_validate_string(ResidentialStatus_, node, 'ResidentialStatus') + self.ResidentialStatus = ResidentialStatus_ + self.validate_ResidentialStatusType(self.ResidentialStatus) # validate type ResidentialStatusType + elif nodeName_ == 'DeliveryPointValidation': + DeliveryPointValidation_ = child_.text + DeliveryPointValidation_ = self.gds_validate_string(DeliveryPointValidation_, node, 'DeliveryPointValidation') + self.DeliveryPointValidation = DeliveryPointValidation_ + self.validate_DeliveryPointValidationType(self.DeliveryPointValidation) # validate type DeliveryPointValidationType + elif nodeName_ == 'CompanyName': + CompanyName_ = child_.text + CompanyName_ = self.gds_validate_string(CompanyName_, node, 'CompanyName') + self.CompanyName = CompanyName_ + elif nodeName_ == 'Address': + obj_ = Address.factory() + obj_.build(child_) + self.set_Address(obj_) + elif nodeName_ == 'ParsedCompanyName': + obj_ = ParsedAddressPart.factory() + obj_.build(child_) + self.set_ParsedCompanyName(obj_) + elif nodeName_ == 'ParsedAddress': + obj_ = ParsedAddress.factory() + obj_.build(child_) + self.set_ParsedAddress(obj_) + elif nodeName_ == 'RemovedNonAddressData': + RemovedNonAddressData_ = child_.text + RemovedNonAddressData_ = self.gds_validate_string(RemovedNonAddressData_, node, 'RemovedNonAddressData') + self.RemovedNonAddressData = RemovedNonAddressData_ +# end class ProposedAddressDetail + + +class ParsedAddress(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, ParsedUrbanizationCode=None, ParsedStreetLine=None, ParsedCity=None, ParsedStateOrProvinceCode=None, ParsedPostalCode=None, ParsedCountryCode=None): + self.ParsedUrbanizationCode = ParsedUrbanizationCode + if ParsedStreetLine is None: + self.ParsedStreetLine = [] + else: + self.ParsedStreetLine = ParsedStreetLine + self.ParsedCity = ParsedCity + self.ParsedStateOrProvinceCode = ParsedStateOrProvinceCode + self.ParsedPostalCode = ParsedPostalCode + self.ParsedCountryCode = ParsedCountryCode + def factory(*args_, **kwargs_): + if ParsedAddress.subclass: + return ParsedAddress.subclass(*args_, **kwargs_) + else: + return ParsedAddress(*args_, **kwargs_) + factory = staticmethod(factory) + def get_ParsedUrbanizationCode(self): return self.ParsedUrbanizationCode + def set_ParsedUrbanizationCode(self, ParsedUrbanizationCode): self.ParsedUrbanizationCode = ParsedUrbanizationCode + def get_ParsedStreetLine(self): return self.ParsedStreetLine + def set_ParsedStreetLine(self, ParsedStreetLine): self.ParsedStreetLine = ParsedStreetLine + def add_ParsedStreetLine(self, value): self.ParsedStreetLine.append(value) + def insert_ParsedStreetLine(self, index, value): self.ParsedStreetLine[index] = value + def get_ParsedCity(self): return self.ParsedCity + def set_ParsedCity(self, ParsedCity): self.ParsedCity = ParsedCity + def get_ParsedStateOrProvinceCode(self): return self.ParsedStateOrProvinceCode + def set_ParsedStateOrProvinceCode(self, ParsedStateOrProvinceCode): self.ParsedStateOrProvinceCode = ParsedStateOrProvinceCode + def get_ParsedPostalCode(self): return self.ParsedPostalCode + def set_ParsedPostalCode(self, ParsedPostalCode): self.ParsedPostalCode = ParsedPostalCode + def get_ParsedCountryCode(self): return self.ParsedCountryCode + def set_ParsedCountryCode(self, ParsedCountryCode): self.ParsedCountryCode = ParsedCountryCode + def export(self, outfile, level, namespace_='ns:', name_='ParsedAddress', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ParsedAddress') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ParsedAddress'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ParsedAddress', fromsubclass_=False): + if self.ParsedUrbanizationCode: + self.ParsedUrbanizationCode.export(outfile, level, namespace_, name_='ParsedUrbanizationCode') + for ParsedStreetLine_ in self.ParsedStreetLine: + ParsedStreetLine_.export(outfile, level, namespace_, name_='ParsedStreetLine') + if self.ParsedCity: + self.ParsedCity.export(outfile, level, namespace_, name_='ParsedCity') + if self.ParsedStateOrProvinceCode: + self.ParsedStateOrProvinceCode.export(outfile, level, namespace_, name_='ParsedStateOrProvinceCode') + if self.ParsedPostalCode: + self.ParsedPostalCode.export(outfile, level, namespace_, name_='ParsedPostalCode') + if self.ParsedCountryCode: + self.ParsedCountryCode.export(outfile, level, namespace_, name_='ParsedCountryCode') + def hasContent_(self): + if ( + self.ParsedUrbanizationCode is not None or + self.ParsedStreetLine or + self.ParsedCity is not None or + self.ParsedStateOrProvinceCode is not None or + self.ParsedPostalCode is not None or + self.ParsedCountryCode is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ParsedAddress'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.ParsedUrbanizationCode is not None: + showIndent(outfile, level) + outfile.write('ParsedUrbanizationCode=model_.ParsedAddressPart(\n') + self.ParsedUrbanizationCode.exportLiteral(outfile, level, name_='ParsedUrbanizationCode') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('ParsedStreetLine=[\n') + level += 1 + for ParsedStreetLine_ in self.ParsedStreetLine: + showIndent(outfile, level) + outfile.write('model_.ParsedAddressPart(\n') + ParsedStreetLine_.exportLiteral(outfile, level, name_='ParsedAddressPart') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.ParsedCity is not None: + showIndent(outfile, level) + outfile.write('ParsedCity=model_.ParsedAddressPart(\n') + self.ParsedCity.exportLiteral(outfile, level, name_='ParsedCity') + showIndent(outfile, level) + outfile.write('),\n') + if self.ParsedStateOrProvinceCode is not None: + showIndent(outfile, level) + outfile.write('ParsedStateOrProvinceCode=model_.ParsedAddressPart(\n') + self.ParsedStateOrProvinceCode.exportLiteral(outfile, level, name_='ParsedStateOrProvinceCode') + showIndent(outfile, level) + outfile.write('),\n') + if self.ParsedPostalCode is not None: + showIndent(outfile, level) + outfile.write('ParsedPostalCode=model_.ParsedAddressPart(\n') + self.ParsedPostalCode.exportLiteral(outfile, level, name_='ParsedPostalCode') + showIndent(outfile, level) + outfile.write('),\n') + if self.ParsedCountryCode is not None: + showIndent(outfile, level) + outfile.write('ParsedCountryCode=model_.ParsedAddressPart(\n') + self.ParsedCountryCode.exportLiteral(outfile, level, name_='ParsedCountryCode') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'ParsedUrbanizationCode': + obj_ = ParsedAddressPart.factory() + obj_.build(child_) + self.set_ParsedUrbanizationCode(obj_) + elif nodeName_ == 'ParsedStreetLine': + obj_ = ParsedAddressPart.factory() + obj_.build(child_) + self.ParsedStreetLine.append(obj_) + elif nodeName_ == 'ParsedCity': + obj_ = ParsedAddressPart.factory() + obj_.build(child_) + self.set_ParsedCity(obj_) + elif nodeName_ == 'ParsedStateOrProvinceCode': + obj_ = ParsedAddressPart.factory() + obj_.build(child_) + self.set_ParsedStateOrProvinceCode(obj_) + elif nodeName_ == 'ParsedPostalCode': + obj_ = ParsedAddressPart.factory() + obj_.build(child_) + self.set_ParsedPostalCode(obj_) + elif nodeName_ == 'ParsedCountryCode': + obj_ = ParsedAddressPart.factory() + obj_.build(child_) + self.set_ParsedCountryCode(obj_) +# end class ParsedAddress + + +class ParsedAddressPart(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Elements=None): + if Elements is None: + self.Elements = [] + else: + self.Elements = Elements + def factory(*args_, **kwargs_): + if ParsedAddressPart.subclass: + return ParsedAddressPart.subclass(*args_, **kwargs_) + else: + return ParsedAddressPart(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Elements(self): return self.Elements + def set_Elements(self, Elements): self.Elements = Elements + def add_Elements(self, value): self.Elements.append(value) + def insert_Elements(self, index, value): self.Elements[index] = value + def export(self, outfile, level, namespace_='ns:', name_='ParsedAddressPart', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ParsedAddressPart') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ParsedAddressPart'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ParsedAddressPart', fromsubclass_=False): + for Elements_ in self.Elements: + Elements_.export(outfile, level, namespace_, name_='Elements') + def hasContent_(self): + if ( + self.Elements + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ParsedAddressPart'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('Elements=[\n') + level += 1 + for Elements_ in self.Elements: + showIndent(outfile, level) + outfile.write('model_.ParsedElement(\n') + Elements_.exportLiteral(outfile, level, name_='ParsedElement') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Elements': + obj_ = ParsedElement.factory() + obj_.build(child_) + self.Elements.append(obj_) +# end class ParsedAddressPart + + +class ParsedElement(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Name=None, Value=None, Changes=None): + self.Name = Name + self.Value = Value + if Changes is None: + self.Changes = [] + else: + self.Changes = Changes + def factory(*args_, **kwargs_): + if ParsedElement.subclass: + return ParsedElement.subclass(*args_, **kwargs_) + else: + return ParsedElement(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Name(self): return self.Name + def set_Name(self, Name): self.Name = Name + def get_Value(self): return self.Value + def set_Value(self, Value): self.Value = Value + def get_Changes(self): return self.Changes + def set_Changes(self, Changes): self.Changes = Changes + def add_Changes(self, value): self.Changes.append(value) + def insert_Changes(self, index, value): self.Changes[index] = value + def validate_AddressValidationChangeType(self, value): + # Validate type AddressValidationChangeType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='ParsedElement', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ParsedElement') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ParsedElement'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ParsedElement', fromsubclass_=False): + if self.Name is not None: + showIndent(outfile, level) + outfile.write('<%sName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Name).encode(ExternalEncoding), input_name='Name'), namespace_)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('<%sValue>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Value).encode(ExternalEncoding), input_name='Value'), namespace_)) + for Changes_ in self.Changes: + showIndent(outfile, level) + outfile.write('<%sChanges>%s\n' % (namespace_, self.gds_format_string(quote_xml(Changes_).encode(ExternalEncoding), input_name='Changes'), namespace_)) + def hasContent_(self): + if ( + self.Name is not None or + self.Value is not None or + self.Changes + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ParsedElement'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Name is not None: + showIndent(outfile, level) + outfile.write('Name=%s,\n' % quote_python(self.Name).encode(ExternalEncoding)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('Value=%s,\n' % quote_python(self.Value).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Changes=[\n') + level += 1 + for Changes_ in self.Changes: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(Changes_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Name': + Name_ = child_.text + Name_ = self.gds_validate_string(Name_, node, 'Name') + self.Name = Name_ + elif nodeName_ == 'Value': + Value_ = child_.text + Value_ = self.gds_validate_string(Value_, node, 'Value') + self.Value = Value_ + elif nodeName_ == 'Changes': + Changes_ = child_.text + Changes_ = self.gds_validate_string(Changes_, node, 'Changes') + self.Changes.append(Changes_) + self.validate_AddressValidationChangeType(self.Changes) # validate type AddressValidationChangeType +# end class ParsedElement + + +class ClientDetail(GeneratedsSuper): + """The descriptive data identifying the client submitting the + transaction.""" + subclass = None + superclass = None + def __init__(self, AccountNumber=None, MeterNumber=None, Localization=None): + self.AccountNumber = AccountNumber + self.MeterNumber = MeterNumber + self.Localization = Localization + def factory(*args_, **kwargs_): + if ClientDetail.subclass: + return ClientDetail.subclass(*args_, **kwargs_) + else: + return ClientDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_AccountNumber(self): return self.AccountNumber + def set_AccountNumber(self, AccountNumber): self.AccountNumber = AccountNumber + def get_MeterNumber(self): return self.MeterNumber + def set_MeterNumber(self, MeterNumber): self.MeterNumber = MeterNumber + def get_Localization(self): return self.Localization + def set_Localization(self, Localization): self.Localization = Localization + def export(self, outfile, level, namespace_='ns:', name_='ClientDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ClientDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ClientDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ClientDetail', fromsubclass_=False): + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('<%sAccountNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AccountNumber).encode(ExternalEncoding), input_name='AccountNumber'), namespace_)) + if self.MeterNumber is not None: + showIndent(outfile, level) + outfile.write('<%sMeterNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.MeterNumber).encode(ExternalEncoding), input_name='MeterNumber'), namespace_)) + if self.Localization: + self.Localization.export(outfile, level, namespace_, name_='Localization') + def hasContent_(self): + if ( + self.AccountNumber is not None or + self.MeterNumber is not None or + self.Localization is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ClientDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('AccountNumber=%s,\n' % quote_python(self.AccountNumber).encode(ExternalEncoding)) + if self.MeterNumber is not None: + showIndent(outfile, level) + outfile.write('MeterNumber=%s,\n' % quote_python(self.MeterNumber).encode(ExternalEncoding)) + if self.Localization is not None: + showIndent(outfile, level) + outfile.write('Localization=model_.Localization(\n') + self.Localization.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'AccountNumber': + AccountNumber_ = child_.text + AccountNumber_ = self.gds_validate_string(AccountNumber_, node, 'AccountNumber') + self.AccountNumber = AccountNumber_ + elif nodeName_ == 'MeterNumber': + MeterNumber_ = child_.text + MeterNumber_ = self.gds_validate_string(MeterNumber_, node, 'MeterNumber') + self.MeterNumber = MeterNumber_ + elif nodeName_ == 'Localization': + obj_ = Localization.factory() + obj_.build(child_) + self.set_Localization(obj_) +# end class ClientDetail + + +class Localization(GeneratedsSuper): + """Governs any future language/translations used for human-readable + text.""" + subclass = None + superclass = None + def __init__(self, LanguageCode=None, LocaleCode=None): + self.LanguageCode = LanguageCode + self.LocaleCode = LocaleCode + def factory(*args_, **kwargs_): + if Localization.subclass: + return Localization.subclass(*args_, **kwargs_) + else: + return Localization(*args_, **kwargs_) + factory = staticmethod(factory) + def get_LanguageCode(self): return self.LanguageCode + def set_LanguageCode(self, LanguageCode): self.LanguageCode = LanguageCode + def get_LocaleCode(self): return self.LocaleCode + def set_LocaleCode(self, LocaleCode): self.LocaleCode = LocaleCode + def export(self, outfile, level, namespace_='ns:', name_='Localization', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Localization') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Localization'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Localization', fromsubclass_=False): + if self.LanguageCode is not None: + showIndent(outfile, level) + outfile.write('<%sLanguageCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LanguageCode).encode(ExternalEncoding), input_name='LanguageCode'), namespace_)) + if self.LocaleCode is not None: + showIndent(outfile, level) + outfile.write('<%sLocaleCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LocaleCode).encode(ExternalEncoding), input_name='LocaleCode'), namespace_)) + def hasContent_(self): + if ( + self.LanguageCode is not None or + self.LocaleCode is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Localization'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.LanguageCode is not None: + showIndent(outfile, level) + outfile.write('LanguageCode=%s,\n' % quote_python(self.LanguageCode).encode(ExternalEncoding)) + if self.LocaleCode is not None: + showIndent(outfile, level) + outfile.write('LocaleCode=%s,\n' % quote_python(self.LocaleCode).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'LanguageCode': + LanguageCode_ = child_.text + LanguageCode_ = self.gds_validate_string(LanguageCode_, node, 'LanguageCode') + self.LanguageCode = LanguageCode_ + elif nodeName_ == 'LocaleCode': + LocaleCode_ = child_.text + LocaleCode_ = self.gds_validate_string(LocaleCode_, node, 'LocaleCode') + self.LocaleCode = LocaleCode_ +# end class Localization + + +class TransactionDetail(GeneratedsSuper): + """Descriptive data for this customer transaction. The + TransactionDetail from the request is echoed back to the caller + in the corresponding reply.""" + subclass = None + superclass = None + def __init__(self, CustomerTransactionId=None, Localization=None): + self.CustomerTransactionId = CustomerTransactionId + self.Localization = Localization + def factory(*args_, **kwargs_): + if TransactionDetail.subclass: + return TransactionDetail.subclass(*args_, **kwargs_) + else: + return TransactionDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_CustomerTransactionId(self): return self.CustomerTransactionId + def set_CustomerTransactionId(self, CustomerTransactionId): self.CustomerTransactionId = CustomerTransactionId + def get_Localization(self): return self.Localization + def set_Localization(self, Localization): self.Localization = Localization + def export(self, outfile, level, namespace_='ns:', name_='TransactionDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='TransactionDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='TransactionDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='TransactionDetail', fromsubclass_=False): + if self.CustomerTransactionId is not None: + showIndent(outfile, level) + outfile.write('<%sCustomerTransactionId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CustomerTransactionId).encode(ExternalEncoding), input_name='CustomerTransactionId'), namespace_)) + if self.Localization: + self.Localization.export(outfile, level, namespace_, name_='Localization') + def hasContent_(self): + if ( + self.CustomerTransactionId is not None or + self.Localization is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='TransactionDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.CustomerTransactionId is not None: + showIndent(outfile, level) + outfile.write('CustomerTransactionId=%s,\n' % quote_python(self.CustomerTransactionId).encode(ExternalEncoding)) + if self.Localization is not None: + showIndent(outfile, level) + outfile.write('Localization=model_.Localization(\n') + self.Localization.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'CustomerTransactionId': + CustomerTransactionId_ = child_.text + CustomerTransactionId_ = self.gds_validate_string(CustomerTransactionId_, node, 'CustomerTransactionId') + self.CustomerTransactionId = CustomerTransactionId_ + elif nodeName_ == 'Localization': + obj_ = Localization.factory() + obj_.build(child_) + self.set_Localization(obj_) +# end class TransactionDetail + + +class VersionId(GeneratedsSuper): + """Identifies the version/level of a service operation expected by a + caller (in each request) and performed by the callee (in each + reply).""" + subclass = None + superclass = None + def __init__(self, ServiceId=None, Major=None, Intermediate=None, Minor=None): + self.ServiceId = ServiceId + self.Major = Major + self.Intermediate = Intermediate + self.Minor = Minor + def factory(*args_, **kwargs_): + if VersionId.subclass: + return VersionId.subclass(*args_, **kwargs_) + else: + return VersionId(*args_, **kwargs_) + factory = staticmethod(factory) + def get_ServiceId(self): return self.ServiceId + def set_ServiceId(self, ServiceId): self.ServiceId = ServiceId + def get_Major(self): return self.Major + def set_Major(self, Major): self.Major = Major + def get_Intermediate(self): return self.Intermediate + def set_Intermediate(self, Intermediate): self.Intermediate = Intermediate + def get_Minor(self): return self.Minor + def set_Minor(self, Minor): self.Minor = Minor + def export(self, outfile, level, namespace_='ns:', name_='VersionId', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='VersionId') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='VersionId'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='VersionId', fromsubclass_=False): + if self.ServiceId is not None: + showIndent(outfile, level) + outfile.write('<%sServiceId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ServiceId).encode(ExternalEncoding), input_name='ServiceId'), namespace_)) + if self.Major is not None: + showIndent(outfile, level) + outfile.write('<%sMajor>%s\n' % (namespace_, self.gds_format_integer(self.Major, input_name='Major'), namespace_)) + if self.Intermediate is not None: + showIndent(outfile, level) + outfile.write('<%sIntermediate>%s\n' % (namespace_, self.gds_format_integer(self.Intermediate, input_name='Intermediate'), namespace_)) + if self.Minor is not None: + showIndent(outfile, level) + outfile.write('<%sMinor>%s\n' % (namespace_, self.gds_format_integer(self.Minor, input_name='Minor'), namespace_)) + def hasContent_(self): + if ( + self.ServiceId is not None or + self.Major is not None or + self.Intermediate is not None or + self.Minor is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='VersionId'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.ServiceId is not None: + showIndent(outfile, level) + outfile.write('ServiceId=%s,\n' % quote_python(self.ServiceId).encode(ExternalEncoding)) + if self.Major is not None: + showIndent(outfile, level) + outfile.write('Major=%d,\n' % self.Major) + if self.Intermediate is not None: + showIndent(outfile, level) + outfile.write('Intermediate=%d,\n' % self.Intermediate) + if self.Minor is not None: + showIndent(outfile, level) + outfile.write('Minor=%d,\n' % self.Minor) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'ServiceId': + ServiceId_ = child_.text + ServiceId_ = self.gds_validate_string(ServiceId_, node, 'ServiceId') + self.ServiceId = ServiceId_ + elif nodeName_ == 'Major': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'Major') + self.Major = ival_ + elif nodeName_ == 'Intermediate': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'Intermediate') + self.Intermediate = ival_ + elif nodeName_ == 'Minor': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'Minor') + self.Minor = ival_ +# end class VersionId + + +class Notification(GeneratedsSuper): + """The descriptive data regarding the results of the submitted + transaction.""" + subclass = None + superclass = None + def __init__(self, Severity=None, Source=None, Code=None, Message=None, LocalizedMessage=None, MessageParameters=None): + self.Severity = Severity + self.Source = Source + self.Code = Code + self.Message = Message + self.LocalizedMessage = LocalizedMessage + if MessageParameters is None: + self.MessageParameters = [] + else: + self.MessageParameters = MessageParameters + def factory(*args_, **kwargs_): + if Notification.subclass: + return Notification.subclass(*args_, **kwargs_) + else: + return Notification(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Severity(self): return self.Severity + def set_Severity(self, Severity): self.Severity = Severity + def validate_NotificationSeverityType(self, value): + # Validate type NotificationSeverityType, a restriction on xs:string. + pass + def get_Source(self): return self.Source + def set_Source(self, Source): self.Source = Source + def get_Code(self): return self.Code + def set_Code(self, Code): self.Code = Code + def get_Message(self): return self.Message + def set_Message(self, Message): self.Message = Message + def get_LocalizedMessage(self): return self.LocalizedMessage + def set_LocalizedMessage(self, LocalizedMessage): self.LocalizedMessage = LocalizedMessage + def get_MessageParameters(self): return self.MessageParameters + def set_MessageParameters(self, MessageParameters): self.MessageParameters = MessageParameters + def add_MessageParameters(self, value): self.MessageParameters.append(value) + def insert_MessageParameters(self, index, value): self.MessageParameters[index] = value + def export(self, outfile, level, namespace_='ns:', name_='Notification', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Notification') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Notification'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Notification', fromsubclass_=False): + if self.Severity is not None: + showIndent(outfile, level) + outfile.write('<%sSeverity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Severity).encode(ExternalEncoding), input_name='Severity'), namespace_)) + if self.Source is not None: + showIndent(outfile, level) + outfile.write('<%sSource>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Source).encode(ExternalEncoding), input_name='Source'), namespace_)) + if self.Code is not None: + showIndent(outfile, level) + outfile.write('<%sCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Code).encode(ExternalEncoding), input_name='Code'), namespace_)) + if self.Message is not None: + showIndent(outfile, level) + outfile.write('<%sMessage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Message).encode(ExternalEncoding), input_name='Message'), namespace_)) + if self.LocalizedMessage is not None: + showIndent(outfile, level) + outfile.write('<%sLocalizedMessage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LocalizedMessage).encode(ExternalEncoding), input_name='LocalizedMessage'), namespace_)) + for MessageParameters_ in self.MessageParameters: + MessageParameters_.export(outfile, level, namespace_, name_='MessageParameters') + def hasContent_(self): + if ( + self.Severity is not None or + self.Source is not None or + self.Code is not None or + self.Message is not None or + self.LocalizedMessage is not None or + self.MessageParameters + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Notification'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Severity is not None: + showIndent(outfile, level) + outfile.write('Severity=%s,\n' % quote_python(self.Severity).encode(ExternalEncoding)) + if self.Source is not None: + showIndent(outfile, level) + outfile.write('Source=%s,\n' % quote_python(self.Source).encode(ExternalEncoding)) + if self.Code is not None: + showIndent(outfile, level) + outfile.write('Code=%s,\n' % quote_python(self.Code).encode(ExternalEncoding)) + if self.Message is not None: + showIndent(outfile, level) + outfile.write('Message=%s,\n' % quote_python(self.Message).encode(ExternalEncoding)) + if self.LocalizedMessage is not None: + showIndent(outfile, level) + outfile.write('LocalizedMessage=%s,\n' % quote_python(self.LocalizedMessage).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('MessageParameters=[\n') + level += 1 + for MessageParameters_ in self.MessageParameters: + showIndent(outfile, level) + outfile.write('model_.NotificationParameter(\n') + MessageParameters_.exportLiteral(outfile, level, name_='NotificationParameter') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Severity': + Severity_ = child_.text + Severity_ = self.gds_validate_string(Severity_, node, 'Severity') + self.Severity = Severity_ + self.validate_NotificationSeverityType(self.Severity) # validate type NotificationSeverityType + elif nodeName_ == 'Source': + Source_ = child_.text + Source_ = self.gds_validate_string(Source_, node, 'Source') + self.Source = Source_ + elif nodeName_ == 'Code': + Code_ = child_.text + Code_ = self.gds_validate_string(Code_, node, 'Code') + self.Code = Code_ + elif nodeName_ == 'Message': + Message_ = child_.text + Message_ = self.gds_validate_string(Message_, node, 'Message') + self.Message = Message_ + elif nodeName_ == 'LocalizedMessage': + LocalizedMessage_ = child_.text + LocalizedMessage_ = self.gds_validate_string(LocalizedMessage_, node, 'LocalizedMessage') + self.LocalizedMessage = LocalizedMessage_ + elif nodeName_ == 'MessageParameters': + obj_ = NotificationParameter.factory() + obj_.build(child_) + self.MessageParameters.append(obj_) +# end class Notification + + +class NotificationParameter(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Id=None, Value=None): + self.Id = Id + self.Value = Value + def factory(*args_, **kwargs_): + if NotificationParameter.subclass: + return NotificationParameter.subclass(*args_, **kwargs_) + else: + return NotificationParameter(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Id(self): return self.Id + def set_Id(self, Id): self.Id = Id + def get_Value(self): return self.Value + def set_Value(self, Value): self.Value = Value + def export(self, outfile, level, namespace_='ns:', name_='NotificationParameter', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='NotificationParameter') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='NotificationParameter'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='NotificationParameter', fromsubclass_=False): + if self.Id is not None: + showIndent(outfile, level) + outfile.write('<%sId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Id).encode(ExternalEncoding), input_name='Id'), namespace_)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('<%sValue>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Value).encode(ExternalEncoding), input_name='Value'), namespace_)) + def hasContent_(self): + if ( + self.Id is not None or + self.Value is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='NotificationParameter'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Id is not None: + showIndent(outfile, level) + outfile.write('Id=%s,\n' % quote_python(self.Id).encode(ExternalEncoding)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('Value=%s,\n' % quote_python(self.Value).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Id': + Id_ = child_.text + Id_ = self.gds_validate_string(Id_, node, 'Id') + self.Id = Id_ + elif nodeName_ == 'Value': + Value_ = child_.text + Value_ = self.gds_validate_string(Value_, node, 'Value') + self.Value = Value_ +# end class NotificationParameter + + +class Address(GeneratedsSuper): + """The descriptive data for a physical location.""" + subclass = None + superclass = None + def __init__(self, StreetLines=None, City=None, StateOrProvinceCode=None, PostalCode=None, UrbanizationCode=None, CountryCode=None, Residential=None): + if StreetLines is None: + self.StreetLines = [] + else: + self.StreetLines = StreetLines + self.City = City + self.StateOrProvinceCode = StateOrProvinceCode + self.PostalCode = PostalCode + self.UrbanizationCode = UrbanizationCode + self.CountryCode = CountryCode + self.Residential = Residential + def factory(*args_, **kwargs_): + if Address.subclass: + return Address.subclass(*args_, **kwargs_) + else: + return Address(*args_, **kwargs_) + factory = staticmethod(factory) + def get_StreetLines(self): return self.StreetLines + def set_StreetLines(self, StreetLines): self.StreetLines = StreetLines + def add_StreetLines(self, value): self.StreetLines.append(value) + def insert_StreetLines(self, index, value): self.StreetLines[index] = value + def get_City(self): return self.City + def set_City(self, City): self.City = City + def get_StateOrProvinceCode(self): return self.StateOrProvinceCode + def set_StateOrProvinceCode(self, StateOrProvinceCode): self.StateOrProvinceCode = StateOrProvinceCode + def get_PostalCode(self): return self.PostalCode + def set_PostalCode(self, PostalCode): self.PostalCode = PostalCode + def get_UrbanizationCode(self): return self.UrbanizationCode + def set_UrbanizationCode(self, UrbanizationCode): self.UrbanizationCode = UrbanizationCode + def get_CountryCode(self): return self.CountryCode + def set_CountryCode(self, CountryCode): self.CountryCode = CountryCode + def get_Residential(self): return self.Residential + def set_Residential(self, Residential): self.Residential = Residential + def export(self, outfile, level, namespace_='ns:', name_='Address', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Address') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Address'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Address', fromsubclass_=False): + for StreetLines_ in self.StreetLines: + showIndent(outfile, level) + outfile.write('<%sStreetLines>%s\n' % (namespace_, self.gds_format_string(quote_xml(StreetLines_).encode(ExternalEncoding), input_name='StreetLines'), namespace_)) + if self.City is not None: + showIndent(outfile, level) + outfile.write('<%sCity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.City).encode(ExternalEncoding), input_name='City'), namespace_)) + if self.StateOrProvinceCode is not None: + showIndent(outfile, level) + outfile.write('<%sStateOrProvinceCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.StateOrProvinceCode).encode(ExternalEncoding), input_name='StateOrProvinceCode'), namespace_)) + if self.PostalCode is not None: + showIndent(outfile, level) + outfile.write('<%sPostalCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PostalCode).encode(ExternalEncoding), input_name='PostalCode'), namespace_)) + if self.UrbanizationCode is not None: + showIndent(outfile, level) + outfile.write('<%sUrbanizationCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.UrbanizationCode).encode(ExternalEncoding), input_name='UrbanizationCode'), namespace_)) + if self.CountryCode is not None: + showIndent(outfile, level) + outfile.write('<%sCountryCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CountryCode).encode(ExternalEncoding), input_name='CountryCode'), namespace_)) + if self.Residential is not None: + showIndent(outfile, level) + outfile.write('<%sResidential>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.Residential)), input_name='Residential'), namespace_)) + def hasContent_(self): + if ( + self.StreetLines or + self.City is not None or + self.StateOrProvinceCode is not None or + self.PostalCode is not None or + self.UrbanizationCode is not None or + self.CountryCode is not None or + self.Residential is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Address'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('StreetLines=[\n') + level += 1 + for StreetLines_ in self.StreetLines: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(StreetLines_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.City is not None: + showIndent(outfile, level) + outfile.write('City=%s,\n' % quote_python(self.City).encode(ExternalEncoding)) + if self.StateOrProvinceCode is not None: + showIndent(outfile, level) + outfile.write('StateOrProvinceCode=%s,\n' % quote_python(self.StateOrProvinceCode).encode(ExternalEncoding)) + if self.PostalCode is not None: + showIndent(outfile, level) + outfile.write('PostalCode=%s,\n' % quote_python(self.PostalCode).encode(ExternalEncoding)) + if self.UrbanizationCode is not None: + showIndent(outfile, level) + outfile.write('UrbanizationCode=%s,\n' % quote_python(self.UrbanizationCode).encode(ExternalEncoding)) + if self.CountryCode is not None: + showIndent(outfile, level) + outfile.write('CountryCode=%s,\n' % quote_python(self.CountryCode).encode(ExternalEncoding)) + if self.Residential is not None: + showIndent(outfile, level) + outfile.write('Residential=%s,\n' % self.Residential) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'StreetLines': + StreetLines_ = child_.text + StreetLines_ = self.gds_validate_string(StreetLines_, node, 'StreetLines') + self.StreetLines.append(StreetLines_) + elif nodeName_ == 'City': + City_ = child_.text + City_ = self.gds_validate_string(City_, node, 'City') + self.City = City_ + elif nodeName_ == 'StateOrProvinceCode': + StateOrProvinceCode_ = child_.text + StateOrProvinceCode_ = self.gds_validate_string(StateOrProvinceCode_, node, 'StateOrProvinceCode') + self.StateOrProvinceCode = StateOrProvinceCode_ + elif nodeName_ == 'PostalCode': + PostalCode_ = child_.text + PostalCode_ = self.gds_validate_string(PostalCode_, node, 'PostalCode') + self.PostalCode = PostalCode_ + elif nodeName_ == 'UrbanizationCode': + UrbanizationCode_ = child_.text + UrbanizationCode_ = self.gds_validate_string(UrbanizationCode_, node, 'UrbanizationCode') + self.UrbanizationCode = UrbanizationCode_ + elif nodeName_ == 'CountryCode': + CountryCode_ = child_.text + CountryCode_ = self.gds_validate_string(CountryCode_, node, 'CountryCode') + self.CountryCode = CountryCode_ + elif nodeName_ == 'Residential': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'Residential') + self.Residential = ival_ +# end class Address + + +USAGE_TEXT = """ +Usage: python .py [ -s ] +""" + +def usage(): + print USAGE_TEXT + sys.exit(1) + + +def get_root_tag(node): + tag = Tag_pattern_.match(node.tag).groups()[-1] + rootClass = globals().get(tag) + return tag, rootClass + + +def parse(inFileName): + doc = parsexml_(inFileName) + rootNode = doc.getroot() + rootTag, rootClass = get_root_tag(rootNode) + if rootClass is None: + rootTag = 'AddressValidationRequest' + rootClass = AddressValidationRequest + rootObj = rootClass.factory() + rootObj.build(rootNode) + # Enable Python to collect the space used by the DOM. + doc = None + sys.stdout.write('\n') + rootObj.export(sys.stdout, 0, name_=rootTag, + namespacedef_='') + return rootObj + + +def parseString(inString): + from StringIO import StringIO + doc = parsexml_(StringIO(inString)) + rootNode = doc.getroot() + rootTag, rootClass = get_root_tag(rootNode) + if rootClass is None: + rootTag = 'AddressValidationRequest' + rootClass = AddressValidationRequest + rootObj = rootClass.factory() + rootObj.build(rootNode) + # Enable Python to collect the space used by the DOM. + doc = None + sys.stdout.write('\n') + rootObj.export(sys.stdout, 0, name_="AddressValidationRequest", + namespacedef_='') + return rootObj + + +def parseLiteral(inFileName): + doc = parsexml_(inFileName) + rootNode = doc.getroot() + rootTag, rootClass = get_root_tag(rootNode) + if rootClass is None: + rootTag = 'AddressValidationRequest' + rootClass = AddressValidationRequest + rootObj = rootClass.factory() + rootObj.build(rootNode) + # Enable Python to collect the space used by the DOM. + doc = None + sys.stdout.write('#from avs import *\n\n') + sys.stdout.write('import avs as model_\n\n') + sys.stdout.write('rootObj = model_.rootTag(\n') + rootObj.exportLiteral(sys.stdout, 0, name_=rootTag) + sys.stdout.write(')\n') + return rootObj + + +def main(): + args = sys.argv[1:] + if len(args) == 1: + parse(args[0]) + else: + usage() + + +if __name__ == '__main__': + #import pdb; pdb.set_trace() + main() + + +__all__ = [ + "Address", + "AddressToValidate", + "AddressValidationOptions", + "AddressValidationReply", + "AddressValidationRequest", + "AddressValidationResult", + "ClientDetail", + "Localization", + "MaximumNumberOfMatches", + "Notification", + "NotificationParameter", + "ParsedAddress", + "ParsedAddressPart", + "ParsedElement", + "ProposedAddressDetail", + "TransactionDetail", + "VersionId", + "WebAuthenticationCredential", + "WebAuthenticationDetail" + ] diff --git a/webxml/fedex/close.py b/webxml/fedex/close.py new file mode 100644 index 0000000..86f56d7 --- /dev/null +++ b/webxml/fedex/close.py @@ -0,0 +1,4094 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# +# Generated Mon Nov 28 15:41:34 2011 by generateDS.py version 2.6a. +# + +import sys +import getopt +import re as re_ + +etree_ = None +Verbose_import_ = False +( XMLParser_import_none, XMLParser_import_lxml, + XMLParser_import_elementtree + ) = range(3) +XMLParser_import_library = None +try: + # lxml + from lxml import etree as etree_ + XMLParser_import_library = XMLParser_import_lxml + if Verbose_import_: + print("running with lxml.etree") +except ImportError: + try: + # cElementTree from Python 2.5+ + import xml.etree.cElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with cElementTree on Python 2.5+") + except ImportError: + try: + # ElementTree from Python 2.5+ + import xml.etree.ElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with ElementTree on Python 2.5+") + except ImportError: + try: + # normal cElementTree install + import cElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with cElementTree") + except ImportError: + try: + # normal ElementTree install + import elementtree.ElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with ElementTree") + except ImportError: + raise ImportError("Failed to import ElementTree from any known place") + +def parsexml_(*args, **kwargs): + if (XMLParser_import_library == XMLParser_import_lxml and + 'parser' not in kwargs): + # Use the lxml ElementTree compatible parser so that, e.g., + # we ignore comments. + kwargs['parser'] = etree_.ETCompatXMLParser() + doc = etree_.parse(*args, **kwargs) + return doc + +# +# User methods +# +# Calls to the methods in these classes are generated by generateDS.py. +# You can replace these methods by re-implementing the following class +# in a module named generatedssuper.py. + +try: + from generatedssuper import GeneratedsSuper +except ImportError, exp: + + class GeneratedsSuper(object): + def gds_format_string(self, input_data, input_name=''): + return input_data + def gds_validate_string(self, input_data, node, input_name=''): + return input_data + def gds_format_integer(self, input_data, input_name=''): + return '%d' % input_data + def gds_validate_integer(self, input_data, node, input_name=''): + return input_data + def gds_format_integer_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_integer_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + try: + fvalue = float(value) + except (TypeError, ValueError), exp: + raise_parse_error(node, 'Requires sequence of integers') + return input_data + def gds_format_float(self, input_data, input_name=''): + return '%f' % input_data + def gds_validate_float(self, input_data, node, input_name=''): + return input_data + def gds_format_float_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_float_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + try: + fvalue = float(value) + except (TypeError, ValueError), exp: + raise_parse_error(node, 'Requires sequence of floats') + return input_data + def gds_format_double(self, input_data, input_name=''): + return '%e' % input_data + def gds_validate_double(self, input_data, node, input_name=''): + return input_data + def gds_format_double_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_double_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + try: + fvalue = float(value) + except (TypeError, ValueError), exp: + raise_parse_error(node, 'Requires sequence of doubles') + return input_data + def gds_format_boolean(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_boolean(self, input_data, node, input_name=''): + return input_data + def gds_format_boolean_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_boolean_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + if value not in ('true', '1', 'false', '0', ): + raise_parse_error(node, 'Requires sequence of booleans ("true", "1", "false", "0")') + return input_data + def gds_str_lower(self, instring): + return instring.lower() + def get_path_(self, node): + path_list = [] + self.get_path_list_(node, path_list) + path_list.reverse() + path = '/'.join(path_list) + return path + Tag_strip_pattern_ = re_.compile(r'\{.*\}') + def get_path_list_(self, node, path_list): + if node is None: + return + tag = GeneratedsSuper.Tag_strip_pattern_.sub('', node.tag) + if tag: + path_list.append(tag) + self.get_path_list_(node.getparent(), path_list) + def get_class_obj_(self, node, default_class=None): + class_obj1 = default_class + if 'xsi' in node.nsmap: + classname = node.get('{%s}type' % node.nsmap['xsi']) + if classname is not None: + names = classname.split(':') + if len(names) == 2: + classname = names[1] + class_obj2 = globals().get(classname) + if class_obj2 is not None: + class_obj1 = class_obj2 + return class_obj1 + + +# +# If you have installed IPython you can uncomment and use the following. +# IPython is available from http://ipython.scipy.org/. +# + +## from IPython.Shell import IPShellEmbed +## args = '' +## ipshell = IPShellEmbed(args, +## banner = 'Dropping into IPython', +## exit_msg = 'Leaving Interpreter, back to program.') + +# Then use the following line where and when you want to drop into the +# IPython shell: +# ipshell(' -- Entering ipshell.\nHit Ctrl-D to exit') + +# +# Globals +# + +ExternalEncoding = 'ascii' +Tag_pattern_ = re_.compile(r'({.*})?(.*)') +String_cleanup_pat_ = re_.compile(r"[\n\r\s]+") +Namespace_extract_pat_ = re_.compile(r'{(.*)}(.*)') + +# +# Support/utility functions. +# + +def showIndent(outfile, level): + for idx in range(level): + outfile.write(' ') + +def quote_xml(inStr): + if not inStr: + return '' + s1 = (isinstance(inStr, basestring) and inStr or + '%s' % inStr) + s1 = s1.replace('&', '&') + s1 = s1.replace('<', '<') + s1 = s1.replace('>', '>') + return s1 + +def quote_attrib(inStr): + s1 = (isinstance(inStr, basestring) and inStr or + '%s' % inStr) + s1 = s1.replace('&', '&') + s1 = s1.replace('<', '<') + s1 = s1.replace('>', '>') + if '"' in s1: + if "'" in s1: + s1 = '"%s"' % s1.replace('"', """) + else: + s1 = "'%s'" % s1 + else: + s1 = '"%s"' % s1 + return s1 + +def quote_python(inStr): + s1 = inStr + if s1.find("'") == -1: + if s1.find('\n') == -1: + return "'%s'" % s1 + else: + return "'''%s'''" % s1 + else: + if s1.find('"') != -1: + s1 = s1.replace('"', '\\"') + if s1.find('\n') == -1: + return '"%s"' % s1 + else: + return '"""%s"""' % s1 + +def get_all_text_(node): + if node.text is not None: + text = node.text + else: + text = '' + for child in node: + if child.tail is not None: + text += child.tail + return text + +def find_attr_value_(attr_name, node): + attrs = node.attrib + attr_parts = attr_name.split(':') + value = None + if len(attr_parts) == 1: + value = attrs.get(attr_name) + elif len(attr_parts) == 2: + prefix, name = attr_parts + namespace = node.nsmap.get(prefix) + if namespace is not None: + value = attrs.get('{%s}%s' % (namespace, name, )) + return value + + +class GDSParseError(Exception): + pass + +def raise_parse_error(node, msg): + if XMLParser_import_library == XMLParser_import_lxml: + msg = '%s (element %s/line %d)' % (msg, node.tag, node.sourceline, ) + else: + msg = '%s (element %s)' % (msg, node.tag, ) + raise GDSParseError(msg) + + +class MixedContainer: + # Constants for category: + CategoryNone = 0 + CategoryText = 1 + CategorySimple = 2 + CategoryComplex = 3 + # Constants for content_type: + TypeNone = 0 + TypeText = 1 + TypeString = 2 + TypeInteger = 3 + TypeFloat = 4 + TypeDecimal = 5 + TypeDouble = 6 + TypeBoolean = 7 + def __init__(self, category, content_type, name, value): + self.category = category + self.content_type = content_type + self.name = name + self.value = value + def getCategory(self): + return self.category + def getContenttype(self, content_type): + return self.content_type + def getValue(self): + return self.value + def getName(self): + return self.name + def export(self, outfile, level, name, namespace): + if self.category == MixedContainer.CategoryText: + # Prevent exporting empty content as empty lines. + if self.value.strip(): + outfile.write(self.value) + elif self.category == MixedContainer.CategorySimple: + self.exportSimple(outfile, level, name) + else: # category == MixedContainer.CategoryComplex + self.value.export(outfile, level, namespace,name) + def exportSimple(self, outfile, level, name): + if self.content_type == MixedContainer.TypeString: + outfile.write('<%s>%s' % (self.name, self.value, self.name)) + elif self.content_type == MixedContainer.TypeInteger or \ + self.content_type == MixedContainer.TypeBoolean: + outfile.write('<%s>%d' % (self.name, self.value, self.name)) + elif self.content_type == MixedContainer.TypeFloat or \ + self.content_type == MixedContainer.TypeDecimal: + outfile.write('<%s>%f' % (self.name, self.value, self.name)) + elif self.content_type == MixedContainer.TypeDouble: + outfile.write('<%s>%g' % (self.name, self.value, self.name)) + def exportLiteral(self, outfile, level, name): + if self.category == MixedContainer.CategoryText: + showIndent(outfile, level) + outfile.write('model_.MixedContainer(%d, %d, "%s", "%s"),\n' % \ + (self.category, self.content_type, self.name, self.value)) + elif self.category == MixedContainer.CategorySimple: + showIndent(outfile, level) + outfile.write('model_.MixedContainer(%d, %d, "%s", "%s"),\n' % \ + (self.category, self.content_type, self.name, self.value)) + else: # category == MixedContainer.CategoryComplex + showIndent(outfile, level) + outfile.write('model_.MixedContainer(%d, %d, "%s",\n' % \ + (self.category, self.content_type, self.name,)) + self.value.exportLiteral(outfile, level + 1) + showIndent(outfile, level) + outfile.write(')\n') + + +class MemberSpec_(object): + def __init__(self, name='', data_type='', container=0): + self.name = name + self.data_type = data_type + self.container = container + def set_name(self, name): self.name = name + def get_name(self): return self.name + def set_data_type(self, data_type): self.data_type = data_type + def get_data_type_chain(self): return self.data_type + def get_data_type(self): + if isinstance(self.data_type, list): + if len(self.data_type) > 0: + return self.data_type[-1] + else: + return 'xs:string' + else: + return self.data_type + def set_container(self, container): self.container = container + def get_container(self): return self.container + +def _cast(typ, value): + if typ is None or value is None: + return value + return typ(value) + +# +# Data representation classes. +# + +class ClientDetail(GeneratedsSuper): + """Descriptive data for the client submitting a transaction.""" + subclass = None + superclass = None + def __init__(self, AccountNumber=None, MeterNumber=None, IntegratorId=None, Localization=None): + self.AccountNumber = AccountNumber + self.MeterNumber = MeterNumber + self.IntegratorId = IntegratorId + self.Localization = Localization + def factory(*args_, **kwargs_): + if ClientDetail.subclass: + return ClientDetail.subclass(*args_, **kwargs_) + else: + return ClientDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_AccountNumber(self): return self.AccountNumber + def set_AccountNumber(self, AccountNumber): self.AccountNumber = AccountNumber + def get_MeterNumber(self): return self.MeterNumber + def set_MeterNumber(self, MeterNumber): self.MeterNumber = MeterNumber + def get_IntegratorId(self): return self.IntegratorId + def set_IntegratorId(self, IntegratorId): self.IntegratorId = IntegratorId + def get_Localization(self): return self.Localization + def set_Localization(self, Localization): self.Localization = Localization + def export(self, outfile, level, namespace_='ns:', name_='ClientDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ClientDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ClientDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ClientDetail', fromsubclass_=False): + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('<%sAccountNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AccountNumber).encode(ExternalEncoding), input_name='AccountNumber'), namespace_)) + if self.MeterNumber is not None: + showIndent(outfile, level) + outfile.write('<%sMeterNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.MeterNumber).encode(ExternalEncoding), input_name='MeterNumber'), namespace_)) + if self.IntegratorId is not None: + showIndent(outfile, level) + outfile.write('<%sIntegratorId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.IntegratorId).encode(ExternalEncoding), input_name='IntegratorId'), namespace_)) + if self.Localization: + self.Localization.export(outfile, level, namespace_, name_='Localization') + def hasContent_(self): + if ( + self.AccountNumber is not None or + self.MeterNumber is not None or + self.IntegratorId is not None or + self.Localization is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ClientDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('AccountNumber=%s,\n' % quote_python(self.AccountNumber).encode(ExternalEncoding)) + if self.MeterNumber is not None: + showIndent(outfile, level) + outfile.write('MeterNumber=%s,\n' % quote_python(self.MeterNumber).encode(ExternalEncoding)) + if self.IntegratorId is not None: + showIndent(outfile, level) + outfile.write('IntegratorId=%s,\n' % quote_python(self.IntegratorId).encode(ExternalEncoding)) + if self.Localization is not None: + showIndent(outfile, level) + outfile.write('Localization=model_.Localization(\n') + self.Localization.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'AccountNumber': + AccountNumber_ = child_.text + AccountNumber_ = self.gds_validate_string(AccountNumber_, node, 'AccountNumber') + self.AccountNumber = AccountNumber_ + elif nodeName_ == 'MeterNumber': + MeterNumber_ = child_.text + MeterNumber_ = self.gds_validate_string(MeterNumber_, node, 'MeterNumber') + self.MeterNumber = MeterNumber_ + elif nodeName_ == 'IntegratorId': + IntegratorId_ = child_.text + IntegratorId_ = self.gds_validate_string(IntegratorId_, node, 'IntegratorId') + self.IntegratorId = IntegratorId_ + elif nodeName_ == 'Localization': + obj_ = Localization.factory() + obj_.build(child_) + self.set_Localization(obj_) +# end class ClientDetail + + +class CloseDocument(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Type=None, ShippingCycle=None, ShippingDocumentDisposition=None, AccessReference=None, Resolution=None, CopiesToPrint=None, Parts=None): + self.Type = Type + self.ShippingCycle = ShippingCycle + self.ShippingDocumentDisposition = ShippingDocumentDisposition + self.AccessReference = AccessReference + self.Resolution = Resolution + self.CopiesToPrint = CopiesToPrint + if Parts is None: + self.Parts = [] + else: + self.Parts = Parts + def factory(*args_, **kwargs_): + if CloseDocument.subclass: + return CloseDocument.subclass(*args_, **kwargs_) + else: + return CloseDocument(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Type(self): return self.Type + def set_Type(self, Type): self.Type = Type + def validate_CloseDocumentType(self, value): + # Validate type CloseDocumentType, a restriction on xs:string. + pass + def get_ShippingCycle(self): return self.ShippingCycle + def set_ShippingCycle(self, ShippingCycle): self.ShippingCycle = ShippingCycle + def get_ShippingDocumentDisposition(self): return self.ShippingDocumentDisposition + def set_ShippingDocumentDisposition(self, ShippingDocumentDisposition): self.ShippingDocumentDisposition = ShippingDocumentDisposition + def validate_ShippingDocumentDispositionType(self, value): + # Validate type ShippingDocumentDispositionType, a restriction on xs:string. + pass + def get_AccessReference(self): return self.AccessReference + def set_AccessReference(self, AccessReference): self.AccessReference = AccessReference + def get_Resolution(self): return self.Resolution + def set_Resolution(self, Resolution): self.Resolution = Resolution + def get_CopiesToPrint(self): return self.CopiesToPrint + def set_CopiesToPrint(self, CopiesToPrint): self.CopiesToPrint = CopiesToPrint + def get_Parts(self): return self.Parts + def set_Parts(self, Parts): self.Parts = Parts + def add_Parts(self, value): self.Parts.append(value) + def insert_Parts(self, index, value): self.Parts[index] = value + def export(self, outfile, level, namespace_='ns:', name_='CloseDocument', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CloseDocument') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CloseDocument'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CloseDocument', fromsubclass_=False): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('<%sType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Type).encode(ExternalEncoding), input_name='Type'), namespace_)) + if self.ShippingCycle is not None: + showIndent(outfile, level) + outfile.write('<%sShippingCycle>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ShippingCycle).encode(ExternalEncoding), input_name='ShippingCycle'), namespace_)) + if self.ShippingDocumentDisposition is not None: + showIndent(outfile, level) + outfile.write('<%sShippingDocumentDisposition>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ShippingDocumentDisposition).encode(ExternalEncoding), input_name='ShippingDocumentDisposition'), namespace_)) + if self.AccessReference is not None: + showIndent(outfile, level) + outfile.write('<%sAccessReference>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AccessReference).encode(ExternalEncoding), input_name='AccessReference'), namespace_)) + if self.Resolution is not None: + showIndent(outfile, level) + outfile.write('<%sResolution>%s\n' % (namespace_, self.gds_format_integer(self.Resolution, input_name='Resolution'), namespace_)) + if self.CopiesToPrint is not None: + showIndent(outfile, level) + outfile.write('<%sCopiesToPrint>%s\n' % (namespace_, self.gds_format_integer(self.CopiesToPrint, input_name='CopiesToPrint'), namespace_)) + for Parts_ in self.Parts: + Parts_.export(outfile, level, namespace_, name_='Parts') + def hasContent_(self): + if ( + self.Type is not None or + self.ShippingCycle is not None or + self.ShippingDocumentDisposition is not None or + self.AccessReference is not None or + self.Resolution is not None or + self.CopiesToPrint is not None or + self.Parts + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CloseDocument'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('Type=%s,\n' % quote_python(self.Type).encode(ExternalEncoding)) + if self.ShippingCycle is not None: + showIndent(outfile, level) + outfile.write('ShippingCycle=%s,\n' % quote_python(self.ShippingCycle).encode(ExternalEncoding)) + if self.ShippingDocumentDisposition is not None: + showIndent(outfile, level) + outfile.write('ShippingDocumentDisposition=%s,\n' % quote_python(self.ShippingDocumentDisposition).encode(ExternalEncoding)) + if self.AccessReference is not None: + showIndent(outfile, level) + outfile.write('AccessReference=%s,\n' % quote_python(self.AccessReference).encode(ExternalEncoding)) + if self.Resolution is not None: + showIndent(outfile, level) + outfile.write('Resolution=%d,\n' % self.Resolution) + if self.CopiesToPrint is not None: + showIndent(outfile, level) + outfile.write('CopiesToPrint=%d,\n' % self.CopiesToPrint) + showIndent(outfile, level) + outfile.write('Parts=[\n') + level += 1 + for Parts_ in self.Parts: + showIndent(outfile, level) + outfile.write('model_.ShippingDocumentPart(\n') + Parts_.exportLiteral(outfile, level, name_='ShippingDocumentPart') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Type': + Type_ = child_.text + Type_ = self.gds_validate_string(Type_, node, 'Type') + self.Type = Type_ + self.validate_CloseDocumentType(self.Type) # validate type CloseDocumentType + elif nodeName_ == 'ShippingCycle': + ShippingCycle_ = child_.text + ShippingCycle_ = self.gds_validate_string(ShippingCycle_, node, 'ShippingCycle') + self.ShippingCycle = ShippingCycle_ + elif nodeName_ == 'ShippingDocumentDisposition': + ShippingDocumentDisposition_ = child_.text + ShippingDocumentDisposition_ = self.gds_validate_string(ShippingDocumentDisposition_, node, 'ShippingDocumentDisposition') + self.ShippingDocumentDisposition = ShippingDocumentDisposition_ + self.validate_ShippingDocumentDispositionType(self.ShippingDocumentDisposition) # validate type ShippingDocumentDispositionType + elif nodeName_ == 'AccessReference': + AccessReference_ = child_.text + AccessReference_ = self.gds_validate_string(AccessReference_, node, 'AccessReference') + self.AccessReference = AccessReference_ + elif nodeName_ == 'Resolution': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'Resolution') + self.Resolution = ival_ + elif nodeName_ == 'CopiesToPrint': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ <= 0: + raise_parse_error(child_, 'requires positiveInteger') + ival_ = self.gds_validate_integer(ival_, node, 'CopiesToPrint') + self.CopiesToPrint = ival_ + elif nodeName_ == 'Parts': + obj_ = ShippingDocumentPart.factory() + obj_.build(child_) + self.Parts.append(obj_) +# end class CloseDocument + + +class CloseDocumentFormat(GeneratedsSuper): + """Specifies characteristics of a shipping document to be produced.""" + subclass = None + superclass = None + def __init__(self, Dispositions=None, TopOfPageOffset=None, ImageType=None, StockType=None, ProvideInstructions=None, Localization=None): + if Dispositions is None: + self.Dispositions = [] + else: + self.Dispositions = Dispositions + self.TopOfPageOffset = TopOfPageOffset + self.ImageType = ImageType + self.StockType = StockType + self.ProvideInstructions = ProvideInstructions + self.Localization = Localization + def factory(*args_, **kwargs_): + if CloseDocumentFormat.subclass: + return CloseDocumentFormat.subclass(*args_, **kwargs_) + else: + return CloseDocumentFormat(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Dispositions(self): return self.Dispositions + def set_Dispositions(self, Dispositions): self.Dispositions = Dispositions + def add_Dispositions(self, value): self.Dispositions.append(value) + def insert_Dispositions(self, index, value): self.Dispositions[index] = value + def get_TopOfPageOffset(self): return self.TopOfPageOffset + def set_TopOfPageOffset(self, TopOfPageOffset): self.TopOfPageOffset = TopOfPageOffset + def get_ImageType(self): return self.ImageType + def set_ImageType(self, ImageType): self.ImageType = ImageType + def validate_ShippingDocumentImageType(self, value): + # Validate type ShippingDocumentImageType, a restriction on xs:string. + pass + def get_StockType(self): return self.StockType + def set_StockType(self, StockType): self.StockType = StockType + def validate_ShippingDocumentStockType(self, value): + # Validate type ShippingDocumentStockType, a restriction on xs:string. + pass + def get_ProvideInstructions(self): return self.ProvideInstructions + def set_ProvideInstructions(self, ProvideInstructions): self.ProvideInstructions = ProvideInstructions + def get_Localization(self): return self.Localization + def set_Localization(self, Localization): self.Localization = Localization + def export(self, outfile, level, namespace_='ns:', name_='CloseDocumentFormat', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CloseDocumentFormat') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CloseDocumentFormat'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CloseDocumentFormat', fromsubclass_=False): + for Dispositions_ in self.Dispositions: + Dispositions_.export(outfile, level, namespace_, name_='Dispositions') + if self.TopOfPageOffset: + self.TopOfPageOffset.export(outfile, level, namespace_, name_='TopOfPageOffset') + if self.ImageType is not None: + showIndent(outfile, level) + outfile.write('<%sImageType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ImageType).encode(ExternalEncoding), input_name='ImageType'), namespace_)) + if self.StockType is not None: + showIndent(outfile, level) + outfile.write('<%sStockType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.StockType).encode(ExternalEncoding), input_name='StockType'), namespace_)) + if self.ProvideInstructions is not None: + showIndent(outfile, level) + outfile.write('<%sProvideInstructions>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.ProvideInstructions)), input_name='ProvideInstructions'), namespace_)) + if self.Localization: + self.Localization.export(outfile, level, namespace_, name_='Localization') + def hasContent_(self): + if ( + self.Dispositions or + self.TopOfPageOffset is not None or + self.ImageType is not None or + self.StockType is not None or + self.ProvideInstructions is not None or + self.Localization is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CloseDocumentFormat'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('Dispositions=[\n') + level += 1 + for Dispositions_ in self.Dispositions: + showIndent(outfile, level) + outfile.write('model_.ShippingDocumentDispositionDetail(\n') + Dispositions_.exportLiteral(outfile, level, name_='ShippingDocumentDispositionDetail') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.TopOfPageOffset is not None: + showIndent(outfile, level) + outfile.write('TopOfPageOffset=model_.LinearMeasure(\n') + self.TopOfPageOffset.exportLiteral(outfile, level, name_='TopOfPageOffset') + showIndent(outfile, level) + outfile.write('),\n') + if self.ImageType is not None: + showIndent(outfile, level) + outfile.write('ImageType=%s,\n' % quote_python(self.ImageType).encode(ExternalEncoding)) + if self.StockType is not None: + showIndent(outfile, level) + outfile.write('StockType=%s,\n' % quote_python(self.StockType).encode(ExternalEncoding)) + if self.ProvideInstructions is not None: + showIndent(outfile, level) + outfile.write('ProvideInstructions=%s,\n' % self.ProvideInstructions) + if self.Localization is not None: + showIndent(outfile, level) + outfile.write('Localization=model_.Localization(\n') + self.Localization.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Dispositions': + obj_ = ShippingDocumentDispositionDetail.factory() + obj_.build(child_) + self.Dispositions.append(obj_) + elif nodeName_ == 'TopOfPageOffset': + obj_ = LinearMeasure.factory() + obj_.build(child_) + self.set_TopOfPageOffset(obj_) + elif nodeName_ == 'ImageType': + ImageType_ = child_.text + ImageType_ = self.gds_validate_string(ImageType_, node, 'ImageType') + self.ImageType = ImageType_ + self.validate_ShippingDocumentImageType(self.ImageType) # validate type ShippingDocumentImageType + elif nodeName_ == 'StockType': + StockType_ = child_.text + StockType_ = self.gds_validate_string(StockType_, node, 'StockType') + self.StockType = StockType_ + self.validate_ShippingDocumentStockType(self.StockType) # validate type ShippingDocumentStockType + elif nodeName_ == 'ProvideInstructions': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'ProvideInstructions') + self.ProvideInstructions = ival_ + elif nodeName_ == 'Localization': + obj_ = Localization.factory() + obj_.build(child_) + self.set_Localization(obj_) +# end class CloseDocumentFormat + + +class CloseDocumentSpecification(GeneratedsSuper): + """Contains all data required for close-time documents to be produced + in conjunction with a specific set of shipments. For January + 2010, there are no applicable options for the COD report, the + Manifest, or the Multiweight Report (they will only be available + in TEXT format). Detail specifications will be added for those + report types when customer-selectable options are implemented.""" + subclass = None + superclass = None + def __init__(self, CloseDocumentTypes=None, Op950Detail=None): + if CloseDocumentTypes is None: + self.CloseDocumentTypes = [] + else: + self.CloseDocumentTypes = CloseDocumentTypes + self.Op950Detail = Op950Detail + def factory(*args_, **kwargs_): + if CloseDocumentSpecification.subclass: + return CloseDocumentSpecification.subclass(*args_, **kwargs_) + else: + return CloseDocumentSpecification(*args_, **kwargs_) + factory = staticmethod(factory) + def get_CloseDocumentTypes(self): return self.CloseDocumentTypes + def set_CloseDocumentTypes(self, CloseDocumentTypes): self.CloseDocumentTypes = CloseDocumentTypes + def add_CloseDocumentTypes(self, value): self.CloseDocumentTypes.append(value) + def insert_CloseDocumentTypes(self, index, value): self.CloseDocumentTypes[index] = value + def validate_CloseDocumentType(self, value): + # Validate type CloseDocumentType, a restriction on xs:string. + pass + def get_Op950Detail(self): return self.Op950Detail + def set_Op950Detail(self, Op950Detail): self.Op950Detail = Op950Detail + def export(self, outfile, level, namespace_='ns:', name_='CloseDocumentSpecification', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CloseDocumentSpecification') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CloseDocumentSpecification'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CloseDocumentSpecification', fromsubclass_=False): + for CloseDocumentTypes_ in self.CloseDocumentTypes: + showIndent(outfile, level) + outfile.write('<%sCloseDocumentTypes>%s\n' % (namespace_, self.gds_format_string(quote_xml(CloseDocumentTypes_).encode(ExternalEncoding), input_name='CloseDocumentTypes'), namespace_)) + if self.Op950Detail: + self.Op950Detail.export(outfile, level, namespace_, name_='Op950Detail') + def hasContent_(self): + if ( + self.CloseDocumentTypes or + self.Op950Detail is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CloseDocumentSpecification'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('CloseDocumentTypes=[\n') + level += 1 + for CloseDocumentTypes_ in self.CloseDocumentTypes: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(CloseDocumentTypes_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.Op950Detail is not None: + showIndent(outfile, level) + outfile.write('Op950Detail=model_.Op950Detail(\n') + self.Op950Detail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'CloseDocumentTypes': + CloseDocumentTypes_ = child_.text + CloseDocumentTypes_ = self.gds_validate_string(CloseDocumentTypes_, node, 'CloseDocumentTypes') + self.CloseDocumentTypes.append(CloseDocumentTypes_) + self.validate_CloseDocumentType(self.CloseDocumentTypes) # validate type CloseDocumentType + elif nodeName_ == 'Op950Detail': + obj_ = Op950Detail.factory() + obj_.build(child_) + self.set_Op950Detail(obj_) +# end class CloseDocumentSpecification + + +class CustomerImageUsage(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Type=None, Id=None, InternalId=None, InternalImageType=None): + self.Type = Type + self.Id = Id + self.InternalId = InternalId + self.InternalImageType = InternalImageType + def factory(*args_, **kwargs_): + if CustomerImageUsage.subclass: + return CustomerImageUsage.subclass(*args_, **kwargs_) + else: + return CustomerImageUsage(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Type(self): return self.Type + def set_Type(self, Type): self.Type = Type + def validate_CustomerImageUsageType(self, value): + # Validate type CustomerImageUsageType, a restriction on xs:string. + pass + def get_Id(self): return self.Id + def set_Id(self, Id): self.Id = Id + def validate_ImageId(self, value): + # Validate type ImageId, a restriction on xs:string. + pass + def get_InternalId(self): return self.InternalId + def set_InternalId(self, InternalId): self.InternalId = InternalId + def get_InternalImageType(self): return self.InternalImageType + def set_InternalImageType(self, InternalImageType): self.InternalImageType = InternalImageType + def validate_InternalImageType(self, value): + # Validate type InternalImageType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='CustomerImageUsage', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CustomerImageUsage') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CustomerImageUsage'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CustomerImageUsage', fromsubclass_=False): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('<%sType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Type).encode(ExternalEncoding), input_name='Type'), namespace_)) + if self.Id is not None: + showIndent(outfile, level) + outfile.write('<%sId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Id).encode(ExternalEncoding), input_name='Id'), namespace_)) + if self.InternalId is not None: + showIndent(outfile, level) + outfile.write('<%sInternalId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.InternalId).encode(ExternalEncoding), input_name='InternalId'), namespace_)) + if self.InternalImageType is not None: + showIndent(outfile, level) + outfile.write('<%sInternalImageType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.InternalImageType).encode(ExternalEncoding), input_name='InternalImageType'), namespace_)) + def hasContent_(self): + if ( + self.Type is not None or + self.Id is not None or + self.InternalId is not None or + self.InternalImageType is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CustomerImageUsage'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('Type=%s,\n' % quote_python(self.Type).encode(ExternalEncoding)) + if self.Id is not None: + showIndent(outfile, level) + outfile.write('Id=%s,\n' % quote_python(self.Id).encode(ExternalEncoding)) + if self.InternalId is not None: + showIndent(outfile, level) + outfile.write('InternalId=%s,\n' % quote_python(self.InternalId).encode(ExternalEncoding)) + if self.InternalImageType is not None: + showIndent(outfile, level) + outfile.write('InternalImageType=%s,\n' % quote_python(self.InternalImageType).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Type': + Type_ = child_.text + Type_ = self.gds_validate_string(Type_, node, 'Type') + self.Type = Type_ + self.validate_CustomerImageUsageType(self.Type) # validate type CustomerImageUsageType + elif nodeName_ == 'Id': + Id_ = child_.text + Id_ = self.gds_validate_string(Id_, node, 'Id') + self.Id = Id_ + self.validate_ImageId(self.Id) # validate type ImageId + elif nodeName_ == 'InternalId': + InternalId_ = child_.text + InternalId_ = self.gds_validate_string(InternalId_, node, 'InternalId') + self.InternalId = InternalId_ + elif nodeName_ == 'InternalImageType': + InternalImageType_ = child_.text + InternalImageType_ = self.gds_validate_string(InternalImageType_, node, 'InternalImageType') + self.InternalImageType = InternalImageType_ + self.validate_InternalImageType(self.InternalImageType) # validate type InternalImageType +# end class CustomerImageUsage + + +class GroundCloseDocumentsReply(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, HighestSeverity=None, Notifications=None, TransactionDetail=None, Version=None, CloseDocuments=None): + self.HighestSeverity = HighestSeverity + if Notifications is None: + self.Notifications = [] + else: + self.Notifications = Notifications + self.TransactionDetail = TransactionDetail + self.Version = Version + if CloseDocuments is None: + self.CloseDocuments = [] + else: + self.CloseDocuments = CloseDocuments + def factory(*args_, **kwargs_): + if GroundCloseDocumentsReply.subclass: + return GroundCloseDocumentsReply.subclass(*args_, **kwargs_) + else: + return GroundCloseDocumentsReply(*args_, **kwargs_) + factory = staticmethod(factory) + def get_HighestSeverity(self): return self.HighestSeverity + def set_HighestSeverity(self, HighestSeverity): self.HighestSeverity = HighestSeverity + def validate_NotificationSeverityType(self, value): + # Validate type NotificationSeverityType, a restriction on xs:string. + pass + def get_Notifications(self): return self.Notifications + def set_Notifications(self, Notifications): self.Notifications = Notifications + def add_Notifications(self, value): self.Notifications.append(value) + def insert_Notifications(self, index, value): self.Notifications[index] = value + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_CloseDocuments(self): return self.CloseDocuments + def set_CloseDocuments(self, CloseDocuments): self.CloseDocuments = CloseDocuments + def add_CloseDocuments(self, value): self.CloseDocuments.append(value) + def insert_CloseDocuments(self, index, value): self.CloseDocuments[index] = value + def export(self, outfile, level, namespace_='ns:', name_='GroundCloseDocumentsReply', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='GroundCloseDocumentsReply') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='GroundCloseDocumentsReply'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='GroundCloseDocumentsReply', fromsubclass_=False): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('<%sHighestSeverity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HighestSeverity).encode(ExternalEncoding), input_name='HighestSeverity'), namespace_)) + for Notifications_ in self.Notifications: + Notifications_.export(outfile, level, namespace_, name_='Notifications') + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + for CloseDocuments_ in self.CloseDocuments: + CloseDocuments_.export(outfile, level, namespace_, name_='CloseDocuments') + def hasContent_(self): + if ( + self.HighestSeverity is not None or + self.Notifications or + self.TransactionDetail is not None or + self.Version is not None or + self.CloseDocuments + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='GroundCloseDocumentsReply'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('HighestSeverity=%s,\n' % quote_python(self.HighestSeverity).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Notifications=[\n') + level += 1 + for Notifications_ in self.Notifications: + showIndent(outfile, level) + outfile.write('model_.Notification(\n') + Notifications_.exportLiteral(outfile, level, name_='Notification') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('CloseDocuments=[\n') + level += 1 + for CloseDocuments_ in self.CloseDocuments: + showIndent(outfile, level) + outfile.write('model_.CloseDocument(\n') + CloseDocuments_.exportLiteral(outfile, level, name_='CloseDocument') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'HighestSeverity': + HighestSeverity_ = child_.text + HighestSeverity_ = self.gds_validate_string(HighestSeverity_, node, 'HighestSeverity') + self.HighestSeverity = HighestSeverity_ + self.validate_NotificationSeverityType(self.HighestSeverity) # validate type NotificationSeverityType + elif nodeName_ == 'Notifications': + obj_ = Notification.factory() + obj_.build(child_) + self.Notifications.append(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'CloseDocuments': + obj_ = CloseDocument.factory() + obj_.build(child_) + self.CloseDocuments.append(obj_) +# end class GroundCloseDocumentsReply + + +class GroundCloseReply(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, HighestSeverity=None, Notifications=None, TransactionDetail=None, Version=None, CodReport=None, HazMatCertificate=None, Manifest=None, MultiweightReport=None): + self.HighestSeverity = HighestSeverity + if Notifications is None: + self.Notifications = [] + else: + self.Notifications = Notifications + self.TransactionDetail = TransactionDetail + self.Version = Version + self.CodReport = CodReport + self.HazMatCertificate = HazMatCertificate + self.Manifest = Manifest + self.MultiweightReport = MultiweightReport + def factory(*args_, **kwargs_): + if GroundCloseReply.subclass: + return GroundCloseReply.subclass(*args_, **kwargs_) + else: + return GroundCloseReply(*args_, **kwargs_) + factory = staticmethod(factory) + def get_HighestSeverity(self): return self.HighestSeverity + def set_HighestSeverity(self, HighestSeverity): self.HighestSeverity = HighestSeverity + def validate_NotificationSeverityType(self, value): + # Validate type NotificationSeverityType, a restriction on xs:string. + pass + def get_Notifications(self): return self.Notifications + def set_Notifications(self, Notifications): self.Notifications = Notifications + def add_Notifications(self, value): self.Notifications.append(value) + def insert_Notifications(self, index, value): self.Notifications[index] = value + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_CodReport(self): return self.CodReport + def set_CodReport(self, CodReport): self.CodReport = CodReport + def get_HazMatCertificate(self): return self.HazMatCertificate + def set_HazMatCertificate(self, HazMatCertificate): self.HazMatCertificate = HazMatCertificate + def get_Manifest(self): return self.Manifest + def set_Manifest(self, Manifest): self.Manifest = Manifest + def get_MultiweightReport(self): return self.MultiweightReport + def set_MultiweightReport(self, MultiweightReport): self.MultiweightReport = MultiweightReport + def export(self, outfile, level, namespace_='ns:', name_='GroundCloseReply', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='GroundCloseReply') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='GroundCloseReply'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='GroundCloseReply', fromsubclass_=False): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('<%sHighestSeverity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HighestSeverity).encode(ExternalEncoding), input_name='HighestSeverity'), namespace_)) + for Notifications_ in self.Notifications: + Notifications_.export(outfile, level, namespace_, name_='Notifications') + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.CodReport: + self.CodReport.export(outfile, level, namespace_, name_='CodReport') + if self.HazMatCertificate: + self.HazMatCertificate.export(outfile, level, namespace_, name_='HazMatCertificate') + if self.Manifest: + self.Manifest.export(outfile, level, namespace_, name_='Manifest') + if self.MultiweightReport: + self.MultiweightReport.export(outfile, level, namespace_, name_='MultiweightReport') + def hasContent_(self): + if ( + self.HighestSeverity is not None or + self.Notifications or + self.TransactionDetail is not None or + self.Version is not None or + self.CodReport is not None or + self.HazMatCertificate is not None or + self.Manifest is not None or + self.MultiweightReport is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='GroundCloseReply'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('HighestSeverity=%s,\n' % quote_python(self.HighestSeverity).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Notifications=[\n') + level += 1 + for Notifications_ in self.Notifications: + showIndent(outfile, level) + outfile.write('model_.Notification(\n') + Notifications_.exportLiteral(outfile, level, name_='Notification') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.CodReport is not None: + showIndent(outfile, level) + outfile.write('CodReport=model_.xs_base64Binary(\n') + self.CodReport.exportLiteral(outfile, level, name_='CodReport') + showIndent(outfile, level) + outfile.write('),\n') + if self.HazMatCertificate is not None: + showIndent(outfile, level) + outfile.write('HazMatCertificate=model_.xs_base64Binary(\n') + self.HazMatCertificate.exportLiteral(outfile, level, name_='HazMatCertificate') + showIndent(outfile, level) + outfile.write('),\n') + if self.Manifest is not None: + showIndent(outfile, level) + outfile.write('Manifest=model_.ManifestFile(\n') + self.Manifest.exportLiteral(outfile, level, name_='Manifest') + showIndent(outfile, level) + outfile.write('),\n') + if self.MultiweightReport is not None: + showIndent(outfile, level) + outfile.write('MultiweightReport=model_.xs_base64Binary(\n') + self.MultiweightReport.exportLiteral(outfile, level, name_='MultiweightReport') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'HighestSeverity': + HighestSeverity_ = child_.text + HighestSeverity_ = self.gds_validate_string(HighestSeverity_, node, 'HighestSeverity') + self.HighestSeverity = HighestSeverity_ + self.validate_NotificationSeverityType(self.HighestSeverity) # validate type NotificationSeverityType + elif nodeName_ == 'Notifications': + obj_ = Notification.factory() + obj_.build(child_) + self.Notifications.append(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'CodReport': + obj_ = xs_base64Binary.factory() + obj_.build(child_) + self.set_CodReport(obj_) + elif nodeName_ == 'HazMatCertificate': + obj_ = xs_base64Binary.factory() + obj_.build(child_) + self.set_HazMatCertificate(obj_) + elif nodeName_ == 'Manifest': + obj_ = ManifestFile.factory() + obj_.build(child_) + self.set_Manifest(obj_) + elif nodeName_ == 'MultiweightReport': + obj_ = xs_base64Binary.factory() + obj_.build(child_) + self.set_MultiweightReport(obj_) +# end class GroundCloseReply + + +class GroundCloseReportsReprintReply(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, HighestSeverity=None, Notifications=None, TransactionDetail=None, Version=None, CodReport=None, HazMatCertificate=None, Manifests=None): + self.HighestSeverity = HighestSeverity + if Notifications is None: + self.Notifications = [] + else: + self.Notifications = Notifications + self.TransactionDetail = TransactionDetail + self.Version = Version + self.CodReport = CodReport + self.HazMatCertificate = HazMatCertificate + if Manifests is None: + self.Manifests = [] + else: + self.Manifests = Manifests + def factory(*args_, **kwargs_): + if GroundCloseReportsReprintReply.subclass: + return GroundCloseReportsReprintReply.subclass(*args_, **kwargs_) + else: + return GroundCloseReportsReprintReply(*args_, **kwargs_) + factory = staticmethod(factory) + def get_HighestSeverity(self): return self.HighestSeverity + def set_HighestSeverity(self, HighestSeverity): self.HighestSeverity = HighestSeverity + def validate_NotificationSeverityType(self, value): + # Validate type NotificationSeverityType, a restriction on xs:string. + pass + def get_Notifications(self): return self.Notifications + def set_Notifications(self, Notifications): self.Notifications = Notifications + def add_Notifications(self, value): self.Notifications.append(value) + def insert_Notifications(self, index, value): self.Notifications[index] = value + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_CodReport(self): return self.CodReport + def set_CodReport(self, CodReport): self.CodReport = CodReport + def get_HazMatCertificate(self): return self.HazMatCertificate + def set_HazMatCertificate(self, HazMatCertificate): self.HazMatCertificate = HazMatCertificate + def get_Manifests(self): return self.Manifests + def set_Manifests(self, Manifests): self.Manifests = Manifests + def add_Manifests(self, value): self.Manifests.append(value) + def insert_Manifests(self, index, value): self.Manifests[index] = value + def export(self, outfile, level, namespace_='ns:', name_='GroundCloseReportsReprintReply', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='GroundCloseReportsReprintReply') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='GroundCloseReportsReprintReply'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='GroundCloseReportsReprintReply', fromsubclass_=False): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('<%sHighestSeverity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HighestSeverity).encode(ExternalEncoding), input_name='HighestSeverity'), namespace_)) + for Notifications_ in self.Notifications: + Notifications_.export(outfile, level, namespace_, name_='Notifications') + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.CodReport: + self.CodReport.export(outfile, level, namespace_, name_='CodReport') + if self.HazMatCertificate: + self.HazMatCertificate.export(outfile, level, namespace_, name_='HazMatCertificate') + for Manifests_ in self.Manifests: + Manifests_.export(outfile, level, namespace_, name_='Manifests') + def hasContent_(self): + if ( + self.HighestSeverity is not None or + self.Notifications or + self.TransactionDetail is not None or + self.Version is not None or + self.CodReport is not None or + self.HazMatCertificate is not None or + self.Manifests + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='GroundCloseReportsReprintReply'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('HighestSeverity=%s,\n' % quote_python(self.HighestSeverity).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Notifications=[\n') + level += 1 + for Notifications_ in self.Notifications: + showIndent(outfile, level) + outfile.write('model_.Notification(\n') + Notifications_.exportLiteral(outfile, level, name_='Notification') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.CodReport is not None: + showIndent(outfile, level) + outfile.write('CodReport=model_.xs_base64Binary(\n') + self.CodReport.exportLiteral(outfile, level, name_='CodReport') + showIndent(outfile, level) + outfile.write('),\n') + if self.HazMatCertificate is not None: + showIndent(outfile, level) + outfile.write('HazMatCertificate=model_.xs_base64Binary(\n') + self.HazMatCertificate.exportLiteral(outfile, level, name_='HazMatCertificate') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('Manifests=[\n') + level += 1 + for Manifests_ in self.Manifests: + showIndent(outfile, level) + outfile.write('model_.ManifestFile(\n') + Manifests_.exportLiteral(outfile, level, name_='ManifestFile') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'HighestSeverity': + HighestSeverity_ = child_.text + HighestSeverity_ = self.gds_validate_string(HighestSeverity_, node, 'HighestSeverity') + self.HighestSeverity = HighestSeverity_ + self.validate_NotificationSeverityType(self.HighestSeverity) # validate type NotificationSeverityType + elif nodeName_ == 'Notifications': + obj_ = Notification.factory() + obj_.build(child_) + self.Notifications.append(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'CodReport': + obj_ = xs_base64Binary.factory() + obj_.build(child_) + self.set_CodReport(obj_) + elif nodeName_ == 'HazMatCertificate': + obj_ = xs_base64Binary.factory() + obj_.build(child_) + self.set_HazMatCertificate(obj_) + elif nodeName_ == 'Manifests': + obj_ = ManifestFile.factory() + obj_.build(child_) + self.Manifests.append(obj_) +# end class GroundCloseReportsReprintReply + + +class GroundCloseReportsReprintRequest(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, WebAuthenticationDetail=None, ClientDetail=None, TransactionDetail=None, Version=None, ReportDate=None, TrackingNumber=None, CloseReportType=None): + self.WebAuthenticationDetail = WebAuthenticationDetail + self.ClientDetail = ClientDetail + self.TransactionDetail = TransactionDetail + self.Version = Version + self.ReportDate = ReportDate + self.TrackingNumber = TrackingNumber + self.CloseReportType = CloseReportType + def factory(*args_, **kwargs_): + if GroundCloseReportsReprintRequest.subclass: + return GroundCloseReportsReprintRequest.subclass(*args_, **kwargs_) + else: + return GroundCloseReportsReprintRequest(*args_, **kwargs_) + factory = staticmethod(factory) + def get_WebAuthenticationDetail(self): return self.WebAuthenticationDetail + def set_WebAuthenticationDetail(self, WebAuthenticationDetail): self.WebAuthenticationDetail = WebAuthenticationDetail + def get_ClientDetail(self): return self.ClientDetail + def set_ClientDetail(self, ClientDetail): self.ClientDetail = ClientDetail + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_ReportDate(self): return self.ReportDate + def set_ReportDate(self, ReportDate): self.ReportDate = ReportDate + def get_TrackingNumber(self): return self.TrackingNumber + def set_TrackingNumber(self, TrackingNumber): self.TrackingNumber = TrackingNumber + def get_CloseReportType(self): return self.CloseReportType + def set_CloseReportType(self, CloseReportType): self.CloseReportType = CloseReportType + def validate_CloseReportType(self, value): + # Validate type CloseReportType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='GroundCloseReportsReprintRequest', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='GroundCloseReportsReprintRequest') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='GroundCloseReportsReprintRequest'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='GroundCloseReportsReprintRequest', fromsubclass_=False): + if self.WebAuthenticationDetail: + self.WebAuthenticationDetail.export(outfile, level, namespace_, name_='WebAuthenticationDetail', ) + if self.ClientDetail: + self.ClientDetail.export(outfile, level, namespace_, name_='ClientDetail', ) + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.ReportDate is not None: + showIndent(outfile, level) + outfile.write('<%sReportDate>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ReportDate).encode(ExternalEncoding), input_name='ReportDate'), namespace_)) + if self.TrackingNumber is not None: + showIndent(outfile, level) + outfile.write('<%sTrackingNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.TrackingNumber).encode(ExternalEncoding), input_name='TrackingNumber'), namespace_)) + if self.CloseReportType is not None: + showIndent(outfile, level) + outfile.write('<%sCloseReportType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CloseReportType).encode(ExternalEncoding), input_name='CloseReportType'), namespace_)) + def hasContent_(self): + if ( + self.WebAuthenticationDetail is not None or + self.ClientDetail is not None or + self.TransactionDetail is not None or + self.Version is not None or + self.ReportDate is not None or + self.TrackingNumber is not None or + self.CloseReportType is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='GroundCloseReportsReprintRequest'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.WebAuthenticationDetail is not None: + showIndent(outfile, level) + outfile.write('WebAuthenticationDetail=model_.WebAuthenticationDetail(\n') + self.WebAuthenticationDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ClientDetail is not None: + showIndent(outfile, level) + outfile.write('ClientDetail=model_.ClientDetail(\n') + self.ClientDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.ReportDate is not None: + showIndent(outfile, level) + outfile.write('ReportDate=%s,\n' % quote_python(self.ReportDate).encode(ExternalEncoding)) + if self.TrackingNumber is not None: + showIndent(outfile, level) + outfile.write('TrackingNumber=%s,\n' % quote_python(self.TrackingNumber).encode(ExternalEncoding)) + if self.CloseReportType is not None: + showIndent(outfile, level) + outfile.write('CloseReportType=%s,\n' % quote_python(self.CloseReportType).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'WebAuthenticationDetail': + obj_ = WebAuthenticationDetail.factory() + obj_.build(child_) + self.set_WebAuthenticationDetail(obj_) + elif nodeName_ == 'ClientDetail': + obj_ = ClientDetail.factory() + obj_.build(child_) + self.set_ClientDetail(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'ReportDate': + ReportDate_ = child_.text + ReportDate_ = self.gds_validate_string(ReportDate_, node, 'ReportDate') + self.ReportDate = ReportDate_ + elif nodeName_ == 'TrackingNumber': + TrackingNumber_ = child_.text + TrackingNumber_ = self.gds_validate_string(TrackingNumber_, node, 'TrackingNumber') + self.TrackingNumber = TrackingNumber_ + elif nodeName_ == 'CloseReportType': + CloseReportType_ = child_.text + CloseReportType_ = self.gds_validate_string(CloseReportType_, node, 'CloseReportType') + self.CloseReportType = CloseReportType_ + self.validate_CloseReportType(self.CloseReportType) # validate type CloseReportType +# end class GroundCloseReportsReprintRequest + + +class GroundCloseRequest(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, WebAuthenticationDetail=None, ClientDetail=None, TransactionDetail=None, Version=None, TimeUpToWhichShipmentsAreToBeClosed=None): + self.WebAuthenticationDetail = WebAuthenticationDetail + self.ClientDetail = ClientDetail + self.TransactionDetail = TransactionDetail + self.Version = Version + self.TimeUpToWhichShipmentsAreToBeClosed = TimeUpToWhichShipmentsAreToBeClosed + def factory(*args_, **kwargs_): + if GroundCloseRequest.subclass: + return GroundCloseRequest.subclass(*args_, **kwargs_) + else: + return GroundCloseRequest(*args_, **kwargs_) + factory = staticmethod(factory) + def get_WebAuthenticationDetail(self): return self.WebAuthenticationDetail + def set_WebAuthenticationDetail(self, WebAuthenticationDetail): self.WebAuthenticationDetail = WebAuthenticationDetail + def get_ClientDetail(self): return self.ClientDetail + def set_ClientDetail(self, ClientDetail): self.ClientDetail = ClientDetail + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_TimeUpToWhichShipmentsAreToBeClosed(self): return self.TimeUpToWhichShipmentsAreToBeClosed + def set_TimeUpToWhichShipmentsAreToBeClosed(self, TimeUpToWhichShipmentsAreToBeClosed): self.TimeUpToWhichShipmentsAreToBeClosed = TimeUpToWhichShipmentsAreToBeClosed + def export(self, outfile, level, namespace_='ns:', name_='GroundCloseRequest', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='GroundCloseRequest') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='GroundCloseRequest'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='GroundCloseRequest', fromsubclass_=False): + if self.WebAuthenticationDetail: + self.WebAuthenticationDetail.export(outfile, level, namespace_, name_='WebAuthenticationDetail', ) + if self.ClientDetail: + self.ClientDetail.export(outfile, level, namespace_, name_='ClientDetail', ) + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.TimeUpToWhichShipmentsAreToBeClosed is not None: + showIndent(outfile, level) + outfile.write('<%sTimeUpToWhichShipmentsAreToBeClosed>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.TimeUpToWhichShipmentsAreToBeClosed).encode(ExternalEncoding), input_name='TimeUpToWhichShipmentsAreToBeClosed'), namespace_)) + def hasContent_(self): + if ( + self.WebAuthenticationDetail is not None or + self.ClientDetail is not None or + self.TransactionDetail is not None or + self.Version is not None or + self.TimeUpToWhichShipmentsAreToBeClosed is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='GroundCloseRequest'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.WebAuthenticationDetail is not None: + showIndent(outfile, level) + outfile.write('WebAuthenticationDetail=model_.WebAuthenticationDetail(\n') + self.WebAuthenticationDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ClientDetail is not None: + showIndent(outfile, level) + outfile.write('ClientDetail=model_.ClientDetail(\n') + self.ClientDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.TimeUpToWhichShipmentsAreToBeClosed is not None: + showIndent(outfile, level) + outfile.write('TimeUpToWhichShipmentsAreToBeClosed=%s,\n' % quote_python(self.TimeUpToWhichShipmentsAreToBeClosed).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'WebAuthenticationDetail': + obj_ = WebAuthenticationDetail.factory() + obj_.build(child_) + self.set_WebAuthenticationDetail(obj_) + elif nodeName_ == 'ClientDetail': + obj_ = ClientDetail.factory() + obj_.build(child_) + self.set_ClientDetail(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'TimeUpToWhichShipmentsAreToBeClosed': + TimeUpToWhichShipmentsAreToBeClosed_ = child_.text + TimeUpToWhichShipmentsAreToBeClosed_ = self.gds_validate_string(TimeUpToWhichShipmentsAreToBeClosed_, node, 'TimeUpToWhichShipmentsAreToBeClosed') + self.TimeUpToWhichShipmentsAreToBeClosed = TimeUpToWhichShipmentsAreToBeClosed_ +# end class GroundCloseRequest + + +class GroundCloseWithDocumentsRequest(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, WebAuthenticationDetail=None, ClientDetail=None, TransactionDetail=None, Version=None, CloseDate=None, CloseDocumentSpecification=None): + self.WebAuthenticationDetail = WebAuthenticationDetail + self.ClientDetail = ClientDetail + self.TransactionDetail = TransactionDetail + self.Version = Version + self.CloseDate = CloseDate + self.CloseDocumentSpecification = CloseDocumentSpecification + def factory(*args_, **kwargs_): + if GroundCloseWithDocumentsRequest.subclass: + return GroundCloseWithDocumentsRequest.subclass(*args_, **kwargs_) + else: + return GroundCloseWithDocumentsRequest(*args_, **kwargs_) + factory = staticmethod(factory) + def get_WebAuthenticationDetail(self): return self.WebAuthenticationDetail + def set_WebAuthenticationDetail(self, WebAuthenticationDetail): self.WebAuthenticationDetail = WebAuthenticationDetail + def get_ClientDetail(self): return self.ClientDetail + def set_ClientDetail(self, ClientDetail): self.ClientDetail = ClientDetail + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_CloseDate(self): return self.CloseDate + def set_CloseDate(self, CloseDate): self.CloseDate = CloseDate + def get_CloseDocumentSpecification(self): return self.CloseDocumentSpecification + def set_CloseDocumentSpecification(self, CloseDocumentSpecification): self.CloseDocumentSpecification = CloseDocumentSpecification + def export(self, outfile, level, namespace_='ns:', name_='GroundCloseWithDocumentsRequest', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='GroundCloseWithDocumentsRequest') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='GroundCloseWithDocumentsRequest'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='GroundCloseWithDocumentsRequest', fromsubclass_=False): + if self.WebAuthenticationDetail: + self.WebAuthenticationDetail.export(outfile, level, namespace_, name_='WebAuthenticationDetail', ) + if self.ClientDetail: + self.ClientDetail.export(outfile, level, namespace_, name_='ClientDetail', ) + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.CloseDate is not None: + showIndent(outfile, level) + outfile.write('<%sCloseDate>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CloseDate).encode(ExternalEncoding), input_name='CloseDate'), namespace_)) + if self.CloseDocumentSpecification: + self.CloseDocumentSpecification.export(outfile, level, namespace_, name_='CloseDocumentSpecification') + def hasContent_(self): + if ( + self.WebAuthenticationDetail is not None or + self.ClientDetail is not None or + self.TransactionDetail is not None or + self.Version is not None or + self.CloseDate is not None or + self.CloseDocumentSpecification is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='GroundCloseWithDocumentsRequest'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.WebAuthenticationDetail is not None: + showIndent(outfile, level) + outfile.write('WebAuthenticationDetail=model_.WebAuthenticationDetail(\n') + self.WebAuthenticationDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ClientDetail is not None: + showIndent(outfile, level) + outfile.write('ClientDetail=model_.ClientDetail(\n') + self.ClientDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.CloseDate is not None: + showIndent(outfile, level) + outfile.write('CloseDate=%s,\n' % quote_python(self.CloseDate).encode(ExternalEncoding)) + if self.CloseDocumentSpecification is not None: + showIndent(outfile, level) + outfile.write('CloseDocumentSpecification=model_.CloseDocumentSpecification(\n') + self.CloseDocumentSpecification.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'WebAuthenticationDetail': + obj_ = WebAuthenticationDetail.factory() + obj_.build(child_) + self.set_WebAuthenticationDetail(obj_) + elif nodeName_ == 'ClientDetail': + obj_ = ClientDetail.factory() + obj_.build(child_) + self.set_ClientDetail(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'CloseDate': + CloseDate_ = child_.text + CloseDate_ = self.gds_validate_string(CloseDate_, node, 'CloseDate') + self.CloseDate = CloseDate_ + elif nodeName_ == 'CloseDocumentSpecification': + obj_ = CloseDocumentSpecification.factory() + obj_.build(child_) + self.set_CloseDocumentSpecification(obj_) +# end class GroundCloseWithDocumentsRequest + + +class LinearMeasure(GeneratedsSuper): + """Represents a one-dimensional measurement in small units (e.g. + suitable for measuring a package or document), contrasted with + Distance, which represents a large one-dimensional measurement + (e.g. distance between cities).""" + subclass = None + superclass = None + def __init__(self, Value=None, Units=None): + self.Value = Value + self.Units = Units + def factory(*args_, **kwargs_): + if LinearMeasure.subclass: + return LinearMeasure.subclass(*args_, **kwargs_) + else: + return LinearMeasure(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Value(self): return self.Value + def set_Value(self, Value): self.Value = Value + def get_Units(self): return self.Units + def set_Units(self, Units): self.Units = Units + def validate_LinearUnits(self, value): + # Validate type LinearUnits, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='LinearMeasure', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='LinearMeasure') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='LinearMeasure'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='LinearMeasure', fromsubclass_=False): + if self.Value is not None: + showIndent(outfile, level) + outfile.write('<%sValue>%s\n' % (namespace_, self.gds_format_float(self.Value, input_name='Value'), namespace_)) + if self.Units is not None: + showIndent(outfile, level) + outfile.write('<%sUnits>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Units).encode(ExternalEncoding), input_name='Units'), namespace_)) + def hasContent_(self): + if ( + self.Value is not None or + self.Units is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='LinearMeasure'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Value is not None: + showIndent(outfile, level) + outfile.write('Value=%f,\n' % self.Value) + if self.Units is not None: + showIndent(outfile, level) + outfile.write('Units=%s,\n' % quote_python(self.Units).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Value': + sval_ = child_.text + try: + fval_ = float(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires float or double: %s' % exp) + fval_ = self.gds_validate_float(fval_, node, 'Value') + self.Value = fval_ + elif nodeName_ == 'Units': + Units_ = child_.text + Units_ = self.gds_validate_string(Units_, node, 'Units') + self.Units = Units_ + self.validate_LinearUnits(self.Units) # validate type LinearUnits +# end class LinearMeasure + + +class Localization(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, LanguageCode=None, LocaleCode=None): + self.LanguageCode = LanguageCode + self.LocaleCode = LocaleCode + def factory(*args_, **kwargs_): + if Localization.subclass: + return Localization.subclass(*args_, **kwargs_) + else: + return Localization(*args_, **kwargs_) + factory = staticmethod(factory) + def get_LanguageCode(self): return self.LanguageCode + def set_LanguageCode(self, LanguageCode): self.LanguageCode = LanguageCode + def get_LocaleCode(self): return self.LocaleCode + def set_LocaleCode(self, LocaleCode): self.LocaleCode = LocaleCode + def export(self, outfile, level, namespace_='ns:', name_='Localization', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Localization') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Localization'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Localization', fromsubclass_=False): + if self.LanguageCode is not None: + showIndent(outfile, level) + outfile.write('<%sLanguageCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LanguageCode).encode(ExternalEncoding), input_name='LanguageCode'), namespace_)) + if self.LocaleCode is not None: + showIndent(outfile, level) + outfile.write('<%sLocaleCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LocaleCode).encode(ExternalEncoding), input_name='LocaleCode'), namespace_)) + def hasContent_(self): + if ( + self.LanguageCode is not None or + self.LocaleCode is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Localization'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.LanguageCode is not None: + showIndent(outfile, level) + outfile.write('LanguageCode=%s,\n' % quote_python(self.LanguageCode).encode(ExternalEncoding)) + if self.LocaleCode is not None: + showIndent(outfile, level) + outfile.write('LocaleCode=%s,\n' % quote_python(self.LocaleCode).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'LanguageCode': + LanguageCode_ = child_.text + LanguageCode_ = self.gds_validate_string(LanguageCode_, node, 'LanguageCode') + self.LanguageCode = LanguageCode_ + elif nodeName_ == 'LocaleCode': + LocaleCode_ = child_.text + LocaleCode_ = self.gds_validate_string(LocaleCode_, node, 'LocaleCode') + self.LocaleCode = LocaleCode_ +# end class Localization + + +class ManifestFile(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, FileName=None, File=None): + self.FileName = FileName + self.File = File + def factory(*args_, **kwargs_): + if ManifestFile.subclass: + return ManifestFile.subclass(*args_, **kwargs_) + else: + return ManifestFile(*args_, **kwargs_) + factory = staticmethod(factory) + def get_FileName(self): return self.FileName + def set_FileName(self, FileName): self.FileName = FileName + def get_File(self): return self.File + def set_File(self, File): self.File = File + def export(self, outfile, level, namespace_='ns:', name_='ManifestFile', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ManifestFile') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ManifestFile'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ManifestFile', fromsubclass_=False): + if self.FileName is not None: + showIndent(outfile, level) + outfile.write('<%sFileName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.FileName).encode(ExternalEncoding), input_name='FileName'), namespace_)) + if self.File: + self.File.export(outfile, level, namespace_, name_='File') + def hasContent_(self): + if ( + self.FileName is not None or + self.File is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ManifestFile'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.FileName is not None: + showIndent(outfile, level) + outfile.write('FileName=%s,\n' % quote_python(self.FileName).encode(ExternalEncoding)) + if self.File is not None: + showIndent(outfile, level) + outfile.write('File=model_.xs_base64Binary(\n') + self.File.exportLiteral(outfile, level, name_='File') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'FileName': + FileName_ = child_.text + FileName_ = self.gds_validate_string(FileName_, node, 'FileName') + self.FileName = FileName_ + elif nodeName_ == 'File': + obj_ = xs_base64Binary.factory() + obj_.build(child_) + self.set_File(obj_) +# end class ManifestFile + + +class Notification(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Severity=None, Source=None, Code=None, Message=None, LocalizedMessage=None, MessageParameters=None): + self.Severity = Severity + self.Source = Source + self.Code = Code + self.Message = Message + self.LocalizedMessage = LocalizedMessage + if MessageParameters is None: + self.MessageParameters = [] + else: + self.MessageParameters = MessageParameters + def factory(*args_, **kwargs_): + if Notification.subclass: + return Notification.subclass(*args_, **kwargs_) + else: + return Notification(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Severity(self): return self.Severity + def set_Severity(self, Severity): self.Severity = Severity + def validate_NotificationSeverityType(self, value): + # Validate type NotificationSeverityType, a restriction on xs:string. + pass + def get_Source(self): return self.Source + def set_Source(self, Source): self.Source = Source + def get_Code(self): return self.Code + def set_Code(self, Code): self.Code = Code + def get_Message(self): return self.Message + def set_Message(self, Message): self.Message = Message + def get_LocalizedMessage(self): return self.LocalizedMessage + def set_LocalizedMessage(self, LocalizedMessage): self.LocalizedMessage = LocalizedMessage + def get_MessageParameters(self): return self.MessageParameters + def set_MessageParameters(self, MessageParameters): self.MessageParameters = MessageParameters + def add_MessageParameters(self, value): self.MessageParameters.append(value) + def insert_MessageParameters(self, index, value): self.MessageParameters[index] = value + def export(self, outfile, level, namespace_='ns:', name_='Notification', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Notification') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Notification'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Notification', fromsubclass_=False): + if self.Severity is not None: + showIndent(outfile, level) + outfile.write('<%sSeverity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Severity).encode(ExternalEncoding), input_name='Severity'), namespace_)) + if self.Source is not None: + showIndent(outfile, level) + outfile.write('<%sSource>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Source).encode(ExternalEncoding), input_name='Source'), namespace_)) + if self.Code is not None: + showIndent(outfile, level) + outfile.write('<%sCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Code).encode(ExternalEncoding), input_name='Code'), namespace_)) + if self.Message is not None: + showIndent(outfile, level) + outfile.write('<%sMessage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Message).encode(ExternalEncoding), input_name='Message'), namespace_)) + if self.LocalizedMessage is not None: + showIndent(outfile, level) + outfile.write('<%sLocalizedMessage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LocalizedMessage).encode(ExternalEncoding), input_name='LocalizedMessage'), namespace_)) + for MessageParameters_ in self.MessageParameters: + MessageParameters_.export(outfile, level, namespace_, name_='MessageParameters') + def hasContent_(self): + if ( + self.Severity is not None or + self.Source is not None or + self.Code is not None or + self.Message is not None or + self.LocalizedMessage is not None or + self.MessageParameters + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Notification'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Severity is not None: + showIndent(outfile, level) + outfile.write('Severity=%s,\n' % quote_python(self.Severity).encode(ExternalEncoding)) + if self.Source is not None: + showIndent(outfile, level) + outfile.write('Source=%s,\n' % quote_python(self.Source).encode(ExternalEncoding)) + if self.Code is not None: + showIndent(outfile, level) + outfile.write('Code=%s,\n' % quote_python(self.Code).encode(ExternalEncoding)) + if self.Message is not None: + showIndent(outfile, level) + outfile.write('Message=%s,\n' % quote_python(self.Message).encode(ExternalEncoding)) + if self.LocalizedMessage is not None: + showIndent(outfile, level) + outfile.write('LocalizedMessage=%s,\n' % quote_python(self.LocalizedMessage).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('MessageParameters=[\n') + level += 1 + for MessageParameters_ in self.MessageParameters: + showIndent(outfile, level) + outfile.write('model_.NotificationParameter(\n') + MessageParameters_.exportLiteral(outfile, level, name_='NotificationParameter') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Severity': + Severity_ = child_.text + Severity_ = self.gds_validate_string(Severity_, node, 'Severity') + self.Severity = Severity_ + self.validate_NotificationSeverityType(self.Severity) # validate type NotificationSeverityType + elif nodeName_ == 'Source': + Source_ = child_.text + Source_ = self.gds_validate_string(Source_, node, 'Source') + self.Source = Source_ + elif nodeName_ == 'Code': + Code_ = child_.text + Code_ = self.gds_validate_string(Code_, node, 'Code') + self.Code = Code_ + elif nodeName_ == 'Message': + Message_ = child_.text + Message_ = self.gds_validate_string(Message_, node, 'Message') + self.Message = Message_ + elif nodeName_ == 'LocalizedMessage': + LocalizedMessage_ = child_.text + LocalizedMessage_ = self.gds_validate_string(LocalizedMessage_, node, 'LocalizedMessage') + self.LocalizedMessage = LocalizedMessage_ + elif nodeName_ == 'MessageParameters': + obj_ = NotificationParameter.factory() + obj_.build(child_) + self.MessageParameters.append(obj_) +# end class Notification + + +class NotificationParameter(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Id=None, Value=None): + self.Id = Id + self.Value = Value + def factory(*args_, **kwargs_): + if NotificationParameter.subclass: + return NotificationParameter.subclass(*args_, **kwargs_) + else: + return NotificationParameter(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Id(self): return self.Id + def set_Id(self, Id): self.Id = Id + def get_Value(self): return self.Value + def set_Value(self, Value): self.Value = Value + def export(self, outfile, level, namespace_='ns:', name_='NotificationParameter', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='NotificationParameter') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='NotificationParameter'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='NotificationParameter', fromsubclass_=False): + if self.Id is not None: + showIndent(outfile, level) + outfile.write('<%sId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Id).encode(ExternalEncoding), input_name='Id'), namespace_)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('<%sValue>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Value).encode(ExternalEncoding), input_name='Value'), namespace_)) + def hasContent_(self): + if ( + self.Id is not None or + self.Value is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='NotificationParameter'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Id is not None: + showIndent(outfile, level) + outfile.write('Id=%s,\n' % quote_python(self.Id).encode(ExternalEncoding)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('Value=%s,\n' % quote_python(self.Value).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Id': + Id_ = child_.text + Id_ = self.gds_validate_string(Id_, node, 'Id') + self.Id = Id_ + elif nodeName_ == 'Value': + Value_ = child_.text + Value_ = self.gds_validate_string(Value_, node, 'Value') + self.Value = Value_ +# end class NotificationParameter + + +class Op950Detail(GeneratedsSuper): + """The instructions indicating how to print the OP-950 form for + hazardous materials.""" + subclass = None + superclass = None + def __init__(self, Format=None, CustomerImageUsages=None, SignatureName=None): + self.Format = Format + if CustomerImageUsages is None: + self.CustomerImageUsages = [] + else: + self.CustomerImageUsages = CustomerImageUsages + self.SignatureName = SignatureName + def factory(*args_, **kwargs_): + if Op950Detail.subclass: + return Op950Detail.subclass(*args_, **kwargs_) + else: + return Op950Detail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Format(self): return self.Format + def set_Format(self, Format): self.Format = Format + def get_CustomerImageUsages(self): return self.CustomerImageUsages + def set_CustomerImageUsages(self, CustomerImageUsages): self.CustomerImageUsages = CustomerImageUsages + def add_CustomerImageUsages(self, value): self.CustomerImageUsages.append(value) + def insert_CustomerImageUsages(self, index, value): self.CustomerImageUsages[index] = value + def get_SignatureName(self): return self.SignatureName + def set_SignatureName(self, SignatureName): self.SignatureName = SignatureName + def export(self, outfile, level, namespace_='ns:', name_='Op950Detail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Op950Detail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Op950Detail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Op950Detail', fromsubclass_=False): + if self.Format: + self.Format.export(outfile, level, namespace_, name_='Format') + for CustomerImageUsages_ in self.CustomerImageUsages: + CustomerImageUsages_.export(outfile, level, namespace_, name_='CustomerImageUsages') + if self.SignatureName is not None: + showIndent(outfile, level) + outfile.write('<%sSignatureName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.SignatureName).encode(ExternalEncoding), input_name='SignatureName'), namespace_)) + def hasContent_(self): + if ( + self.Format is not None or + self.CustomerImageUsages or + self.SignatureName is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Op950Detail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Format is not None: + showIndent(outfile, level) + outfile.write('Format=model_.CloseDocumentFormat(\n') + self.Format.exportLiteral(outfile, level, name_='Format') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('CustomerImageUsages=[\n') + level += 1 + for CustomerImageUsages_ in self.CustomerImageUsages: + showIndent(outfile, level) + outfile.write('model_.CustomerImageUsage(\n') + CustomerImageUsages_.exportLiteral(outfile, level, name_='CustomerImageUsage') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.SignatureName is not None: + showIndent(outfile, level) + outfile.write('SignatureName=%s,\n' % quote_python(self.SignatureName).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Format': + obj_ = CloseDocumentFormat.factory() + obj_.build(child_) + self.set_Format(obj_) + elif nodeName_ == 'CustomerImageUsages': + obj_ = CustomerImageUsage.factory() + obj_.build(child_) + self.CustomerImageUsages.append(obj_) + elif nodeName_ == 'SignatureName': + SignatureName_ = child_.text + SignatureName_ = self.gds_validate_string(SignatureName_, node, 'SignatureName') + self.SignatureName = SignatureName_ +# end class Op950Detail + + +class ReprintGroundCloseDocumentsRequest(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, WebAuthenticationDetail=None, ClientDetail=None, TransactionDetail=None, Version=None, ReprintOption=None, CloseDate=None, TrackingNumber=None, CloseDocumentSpecification=None): + self.WebAuthenticationDetail = WebAuthenticationDetail + self.ClientDetail = ClientDetail + self.TransactionDetail = TransactionDetail + self.Version = Version + self.ReprintOption = ReprintOption + self.CloseDate = CloseDate + self.TrackingNumber = TrackingNumber + self.CloseDocumentSpecification = CloseDocumentSpecification + def factory(*args_, **kwargs_): + if ReprintGroundCloseDocumentsRequest.subclass: + return ReprintGroundCloseDocumentsRequest.subclass(*args_, **kwargs_) + else: + return ReprintGroundCloseDocumentsRequest(*args_, **kwargs_) + factory = staticmethod(factory) + def get_WebAuthenticationDetail(self): return self.WebAuthenticationDetail + def set_WebAuthenticationDetail(self, WebAuthenticationDetail): self.WebAuthenticationDetail = WebAuthenticationDetail + def get_ClientDetail(self): return self.ClientDetail + def set_ClientDetail(self, ClientDetail): self.ClientDetail = ClientDetail + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_ReprintOption(self): return self.ReprintOption + def set_ReprintOption(self, ReprintOption): self.ReprintOption = ReprintOption + def validate_ReprintGroundCloseDocumentsOptionType(self, value): + # Validate type ReprintGroundCloseDocumentsOptionType, a restriction on xs:string. + pass + def get_CloseDate(self): return self.CloseDate + def set_CloseDate(self, CloseDate): self.CloseDate = CloseDate + def get_TrackingNumber(self): return self.TrackingNumber + def set_TrackingNumber(self, TrackingNumber): self.TrackingNumber = TrackingNumber + def get_CloseDocumentSpecification(self): return self.CloseDocumentSpecification + def set_CloseDocumentSpecification(self, CloseDocumentSpecification): self.CloseDocumentSpecification = CloseDocumentSpecification + def export(self, outfile, level, namespace_='ns:', name_='ReprintGroundCloseDocumentsRequest', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ReprintGroundCloseDocumentsRequest') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ReprintGroundCloseDocumentsRequest'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ReprintGroundCloseDocumentsRequest', fromsubclass_=False): + if self.WebAuthenticationDetail: + self.WebAuthenticationDetail.export(outfile, level, namespace_, name_='WebAuthenticationDetail', ) + if self.ClientDetail: + self.ClientDetail.export(outfile, level, namespace_, name_='ClientDetail', ) + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.ReprintOption is not None: + showIndent(outfile, level) + outfile.write('<%sReprintOption>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ReprintOption).encode(ExternalEncoding), input_name='ReprintOption'), namespace_)) + if self.CloseDate is not None: + showIndent(outfile, level) + outfile.write('<%sCloseDate>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CloseDate).encode(ExternalEncoding), input_name='CloseDate'), namespace_)) + if self.TrackingNumber is not None: + showIndent(outfile, level) + outfile.write('<%sTrackingNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.TrackingNumber).encode(ExternalEncoding), input_name='TrackingNumber'), namespace_)) + if self.CloseDocumentSpecification: + self.CloseDocumentSpecification.export(outfile, level, namespace_, name_='CloseDocumentSpecification') + def hasContent_(self): + if ( + self.WebAuthenticationDetail is not None or + self.ClientDetail is not None or + self.TransactionDetail is not None or + self.Version is not None or + self.ReprintOption is not None or + self.CloseDate is not None or + self.TrackingNumber is not None or + self.CloseDocumentSpecification is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ReprintGroundCloseDocumentsRequest'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.WebAuthenticationDetail is not None: + showIndent(outfile, level) + outfile.write('WebAuthenticationDetail=model_.WebAuthenticationDetail(\n') + self.WebAuthenticationDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ClientDetail is not None: + showIndent(outfile, level) + outfile.write('ClientDetail=model_.ClientDetail(\n') + self.ClientDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.ReprintOption is not None: + showIndent(outfile, level) + outfile.write('ReprintOption=%s,\n' % quote_python(self.ReprintOption).encode(ExternalEncoding)) + if self.CloseDate is not None: + showIndent(outfile, level) + outfile.write('CloseDate=%s,\n' % quote_python(self.CloseDate).encode(ExternalEncoding)) + if self.TrackingNumber is not None: + showIndent(outfile, level) + outfile.write('TrackingNumber=%s,\n' % quote_python(self.TrackingNumber).encode(ExternalEncoding)) + if self.CloseDocumentSpecification is not None: + showIndent(outfile, level) + outfile.write('CloseDocumentSpecification=model_.CloseDocumentSpecification(\n') + self.CloseDocumentSpecification.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'WebAuthenticationDetail': + obj_ = WebAuthenticationDetail.factory() + obj_.build(child_) + self.set_WebAuthenticationDetail(obj_) + elif nodeName_ == 'ClientDetail': + obj_ = ClientDetail.factory() + obj_.build(child_) + self.set_ClientDetail(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'ReprintOption': + ReprintOption_ = child_.text + ReprintOption_ = self.gds_validate_string(ReprintOption_, node, 'ReprintOption') + self.ReprintOption = ReprintOption_ + self.validate_ReprintGroundCloseDocumentsOptionType(self.ReprintOption) # validate type ReprintGroundCloseDocumentsOptionType + elif nodeName_ == 'CloseDate': + CloseDate_ = child_.text + CloseDate_ = self.gds_validate_string(CloseDate_, node, 'CloseDate') + self.CloseDate = CloseDate_ + elif nodeName_ == 'TrackingNumber': + TrackingNumber_ = child_.text + TrackingNumber_ = self.gds_validate_string(TrackingNumber_, node, 'TrackingNumber') + self.TrackingNumber = TrackingNumber_ + elif nodeName_ == 'CloseDocumentSpecification': + obj_ = CloseDocumentSpecification.factory() + obj_.build(child_) + self.set_CloseDocumentSpecification(obj_) +# end class ReprintGroundCloseDocumentsRequest + + +class ShippingDocumentDispositionDetail(GeneratedsSuper): + """Each occurrence of this class specifies a particular way in which a + kind of shipping document is to be produced and provided.""" + subclass = None + superclass = None + def __init__(self, DispositionType=None, Grouping=None, StorageDetail=None, EMailDetail=None, PrintDetail=None): + self.DispositionType = DispositionType + self.Grouping = Grouping + self.StorageDetail = StorageDetail + self.EMailDetail = EMailDetail + self.PrintDetail = PrintDetail + def factory(*args_, **kwargs_): + if ShippingDocumentDispositionDetail.subclass: + return ShippingDocumentDispositionDetail.subclass(*args_, **kwargs_) + else: + return ShippingDocumentDispositionDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_DispositionType(self): return self.DispositionType + def set_DispositionType(self, DispositionType): self.DispositionType = DispositionType + def validate_ShippingDocumentDispositionType(self, value): + # Validate type ShippingDocumentDispositionType, a restriction on xs:string. + pass + def get_Grouping(self): return self.Grouping + def set_Grouping(self, Grouping): self.Grouping = Grouping + def validate_ShippingDocumentGroupingType(self, value): + # Validate type ShippingDocumentGroupingType, a restriction on xs:string. + pass + def get_StorageDetail(self): return self.StorageDetail + def set_StorageDetail(self, StorageDetail): self.StorageDetail = StorageDetail + def get_EMailDetail(self): return self.EMailDetail + def set_EMailDetail(self, EMailDetail): self.EMailDetail = EMailDetail + def get_PrintDetail(self): return self.PrintDetail + def set_PrintDetail(self, PrintDetail): self.PrintDetail = PrintDetail + def export(self, outfile, level, namespace_='ns:', name_='ShippingDocumentDispositionDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ShippingDocumentDispositionDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ShippingDocumentDispositionDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ShippingDocumentDispositionDetail', fromsubclass_=False): + if self.DispositionType is not None: + showIndent(outfile, level) + outfile.write('<%sDispositionType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DispositionType).encode(ExternalEncoding), input_name='DispositionType'), namespace_)) + if self.Grouping is not None: + showIndent(outfile, level) + outfile.write('<%sGrouping>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Grouping).encode(ExternalEncoding), input_name='Grouping'), namespace_)) + if self.StorageDetail: + self.StorageDetail.export(outfile, level, namespace_, name_='StorageDetail') + if self.EMailDetail: + self.EMailDetail.export(outfile, level, namespace_, name_='EMailDetail') + if self.PrintDetail: + self.PrintDetail.export(outfile, level, namespace_, name_='PrintDetail') + def hasContent_(self): + if ( + self.DispositionType is not None or + self.Grouping is not None or + self.StorageDetail is not None or + self.EMailDetail is not None or + self.PrintDetail is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ShippingDocumentDispositionDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.DispositionType is not None: + showIndent(outfile, level) + outfile.write('DispositionType=%s,\n' % quote_python(self.DispositionType).encode(ExternalEncoding)) + if self.Grouping is not None: + showIndent(outfile, level) + outfile.write('Grouping=%s,\n' % quote_python(self.Grouping).encode(ExternalEncoding)) + if self.StorageDetail is not None: + showIndent(outfile, level) + outfile.write('StorageDetail=model_.ShippingDocumentStorageDetail(\n') + self.StorageDetail.exportLiteral(outfile, level, name_='StorageDetail') + showIndent(outfile, level) + outfile.write('),\n') + if self.EMailDetail is not None: + showIndent(outfile, level) + outfile.write('EMailDetail=model_.ShippingDocumentEMailDetail(\n') + self.EMailDetail.exportLiteral(outfile, level, name_='EMailDetail') + showIndent(outfile, level) + outfile.write('),\n') + if self.PrintDetail is not None: + showIndent(outfile, level) + outfile.write('PrintDetail=model_.ShippingDocumentPrintDetail(\n') + self.PrintDetail.exportLiteral(outfile, level, name_='PrintDetail') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'DispositionType': + DispositionType_ = child_.text + DispositionType_ = self.gds_validate_string(DispositionType_, node, 'DispositionType') + self.DispositionType = DispositionType_ + self.validate_ShippingDocumentDispositionType(self.DispositionType) # validate type ShippingDocumentDispositionType + elif nodeName_ == 'Grouping': + Grouping_ = child_.text + Grouping_ = self.gds_validate_string(Grouping_, node, 'Grouping') + self.Grouping = Grouping_ + self.validate_ShippingDocumentGroupingType(self.Grouping) # validate type ShippingDocumentGroupingType + elif nodeName_ == 'StorageDetail': + obj_ = ShippingDocumentStorageDetail.factory() + obj_.build(child_) + self.set_StorageDetail(obj_) + elif nodeName_ == 'EMailDetail': + obj_ = ShippingDocumentEMailDetail.factory() + obj_.build(child_) + self.set_EMailDetail(obj_) + elif nodeName_ == 'PrintDetail': + obj_ = ShippingDocumentPrintDetail.factory() + obj_.build(child_) + self.set_PrintDetail(obj_) +# end class ShippingDocumentDispositionDetail + + +class ShippingDocumentEMailDetail(GeneratedsSuper): + """Specifies how to e-mail shipping documents.""" + subclass = None + superclass = None + def __init__(self, EMailRecipients=None, Grouping=None): + if EMailRecipients is None: + self.EMailRecipients = [] + else: + self.EMailRecipients = EMailRecipients + self.Grouping = Grouping + def factory(*args_, **kwargs_): + if ShippingDocumentEMailDetail.subclass: + return ShippingDocumentEMailDetail.subclass(*args_, **kwargs_) + else: + return ShippingDocumentEMailDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_EMailRecipients(self): return self.EMailRecipients + def set_EMailRecipients(self, EMailRecipients): self.EMailRecipients = EMailRecipients + def add_EMailRecipients(self, value): self.EMailRecipients.append(value) + def insert_EMailRecipients(self, index, value): self.EMailRecipients[index] = value + def get_Grouping(self): return self.Grouping + def set_Grouping(self, Grouping): self.Grouping = Grouping + def validate_ShippingDocumentEMailGroupingType(self, value): + # Validate type ShippingDocumentEMailGroupingType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='ShippingDocumentEMailDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ShippingDocumentEMailDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ShippingDocumentEMailDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ShippingDocumentEMailDetail', fromsubclass_=False): + for EMailRecipients_ in self.EMailRecipients: + EMailRecipients_.export(outfile, level, namespace_, name_='EMailRecipients') + if self.Grouping is not None: + showIndent(outfile, level) + outfile.write('<%sGrouping>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Grouping).encode(ExternalEncoding), input_name='Grouping'), namespace_)) + def hasContent_(self): + if ( + self.EMailRecipients or + self.Grouping is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ShippingDocumentEMailDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('EMailRecipients=[\n') + level += 1 + for EMailRecipients_ in self.EMailRecipients: + showIndent(outfile, level) + outfile.write('model_.ShippingDocumentEMailRecipient(\n') + EMailRecipients_.exportLiteral(outfile, level, name_='ShippingDocumentEMailRecipient') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.Grouping is not None: + showIndent(outfile, level) + outfile.write('Grouping=%s,\n' % quote_python(self.Grouping).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'EMailRecipients': + obj_ = ShippingDocumentEMailRecipient.factory() + obj_.build(child_) + self.EMailRecipients.append(obj_) + elif nodeName_ == 'Grouping': + Grouping_ = child_.text + Grouping_ = self.gds_validate_string(Grouping_, node, 'Grouping') + self.Grouping = Grouping_ + self.validate_ShippingDocumentEMailGroupingType(self.Grouping) # validate type ShippingDocumentEMailGroupingType +# end class ShippingDocumentEMailDetail + + +class ShippingDocumentEMailRecipient(GeneratedsSuper): + """Specifies an individual recipient of e-mailed shipping document(s).""" + subclass = None + superclass = None + def __init__(self, RecipientType=None, Address=None): + self.RecipientType = RecipientType + self.Address = Address + def factory(*args_, **kwargs_): + if ShippingDocumentEMailRecipient.subclass: + return ShippingDocumentEMailRecipient.subclass(*args_, **kwargs_) + else: + return ShippingDocumentEMailRecipient(*args_, **kwargs_) + factory = staticmethod(factory) + def get_RecipientType(self): return self.RecipientType + def set_RecipientType(self, RecipientType): self.RecipientType = RecipientType + def validate_EMailNotificationRecipientType(self, value): + # Validate type EMailNotificationRecipientType, a restriction on xs:string. + pass + def get_Address(self): return self.Address + def set_Address(self, Address): self.Address = Address + def export(self, outfile, level, namespace_='ns:', name_='ShippingDocumentEMailRecipient', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ShippingDocumentEMailRecipient') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ShippingDocumentEMailRecipient'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ShippingDocumentEMailRecipient', fromsubclass_=False): + if self.RecipientType is not None: + showIndent(outfile, level) + outfile.write('<%sRecipientType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RecipientType).encode(ExternalEncoding), input_name='RecipientType'), namespace_)) + if self.Address is not None: + showIndent(outfile, level) + outfile.write('<%sAddress>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Address).encode(ExternalEncoding), input_name='Address'), namespace_)) + def hasContent_(self): + if ( + self.RecipientType is not None or + self.Address is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ShippingDocumentEMailRecipient'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.RecipientType is not None: + showIndent(outfile, level) + outfile.write('RecipientType=%s,\n' % quote_python(self.RecipientType).encode(ExternalEncoding)) + if self.Address is not None: + showIndent(outfile, level) + outfile.write('Address=%s,\n' % quote_python(self.Address).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'RecipientType': + RecipientType_ = child_.text + RecipientType_ = self.gds_validate_string(RecipientType_, node, 'RecipientType') + self.RecipientType = RecipientType_ + self.validate_EMailNotificationRecipientType(self.RecipientType) # validate type EMailNotificationRecipientType + elif nodeName_ == 'Address': + Address_ = child_.text + Address_ = self.gds_validate_string(Address_, node, 'Address') + self.Address = Address_ +# end class ShippingDocumentEMailRecipient + + +class ShippingDocumentPart(GeneratedsSuper): + """A single part of a shipping document, such as one page of a + multiple-page document whose format requires a separate image + per page.""" + subclass = None + superclass = None + def __init__(self, DocumentPartSequenceNumber=None, Image=None): + self.DocumentPartSequenceNumber = DocumentPartSequenceNumber + self.Image = Image + def factory(*args_, **kwargs_): + if ShippingDocumentPart.subclass: + return ShippingDocumentPart.subclass(*args_, **kwargs_) + else: + return ShippingDocumentPart(*args_, **kwargs_) + factory = staticmethod(factory) + def get_DocumentPartSequenceNumber(self): return self.DocumentPartSequenceNumber + def set_DocumentPartSequenceNumber(self, DocumentPartSequenceNumber): self.DocumentPartSequenceNumber = DocumentPartSequenceNumber + def get_Image(self): return self.Image + def set_Image(self, Image): self.Image = Image + def export(self, outfile, level, namespace_='ns:', name_='ShippingDocumentPart', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ShippingDocumentPart') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ShippingDocumentPart'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ShippingDocumentPart', fromsubclass_=False): + if self.DocumentPartSequenceNumber is not None: + showIndent(outfile, level) + outfile.write('<%sDocumentPartSequenceNumber>%s\n' % (namespace_, self.gds_format_integer(self.DocumentPartSequenceNumber, input_name='DocumentPartSequenceNumber'), namespace_)) + if self.Image: + self.Image.export(outfile, level, namespace_, name_='Image') + def hasContent_(self): + if ( + self.DocumentPartSequenceNumber is not None or + self.Image is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ShippingDocumentPart'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.DocumentPartSequenceNumber is not None: + showIndent(outfile, level) + outfile.write('DocumentPartSequenceNumber=%d,\n' % self.DocumentPartSequenceNumber) + if self.Image is not None: + showIndent(outfile, level) + outfile.write('Image=model_.xs_base64Binary(\n') + self.Image.exportLiteral(outfile, level, name_='Image') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'DocumentPartSequenceNumber': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ <= 0: + raise_parse_error(child_, 'requires positiveInteger') + ival_ = self.gds_validate_integer(ival_, node, 'DocumentPartSequenceNumber') + self.DocumentPartSequenceNumber = ival_ + elif nodeName_ == 'Image': + obj_ = xs_base64Binary.factory() + obj_.build(child_) + self.set_Image(obj_) +# end class ShippingDocumentPart + + +class ShippingDocumentPrintDetail(GeneratedsSuper): + """Specifies printing options for a shipping document.""" + subclass = None + superclass = None + def __init__(self, PrinterId=None): + self.PrinterId = PrinterId + def factory(*args_, **kwargs_): + if ShippingDocumentPrintDetail.subclass: + return ShippingDocumentPrintDetail.subclass(*args_, **kwargs_) + else: + return ShippingDocumentPrintDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_PrinterId(self): return self.PrinterId + def set_PrinterId(self, PrinterId): self.PrinterId = PrinterId + def export(self, outfile, level, namespace_='ns:', name_='ShippingDocumentPrintDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ShippingDocumentPrintDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ShippingDocumentPrintDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ShippingDocumentPrintDetail', fromsubclass_=False): + if self.PrinterId is not None: + showIndent(outfile, level) + outfile.write('<%sPrinterId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PrinterId).encode(ExternalEncoding), input_name='PrinterId'), namespace_)) + def hasContent_(self): + if ( + self.PrinterId is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ShippingDocumentPrintDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.PrinterId is not None: + showIndent(outfile, level) + outfile.write('PrinterId=%s,\n' % quote_python(self.PrinterId).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'PrinterId': + PrinterId_ = child_.text + PrinterId_ = self.gds_validate_string(PrinterId_, node, 'PrinterId') + self.PrinterId = PrinterId_ +# end class ShippingDocumentPrintDetail + + +class ShippingDocumentStorageDetail(GeneratedsSuper): + """Specifies how to store shipping documents.""" + subclass = None + superclass = None + def __init__(self, FilePath=None, FileNaming=None, FileSuffix=None): + self.FilePath = FilePath + self.FileNaming = FileNaming + self.FileSuffix = FileSuffix + def factory(*args_, **kwargs_): + if ShippingDocumentStorageDetail.subclass: + return ShippingDocumentStorageDetail.subclass(*args_, **kwargs_) + else: + return ShippingDocumentStorageDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_FilePath(self): return self.FilePath + def set_FilePath(self, FilePath): self.FilePath = FilePath + def get_FileNaming(self): return self.FileNaming + def set_FileNaming(self, FileNaming): self.FileNaming = FileNaming + def validate_ShippingDocumentNamingType(self, value): + # Validate type ShippingDocumentNamingType, a restriction on xs:string. + pass + def get_FileSuffix(self): return self.FileSuffix + def set_FileSuffix(self, FileSuffix): self.FileSuffix = FileSuffix + def export(self, outfile, level, namespace_='ns:', name_='ShippingDocumentStorageDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ShippingDocumentStorageDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ShippingDocumentStorageDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ShippingDocumentStorageDetail', fromsubclass_=False): + if self.FilePath is not None: + showIndent(outfile, level) + outfile.write('<%sFilePath>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.FilePath).encode(ExternalEncoding), input_name='FilePath'), namespace_)) + if self.FileNaming is not None: + showIndent(outfile, level) + outfile.write('<%sFileNaming>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.FileNaming).encode(ExternalEncoding), input_name='FileNaming'), namespace_)) + if self.FileSuffix is not None: + showIndent(outfile, level) + outfile.write('<%sFileSuffix>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.FileSuffix).encode(ExternalEncoding), input_name='FileSuffix'), namespace_)) + def hasContent_(self): + if ( + self.FilePath is not None or + self.FileNaming is not None or + self.FileSuffix is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ShippingDocumentStorageDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.FilePath is not None: + showIndent(outfile, level) + outfile.write('FilePath=%s,\n' % quote_python(self.FilePath).encode(ExternalEncoding)) + if self.FileNaming is not None: + showIndent(outfile, level) + outfile.write('FileNaming=%s,\n' % quote_python(self.FileNaming).encode(ExternalEncoding)) + if self.FileSuffix is not None: + showIndent(outfile, level) + outfile.write('FileSuffix=%s,\n' % quote_python(self.FileSuffix).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'FilePath': + FilePath_ = child_.text + FilePath_ = self.gds_validate_string(FilePath_, node, 'FilePath') + self.FilePath = FilePath_ + elif nodeName_ == 'FileNaming': + FileNaming_ = child_.text + FileNaming_ = self.gds_validate_string(FileNaming_, node, 'FileNaming') + self.FileNaming = FileNaming_ + self.validate_ShippingDocumentNamingType(self.FileNaming) # validate type ShippingDocumentNamingType + elif nodeName_ == 'FileSuffix': + FileSuffix_ = child_.text + FileSuffix_ = self.gds_validate_string(FileSuffix_, node, 'FileSuffix') + self.FileSuffix = FileSuffix_ +# end class ShippingDocumentStorageDetail + + +class SmartPostCloseReply(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, HighestSeverity=None, Notifications=None, TransactionDetail=None, Version=None): + self.HighestSeverity = HighestSeverity + if Notifications is None: + self.Notifications = [] + else: + self.Notifications = Notifications + self.TransactionDetail = TransactionDetail + self.Version = Version + def factory(*args_, **kwargs_): + if SmartPostCloseReply.subclass: + return SmartPostCloseReply.subclass(*args_, **kwargs_) + else: + return SmartPostCloseReply(*args_, **kwargs_) + factory = staticmethod(factory) + def get_HighestSeverity(self): return self.HighestSeverity + def set_HighestSeverity(self, HighestSeverity): self.HighestSeverity = HighestSeverity + def validate_NotificationSeverityType(self, value): + # Validate type NotificationSeverityType, a restriction on xs:string. + pass + def get_Notifications(self): return self.Notifications + def set_Notifications(self, Notifications): self.Notifications = Notifications + def add_Notifications(self, value): self.Notifications.append(value) + def insert_Notifications(self, index, value): self.Notifications[index] = value + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def export(self, outfile, level, namespace_='ns:', name_='SmartPostCloseReply', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='SmartPostCloseReply') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='SmartPostCloseReply'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='SmartPostCloseReply', fromsubclass_=False): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('<%sHighestSeverity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HighestSeverity).encode(ExternalEncoding), input_name='HighestSeverity'), namespace_)) + for Notifications_ in self.Notifications: + Notifications_.export(outfile, level, namespace_, name_='Notifications') + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + def hasContent_(self): + if ( + self.HighestSeverity is not None or + self.Notifications or + self.TransactionDetail is not None or + self.Version is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='SmartPostCloseReply'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('HighestSeverity=%s,\n' % quote_python(self.HighestSeverity).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Notifications=[\n') + level += 1 + for Notifications_ in self.Notifications: + showIndent(outfile, level) + outfile.write('model_.Notification(\n') + Notifications_.exportLiteral(outfile, level, name_='Notification') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'HighestSeverity': + HighestSeverity_ = child_.text + HighestSeverity_ = self.gds_validate_string(HighestSeverity_, node, 'HighestSeverity') + self.HighestSeverity = HighestSeverity_ + self.validate_NotificationSeverityType(self.HighestSeverity) # validate type NotificationSeverityType + elif nodeName_ == 'Notifications': + obj_ = Notification.factory() + obj_.build(child_) + self.Notifications.append(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) +# end class SmartPostCloseReply + + +class SmartPostCloseRequest(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, WebAuthenticationDetail=None, ClientDetail=None, TransactionDetail=None, Version=None, HubId=None, CustomerManifestId=None, DestinationCountryCode=None, PickUpCarrier=None): + self.WebAuthenticationDetail = WebAuthenticationDetail + self.ClientDetail = ClientDetail + self.TransactionDetail = TransactionDetail + self.Version = Version + self.HubId = HubId + self.CustomerManifestId = CustomerManifestId + self.DestinationCountryCode = DestinationCountryCode + self.PickUpCarrier = PickUpCarrier + def factory(*args_, **kwargs_): + if SmartPostCloseRequest.subclass: + return SmartPostCloseRequest.subclass(*args_, **kwargs_) + else: + return SmartPostCloseRequest(*args_, **kwargs_) + factory = staticmethod(factory) + def get_WebAuthenticationDetail(self): return self.WebAuthenticationDetail + def set_WebAuthenticationDetail(self, WebAuthenticationDetail): self.WebAuthenticationDetail = WebAuthenticationDetail + def get_ClientDetail(self): return self.ClientDetail + def set_ClientDetail(self, ClientDetail): self.ClientDetail = ClientDetail + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_HubId(self): return self.HubId + def set_HubId(self, HubId): self.HubId = HubId + def get_CustomerManifestId(self): return self.CustomerManifestId + def set_CustomerManifestId(self, CustomerManifestId): self.CustomerManifestId = CustomerManifestId + def get_DestinationCountryCode(self): return self.DestinationCountryCode + def set_DestinationCountryCode(self, DestinationCountryCode): self.DestinationCountryCode = DestinationCountryCode + def get_PickUpCarrier(self): return self.PickUpCarrier + def set_PickUpCarrier(self, PickUpCarrier): self.PickUpCarrier = PickUpCarrier + def validate_CarrierCodeType(self, value): + # Validate type CarrierCodeType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='SmartPostCloseRequest', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='SmartPostCloseRequest') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='SmartPostCloseRequest'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='SmartPostCloseRequest', fromsubclass_=False): + if self.WebAuthenticationDetail: + self.WebAuthenticationDetail.export(outfile, level, namespace_, name_='WebAuthenticationDetail', ) + if self.ClientDetail: + self.ClientDetail.export(outfile, level, namespace_, name_='ClientDetail', ) + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.HubId is not None: + showIndent(outfile, level) + outfile.write('<%sHubId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HubId).encode(ExternalEncoding), input_name='HubId'), namespace_)) + if self.CustomerManifestId is not None: + showIndent(outfile, level) + outfile.write('<%sCustomerManifestId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CustomerManifestId).encode(ExternalEncoding), input_name='CustomerManifestId'), namespace_)) + if self.DestinationCountryCode is not None: + showIndent(outfile, level) + outfile.write('<%sDestinationCountryCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DestinationCountryCode).encode(ExternalEncoding), input_name='DestinationCountryCode'), namespace_)) + if self.PickUpCarrier is not None: + showIndent(outfile, level) + outfile.write('<%sPickUpCarrier>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PickUpCarrier).encode(ExternalEncoding), input_name='PickUpCarrier'), namespace_)) + def hasContent_(self): + if ( + self.WebAuthenticationDetail is not None or + self.ClientDetail is not None or + self.TransactionDetail is not None or + self.Version is not None or + self.HubId is not None or + self.CustomerManifestId is not None or + self.DestinationCountryCode is not None or + self.PickUpCarrier is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='SmartPostCloseRequest'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.WebAuthenticationDetail is not None: + showIndent(outfile, level) + outfile.write('WebAuthenticationDetail=model_.WebAuthenticationDetail(\n') + self.WebAuthenticationDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ClientDetail is not None: + showIndent(outfile, level) + outfile.write('ClientDetail=model_.ClientDetail(\n') + self.ClientDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.HubId is not None: + showIndent(outfile, level) + outfile.write('HubId=%s,\n' % quote_python(self.HubId).encode(ExternalEncoding)) + if self.CustomerManifestId is not None: + showIndent(outfile, level) + outfile.write('CustomerManifestId=%s,\n' % quote_python(self.CustomerManifestId).encode(ExternalEncoding)) + if self.DestinationCountryCode is not None: + showIndent(outfile, level) + outfile.write('DestinationCountryCode=%s,\n' % quote_python(self.DestinationCountryCode).encode(ExternalEncoding)) + if self.PickUpCarrier is not None: + showIndent(outfile, level) + outfile.write('PickUpCarrier=%s,\n' % quote_python(self.PickUpCarrier).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'WebAuthenticationDetail': + obj_ = WebAuthenticationDetail.factory() + obj_.build(child_) + self.set_WebAuthenticationDetail(obj_) + elif nodeName_ == 'ClientDetail': + obj_ = ClientDetail.factory() + obj_.build(child_) + self.set_ClientDetail(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'HubId': + HubId_ = child_.text + HubId_ = self.gds_validate_string(HubId_, node, 'HubId') + self.HubId = HubId_ + elif nodeName_ == 'CustomerManifestId': + CustomerManifestId_ = child_.text + CustomerManifestId_ = self.gds_validate_string(CustomerManifestId_, node, 'CustomerManifestId') + self.CustomerManifestId = CustomerManifestId_ + elif nodeName_ == 'DestinationCountryCode': + DestinationCountryCode_ = child_.text + DestinationCountryCode_ = self.gds_validate_string(DestinationCountryCode_, node, 'DestinationCountryCode') + self.DestinationCountryCode = DestinationCountryCode_ + elif nodeName_ == 'PickUpCarrier': + PickUpCarrier_ = child_.text + PickUpCarrier_ = self.gds_validate_string(PickUpCarrier_, node, 'PickUpCarrier') + self.PickUpCarrier = PickUpCarrier_ + self.validate_CarrierCodeType(self.PickUpCarrier) # validate type CarrierCodeType +# end class SmartPostCloseRequest + + +class TransactionDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, CustomerTransactionId=None, Localization=None): + self.CustomerTransactionId = CustomerTransactionId + self.Localization = Localization + def factory(*args_, **kwargs_): + if TransactionDetail.subclass: + return TransactionDetail.subclass(*args_, **kwargs_) + else: + return TransactionDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_CustomerTransactionId(self): return self.CustomerTransactionId + def set_CustomerTransactionId(self, CustomerTransactionId): self.CustomerTransactionId = CustomerTransactionId + def get_Localization(self): return self.Localization + def set_Localization(self, Localization): self.Localization = Localization + def export(self, outfile, level, namespace_='ns:', name_='TransactionDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='TransactionDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='TransactionDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='TransactionDetail', fromsubclass_=False): + if self.CustomerTransactionId is not None: + showIndent(outfile, level) + outfile.write('<%sCustomerTransactionId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CustomerTransactionId).encode(ExternalEncoding), input_name='CustomerTransactionId'), namespace_)) + if self.Localization: + self.Localization.export(outfile, level, namespace_, name_='Localization') + def hasContent_(self): + if ( + self.CustomerTransactionId is not None or + self.Localization is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='TransactionDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.CustomerTransactionId is not None: + showIndent(outfile, level) + outfile.write('CustomerTransactionId=%s,\n' % quote_python(self.CustomerTransactionId).encode(ExternalEncoding)) + if self.Localization is not None: + showIndent(outfile, level) + outfile.write('Localization=model_.Localization(\n') + self.Localization.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'CustomerTransactionId': + CustomerTransactionId_ = child_.text + CustomerTransactionId_ = self.gds_validate_string(CustomerTransactionId_, node, 'CustomerTransactionId') + self.CustomerTransactionId = CustomerTransactionId_ + elif nodeName_ == 'Localization': + obj_ = Localization.factory() + obj_.build(child_) + self.set_Localization(obj_) +# end class TransactionDetail + + +class VersionId(GeneratedsSuper): + """Identifies the version/level of a service operation expected by a + caller (in each request) and performed by the callee (in each + reply).""" + subclass = None + superclass = None + def __init__(self, ServiceId=None, Major=None, Intermediate=None, Minor=None): + self.ServiceId = ServiceId + self.Major = Major + self.Intermediate = Intermediate + self.Minor = Minor + def factory(*args_, **kwargs_): + if VersionId.subclass: + return VersionId.subclass(*args_, **kwargs_) + else: + return VersionId(*args_, **kwargs_) + factory = staticmethod(factory) + def get_ServiceId(self): return self.ServiceId + def set_ServiceId(self, ServiceId): self.ServiceId = ServiceId + def get_Major(self): return self.Major + def set_Major(self, Major): self.Major = Major + def get_Intermediate(self): return self.Intermediate + def set_Intermediate(self, Intermediate): self.Intermediate = Intermediate + def get_Minor(self): return self.Minor + def set_Minor(self, Minor): self.Minor = Minor + def export(self, outfile, level, namespace_='ns:', name_='VersionId', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='VersionId') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='VersionId'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='VersionId', fromsubclass_=False): + if self.ServiceId is not None: + showIndent(outfile, level) + outfile.write('<%sServiceId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ServiceId).encode(ExternalEncoding), input_name='ServiceId'), namespace_)) + if self.Major is not None: + showIndent(outfile, level) + outfile.write('<%sMajor>%s\n' % (namespace_, self.gds_format_integer(self.Major, input_name='Major'), namespace_)) + if self.Intermediate is not None: + showIndent(outfile, level) + outfile.write('<%sIntermediate>%s\n' % (namespace_, self.gds_format_integer(self.Intermediate, input_name='Intermediate'), namespace_)) + if self.Minor is not None: + showIndent(outfile, level) + outfile.write('<%sMinor>%s\n' % (namespace_, self.gds_format_integer(self.Minor, input_name='Minor'), namespace_)) + def hasContent_(self): + if ( + self.ServiceId is not None or + self.Major is not None or + self.Intermediate is not None or + self.Minor is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='VersionId'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.ServiceId is not None: + showIndent(outfile, level) + outfile.write('ServiceId=%s,\n' % quote_python(self.ServiceId).encode(ExternalEncoding)) + if self.Major is not None: + showIndent(outfile, level) + outfile.write('Major=%d,\n' % self.Major) + if self.Intermediate is not None: + showIndent(outfile, level) + outfile.write('Intermediate=%d,\n' % self.Intermediate) + if self.Minor is not None: + showIndent(outfile, level) + outfile.write('Minor=%d,\n' % self.Minor) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'ServiceId': + ServiceId_ = child_.text + ServiceId_ = self.gds_validate_string(ServiceId_, node, 'ServiceId') + self.ServiceId = ServiceId_ + elif nodeName_ == 'Major': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'Major') + self.Major = ival_ + elif nodeName_ == 'Intermediate': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'Intermediate') + self.Intermediate = ival_ + elif nodeName_ == 'Minor': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'Minor') + self.Minor = ival_ +# end class VersionId + + +class WebAuthenticationDetail(GeneratedsSuper): + """The descriptive data to be used in authentication of the sender's + identity (and right to use FedEx web services).""" + subclass = None + superclass = None + def __init__(self, UserCredential=None): + self.UserCredential = UserCredential + def factory(*args_, **kwargs_): + if WebAuthenticationDetail.subclass: + return WebAuthenticationDetail.subclass(*args_, **kwargs_) + else: + return WebAuthenticationDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_UserCredential(self): return self.UserCredential + def set_UserCredential(self, UserCredential): self.UserCredential = UserCredential + def export(self, outfile, level, namespace_='ns:', name_='WebAuthenticationDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='WebAuthenticationDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='WebAuthenticationDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='WebAuthenticationDetail', fromsubclass_=False): + if self.UserCredential: + self.UserCredential.export(outfile, level, namespace_, name_='UserCredential', ) + def hasContent_(self): + if ( + self.UserCredential is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='WebAuthenticationDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.UserCredential is not None: + showIndent(outfile, level) + outfile.write('UserCredential=model_.WebAuthenticationCredential(\n') + self.UserCredential.exportLiteral(outfile, level, name_='UserCredential') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'UserCredential': + obj_ = WebAuthenticationCredential.factory() + obj_.build(child_) + self.set_UserCredential(obj_) +# end class WebAuthenticationDetail + + +class WebAuthenticationCredential(GeneratedsSuper): + """Two part authentication string used for the sender's identity.""" + subclass = None + superclass = None + def __init__(self, Key=None, Password=None): + self.Key = Key + self.Password = Password + def factory(*args_, **kwargs_): + if WebAuthenticationCredential.subclass: + return WebAuthenticationCredential.subclass(*args_, **kwargs_) + else: + return WebAuthenticationCredential(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Key(self): return self.Key + def set_Key(self, Key): self.Key = Key + def get_Password(self): return self.Password + def set_Password(self, Password): self.Password = Password + def export(self, outfile, level, namespace_='ns:', name_='WebAuthenticationCredential', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='WebAuthenticationCredential') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='WebAuthenticationCredential'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='WebAuthenticationCredential', fromsubclass_=False): + if self.Key is not None: + showIndent(outfile, level) + outfile.write('<%sKey>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Key).encode(ExternalEncoding), input_name='Key'), namespace_)) + if self.Password is not None: + showIndent(outfile, level) + outfile.write('<%sPassword>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Password).encode(ExternalEncoding), input_name='Password'), namespace_)) + def hasContent_(self): + if ( + self.Key is not None or + self.Password is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='WebAuthenticationCredential'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Key is not None: + showIndent(outfile, level) + outfile.write('Key=%s,\n' % quote_python(self.Key).encode(ExternalEncoding)) + if self.Password is not None: + showIndent(outfile, level) + outfile.write('Password=%s,\n' % quote_python(self.Password).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Key': + Key_ = child_.text + Key_ = self.gds_validate_string(Key_, node, 'Key') + self.Key = Key_ + elif nodeName_ == 'Password': + Password_ = child_.text + Password_ = self.gds_validate_string(Password_, node, 'Password') + self.Password = Password_ +# end class WebAuthenticationCredential + + +USAGE_TEXT = """ +Usage: python .py [ -s ] +""" + +def usage(): + print USAGE_TEXT + sys.exit(1) + + +def get_root_tag(node): + tag = Tag_pattern_.match(node.tag).groups()[-1] + rootClass = globals().get(tag) + return tag, rootClass + + +def parse(inFileName): + doc = parsexml_(inFileName) + rootNode = doc.getroot() + rootTag, rootClass = get_root_tag(rootNode) + if rootClass is None: + rootTag = 'SmartPostCloseRequest' + rootClass = SmartPostCloseRequest + rootObj = rootClass.factory() + rootObj.build(rootNode) + # Enable Python to collect the space used by the DOM. + doc = None + sys.stdout.write('\n') + rootObj.export(sys.stdout, 0, name_=rootTag, + namespacedef_='') + return rootObj + + +def parseString(inString): + from StringIO import StringIO + doc = parsexml_(StringIO(inString)) + rootNode = doc.getroot() + rootTag, rootClass = get_root_tag(rootNode) + if rootClass is None: + rootTag = 'SmartPostCloseRequest' + rootClass = SmartPostCloseRequest + rootObj = rootClass.factory() + rootObj.build(rootNode) + # Enable Python to collect the space used by the DOM. + doc = None + sys.stdout.write('\n') + rootObj.export(sys.stdout, 0, name_="SmartPostCloseRequest", + namespacedef_='') + return rootObj + + +def parseLiteral(inFileName): + doc = parsexml_(inFileName) + rootNode = doc.getroot() + rootTag, rootClass = get_root_tag(rootNode) + if rootClass is None: + rootTag = 'SmartPostCloseRequest' + rootClass = SmartPostCloseRequest + rootObj = rootClass.factory() + rootObj.build(rootNode) + # Enable Python to collect the space used by the DOM. + doc = None + sys.stdout.write('#from close import *\n\n') + sys.stdout.write('import close as model_\n\n') + sys.stdout.write('rootObj = model_.rootTag(\n') + rootObj.exportLiteral(sys.stdout, 0, name_=rootTag) + sys.stdout.write(')\n') + return rootObj + + +def main(): + args = sys.argv[1:] + if len(args) == 1: + parse(args[0]) + else: + usage() + + +if __name__ == '__main__': + #import pdb; pdb.set_trace() + main() + + +__all__ = [ + "ClientDetail", + "CloseDocument", + "CloseDocumentFormat", + "CloseDocumentSpecification", + "CustomerImageUsage", + "GroundCloseDocumentsReply", + "GroundCloseReply", + "GroundCloseReportsReprintReply", + "GroundCloseReportsReprintRequest", + "GroundCloseRequest", + "GroundCloseWithDocumentsRequest", + "LinearMeasure", + "Localization", + "ManifestFile", + "Notification", + "NotificationParameter", + "Op950Detail", + "ReprintGroundCloseDocumentsRequest", + "ShippingDocumentDispositionDetail", + "ShippingDocumentEMailDetail", + "ShippingDocumentEMailRecipient", + "ShippingDocumentPart", + "ShippingDocumentPrintDetail", + "ShippingDocumentStorageDetail", + "SmartPostCloseReply", + "SmartPostCloseRequest", + "TransactionDetail", + "VersionId", + "WebAuthenticationCredential", + "WebAuthenticationDetail" + ] diff --git a/webxml/fedex/locate.py b/webxml/fedex/locate.py new file mode 100644 index 0000000..e9c7413 --- /dev/null +++ b/webxml/fedex/locate.py @@ -0,0 +1,2798 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# +# Generated Mon Nov 28 15:43:00 2011 by generateDS.py version 2.6a. +# + +import sys +import getopt +import re as re_ + +etree_ = None +Verbose_import_ = False +( XMLParser_import_none, XMLParser_import_lxml, + XMLParser_import_elementtree + ) = range(3) +XMLParser_import_library = None +try: + # lxml + from lxml import etree as etree_ + XMLParser_import_library = XMLParser_import_lxml + if Verbose_import_: + print("running with lxml.etree") +except ImportError: + try: + # cElementTree from Python 2.5+ + import xml.etree.cElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with cElementTree on Python 2.5+") + except ImportError: + try: + # ElementTree from Python 2.5+ + import xml.etree.ElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with ElementTree on Python 2.5+") + except ImportError: + try: + # normal cElementTree install + import cElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with cElementTree") + except ImportError: + try: + # normal ElementTree install + import elementtree.ElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with ElementTree") + except ImportError: + raise ImportError("Failed to import ElementTree from any known place") + +def parsexml_(*args, **kwargs): + if (XMLParser_import_library == XMLParser_import_lxml and + 'parser' not in kwargs): + # Use the lxml ElementTree compatible parser so that, e.g., + # we ignore comments. + kwargs['parser'] = etree_.ETCompatXMLParser() + doc = etree_.parse(*args, **kwargs) + return doc + +# +# User methods +# +# Calls to the methods in these classes are generated by generateDS.py. +# You can replace these methods by re-implementing the following class +# in a module named generatedssuper.py. + +try: + from generatedssuper import GeneratedsSuper +except ImportError, exp: + + class GeneratedsSuper(object): + def gds_format_string(self, input_data, input_name=''): + return input_data + def gds_validate_string(self, input_data, node, input_name=''): + return input_data + def gds_format_integer(self, input_data, input_name=''): + return '%d' % input_data + def gds_validate_integer(self, input_data, node, input_name=''): + return input_data + def gds_format_integer_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_integer_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + try: + fvalue = float(value) + except (TypeError, ValueError), exp: + raise_parse_error(node, 'Requires sequence of integers') + return input_data + def gds_format_float(self, input_data, input_name=''): + return '%f' % input_data + def gds_validate_float(self, input_data, node, input_name=''): + return input_data + def gds_format_float_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_float_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + try: + fvalue = float(value) + except (TypeError, ValueError), exp: + raise_parse_error(node, 'Requires sequence of floats') + return input_data + def gds_format_double(self, input_data, input_name=''): + return '%e' % input_data + def gds_validate_double(self, input_data, node, input_name=''): + return input_data + def gds_format_double_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_double_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + try: + fvalue = float(value) + except (TypeError, ValueError), exp: + raise_parse_error(node, 'Requires sequence of doubles') + return input_data + def gds_format_boolean(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_boolean(self, input_data, node, input_name=''): + return input_data + def gds_format_boolean_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_boolean_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + if value not in ('true', '1', 'false', '0', ): + raise_parse_error(node, 'Requires sequence of booleans ("true", "1", "false", "0")') + return input_data + def gds_str_lower(self, instring): + return instring.lower() + def get_path_(self, node): + path_list = [] + self.get_path_list_(node, path_list) + path_list.reverse() + path = '/'.join(path_list) + return path + Tag_strip_pattern_ = re_.compile(r'\{.*\}') + def get_path_list_(self, node, path_list): + if node is None: + return + tag = GeneratedsSuper.Tag_strip_pattern_.sub('', node.tag) + if tag: + path_list.append(tag) + self.get_path_list_(node.getparent(), path_list) + def get_class_obj_(self, node, default_class=None): + class_obj1 = default_class + if 'xsi' in node.nsmap: + classname = node.get('{%s}type' % node.nsmap['xsi']) + if classname is not None: + names = classname.split(':') + if len(names) == 2: + classname = names[1] + class_obj2 = globals().get(classname) + if class_obj2 is not None: + class_obj1 = class_obj2 + return class_obj1 + + +# +# If you have installed IPython you can uncomment and use the following. +# IPython is available from http://ipython.scipy.org/. +# + +## from IPython.Shell import IPShellEmbed +## args = '' +## ipshell = IPShellEmbed(args, +## banner = 'Dropping into IPython', +## exit_msg = 'Leaving Interpreter, back to program.') + +# Then use the following line where and when you want to drop into the +# IPython shell: +# ipshell(' -- Entering ipshell.\nHit Ctrl-D to exit') + +# +# Globals +# + +ExternalEncoding = 'ascii' +Tag_pattern_ = re_.compile(r'({.*})?(.*)') +String_cleanup_pat_ = re_.compile(r"[\n\r\s]+") +Namespace_extract_pat_ = re_.compile(r'{(.*)}(.*)') + +# +# Support/utility functions. +# + +def showIndent(outfile, level): + for idx in range(level): + outfile.write(' ') + +def quote_xml(inStr): + if not inStr: + return '' + s1 = (isinstance(inStr, basestring) and inStr or + '%s' % inStr) + s1 = s1.replace('&', '&') + s1 = s1.replace('<', '<') + s1 = s1.replace('>', '>') + return s1 + +def quote_attrib(inStr): + s1 = (isinstance(inStr, basestring) and inStr or + '%s' % inStr) + s1 = s1.replace('&', '&') + s1 = s1.replace('<', '<') + s1 = s1.replace('>', '>') + if '"' in s1: + if "'" in s1: + s1 = '"%s"' % s1.replace('"', """) + else: + s1 = "'%s'" % s1 + else: + s1 = '"%s"' % s1 + return s1 + +def quote_python(inStr): + s1 = inStr + if s1.find("'") == -1: + if s1.find('\n') == -1: + return "'%s'" % s1 + else: + return "'''%s'''" % s1 + else: + if s1.find('"') != -1: + s1 = s1.replace('"', '\\"') + if s1.find('\n') == -1: + return '"%s"' % s1 + else: + return '"""%s"""' % s1 + +def get_all_text_(node): + if node.text is not None: + text = node.text + else: + text = '' + for child in node: + if child.tail is not None: + text += child.tail + return text + +def find_attr_value_(attr_name, node): + attrs = node.attrib + attr_parts = attr_name.split(':') + value = None + if len(attr_parts) == 1: + value = attrs.get(attr_name) + elif len(attr_parts) == 2: + prefix, name = attr_parts + namespace = node.nsmap.get(prefix) + if namespace is not None: + value = attrs.get('{%s}%s' % (namespace, name, )) + return value + + +class GDSParseError(Exception): + pass + +def raise_parse_error(node, msg): + if XMLParser_import_library == XMLParser_import_lxml: + msg = '%s (element %s/line %d)' % (msg, node.tag, node.sourceline, ) + else: + msg = '%s (element %s)' % (msg, node.tag, ) + raise GDSParseError(msg) + + +class MixedContainer: + # Constants for category: + CategoryNone = 0 + CategoryText = 1 + CategorySimple = 2 + CategoryComplex = 3 + # Constants for content_type: + TypeNone = 0 + TypeText = 1 + TypeString = 2 + TypeInteger = 3 + TypeFloat = 4 + TypeDecimal = 5 + TypeDouble = 6 + TypeBoolean = 7 + def __init__(self, category, content_type, name, value): + self.category = category + self.content_type = content_type + self.name = name + self.value = value + def getCategory(self): + return self.category + def getContenttype(self, content_type): + return self.content_type + def getValue(self): + return self.value + def getName(self): + return self.name + def export(self, outfile, level, name, namespace): + if self.category == MixedContainer.CategoryText: + # Prevent exporting empty content as empty lines. + if self.value.strip(): + outfile.write(self.value) + elif self.category == MixedContainer.CategorySimple: + self.exportSimple(outfile, level, name) + else: # category == MixedContainer.CategoryComplex + self.value.export(outfile, level, namespace,name) + def exportSimple(self, outfile, level, name): + if self.content_type == MixedContainer.TypeString: + outfile.write('<%s>%s' % (self.name, self.value, self.name)) + elif self.content_type == MixedContainer.TypeInteger or \ + self.content_type == MixedContainer.TypeBoolean: + outfile.write('<%s>%d' % (self.name, self.value, self.name)) + elif self.content_type == MixedContainer.TypeFloat or \ + self.content_type == MixedContainer.TypeDecimal: + outfile.write('<%s>%f' % (self.name, self.value, self.name)) + elif self.content_type == MixedContainer.TypeDouble: + outfile.write('<%s>%g' % (self.name, self.value, self.name)) + def exportLiteral(self, outfile, level, name): + if self.category == MixedContainer.CategoryText: + showIndent(outfile, level) + outfile.write('model_.MixedContainer(%d, %d, "%s", "%s"),\n' % \ + (self.category, self.content_type, self.name, self.value)) + elif self.category == MixedContainer.CategorySimple: + showIndent(outfile, level) + outfile.write('model_.MixedContainer(%d, %d, "%s", "%s"),\n' % \ + (self.category, self.content_type, self.name, self.value)) + else: # category == MixedContainer.CategoryComplex + showIndent(outfile, level) + outfile.write('model_.MixedContainer(%d, %d, "%s",\n' % \ + (self.category, self.content_type, self.name,)) + self.value.exportLiteral(outfile, level + 1) + showIndent(outfile, level) + outfile.write(')\n') + + +class MemberSpec_(object): + def __init__(self, name='', data_type='', container=0): + self.name = name + self.data_type = data_type + self.container = container + def set_name(self, name): self.name = name + def get_name(self): return self.name + def set_data_type(self, data_type): self.data_type = data_type + def get_data_type_chain(self): return self.data_type + def get_data_type(self): + if isinstance(self.data_type, list): + if len(self.data_type) > 0: + return self.data_type[-1] + else: + return 'xs:string' + else: + return self.data_type + def set_container(self, container): self.container = container + def get_container(self): return self.container + +def _cast(typ, value): + if typ is None or value is None: + return value + return typ(value) + +# +# Data representation classes. +# + +class FedExLocatorRequest(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, WebAuthenticationDetail=None, ClientDetail=None, TransactionDetail=None, Version=None, BeginningRecordIndex=None, MaximumMatchCount=None, DistanceUnits=None, NearToPhoneNumber=None, NearToAddress=None, DropoffServicesDesired=None): + self.WebAuthenticationDetail = WebAuthenticationDetail + self.ClientDetail = ClientDetail + self.TransactionDetail = TransactionDetail + self.Version = Version + self.BeginningRecordIndex = BeginningRecordIndex + self.MaximumMatchCount = MaximumMatchCount + self.DistanceUnits = DistanceUnits + self.NearToPhoneNumber = NearToPhoneNumber + self.NearToAddress = NearToAddress + self.DropoffServicesDesired = DropoffServicesDesired + def factory(*args_, **kwargs_): + if FedExLocatorRequest.subclass: + return FedExLocatorRequest.subclass(*args_, **kwargs_) + else: + return FedExLocatorRequest(*args_, **kwargs_) + factory = staticmethod(factory) + def get_WebAuthenticationDetail(self): return self.WebAuthenticationDetail + def set_WebAuthenticationDetail(self, WebAuthenticationDetail): self.WebAuthenticationDetail = WebAuthenticationDetail + def get_ClientDetail(self): return self.ClientDetail + def set_ClientDetail(self, ClientDetail): self.ClientDetail = ClientDetail + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_BeginningRecordIndex(self): return self.BeginningRecordIndex + def set_BeginningRecordIndex(self, BeginningRecordIndex): self.BeginningRecordIndex = BeginningRecordIndex + def get_MaximumMatchCount(self): return self.MaximumMatchCount + def set_MaximumMatchCount(self, MaximumMatchCount): self.MaximumMatchCount = MaximumMatchCount + def get_DistanceUnits(self): return self.DistanceUnits + def set_DistanceUnits(self, DistanceUnits): self.DistanceUnits = DistanceUnits + def validate_DistanceUnits(self, value): + # Validate type DistanceUnits, a restriction on xs:string. + pass + def get_NearToPhoneNumber(self): return self.NearToPhoneNumber + def set_NearToPhoneNumber(self, NearToPhoneNumber): self.NearToPhoneNumber = NearToPhoneNumber + def get_NearToAddress(self): return self.NearToAddress + def set_NearToAddress(self, NearToAddress): self.NearToAddress = NearToAddress + def get_DropoffServicesDesired(self): return self.DropoffServicesDesired + def set_DropoffServicesDesired(self, DropoffServicesDesired): self.DropoffServicesDesired = DropoffServicesDesired + def export(self, outfile, level, namespace_='ns:', name_='FedExLocatorRequest', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='FedExLocatorRequest') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='FedExLocatorRequest'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='FedExLocatorRequest', fromsubclass_=False): + if self.WebAuthenticationDetail: + self.WebAuthenticationDetail.export(outfile, level, namespace_, name_='WebAuthenticationDetail', ) + if self.ClientDetail: + self.ClientDetail.export(outfile, level, namespace_, name_='ClientDetail', ) + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.BeginningRecordIndex is not None: + showIndent(outfile, level) + outfile.write('<%sBeginningRecordIndex>%s\n' % (namespace_, self.gds_format_integer(self.BeginningRecordIndex, input_name='BeginningRecordIndex'), namespace_)) + if self.MaximumMatchCount is not None: + showIndent(outfile, level) + outfile.write('<%sMaximumMatchCount>%s\n' % (namespace_, self.gds_format_integer(self.MaximumMatchCount, input_name='MaximumMatchCount'), namespace_)) + if self.DistanceUnits is not None: + showIndent(outfile, level) + outfile.write('<%sDistanceUnits>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DistanceUnits).encode(ExternalEncoding), input_name='DistanceUnits'), namespace_)) + if self.NearToPhoneNumber is not None: + showIndent(outfile, level) + outfile.write('<%sNearToPhoneNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.NearToPhoneNumber).encode(ExternalEncoding), input_name='NearToPhoneNumber'), namespace_)) + if self.NearToAddress: + self.NearToAddress.export(outfile, level, namespace_, name_='NearToAddress') + if self.DropoffServicesDesired: + self.DropoffServicesDesired.export(outfile, level, namespace_, name_='DropoffServicesDesired') + def hasContent_(self): + if ( + self.WebAuthenticationDetail is not None or + self.ClientDetail is not None or + self.TransactionDetail is not None or + self.Version is not None or + self.BeginningRecordIndex is not None or + self.MaximumMatchCount is not None or + self.DistanceUnits is not None or + self.NearToPhoneNumber is not None or + self.NearToAddress is not None or + self.DropoffServicesDesired is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='FedExLocatorRequest'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.WebAuthenticationDetail is not None: + showIndent(outfile, level) + outfile.write('WebAuthenticationDetail=model_.WebAuthenticationDetail(\n') + self.WebAuthenticationDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ClientDetail is not None: + showIndent(outfile, level) + outfile.write('ClientDetail=model_.ClientDetail(\n') + self.ClientDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.BeginningRecordIndex is not None: + showIndent(outfile, level) + outfile.write('BeginningRecordIndex=%d,\n' % self.BeginningRecordIndex) + if self.MaximumMatchCount is not None: + showIndent(outfile, level) + outfile.write('MaximumMatchCount=%d,\n' % self.MaximumMatchCount) + if self.DistanceUnits is not None: + showIndent(outfile, level) + outfile.write('DistanceUnits=%s,\n' % quote_python(self.DistanceUnits).encode(ExternalEncoding)) + if self.NearToPhoneNumber is not None: + showIndent(outfile, level) + outfile.write('NearToPhoneNumber=%s,\n' % quote_python(self.NearToPhoneNumber).encode(ExternalEncoding)) + if self.NearToAddress is not None: + showIndent(outfile, level) + outfile.write('NearToAddress=model_.Address(\n') + self.NearToAddress.exportLiteral(outfile, level, name_='NearToAddress') + showIndent(outfile, level) + outfile.write('),\n') + if self.DropoffServicesDesired is not None: + showIndent(outfile, level) + outfile.write('DropoffServicesDesired=model_.DropoffServicesDesired(\n') + self.DropoffServicesDesired.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'WebAuthenticationDetail': + obj_ = WebAuthenticationDetail.factory() + obj_.build(child_) + self.set_WebAuthenticationDetail(obj_) + elif nodeName_ == 'ClientDetail': + obj_ = ClientDetail.factory() + obj_.build(child_) + self.set_ClientDetail(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'BeginningRecordIndex': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'BeginningRecordIndex') + self.BeginningRecordIndex = ival_ + elif nodeName_ == 'MaximumMatchCount': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ <= 0: + raise_parse_error(child_, 'requires positiveInteger') + ival_ = self.gds_validate_integer(ival_, node, 'MaximumMatchCount') + self.MaximumMatchCount = ival_ + elif nodeName_ == 'DistanceUnits': + DistanceUnits_ = child_.text + DistanceUnits_ = self.gds_validate_string(DistanceUnits_, node, 'DistanceUnits') + self.DistanceUnits = DistanceUnits_ + self.validate_DistanceUnits(self.DistanceUnits) # validate type DistanceUnits + elif nodeName_ == 'NearToPhoneNumber': + NearToPhoneNumber_ = child_.text + NearToPhoneNumber_ = self.gds_validate_string(NearToPhoneNumber_, node, 'NearToPhoneNumber') + self.NearToPhoneNumber = NearToPhoneNumber_ + elif nodeName_ == 'NearToAddress': + obj_ = Address.factory() + obj_.build(child_) + self.set_NearToAddress(obj_) + elif nodeName_ == 'DropoffServicesDesired': + obj_ = DropoffServicesDesired.factory() + obj_.build(child_) + self.set_DropoffServicesDesired(obj_) +# end class FedExLocatorRequest + + +class MaximumMatchCount(GeneratedsSuper): + """The maximum number of locations to be returned. Maximum count + allowed is 25. Defaults to 10.""" + subclass = None + superclass = None + def __init__(self): + pass + def factory(*args_, **kwargs_): + if MaximumMatchCount.subclass: + return MaximumMatchCount.subclass(*args_, **kwargs_) + else: + return MaximumMatchCount(*args_, **kwargs_) + factory = staticmethod(factory) + def export(self, outfile, level, namespace_='ns:', name_='MaximumMatchCount', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='MaximumMatchCount') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='MaximumMatchCount'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='MaximumMatchCount', fromsubclass_=False): + pass + def hasContent_(self): + if ( + + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='MaximumMatchCount'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + pass + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + pass +# end class MaximumMatchCount + + +class WebAuthenticationDetail(GeneratedsSuper): + """Used in authentication of the sender's identity.""" + subclass = None + superclass = None + def __init__(self, UserCredential=None): + self.UserCredential = UserCredential + def factory(*args_, **kwargs_): + if WebAuthenticationDetail.subclass: + return WebAuthenticationDetail.subclass(*args_, **kwargs_) + else: + return WebAuthenticationDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_UserCredential(self): return self.UserCredential + def set_UserCredential(self, UserCredential): self.UserCredential = UserCredential + def export(self, outfile, level, namespace_='ns:', name_='WebAuthenticationDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='WebAuthenticationDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='WebAuthenticationDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='WebAuthenticationDetail', fromsubclass_=False): + if self.UserCredential: + self.UserCredential.export(outfile, level, namespace_, name_='UserCredential', ) + def hasContent_(self): + if ( + self.UserCredential is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='WebAuthenticationDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.UserCredential is not None: + showIndent(outfile, level) + outfile.write('UserCredential=model_.WebAuthenticationCredential(\n') + self.UserCredential.exportLiteral(outfile, level, name_='UserCredential') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'UserCredential': + obj_ = WebAuthenticationCredential.factory() + obj_.build(child_) + self.set_UserCredential(obj_) +# end class WebAuthenticationDetail + + +class WebAuthenticationCredential(GeneratedsSuper): + """Two part authentication string used for the sender's identity.""" + subclass = None + superclass = None + def __init__(self, Key=None, Password=None): + self.Key = Key + self.Password = Password + def factory(*args_, **kwargs_): + if WebAuthenticationCredential.subclass: + return WebAuthenticationCredential.subclass(*args_, **kwargs_) + else: + return WebAuthenticationCredential(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Key(self): return self.Key + def set_Key(self, Key): self.Key = Key + def get_Password(self): return self.Password + def set_Password(self, Password): self.Password = Password + def export(self, outfile, level, namespace_='ns:', name_='WebAuthenticationCredential', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='WebAuthenticationCredential') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='WebAuthenticationCredential'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='WebAuthenticationCredential', fromsubclass_=False): + if self.Key is not None: + showIndent(outfile, level) + outfile.write('<%sKey>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Key).encode(ExternalEncoding), input_name='Key'), namespace_)) + if self.Password is not None: + showIndent(outfile, level) + outfile.write('<%sPassword>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Password).encode(ExternalEncoding), input_name='Password'), namespace_)) + def hasContent_(self): + if ( + self.Key is not None or + self.Password is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='WebAuthenticationCredential'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Key is not None: + showIndent(outfile, level) + outfile.write('Key=%s,\n' % quote_python(self.Key).encode(ExternalEncoding)) + if self.Password is not None: + showIndent(outfile, level) + outfile.write('Password=%s,\n' % quote_python(self.Password).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Key': + Key_ = child_.text + Key_ = self.gds_validate_string(Key_, node, 'Key') + self.Key = Key_ + elif nodeName_ == 'Password': + Password_ = child_.text + Password_ = self.gds_validate_string(Password_, node, 'Password') + self.Password = Password_ +# end class WebAuthenticationCredential + + +class ClientDetail(GeneratedsSuper): + """The descriptive data identifying the client submitting the + transaction.""" + subclass = None + superclass = None + def __init__(self, AccountNumber=None, MeterNumber=None, Localization=None): + self.AccountNumber = AccountNumber + self.MeterNumber = MeterNumber + self.Localization = Localization + def factory(*args_, **kwargs_): + if ClientDetail.subclass: + return ClientDetail.subclass(*args_, **kwargs_) + else: + return ClientDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_AccountNumber(self): return self.AccountNumber + def set_AccountNumber(self, AccountNumber): self.AccountNumber = AccountNumber + def get_MeterNumber(self): return self.MeterNumber + def set_MeterNumber(self, MeterNumber): self.MeterNumber = MeterNumber + def get_Localization(self): return self.Localization + def set_Localization(self, Localization): self.Localization = Localization + def export(self, outfile, level, namespace_='ns:', name_='ClientDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ClientDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ClientDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ClientDetail', fromsubclass_=False): + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('<%sAccountNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AccountNumber).encode(ExternalEncoding), input_name='AccountNumber'), namespace_)) + if self.MeterNumber is not None: + showIndent(outfile, level) + outfile.write('<%sMeterNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.MeterNumber).encode(ExternalEncoding), input_name='MeterNumber'), namespace_)) + if self.Localization: + self.Localization.export(outfile, level, namespace_, name_='Localization') + def hasContent_(self): + if ( + self.AccountNumber is not None or + self.MeterNumber is not None or + self.Localization is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ClientDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('AccountNumber=%s,\n' % quote_python(self.AccountNumber).encode(ExternalEncoding)) + if self.MeterNumber is not None: + showIndent(outfile, level) + outfile.write('MeterNumber=%s,\n' % quote_python(self.MeterNumber).encode(ExternalEncoding)) + if self.Localization is not None: + showIndent(outfile, level) + outfile.write('Localization=model_.Localization(\n') + self.Localization.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'AccountNumber': + AccountNumber_ = child_.text + AccountNumber_ = self.gds_validate_string(AccountNumber_, node, 'AccountNumber') + self.AccountNumber = AccountNumber_ + elif nodeName_ == 'MeterNumber': + MeterNumber_ = child_.text + MeterNumber_ = self.gds_validate_string(MeterNumber_, node, 'MeterNumber') + self.MeterNumber = MeterNumber_ + elif nodeName_ == 'Localization': + obj_ = Localization.factory() + obj_.build(child_) + self.set_Localization(obj_) +# end class ClientDetail + + +class DropoffServicesDesired(GeneratedsSuper): + """The descriptive data about the various drop off services.""" + subclass = None + superclass = None + def __init__(self, Express=None, Ground=None, FedExStaffed=None, FedExSelfService=None, FedExAuthorizedShippingCenter=None, LatestExpressDropoff=None, ExpressDropoffAfterTime=None, HoldAtLocation=None, GroundHoldAtLocation=None, DangerousGoods=None, SaturdayService=None, PackingSupplies=None, PackingServices=None, ReturnSystem=None, RedirectToHoldLocation=None, SearchSameStateOnly=None): + self.Express = Express + self.Ground = Ground + self.FedExStaffed = FedExStaffed + self.FedExSelfService = FedExSelfService + self.FedExAuthorizedShippingCenter = FedExAuthorizedShippingCenter + self.LatestExpressDropoff = LatestExpressDropoff + self.ExpressDropoffAfterTime = ExpressDropoffAfterTime + self.HoldAtLocation = HoldAtLocation + self.GroundHoldAtLocation = GroundHoldAtLocation + self.DangerousGoods = DangerousGoods + self.SaturdayService = SaturdayService + self.PackingSupplies = PackingSupplies + self.PackingServices = PackingServices + self.ReturnSystem = ReturnSystem + self.RedirectToHoldLocation = RedirectToHoldLocation + self.SearchSameStateOnly = SearchSameStateOnly + def factory(*args_, **kwargs_): + if DropoffServicesDesired.subclass: + return DropoffServicesDesired.subclass(*args_, **kwargs_) + else: + return DropoffServicesDesired(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Express(self): return self.Express + def set_Express(self, Express): self.Express = Express + def get_Ground(self): return self.Ground + def set_Ground(self, Ground): self.Ground = Ground + def get_FedExStaffed(self): return self.FedExStaffed + def set_FedExStaffed(self, FedExStaffed): self.FedExStaffed = FedExStaffed + def get_FedExSelfService(self): return self.FedExSelfService + def set_FedExSelfService(self, FedExSelfService): self.FedExSelfService = FedExSelfService + def get_FedExAuthorizedShippingCenter(self): return self.FedExAuthorizedShippingCenter + def set_FedExAuthorizedShippingCenter(self, FedExAuthorizedShippingCenter): self.FedExAuthorizedShippingCenter = FedExAuthorizedShippingCenter + def get_LatestExpressDropoff(self): return self.LatestExpressDropoff + def set_LatestExpressDropoff(self, LatestExpressDropoff): self.LatestExpressDropoff = LatestExpressDropoff + def get_ExpressDropoffAfterTime(self): return self.ExpressDropoffAfterTime + def set_ExpressDropoffAfterTime(self, ExpressDropoffAfterTime): self.ExpressDropoffAfterTime = ExpressDropoffAfterTime + def get_HoldAtLocation(self): return self.HoldAtLocation + def set_HoldAtLocation(self, HoldAtLocation): self.HoldAtLocation = HoldAtLocation + def get_GroundHoldAtLocation(self): return self.GroundHoldAtLocation + def set_GroundHoldAtLocation(self, GroundHoldAtLocation): self.GroundHoldAtLocation = GroundHoldAtLocation + def get_DangerousGoods(self): return self.DangerousGoods + def set_DangerousGoods(self, DangerousGoods): self.DangerousGoods = DangerousGoods + def get_SaturdayService(self): return self.SaturdayService + def set_SaturdayService(self, SaturdayService): self.SaturdayService = SaturdayService + def get_PackingSupplies(self): return self.PackingSupplies + def set_PackingSupplies(self, PackingSupplies): self.PackingSupplies = PackingSupplies + def get_PackingServices(self): return self.PackingServices + def set_PackingServices(self, PackingServices): self.PackingServices = PackingServices + def get_ReturnSystem(self): return self.ReturnSystem + def set_ReturnSystem(self, ReturnSystem): self.ReturnSystem = ReturnSystem + def get_RedirectToHoldLocation(self): return self.RedirectToHoldLocation + def set_RedirectToHoldLocation(self, RedirectToHoldLocation): self.RedirectToHoldLocation = RedirectToHoldLocation + def validate_RedirectToHoldLocationType(self, value): + # Validate type RedirectToHoldLocationType, a restriction on xs:string. + pass + def get_SearchSameStateOnly(self): return self.SearchSameStateOnly + def set_SearchSameStateOnly(self, SearchSameStateOnly): self.SearchSameStateOnly = SearchSameStateOnly + def export(self, outfile, level, namespace_='ns:', name_='DropoffServicesDesired', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='DropoffServicesDesired') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='DropoffServicesDesired'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='DropoffServicesDesired', fromsubclass_=False): + if self.Express is not None: + showIndent(outfile, level) + outfile.write('<%sExpress>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.Express)), input_name='Express'), namespace_)) + if self.Ground is not None: + showIndent(outfile, level) + outfile.write('<%sGround>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.Ground)), input_name='Ground'), namespace_)) + if self.FedExStaffed is not None: + showIndent(outfile, level) + outfile.write('<%sFedExStaffed>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.FedExStaffed)), input_name='FedExStaffed'), namespace_)) + if self.FedExSelfService is not None: + showIndent(outfile, level) + outfile.write('<%sFedExSelfService>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.FedExSelfService)), input_name='FedExSelfService'), namespace_)) + if self.FedExAuthorizedShippingCenter is not None: + showIndent(outfile, level) + outfile.write('<%sFedExAuthorizedShippingCenter>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.FedExAuthorizedShippingCenter)), input_name='FedExAuthorizedShippingCenter'), namespace_)) + if self.LatestExpressDropoff is not None: + showIndent(outfile, level) + outfile.write('<%sLatestExpressDropoff>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.LatestExpressDropoff)), input_name='LatestExpressDropoff'), namespace_)) + if self.ExpressDropoffAfterTime: + self.ExpressDropoffAfterTime.export(outfile, level, namespace_, name_='ExpressDropoffAfterTime') + if self.HoldAtLocation is not None: + showIndent(outfile, level) + outfile.write('<%sHoldAtLocation>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.HoldAtLocation)), input_name='HoldAtLocation'), namespace_)) + if self.GroundHoldAtLocation is not None: + showIndent(outfile, level) + outfile.write('<%sGroundHoldAtLocation>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.GroundHoldAtLocation)), input_name='GroundHoldAtLocation'), namespace_)) + if self.DangerousGoods is not None: + showIndent(outfile, level) + outfile.write('<%sDangerousGoods>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.DangerousGoods)), input_name='DangerousGoods'), namespace_)) + if self.SaturdayService is not None: + showIndent(outfile, level) + outfile.write('<%sSaturdayService>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.SaturdayService)), input_name='SaturdayService'), namespace_)) + if self.PackingSupplies is not None: + showIndent(outfile, level) + outfile.write('<%sPackingSupplies>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.PackingSupplies)), input_name='PackingSupplies'), namespace_)) + if self.PackingServices is not None: + showIndent(outfile, level) + outfile.write('<%sPackingServices>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.PackingServices)), input_name='PackingServices'), namespace_)) + if self.ReturnSystem is not None: + showIndent(outfile, level) + outfile.write('<%sReturnSystem>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.ReturnSystem)), input_name='ReturnSystem'), namespace_)) + if self.RedirectToHoldLocation is not None: + showIndent(outfile, level) + outfile.write('<%sRedirectToHoldLocation>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RedirectToHoldLocation).encode(ExternalEncoding), input_name='RedirectToHoldLocation'), namespace_)) + if self.SearchSameStateOnly is not None: + showIndent(outfile, level) + outfile.write('<%sSearchSameStateOnly>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.SearchSameStateOnly)), input_name='SearchSameStateOnly'), namespace_)) + def hasContent_(self): + if ( + self.Express is not None or + self.Ground is not None or + self.FedExStaffed is not None or + self.FedExSelfService is not None or + self.FedExAuthorizedShippingCenter is not None or + self.LatestExpressDropoff is not None or + self.ExpressDropoffAfterTime is not None or + self.HoldAtLocation is not None or + self.GroundHoldAtLocation is not None or + self.DangerousGoods is not None or + self.SaturdayService is not None or + self.PackingSupplies is not None or + self.PackingServices is not None or + self.ReturnSystem is not None or + self.RedirectToHoldLocation is not None or + self.SearchSameStateOnly is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='DropoffServicesDesired'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Express is not None: + showIndent(outfile, level) + outfile.write('Express=%s,\n' % self.Express) + if self.Ground is not None: + showIndent(outfile, level) + outfile.write('Ground=%s,\n' % self.Ground) + if self.FedExStaffed is not None: + showIndent(outfile, level) + outfile.write('FedExStaffed=%s,\n' % self.FedExStaffed) + if self.FedExSelfService is not None: + showIndent(outfile, level) + outfile.write('FedExSelfService=%s,\n' % self.FedExSelfService) + if self.FedExAuthorizedShippingCenter is not None: + showIndent(outfile, level) + outfile.write('FedExAuthorizedShippingCenter=%s,\n' % self.FedExAuthorizedShippingCenter) + if self.LatestExpressDropoff is not None: + showIndent(outfile, level) + outfile.write('LatestExpressDropoff=%s,\n' % self.LatestExpressDropoff) + if self.ExpressDropoffAfterTime is not None: + showIndent(outfile, level) + outfile.write('ExpressDropoffAfterTime=model_.xs_time(\n') + self.ExpressDropoffAfterTime.exportLiteral(outfile, level, name_='ExpressDropoffAfterTime') + showIndent(outfile, level) + outfile.write('),\n') + if self.HoldAtLocation is not None: + showIndent(outfile, level) + outfile.write('HoldAtLocation=%s,\n' % self.HoldAtLocation) + if self.GroundHoldAtLocation is not None: + showIndent(outfile, level) + outfile.write('GroundHoldAtLocation=%s,\n' % self.GroundHoldAtLocation) + if self.DangerousGoods is not None: + showIndent(outfile, level) + outfile.write('DangerousGoods=%s,\n' % self.DangerousGoods) + if self.SaturdayService is not None: + showIndent(outfile, level) + outfile.write('SaturdayService=%s,\n' % self.SaturdayService) + if self.PackingSupplies is not None: + showIndent(outfile, level) + outfile.write('PackingSupplies=%s,\n' % self.PackingSupplies) + if self.PackingServices is not None: + showIndent(outfile, level) + outfile.write('PackingServices=%s,\n' % self.PackingServices) + if self.ReturnSystem is not None: + showIndent(outfile, level) + outfile.write('ReturnSystem=%s,\n' % self.ReturnSystem) + if self.RedirectToHoldLocation is not None: + showIndent(outfile, level) + outfile.write('RedirectToHoldLocation=%s,\n' % quote_python(self.RedirectToHoldLocation).encode(ExternalEncoding)) + if self.SearchSameStateOnly is not None: + showIndent(outfile, level) + outfile.write('SearchSameStateOnly=%s,\n' % self.SearchSameStateOnly) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Express': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'Express') + self.Express = ival_ + elif nodeName_ == 'Ground': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'Ground') + self.Ground = ival_ + elif nodeName_ == 'FedExStaffed': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'FedExStaffed') + self.FedExStaffed = ival_ + elif nodeName_ == 'FedExSelfService': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'FedExSelfService') + self.FedExSelfService = ival_ + elif nodeName_ == 'FedExAuthorizedShippingCenter': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'FedExAuthorizedShippingCenter') + self.FedExAuthorizedShippingCenter = ival_ + elif nodeName_ == 'LatestExpressDropoff': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'LatestExpressDropoff') + self.LatestExpressDropoff = ival_ + elif nodeName_ == 'ExpressDropoffAfterTime': + obj_ = xs_time.factory() + obj_.build(child_) + self.set_ExpressDropoffAfterTime(obj_) + elif nodeName_ == 'HoldAtLocation': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'HoldAtLocation') + self.HoldAtLocation = ival_ + elif nodeName_ == 'GroundHoldAtLocation': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'GroundHoldAtLocation') + self.GroundHoldAtLocation = ival_ + elif nodeName_ == 'DangerousGoods': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'DangerousGoods') + self.DangerousGoods = ival_ + elif nodeName_ == 'SaturdayService': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'SaturdayService') + self.SaturdayService = ival_ + elif nodeName_ == 'PackingSupplies': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'PackingSupplies') + self.PackingSupplies = ival_ + elif nodeName_ == 'PackingServices': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'PackingServices') + self.PackingServices = ival_ + elif nodeName_ == 'ReturnSystem': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'ReturnSystem') + self.ReturnSystem = ival_ + elif nodeName_ == 'RedirectToHoldLocation': + RedirectToHoldLocation_ = child_.text + RedirectToHoldLocation_ = self.gds_validate_string(RedirectToHoldLocation_, node, 'RedirectToHoldLocation') + self.RedirectToHoldLocation = RedirectToHoldLocation_ + self.validate_RedirectToHoldLocationType(self.RedirectToHoldLocation) # validate type RedirectToHoldLocationType + elif nodeName_ == 'SearchSameStateOnly': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'SearchSameStateOnly') + self.SearchSameStateOnly = ival_ +# end class DropoffServicesDesired + + +class FedExLocatorReply(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, HighestSeverity=None, Notifications=None, TransactionDetail=None, Version=None, DropoffLocations=None, AvailableRecordCount=None): + self.HighestSeverity = HighestSeverity + if Notifications is None: + self.Notifications = [] + else: + self.Notifications = Notifications + self.TransactionDetail = TransactionDetail + self.Version = Version + if DropoffLocations is None: + self.DropoffLocations = [] + else: + self.DropoffLocations = DropoffLocations + self.AvailableRecordCount = AvailableRecordCount + def factory(*args_, **kwargs_): + if FedExLocatorReply.subclass: + return FedExLocatorReply.subclass(*args_, **kwargs_) + else: + return FedExLocatorReply(*args_, **kwargs_) + factory = staticmethod(factory) + def get_HighestSeverity(self): return self.HighestSeverity + def set_HighestSeverity(self, HighestSeverity): self.HighestSeverity = HighestSeverity + def validate_NotificationSeverityType(self, value): + # Validate type NotificationSeverityType, a restriction on xs:string. + pass + def get_Notifications(self): return self.Notifications + def set_Notifications(self, Notifications): self.Notifications = Notifications + def add_Notifications(self, value): self.Notifications.append(value) + def insert_Notifications(self, index, value): self.Notifications[index] = value + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_DropoffLocations(self): return self.DropoffLocations + def set_DropoffLocations(self, DropoffLocations): self.DropoffLocations = DropoffLocations + def add_DropoffLocations(self, value): self.DropoffLocations.append(value) + def insert_DropoffLocations(self, index, value): self.DropoffLocations[index] = value + def get_AvailableRecordCount(self): return self.AvailableRecordCount + def set_AvailableRecordCount(self, AvailableRecordCount): self.AvailableRecordCount = AvailableRecordCount + def export(self, outfile, level, namespace_='ns:', name_='FedExLocatorReply', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='FedExLocatorReply') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='FedExLocatorReply'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='FedExLocatorReply', fromsubclass_=False): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('<%sHighestSeverity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HighestSeverity).encode(ExternalEncoding), input_name='HighestSeverity'), namespace_)) + for Notifications_ in self.Notifications: + Notifications_.export(outfile, level, namespace_, name_='Notifications') + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version') + for DropoffLocations_ in self.DropoffLocations: + DropoffLocations_.export(outfile, level, namespace_, name_='DropoffLocations') + if self.AvailableRecordCount is not None: + showIndent(outfile, level) + outfile.write('<%sAvailableRecordCount>%s\n' % (namespace_, self.gds_format_integer(self.AvailableRecordCount, input_name='AvailableRecordCount'), namespace_)) + def hasContent_(self): + if ( + self.HighestSeverity is not None or + self.Notifications or + self.TransactionDetail is not None or + self.Version is not None or + self.DropoffLocations or + self.AvailableRecordCount is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='FedExLocatorReply'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('HighestSeverity=%s,\n' % quote_python(self.HighestSeverity).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Notifications=[\n') + level += 1 + for Notifications_ in self.Notifications: + showIndent(outfile, level) + outfile.write('model_.Notification(\n') + Notifications_.exportLiteral(outfile, level, name_='Notification') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('DropoffLocations=[\n') + level += 1 + for DropoffLocations_ in self.DropoffLocations: + showIndent(outfile, level) + outfile.write('model_.DropoffLocation(\n') + DropoffLocations_.exportLiteral(outfile, level, name_='DropoffLocation') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.AvailableRecordCount is not None: + showIndent(outfile, level) + outfile.write('AvailableRecordCount=%d,\n' % self.AvailableRecordCount) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'HighestSeverity': + HighestSeverity_ = child_.text + HighestSeverity_ = self.gds_validate_string(HighestSeverity_, node, 'HighestSeverity') + self.HighestSeverity = HighestSeverity_ + self.validate_NotificationSeverityType(self.HighestSeverity) # validate type NotificationSeverityType + elif nodeName_ == 'Notifications': + obj_ = Notification.factory() + obj_.build(child_) + self.Notifications.append(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'DropoffLocations': + obj_ = DropoffLocation.factory() + obj_.build(child_) + self.DropoffLocations.append(obj_) + elif nodeName_ == 'AvailableRecordCount': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'AvailableRecordCount') + self.AvailableRecordCount = ival_ +# end class FedExLocatorReply + + +class Notification(GeneratedsSuper): + """The descriptive data regarding the results of the submitted + transaction.""" + subclass = None + superclass = None + def __init__(self, Severity=None, Source=None, Code=None, Message=None, LocalizedMessage=None, MessageParameters=None): + self.Severity = Severity + self.Source = Source + self.Code = Code + self.Message = Message + self.LocalizedMessage = LocalizedMessage + if MessageParameters is None: + self.MessageParameters = [] + else: + self.MessageParameters = MessageParameters + def factory(*args_, **kwargs_): + if Notification.subclass: + return Notification.subclass(*args_, **kwargs_) + else: + return Notification(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Severity(self): return self.Severity + def set_Severity(self, Severity): self.Severity = Severity + def validate_NotificationSeverityType(self, value): + # Validate type NotificationSeverityType, a restriction on xs:string. + pass + def get_Source(self): return self.Source + def set_Source(self, Source): self.Source = Source + def get_Code(self): return self.Code + def set_Code(self, Code): self.Code = Code + def get_Message(self): return self.Message + def set_Message(self, Message): self.Message = Message + def get_LocalizedMessage(self): return self.LocalizedMessage + def set_LocalizedMessage(self, LocalizedMessage): self.LocalizedMessage = LocalizedMessage + def get_MessageParameters(self): return self.MessageParameters + def set_MessageParameters(self, MessageParameters): self.MessageParameters = MessageParameters + def add_MessageParameters(self, value): self.MessageParameters.append(value) + def insert_MessageParameters(self, index, value): self.MessageParameters[index] = value + def export(self, outfile, level, namespace_='ns:', name_='Notification', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Notification') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Notification'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Notification', fromsubclass_=False): + if self.Severity is not None: + showIndent(outfile, level) + outfile.write('<%sSeverity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Severity).encode(ExternalEncoding), input_name='Severity'), namespace_)) + if self.Source is not None: + showIndent(outfile, level) + outfile.write('<%sSource>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Source).encode(ExternalEncoding), input_name='Source'), namespace_)) + if self.Code is not None: + showIndent(outfile, level) + outfile.write('<%sCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Code).encode(ExternalEncoding), input_name='Code'), namespace_)) + if self.Message is not None: + showIndent(outfile, level) + outfile.write('<%sMessage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Message).encode(ExternalEncoding), input_name='Message'), namespace_)) + if self.LocalizedMessage is not None: + showIndent(outfile, level) + outfile.write('<%sLocalizedMessage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LocalizedMessage).encode(ExternalEncoding), input_name='LocalizedMessage'), namespace_)) + for MessageParameters_ in self.MessageParameters: + MessageParameters_.export(outfile, level, namespace_, name_='MessageParameters') + def hasContent_(self): + if ( + self.Severity is not None or + self.Source is not None or + self.Code is not None or + self.Message is not None or + self.LocalizedMessage is not None or + self.MessageParameters + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Notification'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Severity is not None: + showIndent(outfile, level) + outfile.write('Severity=%s,\n' % quote_python(self.Severity).encode(ExternalEncoding)) + if self.Source is not None: + showIndent(outfile, level) + outfile.write('Source=%s,\n' % quote_python(self.Source).encode(ExternalEncoding)) + if self.Code is not None: + showIndent(outfile, level) + outfile.write('Code=%s,\n' % quote_python(self.Code).encode(ExternalEncoding)) + if self.Message is not None: + showIndent(outfile, level) + outfile.write('Message=%s,\n' % quote_python(self.Message).encode(ExternalEncoding)) + if self.LocalizedMessage is not None: + showIndent(outfile, level) + outfile.write('LocalizedMessage=%s,\n' % quote_python(self.LocalizedMessage).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('MessageParameters=[\n') + level += 1 + for MessageParameters_ in self.MessageParameters: + showIndent(outfile, level) + outfile.write('model_.NotificationParameter(\n') + MessageParameters_.exportLiteral(outfile, level, name_='NotificationParameter') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Severity': + Severity_ = child_.text + Severity_ = self.gds_validate_string(Severity_, node, 'Severity') + self.Severity = Severity_ + self.validate_NotificationSeverityType(self.Severity) # validate type NotificationSeverityType + elif nodeName_ == 'Source': + Source_ = child_.text + Source_ = self.gds_validate_string(Source_, node, 'Source') + self.Source = Source_ + elif nodeName_ == 'Code': + Code_ = child_.text + Code_ = self.gds_validate_string(Code_, node, 'Code') + self.Code = Code_ + elif nodeName_ == 'Message': + Message_ = child_.text + Message_ = self.gds_validate_string(Message_, node, 'Message') + self.Message = Message_ + elif nodeName_ == 'LocalizedMessage': + LocalizedMessage_ = child_.text + LocalizedMessage_ = self.gds_validate_string(LocalizedMessage_, node, 'LocalizedMessage') + self.LocalizedMessage = LocalizedMessage_ + elif nodeName_ == 'MessageParameters': + obj_ = NotificationParameter.factory() + obj_.build(child_) + self.MessageParameters.append(obj_) +# end class Notification + + +class NotificationParameter(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Id=None, Value=None): + self.Id = Id + self.Value = Value + def factory(*args_, **kwargs_): + if NotificationParameter.subclass: + return NotificationParameter.subclass(*args_, **kwargs_) + else: + return NotificationParameter(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Id(self): return self.Id + def set_Id(self, Id): self.Id = Id + def get_Value(self): return self.Value + def set_Value(self, Value): self.Value = Value + def export(self, outfile, level, namespace_='ns:', name_='NotificationParameter', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='NotificationParameter') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='NotificationParameter'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='NotificationParameter', fromsubclass_=False): + if self.Id is not None: + showIndent(outfile, level) + outfile.write('<%sId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Id).encode(ExternalEncoding), input_name='Id'), namespace_)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('<%sValue>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Value).encode(ExternalEncoding), input_name='Value'), namespace_)) + def hasContent_(self): + if ( + self.Id is not None or + self.Value is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='NotificationParameter'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Id is not None: + showIndent(outfile, level) + outfile.write('Id=%s,\n' % quote_python(self.Id).encode(ExternalEncoding)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('Value=%s,\n' % quote_python(self.Value).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Id': + Id_ = child_.text + Id_ = self.gds_validate_string(Id_, node, 'Id') + self.Id = Id_ + elif nodeName_ == 'Value': + Value_ = child_.text + Value_ = self.gds_validate_string(Value_, node, 'Value') + self.Value = Value_ +# end class NotificationParameter + + +class TransactionDetail(GeneratedsSuper): + """The descriptive data that governs data payload + language/translations.""" + subclass = None + superclass = None + def __init__(self, CustomerTransactionId=None, Localization=None): + self.CustomerTransactionId = CustomerTransactionId + self.Localization = Localization + def factory(*args_, **kwargs_): + if TransactionDetail.subclass: + return TransactionDetail.subclass(*args_, **kwargs_) + else: + return TransactionDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_CustomerTransactionId(self): return self.CustomerTransactionId + def set_CustomerTransactionId(self, CustomerTransactionId): self.CustomerTransactionId = CustomerTransactionId + def get_Localization(self): return self.Localization + def set_Localization(self, Localization): self.Localization = Localization + def export(self, outfile, level, namespace_='ns:', name_='TransactionDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='TransactionDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='TransactionDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='TransactionDetail', fromsubclass_=False): + if self.CustomerTransactionId is not None: + showIndent(outfile, level) + outfile.write('<%sCustomerTransactionId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CustomerTransactionId).encode(ExternalEncoding), input_name='CustomerTransactionId'), namespace_)) + if self.Localization: + self.Localization.export(outfile, level, namespace_, name_='Localization') + def hasContent_(self): + if ( + self.CustomerTransactionId is not None or + self.Localization is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='TransactionDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.CustomerTransactionId is not None: + showIndent(outfile, level) + outfile.write('CustomerTransactionId=%s,\n' % quote_python(self.CustomerTransactionId).encode(ExternalEncoding)) + if self.Localization is not None: + showIndent(outfile, level) + outfile.write('Localization=model_.Localization(\n') + self.Localization.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'CustomerTransactionId': + CustomerTransactionId_ = child_.text + CustomerTransactionId_ = self.gds_validate_string(CustomerTransactionId_, node, 'CustomerTransactionId') + self.CustomerTransactionId = CustomerTransactionId_ + elif nodeName_ == 'Localization': + obj_ = Localization.factory() + obj_.build(child_) + self.set_Localization(obj_) +# end class TransactionDetail + + +class Localization(GeneratedsSuper): + """The descriptive data for the local language and locale (i.e. + country).""" + subclass = None + superclass = None + def __init__(self, LanguageCode=None, LocaleCode=None): + self.LanguageCode = LanguageCode + self.LocaleCode = LocaleCode + def factory(*args_, **kwargs_): + if Localization.subclass: + return Localization.subclass(*args_, **kwargs_) + else: + return Localization(*args_, **kwargs_) + factory = staticmethod(factory) + def get_LanguageCode(self): return self.LanguageCode + def set_LanguageCode(self, LanguageCode): self.LanguageCode = LanguageCode + def get_LocaleCode(self): return self.LocaleCode + def set_LocaleCode(self, LocaleCode): self.LocaleCode = LocaleCode + def export(self, outfile, level, namespace_='ns:', name_='Localization', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Localization') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Localization'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Localization', fromsubclass_=False): + if self.LanguageCode is not None: + showIndent(outfile, level) + outfile.write('<%sLanguageCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LanguageCode).encode(ExternalEncoding), input_name='LanguageCode'), namespace_)) + if self.LocaleCode is not None: + showIndent(outfile, level) + outfile.write('<%sLocaleCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LocaleCode).encode(ExternalEncoding), input_name='LocaleCode'), namespace_)) + def hasContent_(self): + if ( + self.LanguageCode is not None or + self.LocaleCode is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Localization'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.LanguageCode is not None: + showIndent(outfile, level) + outfile.write('LanguageCode=%s,\n' % quote_python(self.LanguageCode).encode(ExternalEncoding)) + if self.LocaleCode is not None: + showIndent(outfile, level) + outfile.write('LocaleCode=%s,\n' % quote_python(self.LocaleCode).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'LanguageCode': + LanguageCode_ = child_.text + LanguageCode_ = self.gds_validate_string(LanguageCode_, node, 'LanguageCode') + self.LanguageCode = LanguageCode_ + elif nodeName_ == 'LocaleCode': + LocaleCode_ = child_.text + LocaleCode_ = self.gds_validate_string(LocaleCode_, node, 'LocaleCode') + self.LocaleCode = LocaleCode_ +# end class Localization + + +class VersionId(GeneratedsSuper): + """Identifies the version/level of a service operation expected by a + caller (in each request) and performed by the callee (in each + reply).""" + subclass = None + superclass = None + def __init__(self, ServiceId=None, Major=None, Intermediate=None, Minor=None): + self.ServiceId = ServiceId + self.Major = Major + self.Intermediate = Intermediate + self.Minor = Minor + def factory(*args_, **kwargs_): + if VersionId.subclass: + return VersionId.subclass(*args_, **kwargs_) + else: + return VersionId(*args_, **kwargs_) + factory = staticmethod(factory) + def get_ServiceId(self): return self.ServiceId + def set_ServiceId(self, ServiceId): self.ServiceId = ServiceId + def get_Major(self): return self.Major + def set_Major(self, Major): self.Major = Major + def get_Intermediate(self): return self.Intermediate + def set_Intermediate(self, Intermediate): self.Intermediate = Intermediate + def get_Minor(self): return self.Minor + def set_Minor(self, Minor): self.Minor = Minor + def export(self, outfile, level, namespace_='ns:', name_='VersionId', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='VersionId') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='VersionId'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='VersionId', fromsubclass_=False): + if self.ServiceId is not None: + showIndent(outfile, level) + outfile.write('<%sServiceId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ServiceId).encode(ExternalEncoding), input_name='ServiceId'), namespace_)) + if self.Major is not None: + showIndent(outfile, level) + outfile.write('<%sMajor>%s\n' % (namespace_, self.gds_format_integer(self.Major, input_name='Major'), namespace_)) + if self.Intermediate is not None: + showIndent(outfile, level) + outfile.write('<%sIntermediate>%s\n' % (namespace_, self.gds_format_integer(self.Intermediate, input_name='Intermediate'), namespace_)) + if self.Minor is not None: + showIndent(outfile, level) + outfile.write('<%sMinor>%s\n' % (namespace_, self.gds_format_integer(self.Minor, input_name='Minor'), namespace_)) + def hasContent_(self): + if ( + self.ServiceId is not None or + self.Major is not None or + self.Intermediate is not None or + self.Minor is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='VersionId'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.ServiceId is not None: + showIndent(outfile, level) + outfile.write('ServiceId=%s,\n' % quote_python(self.ServiceId).encode(ExternalEncoding)) + if self.Major is not None: + showIndent(outfile, level) + outfile.write('Major=%d,\n' % self.Major) + if self.Intermediate is not None: + showIndent(outfile, level) + outfile.write('Intermediate=%d,\n' % self.Intermediate) + if self.Minor is not None: + showIndent(outfile, level) + outfile.write('Minor=%d,\n' % self.Minor) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'ServiceId': + ServiceId_ = child_.text + ServiceId_ = self.gds_validate_string(ServiceId_, node, 'ServiceId') + self.ServiceId = ServiceId_ + elif nodeName_ == 'Major': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'Major') + self.Major = ival_ + elif nodeName_ == 'Intermediate': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'Intermediate') + self.Intermediate = ival_ + elif nodeName_ == 'Minor': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'Minor') + self.Minor = ival_ +# end class VersionId + + +class DropoffLocation(GeneratedsSuper): + """The descriptive data of locations matching the criteria provided in + the drop of locator request. A maximum of ten different + locations can be returned.""" + subclass = None + superclass = None + def __init__(self, BusinessName=None, BusinessId=None, BusinessDescription=None, BusinessAddress=None, Distance=None, ServiceProfile=None, RecordIndex=None): + self.BusinessName = BusinessName + self.BusinessId = BusinessId + self.BusinessDescription = BusinessDescription + self.BusinessAddress = BusinessAddress + self.Distance = Distance + self.ServiceProfile = ServiceProfile + self.RecordIndex = RecordIndex + def factory(*args_, **kwargs_): + if DropoffLocation.subclass: + return DropoffLocation.subclass(*args_, **kwargs_) + else: + return DropoffLocation(*args_, **kwargs_) + factory = staticmethod(factory) + def get_BusinessName(self): return self.BusinessName + def set_BusinessName(self, BusinessName): self.BusinessName = BusinessName + def get_BusinessId(self): return self.BusinessId + def set_BusinessId(self, BusinessId): self.BusinessId = BusinessId + def get_BusinessDescription(self): return self.BusinessDescription + def set_BusinessDescription(self, BusinessDescription): self.BusinessDescription = BusinessDescription + def get_BusinessAddress(self): return self.BusinessAddress + def set_BusinessAddress(self, BusinessAddress): self.BusinessAddress = BusinessAddress + def get_Distance(self): return self.Distance + def set_Distance(self, Distance): self.Distance = Distance + def get_ServiceProfile(self): return self.ServiceProfile + def set_ServiceProfile(self, ServiceProfile): self.ServiceProfile = ServiceProfile + def get_RecordIndex(self): return self.RecordIndex + def set_RecordIndex(self, RecordIndex): self.RecordIndex = RecordIndex + def export(self, outfile, level, namespace_='ns:', name_='DropoffLocation', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='DropoffLocation') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='DropoffLocation'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='DropoffLocation', fromsubclass_=False): + if self.BusinessName is not None: + showIndent(outfile, level) + outfile.write('<%sBusinessName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.BusinessName).encode(ExternalEncoding), input_name='BusinessName'), namespace_)) + if self.BusinessId is not None: + showIndent(outfile, level) + outfile.write('<%sBusinessId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.BusinessId).encode(ExternalEncoding), input_name='BusinessId'), namespace_)) + if self.BusinessDescription is not None: + showIndent(outfile, level) + outfile.write('<%sBusinessDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.BusinessDescription).encode(ExternalEncoding), input_name='BusinessDescription'), namespace_)) + if self.BusinessAddress: + self.BusinessAddress.export(outfile, level, namespace_, name_='BusinessAddress') + if self.Distance: + self.Distance.export(outfile, level, namespace_, name_='Distance') + if self.ServiceProfile: + self.ServiceProfile.export(outfile, level, namespace_, name_='ServiceProfile') + if self.RecordIndex is not None: + showIndent(outfile, level) + outfile.write('<%sRecordIndex>%s\n' % (namespace_, self.gds_format_integer(self.RecordIndex, input_name='RecordIndex'), namespace_)) + def hasContent_(self): + if ( + self.BusinessName is not None or + self.BusinessId is not None or + self.BusinessDescription is not None or + self.BusinessAddress is not None or + self.Distance is not None or + self.ServiceProfile is not None or + self.RecordIndex is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='DropoffLocation'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.BusinessName is not None: + showIndent(outfile, level) + outfile.write('BusinessName=%s,\n' % quote_python(self.BusinessName).encode(ExternalEncoding)) + if self.BusinessId is not None: + showIndent(outfile, level) + outfile.write('BusinessId=%s,\n' % quote_python(self.BusinessId).encode(ExternalEncoding)) + if self.BusinessDescription is not None: + showIndent(outfile, level) + outfile.write('BusinessDescription=%s,\n' % quote_python(self.BusinessDescription).encode(ExternalEncoding)) + if self.BusinessAddress is not None: + showIndent(outfile, level) + outfile.write('BusinessAddress=model_.Address(\n') + self.BusinessAddress.exportLiteral(outfile, level, name_='BusinessAddress') + showIndent(outfile, level) + outfile.write('),\n') + if self.Distance is not None: + showIndent(outfile, level) + outfile.write('Distance=model_.Distance(\n') + self.Distance.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ServiceProfile is not None: + showIndent(outfile, level) + outfile.write('ServiceProfile=model_.DropoffLocationProfile(\n') + self.ServiceProfile.exportLiteral(outfile, level, name_='ServiceProfile') + showIndent(outfile, level) + outfile.write('),\n') + if self.RecordIndex is not None: + showIndent(outfile, level) + outfile.write('RecordIndex=%d,\n' % self.RecordIndex) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'BusinessName': + BusinessName_ = child_.text + BusinessName_ = self.gds_validate_string(BusinessName_, node, 'BusinessName') + self.BusinessName = BusinessName_ + elif nodeName_ == 'BusinessId': + BusinessId_ = child_.text + BusinessId_ = self.gds_validate_string(BusinessId_, node, 'BusinessId') + self.BusinessId = BusinessId_ + elif nodeName_ == 'BusinessDescription': + BusinessDescription_ = child_.text + BusinessDescription_ = self.gds_validate_string(BusinessDescription_, node, 'BusinessDescription') + self.BusinessDescription = BusinessDescription_ + elif nodeName_ == 'BusinessAddress': + obj_ = Address.factory() + obj_.build(child_) + self.set_BusinessAddress(obj_) + elif nodeName_ == 'Distance': + obj_ = Distance.factory() + obj_.build(child_) + self.set_Distance(obj_) + elif nodeName_ == 'ServiceProfile': + obj_ = DropoffLocationProfile.factory() + obj_.build(child_) + self.set_ServiceProfile(obj_) + elif nodeName_ == 'RecordIndex': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'RecordIndex') + self.RecordIndex = ival_ +# end class DropoffLocation + + +class RecordIndex(GeneratedsSuper): + """Of the Total locations available this is the individual location + identifier.""" + subclass = None + superclass = None + def __init__(self): + pass + def factory(*args_, **kwargs_): + if RecordIndex.subclass: + return RecordIndex.subclass(*args_, **kwargs_) + else: + return RecordIndex(*args_, **kwargs_) + factory = staticmethod(factory) + def export(self, outfile, level, namespace_='ns:', name_='RecordIndex', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='RecordIndex') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='RecordIndex'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='RecordIndex', fromsubclass_=False): + pass + def hasContent_(self): + if ( + + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='RecordIndex'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + pass + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + pass +# end class RecordIndex + + +class Address(GeneratedsSuper): + """The descriptive data for a physical location.""" + subclass = None + superclass = None + def __init__(self, StreetLines=None, City=None, StateOrProvinceCode=None, PostalCode=None, UrbanizationCode=None, CountryCode=None, Residential=None): + if StreetLines is None: + self.StreetLines = [] + else: + self.StreetLines = StreetLines + self.City = City + self.StateOrProvinceCode = StateOrProvinceCode + self.PostalCode = PostalCode + self.UrbanizationCode = UrbanizationCode + self.CountryCode = CountryCode + self.Residential = Residential + def factory(*args_, **kwargs_): + if Address.subclass: + return Address.subclass(*args_, **kwargs_) + else: + return Address(*args_, **kwargs_) + factory = staticmethod(factory) + def get_StreetLines(self): return self.StreetLines + def set_StreetLines(self, StreetLines): self.StreetLines = StreetLines + def add_StreetLines(self, value): self.StreetLines.append(value) + def insert_StreetLines(self, index, value): self.StreetLines[index] = value + def get_City(self): return self.City + def set_City(self, City): self.City = City + def get_StateOrProvinceCode(self): return self.StateOrProvinceCode + def set_StateOrProvinceCode(self, StateOrProvinceCode): self.StateOrProvinceCode = StateOrProvinceCode + def get_PostalCode(self): return self.PostalCode + def set_PostalCode(self, PostalCode): self.PostalCode = PostalCode + def get_UrbanizationCode(self): return self.UrbanizationCode + def set_UrbanizationCode(self, UrbanizationCode): self.UrbanizationCode = UrbanizationCode + def get_CountryCode(self): return self.CountryCode + def set_CountryCode(self, CountryCode): self.CountryCode = CountryCode + def get_Residential(self): return self.Residential + def set_Residential(self, Residential): self.Residential = Residential + def export(self, outfile, level, namespace_='ns:', name_='Address', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Address') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Address'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Address', fromsubclass_=False): + for StreetLines_ in self.StreetLines: + showIndent(outfile, level) + outfile.write('<%sStreetLines>%s\n' % (namespace_, self.gds_format_string(quote_xml(StreetLines_).encode(ExternalEncoding), input_name='StreetLines'), namespace_)) + if self.City is not None: + showIndent(outfile, level) + outfile.write('<%sCity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.City).encode(ExternalEncoding), input_name='City'), namespace_)) + if self.StateOrProvinceCode is not None: + showIndent(outfile, level) + outfile.write('<%sStateOrProvinceCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.StateOrProvinceCode).encode(ExternalEncoding), input_name='StateOrProvinceCode'), namespace_)) + if self.PostalCode is not None: + showIndent(outfile, level) + outfile.write('<%sPostalCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PostalCode).encode(ExternalEncoding), input_name='PostalCode'), namespace_)) + if self.UrbanizationCode is not None: + showIndent(outfile, level) + outfile.write('<%sUrbanizationCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.UrbanizationCode).encode(ExternalEncoding), input_name='UrbanizationCode'), namespace_)) + if self.CountryCode is not None: + showIndent(outfile, level) + outfile.write('<%sCountryCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CountryCode).encode(ExternalEncoding), input_name='CountryCode'), namespace_)) + if self.Residential is not None: + showIndent(outfile, level) + outfile.write('<%sResidential>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.Residential)), input_name='Residential'), namespace_)) + def hasContent_(self): + if ( + self.StreetLines or + self.City is not None or + self.StateOrProvinceCode is not None or + self.PostalCode is not None or + self.UrbanizationCode is not None or + self.CountryCode is not None or + self.Residential is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Address'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('StreetLines=[\n') + level += 1 + for StreetLines_ in self.StreetLines: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(StreetLines_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.City is not None: + showIndent(outfile, level) + outfile.write('City=%s,\n' % quote_python(self.City).encode(ExternalEncoding)) + if self.StateOrProvinceCode is not None: + showIndent(outfile, level) + outfile.write('StateOrProvinceCode=%s,\n' % quote_python(self.StateOrProvinceCode).encode(ExternalEncoding)) + if self.PostalCode is not None: + showIndent(outfile, level) + outfile.write('PostalCode=%s,\n' % quote_python(self.PostalCode).encode(ExternalEncoding)) + if self.UrbanizationCode is not None: + showIndent(outfile, level) + outfile.write('UrbanizationCode=%s,\n' % quote_python(self.UrbanizationCode).encode(ExternalEncoding)) + if self.CountryCode is not None: + showIndent(outfile, level) + outfile.write('CountryCode=%s,\n' % quote_python(self.CountryCode).encode(ExternalEncoding)) + if self.Residential is not None: + showIndent(outfile, level) + outfile.write('Residential=%s,\n' % self.Residential) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'StreetLines': + StreetLines_ = child_.text + StreetLines_ = self.gds_validate_string(StreetLines_, node, 'StreetLines') + self.StreetLines.append(StreetLines_) + elif nodeName_ == 'City': + City_ = child_.text + City_ = self.gds_validate_string(City_, node, 'City') + self.City = City_ + elif nodeName_ == 'StateOrProvinceCode': + StateOrProvinceCode_ = child_.text + StateOrProvinceCode_ = self.gds_validate_string(StateOrProvinceCode_, node, 'StateOrProvinceCode') + self.StateOrProvinceCode = StateOrProvinceCode_ + elif nodeName_ == 'PostalCode': + PostalCode_ = child_.text + PostalCode_ = self.gds_validate_string(PostalCode_, node, 'PostalCode') + self.PostalCode = PostalCode_ + elif nodeName_ == 'UrbanizationCode': + UrbanizationCode_ = child_.text + UrbanizationCode_ = self.gds_validate_string(UrbanizationCode_, node, 'UrbanizationCode') + self.UrbanizationCode = UrbanizationCode_ + elif nodeName_ == 'CountryCode': + CountryCode_ = child_.text + CountryCode_ = self.gds_validate_string(CountryCode_, node, 'CountryCode') + self.CountryCode = CountryCode_ + elif nodeName_ == 'Residential': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'Residential') + self.Residential = ival_ +# end class Address + + +class Distance(GeneratedsSuper): + """The descriptive data for distance.""" + subclass = None + superclass = None + def __init__(self, Value=None, Units=None): + self.Value = Value + self.Units = Units + def factory(*args_, **kwargs_): + if Distance.subclass: + return Distance.subclass(*args_, **kwargs_) + else: + return Distance(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Value(self): return self.Value + def set_Value(self, Value): self.Value = Value + def get_Units(self): return self.Units + def set_Units(self, Units): self.Units = Units + def validate_DistanceUnits(self, value): + # Validate type DistanceUnits, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='Distance', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Distance') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Distance'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Distance', fromsubclass_=False): + if self.Value is not None: + showIndent(outfile, level) + outfile.write('<%sValue>%s\n' % (namespace_, self.gds_format_float(self.Value, input_name='Value'), namespace_)) + if self.Units is not None: + showIndent(outfile, level) + outfile.write('<%sUnits>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Units).encode(ExternalEncoding), input_name='Units'), namespace_)) + def hasContent_(self): + if ( + self.Value is not None or + self.Units is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Distance'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Value is not None: + showIndent(outfile, level) + outfile.write('Value=%f,\n' % self.Value) + if self.Units is not None: + showIndent(outfile, level) + outfile.write('Units=%s,\n' % quote_python(self.Units).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Value': + sval_ = child_.text + try: + fval_ = float(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires float or double: %s' % exp) + fval_ = self.gds_validate_float(fval_, node, 'Value') + self.Value = fval_ + elif nodeName_ == 'Units': + Units_ = child_.text + Units_ = self.gds_validate_string(Units_, node, 'Units') + self.Units = Units_ + self.validate_DistanceUnits(self.Units) # validate type DistanceUnits +# end class Distance + + +class DropoffLocationProfile(GeneratedsSuper): + """The descriptive data about the various drop off services.""" + subclass = None + superclass = None + def __init__(self, ExpressService=None, GroundService=None, HoursWeekdays=None, HoursSaturdays=None, LastExpressDropoffTimeWeekdays=None, LastExpressDropoffTimeSaturdays=None, LastGroundDropoffTimeWeekdays=None, LastGroundDropoffTimeSaturdays=None, HoldAtLocation=None, GroundHoldAtLocation=None, DangerousGoods=None, PackagingSupplies=None, PackagingServices=None, ReturnSystem=None): + self.ExpressService = ExpressService + self.GroundService = GroundService + self.HoursWeekdays = HoursWeekdays + self.HoursSaturdays = HoursSaturdays + self.LastExpressDropoffTimeWeekdays = LastExpressDropoffTimeWeekdays + self.LastExpressDropoffTimeSaturdays = LastExpressDropoffTimeSaturdays + self.LastGroundDropoffTimeWeekdays = LastGroundDropoffTimeWeekdays + self.LastGroundDropoffTimeSaturdays = LastGroundDropoffTimeSaturdays + self.HoldAtLocation = HoldAtLocation + self.GroundHoldAtLocation = GroundHoldAtLocation + self.DangerousGoods = DangerousGoods + self.PackagingSupplies = PackagingSupplies + self.PackagingServices = PackagingServices + self.ReturnSystem = ReturnSystem + def factory(*args_, **kwargs_): + if DropoffLocationProfile.subclass: + return DropoffLocationProfile.subclass(*args_, **kwargs_) + else: + return DropoffLocationProfile(*args_, **kwargs_) + factory = staticmethod(factory) + def get_ExpressService(self): return self.ExpressService + def set_ExpressService(self, ExpressService): self.ExpressService = ExpressService + def get_GroundService(self): return self.GroundService + def set_GroundService(self, GroundService): self.GroundService = GroundService + def get_HoursWeekdays(self): return self.HoursWeekdays + def set_HoursWeekdays(self, HoursWeekdays): self.HoursWeekdays = HoursWeekdays + def get_HoursSaturdays(self): return self.HoursSaturdays + def set_HoursSaturdays(self, HoursSaturdays): self.HoursSaturdays = HoursSaturdays + def get_LastExpressDropoffTimeWeekdays(self): return self.LastExpressDropoffTimeWeekdays + def set_LastExpressDropoffTimeWeekdays(self, LastExpressDropoffTimeWeekdays): self.LastExpressDropoffTimeWeekdays = LastExpressDropoffTimeWeekdays + def get_LastExpressDropoffTimeSaturdays(self): return self.LastExpressDropoffTimeSaturdays + def set_LastExpressDropoffTimeSaturdays(self, LastExpressDropoffTimeSaturdays): self.LastExpressDropoffTimeSaturdays = LastExpressDropoffTimeSaturdays + def get_LastGroundDropoffTimeWeekdays(self): return self.LastGroundDropoffTimeWeekdays + def set_LastGroundDropoffTimeWeekdays(self, LastGroundDropoffTimeWeekdays): self.LastGroundDropoffTimeWeekdays = LastGroundDropoffTimeWeekdays + def get_LastGroundDropoffTimeSaturdays(self): return self.LastGroundDropoffTimeSaturdays + def set_LastGroundDropoffTimeSaturdays(self, LastGroundDropoffTimeSaturdays): self.LastGroundDropoffTimeSaturdays = LastGroundDropoffTimeSaturdays + def get_HoldAtLocation(self): return self.HoldAtLocation + def set_HoldAtLocation(self, HoldAtLocation): self.HoldAtLocation = HoldAtLocation + def get_GroundHoldAtLocation(self): return self.GroundHoldAtLocation + def set_GroundHoldAtLocation(self, GroundHoldAtLocation): self.GroundHoldAtLocation = GroundHoldAtLocation + def get_DangerousGoods(self): return self.DangerousGoods + def set_DangerousGoods(self, DangerousGoods): self.DangerousGoods = DangerousGoods + def get_PackagingSupplies(self): return self.PackagingSupplies + def set_PackagingSupplies(self, PackagingSupplies): self.PackagingSupplies = PackagingSupplies + def get_PackagingServices(self): return self.PackagingServices + def set_PackagingServices(self, PackagingServices): self.PackagingServices = PackagingServices + def get_ReturnSystem(self): return self.ReturnSystem + def set_ReturnSystem(self, ReturnSystem): self.ReturnSystem = ReturnSystem + def export(self, outfile, level, namespace_='ns:', name_='DropoffLocationProfile', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='DropoffLocationProfile') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='DropoffLocationProfile'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='DropoffLocationProfile', fromsubclass_=False): + if self.ExpressService is not None: + showIndent(outfile, level) + outfile.write('<%sExpressService>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.ExpressService)), input_name='ExpressService'), namespace_)) + if self.GroundService is not None: + showIndent(outfile, level) + outfile.write('<%sGroundService>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.GroundService)), input_name='GroundService'), namespace_)) + if self.HoursWeekdays is not None: + showIndent(outfile, level) + outfile.write('<%sHoursWeekdays>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HoursWeekdays).encode(ExternalEncoding), input_name='HoursWeekdays'), namespace_)) + if self.HoursSaturdays is not None: + showIndent(outfile, level) + outfile.write('<%sHoursSaturdays>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HoursSaturdays).encode(ExternalEncoding), input_name='HoursSaturdays'), namespace_)) + if self.LastExpressDropoffTimeWeekdays is not None: + showIndent(outfile, level) + outfile.write('<%sLastExpressDropoffTimeWeekdays>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LastExpressDropoffTimeWeekdays).encode(ExternalEncoding), input_name='LastExpressDropoffTimeWeekdays'), namespace_)) + if self.LastExpressDropoffTimeSaturdays is not None: + showIndent(outfile, level) + outfile.write('<%sLastExpressDropoffTimeSaturdays>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LastExpressDropoffTimeSaturdays).encode(ExternalEncoding), input_name='LastExpressDropoffTimeSaturdays'), namespace_)) + if self.LastGroundDropoffTimeWeekdays is not None: + showIndent(outfile, level) + outfile.write('<%sLastGroundDropoffTimeWeekdays>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LastGroundDropoffTimeWeekdays).encode(ExternalEncoding), input_name='LastGroundDropoffTimeWeekdays'), namespace_)) + if self.LastGroundDropoffTimeSaturdays is not None: + showIndent(outfile, level) + outfile.write('<%sLastGroundDropoffTimeSaturdays>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LastGroundDropoffTimeSaturdays).encode(ExternalEncoding), input_name='LastGroundDropoffTimeSaturdays'), namespace_)) + if self.HoldAtLocation is not None: + showIndent(outfile, level) + outfile.write('<%sHoldAtLocation>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.HoldAtLocation)), input_name='HoldAtLocation'), namespace_)) + if self.GroundHoldAtLocation is not None: + showIndent(outfile, level) + outfile.write('<%sGroundHoldAtLocation>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.GroundHoldAtLocation)), input_name='GroundHoldAtLocation'), namespace_)) + if self.DangerousGoods is not None: + showIndent(outfile, level) + outfile.write('<%sDangerousGoods>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.DangerousGoods)), input_name='DangerousGoods'), namespace_)) + if self.PackagingSupplies is not None: + showIndent(outfile, level) + outfile.write('<%sPackagingSupplies>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.PackagingSupplies)), input_name='PackagingSupplies'), namespace_)) + if self.PackagingServices is not None: + showIndent(outfile, level) + outfile.write('<%sPackagingServices>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.PackagingServices)), input_name='PackagingServices'), namespace_)) + if self.ReturnSystem is not None: + showIndent(outfile, level) + outfile.write('<%sReturnSystem>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.ReturnSystem)), input_name='ReturnSystem'), namespace_)) + def hasContent_(self): + if ( + self.ExpressService is not None or + self.GroundService is not None or + self.HoursWeekdays is not None or + self.HoursSaturdays is not None or + self.LastExpressDropoffTimeWeekdays is not None or + self.LastExpressDropoffTimeSaturdays is not None or + self.LastGroundDropoffTimeWeekdays is not None or + self.LastGroundDropoffTimeSaturdays is not None or + self.HoldAtLocation is not None or + self.GroundHoldAtLocation is not None or + self.DangerousGoods is not None or + self.PackagingSupplies is not None or + self.PackagingServices is not None or + self.ReturnSystem is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='DropoffLocationProfile'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.ExpressService is not None: + showIndent(outfile, level) + outfile.write('ExpressService=%s,\n' % self.ExpressService) + if self.GroundService is not None: + showIndent(outfile, level) + outfile.write('GroundService=%s,\n' % self.GroundService) + if self.HoursWeekdays is not None: + showIndent(outfile, level) + outfile.write('HoursWeekdays=%s,\n' % quote_python(self.HoursWeekdays).encode(ExternalEncoding)) + if self.HoursSaturdays is not None: + showIndent(outfile, level) + outfile.write('HoursSaturdays=%s,\n' % quote_python(self.HoursSaturdays).encode(ExternalEncoding)) + if self.LastExpressDropoffTimeWeekdays is not None: + showIndent(outfile, level) + outfile.write('LastExpressDropoffTimeWeekdays=%s,\n' % quote_python(self.LastExpressDropoffTimeWeekdays).encode(ExternalEncoding)) + if self.LastExpressDropoffTimeSaturdays is not None: + showIndent(outfile, level) + outfile.write('LastExpressDropoffTimeSaturdays=%s,\n' % quote_python(self.LastExpressDropoffTimeSaturdays).encode(ExternalEncoding)) + if self.LastGroundDropoffTimeWeekdays is not None: + showIndent(outfile, level) + outfile.write('LastGroundDropoffTimeWeekdays=%s,\n' % quote_python(self.LastGroundDropoffTimeWeekdays).encode(ExternalEncoding)) + if self.LastGroundDropoffTimeSaturdays is not None: + showIndent(outfile, level) + outfile.write('LastGroundDropoffTimeSaturdays=%s,\n' % quote_python(self.LastGroundDropoffTimeSaturdays).encode(ExternalEncoding)) + if self.HoldAtLocation is not None: + showIndent(outfile, level) + outfile.write('HoldAtLocation=%s,\n' % self.HoldAtLocation) + if self.GroundHoldAtLocation is not None: + showIndent(outfile, level) + outfile.write('GroundHoldAtLocation=%s,\n' % self.GroundHoldAtLocation) + if self.DangerousGoods is not None: + showIndent(outfile, level) + outfile.write('DangerousGoods=%s,\n' % self.DangerousGoods) + if self.PackagingSupplies is not None: + showIndent(outfile, level) + outfile.write('PackagingSupplies=%s,\n' % self.PackagingSupplies) + if self.PackagingServices is not None: + showIndent(outfile, level) + outfile.write('PackagingServices=%s,\n' % self.PackagingServices) + if self.ReturnSystem is not None: + showIndent(outfile, level) + outfile.write('ReturnSystem=%s,\n' % self.ReturnSystem) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'ExpressService': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'ExpressService') + self.ExpressService = ival_ + elif nodeName_ == 'GroundService': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'GroundService') + self.GroundService = ival_ + elif nodeName_ == 'HoursWeekdays': + HoursWeekdays_ = child_.text + HoursWeekdays_ = self.gds_validate_string(HoursWeekdays_, node, 'HoursWeekdays') + self.HoursWeekdays = HoursWeekdays_ + elif nodeName_ == 'HoursSaturdays': + HoursSaturdays_ = child_.text + HoursSaturdays_ = self.gds_validate_string(HoursSaturdays_, node, 'HoursSaturdays') + self.HoursSaturdays = HoursSaturdays_ + elif nodeName_ == 'LastExpressDropoffTimeWeekdays': + LastExpressDropoffTimeWeekdays_ = child_.text + LastExpressDropoffTimeWeekdays_ = self.gds_validate_string(LastExpressDropoffTimeWeekdays_, node, 'LastExpressDropoffTimeWeekdays') + self.LastExpressDropoffTimeWeekdays = LastExpressDropoffTimeWeekdays_ + elif nodeName_ == 'LastExpressDropoffTimeSaturdays': + LastExpressDropoffTimeSaturdays_ = child_.text + LastExpressDropoffTimeSaturdays_ = self.gds_validate_string(LastExpressDropoffTimeSaturdays_, node, 'LastExpressDropoffTimeSaturdays') + self.LastExpressDropoffTimeSaturdays = LastExpressDropoffTimeSaturdays_ + elif nodeName_ == 'LastGroundDropoffTimeWeekdays': + LastGroundDropoffTimeWeekdays_ = child_.text + LastGroundDropoffTimeWeekdays_ = self.gds_validate_string(LastGroundDropoffTimeWeekdays_, node, 'LastGroundDropoffTimeWeekdays') + self.LastGroundDropoffTimeWeekdays = LastGroundDropoffTimeWeekdays_ + elif nodeName_ == 'LastGroundDropoffTimeSaturdays': + LastGroundDropoffTimeSaturdays_ = child_.text + LastGroundDropoffTimeSaturdays_ = self.gds_validate_string(LastGroundDropoffTimeSaturdays_, node, 'LastGroundDropoffTimeSaturdays') + self.LastGroundDropoffTimeSaturdays = LastGroundDropoffTimeSaturdays_ + elif nodeName_ == 'HoldAtLocation': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'HoldAtLocation') + self.HoldAtLocation = ival_ + elif nodeName_ == 'GroundHoldAtLocation': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'GroundHoldAtLocation') + self.GroundHoldAtLocation = ival_ + elif nodeName_ == 'DangerousGoods': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'DangerousGoods') + self.DangerousGoods = ival_ + elif nodeName_ == 'PackagingSupplies': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'PackagingSupplies') + self.PackagingSupplies = ival_ + elif nodeName_ == 'PackagingServices': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'PackagingServices') + self.PackagingServices = ival_ + elif nodeName_ == 'ReturnSystem': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'ReturnSystem') + self.ReturnSystem = ival_ +# end class DropoffLocationProfile + + +USAGE_TEXT = """ +Usage: python .py [ -s ] +""" + +def usage(): + print USAGE_TEXT + sys.exit(1) + + +def get_root_tag(node): + tag = Tag_pattern_.match(node.tag).groups()[-1] + rootClass = globals().get(tag) + return tag, rootClass + + +def parse(inFileName): + doc = parsexml_(inFileName) + rootNode = doc.getroot() + rootTag, rootClass = get_root_tag(rootNode) + if rootClass is None: + rootTag = 'FedExLocatorRequest' + rootClass = FedExLocatorRequest + rootObj = rootClass.factory() + rootObj.build(rootNode) + # Enable Python to collect the space used by the DOM. + doc = None + sys.stdout.write('\n') + rootObj.export(sys.stdout, 0, name_=rootTag, + namespacedef_='') + return rootObj + + +def parseString(inString): + from StringIO import StringIO + doc = parsexml_(StringIO(inString)) + rootNode = doc.getroot() + rootTag, rootClass = get_root_tag(rootNode) + if rootClass is None: + rootTag = 'FedExLocatorRequest' + rootClass = FedExLocatorRequest + rootObj = rootClass.factory() + rootObj.build(rootNode) + # Enable Python to collect the space used by the DOM. + doc = None + sys.stdout.write('\n') + rootObj.export(sys.stdout, 0, name_="FedExLocatorRequest", + namespacedef_='') + return rootObj + + +def parseLiteral(inFileName): + doc = parsexml_(inFileName) + rootNode = doc.getroot() + rootTag, rootClass = get_root_tag(rootNode) + if rootClass is None: + rootTag = 'FedExLocatorRequest' + rootClass = FedExLocatorRequest + rootObj = rootClass.factory() + rootObj.build(rootNode) + # Enable Python to collect the space used by the DOM. + doc = None + sys.stdout.write('#from locate import *\n\n') + sys.stdout.write('import locate as model_\n\n') + sys.stdout.write('rootObj = model_.rootTag(\n') + rootObj.exportLiteral(sys.stdout, 0, name_=rootTag) + sys.stdout.write(')\n') + return rootObj + + +def main(): + args = sys.argv[1:] + if len(args) == 1: + parse(args[0]) + else: + usage() + + +if __name__ == '__main__': + #import pdb; pdb.set_trace() + main() + + +__all__ = [ + "Address", + "ClientDetail", + "Distance", + "DropoffLocation", + "DropoffLocationProfile", + "DropoffServicesDesired", + "FedExLocatorReply", + "FedExLocatorRequest", + "Localization", + "MaximumMatchCount", + "Notification", + "NotificationParameter", + "RecordIndex", + "TransactionDetail", + "VersionId", + "WebAuthenticationCredential", + "WebAuthenticationDetail" + ] diff --git a/webxml/fedex/movement.py b/webxml/fedex/movement.py new file mode 100644 index 0000000..697a42f --- /dev/null +++ b/webxml/fedex/movement.py @@ -0,0 +1,2239 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# +# Generated Mon Nov 28 15:43:43 2011 by generateDS.py version 2.6a. +# + +import sys +import getopt +import re as re_ + +etree_ = None +Verbose_import_ = False +( XMLParser_import_none, XMLParser_import_lxml, + XMLParser_import_elementtree + ) = range(3) +XMLParser_import_library = None +try: + # lxml + from lxml import etree as etree_ + XMLParser_import_library = XMLParser_import_lxml + if Verbose_import_: + print("running with lxml.etree") +except ImportError: + try: + # cElementTree from Python 2.5+ + import xml.etree.cElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with cElementTree on Python 2.5+") + except ImportError: + try: + # ElementTree from Python 2.5+ + import xml.etree.ElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with ElementTree on Python 2.5+") + except ImportError: + try: + # normal cElementTree install + import cElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with cElementTree") + except ImportError: + try: + # normal ElementTree install + import elementtree.ElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with ElementTree") + except ImportError: + raise ImportError("Failed to import ElementTree from any known place") + +def parsexml_(*args, **kwargs): + if (XMLParser_import_library == XMLParser_import_lxml and + 'parser' not in kwargs): + # Use the lxml ElementTree compatible parser so that, e.g., + # we ignore comments. + kwargs['parser'] = etree_.ETCompatXMLParser() + doc = etree_.parse(*args, **kwargs) + return doc + +# +# User methods +# +# Calls to the methods in these classes are generated by generateDS.py. +# You can replace these methods by re-implementing the following class +# in a module named generatedssuper.py. + +try: + from generatedssuper import GeneratedsSuper +except ImportError, exp: + + class GeneratedsSuper(object): + def gds_format_string(self, input_data, input_name=''): + return input_data + def gds_validate_string(self, input_data, node, input_name=''): + return input_data + def gds_format_integer(self, input_data, input_name=''): + return '%d' % input_data + def gds_validate_integer(self, input_data, node, input_name=''): + return input_data + def gds_format_integer_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_integer_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + try: + fvalue = float(value) + except (TypeError, ValueError), exp: + raise_parse_error(node, 'Requires sequence of integers') + return input_data + def gds_format_float(self, input_data, input_name=''): + return '%f' % input_data + def gds_validate_float(self, input_data, node, input_name=''): + return input_data + def gds_format_float_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_float_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + try: + fvalue = float(value) + except (TypeError, ValueError), exp: + raise_parse_error(node, 'Requires sequence of floats') + return input_data + def gds_format_double(self, input_data, input_name=''): + return '%e' % input_data + def gds_validate_double(self, input_data, node, input_name=''): + return input_data + def gds_format_double_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_double_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + try: + fvalue = float(value) + except (TypeError, ValueError), exp: + raise_parse_error(node, 'Requires sequence of doubles') + return input_data + def gds_format_boolean(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_boolean(self, input_data, node, input_name=''): + return input_data + def gds_format_boolean_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_boolean_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + if value not in ('true', '1', 'false', '0', ): + raise_parse_error(node, 'Requires sequence of booleans ("true", "1", "false", "0")') + return input_data + def gds_str_lower(self, instring): + return instring.lower() + def get_path_(self, node): + path_list = [] + self.get_path_list_(node, path_list) + path_list.reverse() + path = '/'.join(path_list) + return path + Tag_strip_pattern_ = re_.compile(r'\{.*\}') + def get_path_list_(self, node, path_list): + if node is None: + return + tag = GeneratedsSuper.Tag_strip_pattern_.sub('', node.tag) + if tag: + path_list.append(tag) + self.get_path_list_(node.getparent(), path_list) + def get_class_obj_(self, node, default_class=None): + class_obj1 = default_class + if 'xsi' in node.nsmap: + classname = node.get('{%s}type' % node.nsmap['xsi']) + if classname is not None: + names = classname.split(':') + if len(names) == 2: + classname = names[1] + class_obj2 = globals().get(classname) + if class_obj2 is not None: + class_obj1 = class_obj2 + return class_obj1 + + +# +# If you have installed IPython you can uncomment and use the following. +# IPython is available from http://ipython.scipy.org/. +# + +## from IPython.Shell import IPShellEmbed +## args = '' +## ipshell = IPShellEmbed(args, +## banner = 'Dropping into IPython', +## exit_msg = 'Leaving Interpreter, back to program.') + +# Then use the following line where and when you want to drop into the +# IPython shell: +# ipshell(' -- Entering ipshell.\nHit Ctrl-D to exit') + +# +# Globals +# + +ExternalEncoding = 'ascii' +Tag_pattern_ = re_.compile(r'({.*})?(.*)') +String_cleanup_pat_ = re_.compile(r"[\n\r\s]+") +Namespace_extract_pat_ = re_.compile(r'{(.*)}(.*)') + +# +# Support/utility functions. +# + +def showIndent(outfile, level): + for idx in range(level): + outfile.write(' ') + +def quote_xml(inStr): + if not inStr: + return '' + s1 = (isinstance(inStr, basestring) and inStr or + '%s' % inStr) + s1 = s1.replace('&', '&') + s1 = s1.replace('<', '<') + s1 = s1.replace('>', '>') + return s1 + +def quote_attrib(inStr): + s1 = (isinstance(inStr, basestring) and inStr or + '%s' % inStr) + s1 = s1.replace('&', '&') + s1 = s1.replace('<', '<') + s1 = s1.replace('>', '>') + if '"' in s1: + if "'" in s1: + s1 = '"%s"' % s1.replace('"', """) + else: + s1 = "'%s'" % s1 + else: + s1 = '"%s"' % s1 + return s1 + +def quote_python(inStr): + s1 = inStr + if s1.find("'") == -1: + if s1.find('\n') == -1: + return "'%s'" % s1 + else: + return "'''%s'''" % s1 + else: + if s1.find('"') != -1: + s1 = s1.replace('"', '\\"') + if s1.find('\n') == -1: + return '"%s"' % s1 + else: + return '"""%s"""' % s1 + +def get_all_text_(node): + if node.text is not None: + text = node.text + else: + text = '' + for child in node: + if child.tail is not None: + text += child.tail + return text + +def find_attr_value_(attr_name, node): + attrs = node.attrib + attr_parts = attr_name.split(':') + value = None + if len(attr_parts) == 1: + value = attrs.get(attr_name) + elif len(attr_parts) == 2: + prefix, name = attr_parts + namespace = node.nsmap.get(prefix) + if namespace is not None: + value = attrs.get('{%s}%s' % (namespace, name, )) + return value + + +class GDSParseError(Exception): + pass + +def raise_parse_error(node, msg): + if XMLParser_import_library == XMLParser_import_lxml: + msg = '%s (element %s/line %d)' % (msg, node.tag, node.sourceline, ) + else: + msg = '%s (element %s)' % (msg, node.tag, ) + raise GDSParseError(msg) + + +class MixedContainer: + # Constants for category: + CategoryNone = 0 + CategoryText = 1 + CategorySimple = 2 + CategoryComplex = 3 + # Constants for content_type: + TypeNone = 0 + TypeText = 1 + TypeString = 2 + TypeInteger = 3 + TypeFloat = 4 + TypeDecimal = 5 + TypeDouble = 6 + TypeBoolean = 7 + def __init__(self, category, content_type, name, value): + self.category = category + self.content_type = content_type + self.name = name + self.value = value + def getCategory(self): + return self.category + def getContenttype(self, content_type): + return self.content_type + def getValue(self): + return self.value + def getName(self): + return self.name + def export(self, outfile, level, name, namespace): + if self.category == MixedContainer.CategoryText: + # Prevent exporting empty content as empty lines. + if self.value.strip(): + outfile.write(self.value) + elif self.category == MixedContainer.CategorySimple: + self.exportSimple(outfile, level, name) + else: # category == MixedContainer.CategoryComplex + self.value.export(outfile, level, namespace,name) + def exportSimple(self, outfile, level, name): + if self.content_type == MixedContainer.TypeString: + outfile.write('<%s>%s' % (self.name, self.value, self.name)) + elif self.content_type == MixedContainer.TypeInteger or \ + self.content_type == MixedContainer.TypeBoolean: + outfile.write('<%s>%d' % (self.name, self.value, self.name)) + elif self.content_type == MixedContainer.TypeFloat or \ + self.content_type == MixedContainer.TypeDecimal: + outfile.write('<%s>%f' % (self.name, self.value, self.name)) + elif self.content_type == MixedContainer.TypeDouble: + outfile.write('<%s>%g' % (self.name, self.value, self.name)) + def exportLiteral(self, outfile, level, name): + if self.category == MixedContainer.CategoryText: + showIndent(outfile, level) + outfile.write('model_.MixedContainer(%d, %d, "%s", "%s"),\n' % \ + (self.category, self.content_type, self.name, self.value)) + elif self.category == MixedContainer.CategorySimple: + showIndent(outfile, level) + outfile.write('model_.MixedContainer(%d, %d, "%s", "%s"),\n' % \ + (self.category, self.content_type, self.name, self.value)) + else: # category == MixedContainer.CategoryComplex + showIndent(outfile, level) + outfile.write('model_.MixedContainer(%d, %d, "%s",\n' % \ + (self.category, self.content_type, self.name,)) + self.value.exportLiteral(outfile, level + 1) + showIndent(outfile, level) + outfile.write(')\n') + + +class MemberSpec_(object): + def __init__(self, name='', data_type='', container=0): + self.name = name + self.data_type = data_type + self.container = container + def set_name(self, name): self.name = name + def get_name(self): return self.name + def set_data_type(self, data_type): self.data_type = data_type + def get_data_type_chain(self): return self.data_type + def get_data_type(self): + if isinstance(self.data_type, list): + if len(self.data_type) > 0: + return self.data_type[-1] + else: + return 'xs:string' + else: + return self.data_type + def set_container(self, container): self.container = container + def get_container(self): return self.container + +def _cast(typ, value): + if typ is None or value is None: + return value + return typ(value) + +# +# Data representation classes. +# + +class Address(GeneratedsSuper): + """Descriptive data for a physical location. May be used as an actual + physical address (place to which one could go), or as a + container of "address parts" which should be handled as a unit + (such as a city-state-ZIP combination within the US).""" + subclass = None + superclass = None + def __init__(self, PostalCode=None, CountryCode=None): + self.PostalCode = PostalCode + self.CountryCode = CountryCode + def factory(*args_, **kwargs_): + if Address.subclass: + return Address.subclass(*args_, **kwargs_) + else: + return Address(*args_, **kwargs_) + factory = staticmethod(factory) + def get_PostalCode(self): return self.PostalCode + def set_PostalCode(self, PostalCode): self.PostalCode = PostalCode + def get_CountryCode(self): return self.CountryCode + def set_CountryCode(self, CountryCode): self.CountryCode = CountryCode + def export(self, outfile, level, namespace_='ns:', name_='Address', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Address') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Address'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Address', fromsubclass_=False): + if self.PostalCode is not None: + showIndent(outfile, level) + outfile.write('<%sPostalCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PostalCode).encode(ExternalEncoding), input_name='PostalCode'), namespace_)) + if self.CountryCode is not None: + showIndent(outfile, level) + outfile.write('<%sCountryCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CountryCode).encode(ExternalEncoding), input_name='CountryCode'), namespace_)) + def hasContent_(self): + if ( + self.PostalCode is not None or + self.CountryCode is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Address'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.PostalCode is not None: + showIndent(outfile, level) + outfile.write('PostalCode=%s,\n' % quote_python(self.PostalCode).encode(ExternalEncoding)) + if self.CountryCode is not None: + showIndent(outfile, level) + outfile.write('CountryCode=%s,\n' % quote_python(self.CountryCode).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'PostalCode': + PostalCode_ = child_.text + PostalCode_ = self.gds_validate_string(PostalCode_, node, 'PostalCode') + self.PostalCode = PostalCode_ + elif nodeName_ == 'CountryCode': + CountryCode_ = child_.text + CountryCode_ = self.gds_validate_string(CountryCode_, node, 'CountryCode') + self.CountryCode = CountryCode_ +# end class Address + + +class ClientDetail(GeneratedsSuper): + """Descriptive data for the client submitting a transaction.""" + subclass = None + superclass = None + def __init__(self, AccountNumber=None, MeterNumber=None, Localization=None): + self.AccountNumber = AccountNumber + self.MeterNumber = MeterNumber + self.Localization = Localization + def factory(*args_, **kwargs_): + if ClientDetail.subclass: + return ClientDetail.subclass(*args_, **kwargs_) + else: + return ClientDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_AccountNumber(self): return self.AccountNumber + def set_AccountNumber(self, AccountNumber): self.AccountNumber = AccountNumber + def get_MeterNumber(self): return self.MeterNumber + def set_MeterNumber(self, MeterNumber): self.MeterNumber = MeterNumber + def get_Localization(self): return self.Localization + def set_Localization(self, Localization): self.Localization = Localization + def export(self, outfile, level, namespace_='ns:', name_='ClientDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ClientDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ClientDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ClientDetail', fromsubclass_=False): + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('<%sAccountNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AccountNumber).encode(ExternalEncoding), input_name='AccountNumber'), namespace_)) + if self.MeterNumber is not None: + showIndent(outfile, level) + outfile.write('<%sMeterNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.MeterNumber).encode(ExternalEncoding), input_name='MeterNumber'), namespace_)) + if self.Localization: + self.Localization.export(outfile, level, namespace_, name_='Localization') + def hasContent_(self): + if ( + self.AccountNumber is not None or + self.MeterNumber is not None or + self.Localization is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ClientDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('AccountNumber=%s,\n' % quote_python(self.AccountNumber).encode(ExternalEncoding)) + if self.MeterNumber is not None: + showIndent(outfile, level) + outfile.write('MeterNumber=%s,\n' % quote_python(self.MeterNumber).encode(ExternalEncoding)) + if self.Localization is not None: + showIndent(outfile, level) + outfile.write('Localization=model_.Localization(\n') + self.Localization.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'AccountNumber': + AccountNumber_ = child_.text + AccountNumber_ = self.gds_validate_string(AccountNumber_, node, 'AccountNumber') + self.AccountNumber = AccountNumber_ + elif nodeName_ == 'MeterNumber': + MeterNumber_ = child_.text + MeterNumber_ = self.gds_validate_string(MeterNumber_, node, 'MeterNumber') + self.MeterNumber = MeterNumber_ + elif nodeName_ == 'Localization': + obj_ = Localization.factory() + obj_.build(child_) + self.set_Localization(obj_) +# end class ClientDetail + + +class Localization(GeneratedsSuper): + """Identifies the representation of human-readable text.""" + subclass = None + superclass = None + def __init__(self, LanguageCode=None, LocaleCode=None): + self.LanguageCode = LanguageCode + self.LocaleCode = LocaleCode + def factory(*args_, **kwargs_): + if Localization.subclass: + return Localization.subclass(*args_, **kwargs_) + else: + return Localization(*args_, **kwargs_) + factory = staticmethod(factory) + def get_LanguageCode(self): return self.LanguageCode + def set_LanguageCode(self, LanguageCode): self.LanguageCode = LanguageCode + def get_LocaleCode(self): return self.LocaleCode + def set_LocaleCode(self, LocaleCode): self.LocaleCode = LocaleCode + def export(self, outfile, level, namespace_='ns:', name_='Localization', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Localization') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Localization'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Localization', fromsubclass_=False): + if self.LanguageCode is not None: + showIndent(outfile, level) + outfile.write('<%sLanguageCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LanguageCode).encode(ExternalEncoding), input_name='LanguageCode'), namespace_)) + if self.LocaleCode is not None: + showIndent(outfile, level) + outfile.write('<%sLocaleCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LocaleCode).encode(ExternalEncoding), input_name='LocaleCode'), namespace_)) + def hasContent_(self): + if ( + self.LanguageCode is not None or + self.LocaleCode is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Localization'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.LanguageCode is not None: + showIndent(outfile, level) + outfile.write('LanguageCode=%s,\n' % quote_python(self.LanguageCode).encode(ExternalEncoding)) + if self.LocaleCode is not None: + showIndent(outfile, level) + outfile.write('LocaleCode=%s,\n' % quote_python(self.LocaleCode).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'LanguageCode': + LanguageCode_ = child_.text + LanguageCode_ = self.gds_validate_string(LanguageCode_, node, 'LanguageCode') + self.LanguageCode = LanguageCode_ + elif nodeName_ == 'LocaleCode': + LocaleCode_ = child_.text + LocaleCode_ = self.gds_validate_string(LocaleCode_, node, 'LocaleCode') + self.LocaleCode = LocaleCode_ +# end class Localization + + +class Notification(GeneratedsSuper): + """The descriptive data regarding the result of the submitted + transaction.""" + subclass = None + superclass = None + def __init__(self, Severity=None, Source=None, Code=None, Message=None, LocalizedMessage=None, MessageParameters=None): + self.Severity = Severity + self.Source = Source + self.Code = Code + self.Message = Message + self.LocalizedMessage = LocalizedMessage + if MessageParameters is None: + self.MessageParameters = [] + else: + self.MessageParameters = MessageParameters + def factory(*args_, **kwargs_): + if Notification.subclass: + return Notification.subclass(*args_, **kwargs_) + else: + return Notification(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Severity(self): return self.Severity + def set_Severity(self, Severity): self.Severity = Severity + def validate_NotificationSeverityType(self, value): + # Validate type NotificationSeverityType, a restriction on xs:string. + pass + def get_Source(self): return self.Source + def set_Source(self, Source): self.Source = Source + def get_Code(self): return self.Code + def set_Code(self, Code): self.Code = Code + def get_Message(self): return self.Message + def set_Message(self, Message): self.Message = Message + def get_LocalizedMessage(self): return self.LocalizedMessage + def set_LocalizedMessage(self, LocalizedMessage): self.LocalizedMessage = LocalizedMessage + def get_MessageParameters(self): return self.MessageParameters + def set_MessageParameters(self, MessageParameters): self.MessageParameters = MessageParameters + def add_MessageParameters(self, value): self.MessageParameters.append(value) + def insert_MessageParameters(self, index, value): self.MessageParameters[index] = value + def export(self, outfile, level, namespace_='ns:', name_='Notification', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Notification') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Notification'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Notification', fromsubclass_=False): + if self.Severity is not None: + showIndent(outfile, level) + outfile.write('<%sSeverity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Severity).encode(ExternalEncoding), input_name='Severity'), namespace_)) + if self.Source is not None: + showIndent(outfile, level) + outfile.write('<%sSource>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Source).encode(ExternalEncoding), input_name='Source'), namespace_)) + if self.Code is not None: + showIndent(outfile, level) + outfile.write('<%sCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Code).encode(ExternalEncoding), input_name='Code'), namespace_)) + if self.Message is not None: + showIndent(outfile, level) + outfile.write('<%sMessage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Message).encode(ExternalEncoding), input_name='Message'), namespace_)) + if self.LocalizedMessage is not None: + showIndent(outfile, level) + outfile.write('<%sLocalizedMessage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LocalizedMessage).encode(ExternalEncoding), input_name='LocalizedMessage'), namespace_)) + for MessageParameters_ in self.MessageParameters: + MessageParameters_.export(outfile, level, namespace_, name_='MessageParameters') + def hasContent_(self): + if ( + self.Severity is not None or + self.Source is not None or + self.Code is not None or + self.Message is not None or + self.LocalizedMessage is not None or + self.MessageParameters + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Notification'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Severity is not None: + showIndent(outfile, level) + outfile.write('Severity=%s,\n' % quote_python(self.Severity).encode(ExternalEncoding)) + if self.Source is not None: + showIndent(outfile, level) + outfile.write('Source=%s,\n' % quote_python(self.Source).encode(ExternalEncoding)) + if self.Code is not None: + showIndent(outfile, level) + outfile.write('Code=%s,\n' % quote_python(self.Code).encode(ExternalEncoding)) + if self.Message is not None: + showIndent(outfile, level) + outfile.write('Message=%s,\n' % quote_python(self.Message).encode(ExternalEncoding)) + if self.LocalizedMessage is not None: + showIndent(outfile, level) + outfile.write('LocalizedMessage=%s,\n' % quote_python(self.LocalizedMessage).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('MessageParameters=[\n') + level += 1 + for MessageParameters_ in self.MessageParameters: + showIndent(outfile, level) + outfile.write('model_.NotificationParameter(\n') + MessageParameters_.exportLiteral(outfile, level, name_='NotificationParameter') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Severity': + Severity_ = child_.text + Severity_ = self.gds_validate_string(Severity_, node, 'Severity') + self.Severity = Severity_ + self.validate_NotificationSeverityType(self.Severity) # validate type NotificationSeverityType + elif nodeName_ == 'Source': + Source_ = child_.text + Source_ = self.gds_validate_string(Source_, node, 'Source') + self.Source = Source_ + elif nodeName_ == 'Code': + Code_ = child_.text + Code_ = self.gds_validate_string(Code_, node, 'Code') + self.Code = Code_ + elif nodeName_ == 'Message': + Message_ = child_.text + Message_ = self.gds_validate_string(Message_, node, 'Message') + self.Message = Message_ + elif nodeName_ == 'LocalizedMessage': + LocalizedMessage_ = child_.text + LocalizedMessage_ = self.gds_validate_string(LocalizedMessage_, node, 'LocalizedMessage') + self.LocalizedMessage = LocalizedMessage_ + elif nodeName_ == 'MessageParameters': + obj_ = NotificationParameter.factory() + obj_.build(child_) + self.MessageParameters.append(obj_) +# end class Notification + + +class NotificationParameter(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Id=None, Value=None): + self.Id = Id + self.Value = Value + def factory(*args_, **kwargs_): + if NotificationParameter.subclass: + return NotificationParameter.subclass(*args_, **kwargs_) + else: + return NotificationParameter(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Id(self): return self.Id + def set_Id(self, Id): self.Id = Id + def get_Value(self): return self.Value + def set_Value(self, Value): self.Value = Value + def export(self, outfile, level, namespace_='ns:', name_='NotificationParameter', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='NotificationParameter') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='NotificationParameter'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='NotificationParameter', fromsubclass_=False): + if self.Id is not None: + showIndent(outfile, level) + outfile.write('<%sId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Id).encode(ExternalEncoding), input_name='Id'), namespace_)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('<%sValue>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Value).encode(ExternalEncoding), input_name='Value'), namespace_)) + def hasContent_(self): + if ( + self.Id is not None or + self.Value is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='NotificationParameter'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Id is not None: + showIndent(outfile, level) + outfile.write('Id=%s,\n' % quote_python(self.Id).encode(ExternalEncoding)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('Value=%s,\n' % quote_python(self.Value).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Id': + Id_ = child_.text + Id_ = self.gds_validate_string(Id_, node, 'Id') + self.Id = Id_ + elif nodeName_ == 'Value': + Value_ = child_.text + Value_ = self.gds_validate_string(Value_, node, 'Value') + self.Value = Value_ +# end class NotificationParameter + + +class PostalCodeInquiryReply(GeneratedsSuper): + """FedEx Postal Code Inquiry reply.""" + subclass = None + superclass = None + def __init__(self, HighestSeverity=None, Notifications=None, TransactionDetail=None, Version=None, ExpressFreightContractorDeliveryArea=None, ExpressDescription=None, ExpressFreightDescription=None): + self.HighestSeverity = HighestSeverity + if Notifications is None: + self.Notifications = [] + else: + self.Notifications = Notifications + self.TransactionDetail = TransactionDetail + self.Version = Version + self.ExpressFreightContractorDeliveryArea = ExpressFreightContractorDeliveryArea + self.ExpressDescription = ExpressDescription + self.ExpressFreightDescription = ExpressFreightDescription + def factory(*args_, **kwargs_): + if PostalCodeInquiryReply.subclass: + return PostalCodeInquiryReply.subclass(*args_, **kwargs_) + else: + return PostalCodeInquiryReply(*args_, **kwargs_) + factory = staticmethod(factory) + def get_HighestSeverity(self): return self.HighestSeverity + def set_HighestSeverity(self, HighestSeverity): self.HighestSeverity = HighestSeverity + def validate_NotificationSeverityType(self, value): + # Validate type NotificationSeverityType, a restriction on xs:string. + pass + def get_Notifications(self): return self.Notifications + def set_Notifications(self, Notifications): self.Notifications = Notifications + def add_Notifications(self, value): self.Notifications.append(value) + def insert_Notifications(self, index, value): self.Notifications[index] = value + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_ExpressFreightContractorDeliveryArea(self): return self.ExpressFreightContractorDeliveryArea + def set_ExpressFreightContractorDeliveryArea(self, ExpressFreightContractorDeliveryArea): self.ExpressFreightContractorDeliveryArea = ExpressFreightContractorDeliveryArea + def get_ExpressDescription(self): return self.ExpressDescription + def set_ExpressDescription(self, ExpressDescription): self.ExpressDescription = ExpressDescription + def get_ExpressFreightDescription(self): return self.ExpressFreightDescription + def set_ExpressFreightDescription(self, ExpressFreightDescription): self.ExpressFreightDescription = ExpressFreightDescription + def export(self, outfile, level, namespace_='ns:', name_='PostalCodeInquiryReply', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='PostalCodeInquiryReply') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='PostalCodeInquiryReply'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='PostalCodeInquiryReply', fromsubclass_=False): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('<%sHighestSeverity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HighestSeverity).encode(ExternalEncoding), input_name='HighestSeverity'), namespace_)) + for Notifications_ in self.Notifications: + Notifications_.export(outfile, level, namespace_, name_='Notifications') + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.ExpressFreightContractorDeliveryArea is not None: + showIndent(outfile, level) + outfile.write('<%sExpressFreightContractorDeliveryArea>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.ExpressFreightContractorDeliveryArea)), input_name='ExpressFreightContractorDeliveryArea'), namespace_)) + if self.ExpressDescription: + self.ExpressDescription.export(outfile, level, namespace_, name_='ExpressDescription') + if self.ExpressFreightDescription: + self.ExpressFreightDescription.export(outfile, level, namespace_, name_='ExpressFreightDescription') + def hasContent_(self): + if ( + self.HighestSeverity is not None or + self.Notifications or + self.TransactionDetail is not None or + self.Version is not None or + self.ExpressFreightContractorDeliveryArea is not None or + self.ExpressDescription is not None or + self.ExpressFreightDescription is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='PostalCodeInquiryReply'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('HighestSeverity=%s,\n' % quote_python(self.HighestSeverity).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Notifications=[\n') + level += 1 + for Notifications_ in self.Notifications: + showIndent(outfile, level) + outfile.write('model_.Notification(\n') + Notifications_.exportLiteral(outfile, level, name_='Notification') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.ExpressFreightContractorDeliveryArea is not None: + showIndent(outfile, level) + outfile.write('ExpressFreightContractorDeliveryArea=%s,\n' % self.ExpressFreightContractorDeliveryArea) + if self.ExpressDescription is not None: + showIndent(outfile, level) + outfile.write('ExpressDescription=model_.PostalCodeServiceAreaDescription(\n') + self.ExpressDescription.exportLiteral(outfile, level, name_='ExpressDescription') + showIndent(outfile, level) + outfile.write('),\n') + if self.ExpressFreightDescription is not None: + showIndent(outfile, level) + outfile.write('ExpressFreightDescription=model_.PostalCodeServiceAreaDescription(\n') + self.ExpressFreightDescription.exportLiteral(outfile, level, name_='ExpressFreightDescription') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'HighestSeverity': + HighestSeverity_ = child_.text + HighestSeverity_ = self.gds_validate_string(HighestSeverity_, node, 'HighestSeverity') + self.HighestSeverity = HighestSeverity_ + self.validate_NotificationSeverityType(self.HighestSeverity) # validate type NotificationSeverityType + elif nodeName_ == 'Notifications': + obj_ = Notification.factory() + obj_.build(child_) + self.Notifications.append(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'ExpressFreightContractorDeliveryArea': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'ExpressFreightContractorDeliveryArea') + self.ExpressFreightContractorDeliveryArea = ival_ + elif nodeName_ == 'ExpressDescription': + obj_ = PostalCodeServiceAreaDescription.factory() + obj_.build(child_) + self.set_ExpressDescription(obj_) + elif nodeName_ == 'ExpressFreightDescription': + obj_ = PostalCodeServiceAreaDescription.factory() + obj_.build(child_) + self.set_ExpressFreightDescription(obj_) +# end class PostalCodeInquiryReply + + +class PostalCodeInquiryRequest(GeneratedsSuper): + """FedEx Postal Code Inquiry request.""" + subclass = None + superclass = None + def __init__(self, WebAuthenticationDetail=None, ClientDetail=None, TransactionDetail=None, Version=None, PostalCode=None, CountryCode=None): + self.WebAuthenticationDetail = WebAuthenticationDetail + self.ClientDetail = ClientDetail + self.TransactionDetail = TransactionDetail + self.Version = Version + self.PostalCode = PostalCode + self.CountryCode = CountryCode + def factory(*args_, **kwargs_): + if PostalCodeInquiryRequest.subclass: + return PostalCodeInquiryRequest.subclass(*args_, **kwargs_) + else: + return PostalCodeInquiryRequest(*args_, **kwargs_) + factory = staticmethod(factory) + def get_WebAuthenticationDetail(self): return self.WebAuthenticationDetail + def set_WebAuthenticationDetail(self, WebAuthenticationDetail): self.WebAuthenticationDetail = WebAuthenticationDetail + def get_ClientDetail(self): return self.ClientDetail + def set_ClientDetail(self, ClientDetail): self.ClientDetail = ClientDetail + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_PostalCode(self): return self.PostalCode + def set_PostalCode(self, PostalCode): self.PostalCode = PostalCode + def get_CountryCode(self): return self.CountryCode + def set_CountryCode(self, CountryCode): self.CountryCode = CountryCode + def export(self, outfile, level, namespace_='ns:', name_='PostalCodeInquiryRequest', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='PostalCodeInquiryRequest') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='PostalCodeInquiryRequest'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='PostalCodeInquiryRequest', fromsubclass_=False): + if self.WebAuthenticationDetail: + self.WebAuthenticationDetail.export(outfile, level, namespace_, name_='WebAuthenticationDetail', ) + if self.ClientDetail: + self.ClientDetail.export(outfile, level, namespace_, name_='ClientDetail', ) + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.PostalCode is not None: + showIndent(outfile, level) + outfile.write('<%sPostalCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PostalCode).encode(ExternalEncoding), input_name='PostalCode'), namespace_)) + if self.CountryCode is not None: + showIndent(outfile, level) + outfile.write('<%sCountryCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CountryCode).encode(ExternalEncoding), input_name='CountryCode'), namespace_)) + def hasContent_(self): + if ( + self.WebAuthenticationDetail is not None or + self.ClientDetail is not None or + self.TransactionDetail is not None or + self.Version is not None or + self.PostalCode is not None or + self.CountryCode is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='PostalCodeInquiryRequest'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.WebAuthenticationDetail is not None: + showIndent(outfile, level) + outfile.write('WebAuthenticationDetail=model_.WebAuthenticationDetail(\n') + self.WebAuthenticationDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ClientDetail is not None: + showIndent(outfile, level) + outfile.write('ClientDetail=model_.ClientDetail(\n') + self.ClientDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.PostalCode is not None: + showIndent(outfile, level) + outfile.write('PostalCode=%s,\n' % quote_python(self.PostalCode).encode(ExternalEncoding)) + if self.CountryCode is not None: + showIndent(outfile, level) + outfile.write('CountryCode=%s,\n' % quote_python(self.CountryCode).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'WebAuthenticationDetail': + obj_ = WebAuthenticationDetail.factory() + obj_.build(child_) + self.set_WebAuthenticationDetail(obj_) + elif nodeName_ == 'ClientDetail': + obj_ = ClientDetail.factory() + obj_.build(child_) + self.set_ClientDetail(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'PostalCode': + PostalCode_ = child_.text + PostalCode_ = self.gds_validate_string(PostalCode_, node, 'PostalCode') + self.PostalCode = PostalCode_ + elif nodeName_ == 'CountryCode': + CountryCode_ = child_.text + CountryCode_ = self.gds_validate_string(CountryCode_, node, 'CountryCode') + self.CountryCode = CountryCode_ +# end class PostalCodeInquiryRequest + + +class PostalCodeServiceAreaDescription(GeneratedsSuper): + """Postal Code Service Area description.""" + subclass = None + superclass = None + def __init__(self, LocationId=None, StateOrProvinceCode=None, PostalCode=None, ServiceArea=None): + self.LocationId = LocationId + self.StateOrProvinceCode = StateOrProvinceCode + self.PostalCode = PostalCode + self.ServiceArea = ServiceArea + def factory(*args_, **kwargs_): + if PostalCodeServiceAreaDescription.subclass: + return PostalCodeServiceAreaDescription.subclass(*args_, **kwargs_) + else: + return PostalCodeServiceAreaDescription(*args_, **kwargs_) + factory = staticmethod(factory) + def get_LocationId(self): return self.LocationId + def set_LocationId(self, LocationId): self.LocationId = LocationId + def get_StateOrProvinceCode(self): return self.StateOrProvinceCode + def set_StateOrProvinceCode(self, StateOrProvinceCode): self.StateOrProvinceCode = StateOrProvinceCode + def get_PostalCode(self): return self.PostalCode + def set_PostalCode(self, PostalCode): self.PostalCode = PostalCode + def get_ServiceArea(self): return self.ServiceArea + def set_ServiceArea(self, ServiceArea): self.ServiceArea = ServiceArea + def export(self, outfile, level, namespace_='ns:', name_='PostalCodeServiceAreaDescription', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='PostalCodeServiceAreaDescription') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='PostalCodeServiceAreaDescription'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='PostalCodeServiceAreaDescription', fromsubclass_=False): + if self.LocationId is not None: + showIndent(outfile, level) + outfile.write('<%sLocationId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LocationId).encode(ExternalEncoding), input_name='LocationId'), namespace_)) + if self.StateOrProvinceCode is not None: + showIndent(outfile, level) + outfile.write('<%sStateOrProvinceCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.StateOrProvinceCode).encode(ExternalEncoding), input_name='StateOrProvinceCode'), namespace_)) + if self.PostalCode is not None: + showIndent(outfile, level) + outfile.write('<%sPostalCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PostalCode).encode(ExternalEncoding), input_name='PostalCode'), namespace_)) + if self.ServiceArea is not None: + showIndent(outfile, level) + outfile.write('<%sServiceArea>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ServiceArea).encode(ExternalEncoding), input_name='ServiceArea'), namespace_)) + def hasContent_(self): + if ( + self.LocationId is not None or + self.StateOrProvinceCode is not None or + self.PostalCode is not None or + self.ServiceArea is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='PostalCodeServiceAreaDescription'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.LocationId is not None: + showIndent(outfile, level) + outfile.write('LocationId=%s,\n' % quote_python(self.LocationId).encode(ExternalEncoding)) + if self.StateOrProvinceCode is not None: + showIndent(outfile, level) + outfile.write('StateOrProvinceCode=%s,\n' % quote_python(self.StateOrProvinceCode).encode(ExternalEncoding)) + if self.PostalCode is not None: + showIndent(outfile, level) + outfile.write('PostalCode=%s,\n' % quote_python(self.PostalCode).encode(ExternalEncoding)) + if self.ServiceArea is not None: + showIndent(outfile, level) + outfile.write('ServiceArea=%s,\n' % quote_python(self.ServiceArea).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'LocationId': + LocationId_ = child_.text + LocationId_ = self.gds_validate_string(LocationId_, node, 'LocationId') + self.LocationId = LocationId_ + elif nodeName_ == 'StateOrProvinceCode': + StateOrProvinceCode_ = child_.text + StateOrProvinceCode_ = self.gds_validate_string(StateOrProvinceCode_, node, 'StateOrProvinceCode') + self.StateOrProvinceCode = StateOrProvinceCode_ + elif nodeName_ == 'PostalCode': + PostalCode_ = child_.text + PostalCode_ = self.gds_validate_string(PostalCode_, node, 'PostalCode') + self.PostalCode = PostalCode_ + elif nodeName_ == 'ServiceArea': + ServiceArea_ = child_.text + ServiceArea_ = self.gds_validate_string(ServiceArea_, node, 'ServiceArea') + self.ServiceArea = ServiceArea_ +# end class PostalCodeServiceAreaDescription + + +class ServiceAvailabilityOption(GeneratedsSuper): + """The descriptive data which identifies an available FedEx Service.""" + subclass = None + superclass = None + def __init__(self, Service=None, DeliveryDate=None, DeliveryDay=None, DestinationStationId=None, DestinationAirportId=None): + self.Service = Service + self.DeliveryDate = DeliveryDate + self.DeliveryDay = DeliveryDay + self.DestinationStationId = DestinationStationId + self.DestinationAirportId = DestinationAirportId + def factory(*args_, **kwargs_): + if ServiceAvailabilityOption.subclass: + return ServiceAvailabilityOption.subclass(*args_, **kwargs_) + else: + return ServiceAvailabilityOption(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Service(self): return self.Service + def set_Service(self, Service): self.Service = Service + def validate_ServiceType(self, value): + # Validate type ServiceType, a restriction on xs:string. + pass + def get_DeliveryDate(self): return self.DeliveryDate + def set_DeliveryDate(self, DeliveryDate): self.DeliveryDate = DeliveryDate + def get_DeliveryDay(self): return self.DeliveryDay + def set_DeliveryDay(self, DeliveryDay): self.DeliveryDay = DeliveryDay + def validate_DayOfWeekType(self, value): + # Validate type DayOfWeekType, a restriction on xs:string. + pass + def get_DestinationStationId(self): return self.DestinationStationId + def set_DestinationStationId(self, DestinationStationId): self.DestinationStationId = DestinationStationId + def get_DestinationAirportId(self): return self.DestinationAirportId + def set_DestinationAirportId(self, DestinationAirportId): self.DestinationAirportId = DestinationAirportId + def export(self, outfile, level, namespace_='ns:', name_='ServiceAvailabilityOption', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ServiceAvailabilityOption') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ServiceAvailabilityOption'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ServiceAvailabilityOption', fromsubclass_=False): + if self.Service is not None: + showIndent(outfile, level) + outfile.write('<%sService>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Service).encode(ExternalEncoding), input_name='Service'), namespace_)) + if self.DeliveryDate is not None: + showIndent(outfile, level) + outfile.write('<%sDeliveryDate>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DeliveryDate).encode(ExternalEncoding), input_name='DeliveryDate'), namespace_)) + if self.DeliveryDay is not None: + showIndent(outfile, level) + outfile.write('<%sDeliveryDay>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DeliveryDay).encode(ExternalEncoding), input_name='DeliveryDay'), namespace_)) + if self.DestinationStationId is not None: + showIndent(outfile, level) + outfile.write('<%sDestinationStationId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DestinationStationId).encode(ExternalEncoding), input_name='DestinationStationId'), namespace_)) + if self.DestinationAirportId is not None: + showIndent(outfile, level) + outfile.write('<%sDestinationAirportId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DestinationAirportId).encode(ExternalEncoding), input_name='DestinationAirportId'), namespace_)) + def hasContent_(self): + if ( + self.Service is not None or + self.DeliveryDate is not None or + self.DeliveryDay is not None or + self.DestinationStationId is not None or + self.DestinationAirportId is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ServiceAvailabilityOption'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Service is not None: + showIndent(outfile, level) + outfile.write('Service=%s,\n' % quote_python(self.Service).encode(ExternalEncoding)) + if self.DeliveryDate is not None: + showIndent(outfile, level) + outfile.write('DeliveryDate=%s,\n' % quote_python(self.DeliveryDate).encode(ExternalEncoding)) + if self.DeliveryDay is not None: + showIndent(outfile, level) + outfile.write('DeliveryDay=%s,\n' % quote_python(self.DeliveryDay).encode(ExternalEncoding)) + if self.DestinationStationId is not None: + showIndent(outfile, level) + outfile.write('DestinationStationId=%s,\n' % quote_python(self.DestinationStationId).encode(ExternalEncoding)) + if self.DestinationAirportId is not None: + showIndent(outfile, level) + outfile.write('DestinationAirportId=%s,\n' % quote_python(self.DestinationAirportId).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Service': + Service_ = child_.text + Service_ = self.gds_validate_string(Service_, node, 'Service') + self.Service = Service_ + self.validate_ServiceType(self.Service) # validate type ServiceType + elif nodeName_ == 'DeliveryDate': + DeliveryDate_ = child_.text + DeliveryDate_ = self.gds_validate_string(DeliveryDate_, node, 'DeliveryDate') + self.DeliveryDate = DeliveryDate_ + elif nodeName_ == 'DeliveryDay': + DeliveryDay_ = child_.text + DeliveryDay_ = self.gds_validate_string(DeliveryDay_, node, 'DeliveryDay') + self.DeliveryDay = DeliveryDay_ + self.validate_DayOfWeekType(self.DeliveryDay) # validate type DayOfWeekType + elif nodeName_ == 'DestinationStationId': + DestinationStationId_ = child_.text + DestinationStationId_ = self.gds_validate_string(DestinationStationId_, node, 'DestinationStationId') + self.DestinationStationId = DestinationStationId_ + elif nodeName_ == 'DestinationAirportId': + DestinationAirportId_ = child_.text + DestinationAirportId_ = self.gds_validate_string(DestinationAirportId_, node, 'DestinationAirportId') + self.DestinationAirportId = DestinationAirportId_ +# end class ServiceAvailabilityOption + + +class ServiceAvailabilityReply(GeneratedsSuper): + """The descriptive data returned for a FedEx service availability + request.""" + subclass = None + superclass = None + def __init__(self, HighestSeverity=None, Notifications=None, TransactionDetail=None, Version=None, Options=None): + self.HighestSeverity = HighestSeverity + if Notifications is None: + self.Notifications = [] + else: + self.Notifications = Notifications + self.TransactionDetail = TransactionDetail + self.Version = Version + if Options is None: + self.Options = [] + else: + self.Options = Options + def factory(*args_, **kwargs_): + if ServiceAvailabilityReply.subclass: + return ServiceAvailabilityReply.subclass(*args_, **kwargs_) + else: + return ServiceAvailabilityReply(*args_, **kwargs_) + factory = staticmethod(factory) + def get_HighestSeverity(self): return self.HighestSeverity + def set_HighestSeverity(self, HighestSeverity): self.HighestSeverity = HighestSeverity + def validate_NotificationSeverityType(self, value): + # Validate type NotificationSeverityType, a restriction on xs:string. + pass + def get_Notifications(self): return self.Notifications + def set_Notifications(self, Notifications): self.Notifications = Notifications + def add_Notifications(self, value): self.Notifications.append(value) + def insert_Notifications(self, index, value): self.Notifications[index] = value + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_Options(self): return self.Options + def set_Options(self, Options): self.Options = Options + def add_Options(self, value): self.Options.append(value) + def insert_Options(self, index, value): self.Options[index] = value + def export(self, outfile, level, namespace_='ns:', name_='ServiceAvailabilityReply', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ServiceAvailabilityReply') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ServiceAvailabilityReply'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ServiceAvailabilityReply', fromsubclass_=False): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('<%sHighestSeverity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HighestSeverity).encode(ExternalEncoding), input_name='HighestSeverity'), namespace_)) + for Notifications_ in self.Notifications: + Notifications_.export(outfile, level, namespace_, name_='Notifications') + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + for Options_ in self.Options: + Options_.export(outfile, level, namespace_, name_='Options') + def hasContent_(self): + if ( + self.HighestSeverity is not None or + self.Notifications or + self.TransactionDetail is not None or + self.Version is not None or + self.Options + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ServiceAvailabilityReply'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('HighestSeverity=%s,\n' % quote_python(self.HighestSeverity).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Notifications=[\n') + level += 1 + for Notifications_ in self.Notifications: + showIndent(outfile, level) + outfile.write('model_.Notification(\n') + Notifications_.exportLiteral(outfile, level, name_='Notification') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('Options=[\n') + level += 1 + for Options_ in self.Options: + showIndent(outfile, level) + outfile.write('model_.ServiceAvailabilityOption(\n') + Options_.exportLiteral(outfile, level, name_='ServiceAvailabilityOption') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'HighestSeverity': + HighestSeverity_ = child_.text + HighestSeverity_ = self.gds_validate_string(HighestSeverity_, node, 'HighestSeverity') + self.HighestSeverity = HighestSeverity_ + self.validate_NotificationSeverityType(self.HighestSeverity) # validate type NotificationSeverityType + elif nodeName_ == 'Notifications': + obj_ = Notification.factory() + obj_.build(child_) + self.Notifications.append(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'Options': + obj_ = ServiceAvailabilityOption.factory() + obj_.build(child_) + self.Options.append(obj_) +# end class ServiceAvailabilityReply + + +class ServiceAvailabilityRequest(GeneratedsSuper): + """The descriptive data which is used to determine which FedEx Express + services are available between an origin and destination. To + check the availability of one particular FedEx Express service + and packaging type, include the Service and Packaging elements + in the request message. Only information regarding that single + service and packaging type will be returned from the request. To + obtain a list of all available services for a given origin and + destination, omit the Service and Packaging elements from the + request. In this case the reply will contain every available + service.""" + subclass = None + superclass = None + def __init__(self, WebAuthenticationDetail=None, ClientDetail=None, TransactionDetail=None, Version=None, Origin=None, Destination=None, ShipDate=None, CarrierCode=None, Service=None, Packaging=None): + self.WebAuthenticationDetail = WebAuthenticationDetail + self.ClientDetail = ClientDetail + self.TransactionDetail = TransactionDetail + self.Version = Version + self.Origin = Origin + self.Destination = Destination + self.ShipDate = ShipDate + self.CarrierCode = CarrierCode + self.Service = Service + self.Packaging = Packaging + def factory(*args_, **kwargs_): + if ServiceAvailabilityRequest.subclass: + return ServiceAvailabilityRequest.subclass(*args_, **kwargs_) + else: + return ServiceAvailabilityRequest(*args_, **kwargs_) + factory = staticmethod(factory) + def get_WebAuthenticationDetail(self): return self.WebAuthenticationDetail + def set_WebAuthenticationDetail(self, WebAuthenticationDetail): self.WebAuthenticationDetail = WebAuthenticationDetail + def get_ClientDetail(self): return self.ClientDetail + def set_ClientDetail(self, ClientDetail): self.ClientDetail = ClientDetail + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_Origin(self): return self.Origin + def set_Origin(self, Origin): self.Origin = Origin + def get_Destination(self): return self.Destination + def set_Destination(self, Destination): self.Destination = Destination + def get_ShipDate(self): return self.ShipDate + def set_ShipDate(self, ShipDate): self.ShipDate = ShipDate + def get_CarrierCode(self): return self.CarrierCode + def set_CarrierCode(self, CarrierCode): self.CarrierCode = CarrierCode + def validate_CarrierCodeType(self, value): + # Validate type CarrierCodeType, a restriction on xs:string. + pass + def get_Service(self): return self.Service + def set_Service(self, Service): self.Service = Service + def validate_ServiceType(self, value): + # Validate type ServiceType, a restriction on xs:string. + pass + def get_Packaging(self): return self.Packaging + def set_Packaging(self, Packaging): self.Packaging = Packaging + def validate_PackagingType(self, value): + # Validate type PackagingType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='ServiceAvailabilityRequest', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ServiceAvailabilityRequest') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ServiceAvailabilityRequest'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ServiceAvailabilityRequest', fromsubclass_=False): + if self.WebAuthenticationDetail: + self.WebAuthenticationDetail.export(outfile, level, namespace_, name_='WebAuthenticationDetail', ) + if self.ClientDetail: + self.ClientDetail.export(outfile, level, namespace_, name_='ClientDetail', ) + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.Origin: + self.Origin.export(outfile, level, namespace_, name_='Origin', ) + if self.Destination: + self.Destination.export(outfile, level, namespace_, name_='Destination', ) + if self.ShipDate is not None: + showIndent(outfile, level) + outfile.write('<%sShipDate>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ShipDate).encode(ExternalEncoding), input_name='ShipDate'), namespace_)) + if self.CarrierCode is not None: + showIndent(outfile, level) + outfile.write('<%sCarrierCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CarrierCode).encode(ExternalEncoding), input_name='CarrierCode'), namespace_)) + if self.Service is not None: + showIndent(outfile, level) + outfile.write('<%sService>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Service).encode(ExternalEncoding), input_name='Service'), namespace_)) + if self.Packaging is not None: + showIndent(outfile, level) + outfile.write('<%sPackaging>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Packaging).encode(ExternalEncoding), input_name='Packaging'), namespace_)) + def hasContent_(self): + if ( + self.WebAuthenticationDetail is not None or + self.ClientDetail is not None or + self.TransactionDetail is not None or + self.Version is not None or + self.Origin is not None or + self.Destination is not None or + self.ShipDate is not None or + self.CarrierCode is not None or + self.Service is not None or + self.Packaging is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ServiceAvailabilityRequest'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.WebAuthenticationDetail is not None: + showIndent(outfile, level) + outfile.write('WebAuthenticationDetail=model_.WebAuthenticationDetail(\n') + self.WebAuthenticationDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ClientDetail is not None: + showIndent(outfile, level) + outfile.write('ClientDetail=model_.ClientDetail(\n') + self.ClientDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.Origin is not None: + showIndent(outfile, level) + outfile.write('Origin=model_.Address(\n') + self.Origin.exportLiteral(outfile, level, name_='Origin') + showIndent(outfile, level) + outfile.write('),\n') + if self.Destination is not None: + showIndent(outfile, level) + outfile.write('Destination=model_.Address(\n') + self.Destination.exportLiteral(outfile, level, name_='Destination') + showIndent(outfile, level) + outfile.write('),\n') + if self.ShipDate is not None: + showIndent(outfile, level) + outfile.write('ShipDate=%s,\n' % quote_python(self.ShipDate).encode(ExternalEncoding)) + if self.CarrierCode is not None: + showIndent(outfile, level) + outfile.write('CarrierCode=%s,\n' % quote_python(self.CarrierCode).encode(ExternalEncoding)) + if self.Service is not None: + showIndent(outfile, level) + outfile.write('Service=%s,\n' % quote_python(self.Service).encode(ExternalEncoding)) + if self.Packaging is not None: + showIndent(outfile, level) + outfile.write('Packaging=%s,\n' % quote_python(self.Packaging).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'WebAuthenticationDetail': + obj_ = WebAuthenticationDetail.factory() + obj_.build(child_) + self.set_WebAuthenticationDetail(obj_) + elif nodeName_ == 'ClientDetail': + obj_ = ClientDetail.factory() + obj_.build(child_) + self.set_ClientDetail(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'Origin': + obj_ = Address.factory() + obj_.build(child_) + self.set_Origin(obj_) + elif nodeName_ == 'Destination': + obj_ = Address.factory() + obj_.build(child_) + self.set_Destination(obj_) + elif nodeName_ == 'ShipDate': + ShipDate_ = child_.text + ShipDate_ = self.gds_validate_string(ShipDate_, node, 'ShipDate') + self.ShipDate = ShipDate_ + elif nodeName_ == 'CarrierCode': + CarrierCode_ = child_.text + CarrierCode_ = self.gds_validate_string(CarrierCode_, node, 'CarrierCode') + self.CarrierCode = CarrierCode_ + self.validate_CarrierCodeType(self.CarrierCode) # validate type CarrierCodeType + elif nodeName_ == 'Service': + Service_ = child_.text + Service_ = self.gds_validate_string(Service_, node, 'Service') + self.Service = Service_ + self.validate_ServiceType(self.Service) # validate type ServiceType + elif nodeName_ == 'Packaging': + Packaging_ = child_.text + Packaging_ = self.gds_validate_string(Packaging_, node, 'Packaging') + self.Packaging = Packaging_ + self.validate_PackagingType(self.Packaging) # validate type PackagingType +# end class ServiceAvailabilityRequest + + +class TransactionDetail(GeneratedsSuper): + """The descriptive data that governs data payload + language/translations.""" + subclass = None + superclass = None + def __init__(self, CustomerTransactionId=None, Localization=None): + self.CustomerTransactionId = CustomerTransactionId + self.Localization = Localization + def factory(*args_, **kwargs_): + if TransactionDetail.subclass: + return TransactionDetail.subclass(*args_, **kwargs_) + else: + return TransactionDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_CustomerTransactionId(self): return self.CustomerTransactionId + def set_CustomerTransactionId(self, CustomerTransactionId): self.CustomerTransactionId = CustomerTransactionId + def get_Localization(self): return self.Localization + def set_Localization(self, Localization): self.Localization = Localization + def export(self, outfile, level, namespace_='ns:', name_='TransactionDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='TransactionDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='TransactionDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='TransactionDetail', fromsubclass_=False): + if self.CustomerTransactionId is not None: + showIndent(outfile, level) + outfile.write('<%sCustomerTransactionId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CustomerTransactionId).encode(ExternalEncoding), input_name='CustomerTransactionId'), namespace_)) + if self.Localization: + self.Localization.export(outfile, level, namespace_, name_='Localization') + def hasContent_(self): + if ( + self.CustomerTransactionId is not None or + self.Localization is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='TransactionDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.CustomerTransactionId is not None: + showIndent(outfile, level) + outfile.write('CustomerTransactionId=%s,\n' % quote_python(self.CustomerTransactionId).encode(ExternalEncoding)) + if self.Localization is not None: + showIndent(outfile, level) + outfile.write('Localization=model_.Localization(\n') + self.Localization.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'CustomerTransactionId': + CustomerTransactionId_ = child_.text + CustomerTransactionId_ = self.gds_validate_string(CustomerTransactionId_, node, 'CustomerTransactionId') + self.CustomerTransactionId = CustomerTransactionId_ + elif nodeName_ == 'Localization': + obj_ = Localization.factory() + obj_.build(child_) + self.set_Localization(obj_) +# end class TransactionDetail + + +class WebAuthenticationDetail(GeneratedsSuper): + """Used in authentication of the sender's identity.""" + subclass = None + superclass = None + def __init__(self, UserCredential=None): + self.UserCredential = UserCredential + def factory(*args_, **kwargs_): + if WebAuthenticationDetail.subclass: + return WebAuthenticationDetail.subclass(*args_, **kwargs_) + else: + return WebAuthenticationDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_UserCredential(self): return self.UserCredential + def set_UserCredential(self, UserCredential): self.UserCredential = UserCredential + def export(self, outfile, level, namespace_='ns:', name_='WebAuthenticationDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='WebAuthenticationDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='WebAuthenticationDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='WebAuthenticationDetail', fromsubclass_=False): + if self.UserCredential: + self.UserCredential.export(outfile, level, namespace_, name_='UserCredential', ) + def hasContent_(self): + if ( + self.UserCredential is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='WebAuthenticationDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.UserCredential is not None: + showIndent(outfile, level) + outfile.write('UserCredential=model_.WebAuthenticationCredential(\n') + self.UserCredential.exportLiteral(outfile, level, name_='UserCredential') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'UserCredential': + obj_ = WebAuthenticationCredential.factory() + obj_.build(child_) + self.set_UserCredential(obj_) +# end class WebAuthenticationDetail + + +class WebAuthenticationCredential(GeneratedsSuper): + """Two part authentication string used for the sender's identity""" + subclass = None + superclass = None + def __init__(self, Key=None, Password=None): + self.Key = Key + self.Password = Password + def factory(*args_, **kwargs_): + if WebAuthenticationCredential.subclass: + return WebAuthenticationCredential.subclass(*args_, **kwargs_) + else: + return WebAuthenticationCredential(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Key(self): return self.Key + def set_Key(self, Key): self.Key = Key + def get_Password(self): return self.Password + def set_Password(self, Password): self.Password = Password + def export(self, outfile, level, namespace_='ns:', name_='WebAuthenticationCredential', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='WebAuthenticationCredential') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='WebAuthenticationCredential'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='WebAuthenticationCredential', fromsubclass_=False): + if self.Key is not None: + showIndent(outfile, level) + outfile.write('<%sKey>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Key).encode(ExternalEncoding), input_name='Key'), namespace_)) + if self.Password is not None: + showIndent(outfile, level) + outfile.write('<%sPassword>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Password).encode(ExternalEncoding), input_name='Password'), namespace_)) + def hasContent_(self): + if ( + self.Key is not None or + self.Password is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='WebAuthenticationCredential'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Key is not None: + showIndent(outfile, level) + outfile.write('Key=%s,\n' % quote_python(self.Key).encode(ExternalEncoding)) + if self.Password is not None: + showIndent(outfile, level) + outfile.write('Password=%s,\n' % quote_python(self.Password).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Key': + Key_ = child_.text + Key_ = self.gds_validate_string(Key_, node, 'Key') + self.Key = Key_ + elif nodeName_ == 'Password': + Password_ = child_.text + Password_ = self.gds_validate_string(Password_, node, 'Password') + self.Password = Password_ +# end class WebAuthenticationCredential + + +class VersionId(GeneratedsSuper): + """Identifies the version/level of a service operation expected by a + caller (in each request) and performed by the callee (in each + reply).""" + subclass = None + superclass = None + def __init__(self, ServiceId=None, Major=None, Intermediate=None, Minor=None): + self.ServiceId = ServiceId + self.Major = Major + self.Intermediate = Intermediate + self.Minor = Minor + def factory(*args_, **kwargs_): + if VersionId.subclass: + return VersionId.subclass(*args_, **kwargs_) + else: + return VersionId(*args_, **kwargs_) + factory = staticmethod(factory) + def get_ServiceId(self): return self.ServiceId + def set_ServiceId(self, ServiceId): self.ServiceId = ServiceId + def get_Major(self): return self.Major + def set_Major(self, Major): self.Major = Major + def get_Intermediate(self): return self.Intermediate + def set_Intermediate(self, Intermediate): self.Intermediate = Intermediate + def get_Minor(self): return self.Minor + def set_Minor(self, Minor): self.Minor = Minor + def export(self, outfile, level, namespace_='ns:', name_='VersionId', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='VersionId') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='VersionId'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='VersionId', fromsubclass_=False): + if self.ServiceId is not None: + showIndent(outfile, level) + outfile.write('<%sServiceId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ServiceId).encode(ExternalEncoding), input_name='ServiceId'), namespace_)) + if self.Major is not None: + showIndent(outfile, level) + outfile.write('<%sMajor>%s\n' % (namespace_, self.gds_format_integer(self.Major, input_name='Major'), namespace_)) + if self.Intermediate is not None: + showIndent(outfile, level) + outfile.write('<%sIntermediate>%s\n' % (namespace_, self.gds_format_integer(self.Intermediate, input_name='Intermediate'), namespace_)) + if self.Minor is not None: + showIndent(outfile, level) + outfile.write('<%sMinor>%s\n' % (namespace_, self.gds_format_integer(self.Minor, input_name='Minor'), namespace_)) + def hasContent_(self): + if ( + self.ServiceId is not None or + self.Major is not None or + self.Intermediate is not None or + self.Minor is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='VersionId'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.ServiceId is not None: + showIndent(outfile, level) + outfile.write('ServiceId=%s,\n' % quote_python(self.ServiceId).encode(ExternalEncoding)) + if self.Major is not None: + showIndent(outfile, level) + outfile.write('Major=%d,\n' % self.Major) + if self.Intermediate is not None: + showIndent(outfile, level) + outfile.write('Intermediate=%d,\n' % self.Intermediate) + if self.Minor is not None: + showIndent(outfile, level) + outfile.write('Minor=%d,\n' % self.Minor) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'ServiceId': + ServiceId_ = child_.text + ServiceId_ = self.gds_validate_string(ServiceId_, node, 'ServiceId') + self.ServiceId = ServiceId_ + elif nodeName_ == 'Major': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'Major') + self.Major = ival_ + elif nodeName_ == 'Intermediate': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'Intermediate') + self.Intermediate = ival_ + elif nodeName_ == 'Minor': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'Minor') + self.Minor = ival_ +# end class VersionId + + +USAGE_TEXT = """ +Usage: python .py [ -s ] +""" + +def usage(): + print USAGE_TEXT + sys.exit(1) + + +def get_root_tag(node): + tag = Tag_pattern_.match(node.tag).groups()[-1] + rootClass = globals().get(tag) + return tag, rootClass + + +def parse(inFileName): + doc = parsexml_(inFileName) + rootNode = doc.getroot() + rootTag, rootClass = get_root_tag(rootNode) + if rootClass is None: + rootTag = 'PostalCodeInquiryReply' + rootClass = PostalCodeInquiryReply + rootObj = rootClass.factory() + rootObj.build(rootNode) + # Enable Python to collect the space used by the DOM. + doc = None + sys.stdout.write('\n') + rootObj.export(sys.stdout, 0, name_=rootTag, + namespacedef_='') + return rootObj + + +def parseString(inString): + from StringIO import StringIO + doc = parsexml_(StringIO(inString)) + rootNode = doc.getroot() + rootTag, rootClass = get_root_tag(rootNode) + if rootClass is None: + rootTag = 'PostalCodeInquiryReply' + rootClass = PostalCodeInquiryReply + rootObj = rootClass.factory() + rootObj.build(rootNode) + # Enable Python to collect the space used by the DOM. + doc = None + sys.stdout.write('\n') + rootObj.export(sys.stdout, 0, name_="PostalCodeInquiryReply", + namespacedef_='') + return rootObj + + +def parseLiteral(inFileName): + doc = parsexml_(inFileName) + rootNode = doc.getroot() + rootTag, rootClass = get_root_tag(rootNode) + if rootClass is None: + rootTag = 'PostalCodeInquiryReply' + rootClass = PostalCodeInquiryReply + rootObj = rootClass.factory() + rootObj.build(rootNode) + # Enable Python to collect the space used by the DOM. + doc = None + sys.stdout.write('#from movement import *\n\n') + sys.stdout.write('import movement as model_\n\n') + sys.stdout.write('rootObj = model_.rootTag(\n') + rootObj.exportLiteral(sys.stdout, 0, name_=rootTag) + sys.stdout.write(')\n') + return rootObj + + +def main(): + args = sys.argv[1:] + if len(args) == 1: + parse(args[0]) + else: + usage() + + +if __name__ == '__main__': + #import pdb; pdb.set_trace() + main() + + +__all__ = [ + "Address", + "ClientDetail", + "Localization", + "Notification", + "NotificationParameter", + "PostalCodeInquiryReply", + "PostalCodeInquiryRequest", + "PostalCodeServiceAreaDescription", + "ServiceAvailabilityOption", + "ServiceAvailabilityReply", + "ServiceAvailabilityRequest", + "TransactionDetail", + "VersionId", + "WebAuthenticationCredential", + "WebAuthenticationDetail" + ] diff --git a/webxml/fedex/pickup.py b/webxml/fedex/pickup.py new file mode 100644 index 0000000..2ba9575 --- /dev/null +++ b/webxml/fedex/pickup.py @@ -0,0 +1,10061 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# +# Generated Mon Nov 28 15:43:24 2011 by generateDS.py version 2.6a. +# + +import sys +import getopt +import re as re_ + +etree_ = None +Verbose_import_ = False +( XMLParser_import_none, XMLParser_import_lxml, + XMLParser_import_elementtree + ) = range(3) +XMLParser_import_library = None +try: + # lxml + from lxml import etree as etree_ + XMLParser_import_library = XMLParser_import_lxml + if Verbose_import_: + print("running with lxml.etree") +except ImportError: + try: + # cElementTree from Python 2.5+ + import xml.etree.cElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with cElementTree on Python 2.5+") + except ImportError: + try: + # ElementTree from Python 2.5+ + import xml.etree.ElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with ElementTree on Python 2.5+") + except ImportError: + try: + # normal cElementTree install + import cElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with cElementTree") + except ImportError: + try: + # normal ElementTree install + import elementtree.ElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with ElementTree") + except ImportError: + raise ImportError("Failed to import ElementTree from any known place") + +def parsexml_(*args, **kwargs): + if (XMLParser_import_library == XMLParser_import_lxml and + 'parser' not in kwargs): + # Use the lxml ElementTree compatible parser so that, e.g., + # we ignore comments. + kwargs['parser'] = etree_.ETCompatXMLParser() + doc = etree_.parse(*args, **kwargs) + return doc + +# +# User methods +# +# Calls to the methods in these classes are generated by generateDS.py. +# You can replace these methods by re-implementing the following class +# in a module named generatedssuper.py. + +try: + from generatedssuper import GeneratedsSuper +except ImportError, exp: + + class GeneratedsSuper(object): + def gds_format_string(self, input_data, input_name=''): + return input_data + def gds_validate_string(self, input_data, node, input_name=''): + return input_data + def gds_format_integer(self, input_data, input_name=''): + return '%d' % input_data + def gds_validate_integer(self, input_data, node, input_name=''): + return input_data + def gds_format_integer_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_integer_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + try: + fvalue = float(value) + except (TypeError, ValueError), exp: + raise_parse_error(node, 'Requires sequence of integers') + return input_data + def gds_format_float(self, input_data, input_name=''): + return '%f' % input_data + def gds_validate_float(self, input_data, node, input_name=''): + return input_data + def gds_format_float_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_float_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + try: + fvalue = float(value) + except (TypeError, ValueError), exp: + raise_parse_error(node, 'Requires sequence of floats') + return input_data + def gds_format_double(self, input_data, input_name=''): + return '%e' % input_data + def gds_validate_double(self, input_data, node, input_name=''): + return input_data + def gds_format_double_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_double_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + try: + fvalue = float(value) + except (TypeError, ValueError), exp: + raise_parse_error(node, 'Requires sequence of doubles') + return input_data + def gds_format_boolean(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_boolean(self, input_data, node, input_name=''): + return input_data + def gds_format_boolean_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_boolean_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + if value not in ('true', '1', 'false', '0', ): + raise_parse_error(node, 'Requires sequence of booleans ("true", "1", "false", "0")') + return input_data + def gds_str_lower(self, instring): + return instring.lower() + def get_path_(self, node): + path_list = [] + self.get_path_list_(node, path_list) + path_list.reverse() + path = '/'.join(path_list) + return path + Tag_strip_pattern_ = re_.compile(r'\{.*\}') + def get_path_list_(self, node, path_list): + if node is None: + return + tag = GeneratedsSuper.Tag_strip_pattern_.sub('', node.tag) + if tag: + path_list.append(tag) + self.get_path_list_(node.getparent(), path_list) + def get_class_obj_(self, node, default_class=None): + class_obj1 = default_class + if 'xsi' in node.nsmap: + classname = node.get('{%s}type' % node.nsmap['xsi']) + if classname is not None: + names = classname.split(':') + if len(names) == 2: + classname = names[1] + class_obj2 = globals().get(classname) + if class_obj2 is not None: + class_obj1 = class_obj2 + return class_obj1 + + +# +# If you have installed IPython you can uncomment and use the following. +# IPython is available from http://ipython.scipy.org/. +# + +## from IPython.Shell import IPShellEmbed +## args = '' +## ipshell = IPShellEmbed(args, +## banner = 'Dropping into IPython', +## exit_msg = 'Leaving Interpreter, back to program.') + +# Then use the following line where and when you want to drop into the +# IPython shell: +# ipshell(' -- Entering ipshell.\nHit Ctrl-D to exit') + +# +# Globals +# + +ExternalEncoding = 'ascii' +Tag_pattern_ = re_.compile(r'({.*})?(.*)') +String_cleanup_pat_ = re_.compile(r"[\n\r\s]+") +Namespace_extract_pat_ = re_.compile(r'{(.*)}(.*)') + +# +# Support/utility functions. +# + +def showIndent(outfile, level): + for idx in range(level): + outfile.write(' ') + +def quote_xml(inStr): + if not inStr: + return '' + s1 = (isinstance(inStr, basestring) and inStr or + '%s' % inStr) + s1 = s1.replace('&', '&') + s1 = s1.replace('<', '<') + s1 = s1.replace('>', '>') + return s1 + +def quote_attrib(inStr): + s1 = (isinstance(inStr, basestring) and inStr or + '%s' % inStr) + s1 = s1.replace('&', '&') + s1 = s1.replace('<', '<') + s1 = s1.replace('>', '>') + if '"' in s1: + if "'" in s1: + s1 = '"%s"' % s1.replace('"', """) + else: + s1 = "'%s'" % s1 + else: + s1 = '"%s"' % s1 + return s1 + +def quote_python(inStr): + s1 = inStr + if s1.find("'") == -1: + if s1.find('\n') == -1: + return "'%s'" % s1 + else: + return "'''%s'''" % s1 + else: + if s1.find('"') != -1: + s1 = s1.replace('"', '\\"') + if s1.find('\n') == -1: + return '"%s"' % s1 + else: + return '"""%s"""' % s1 + +def get_all_text_(node): + if node.text is not None: + text = node.text + else: + text = '' + for child in node: + if child.tail is not None: + text += child.tail + return text + +def find_attr_value_(attr_name, node): + attrs = node.attrib + attr_parts = attr_name.split(':') + value = None + if len(attr_parts) == 1: + value = attrs.get(attr_name) + elif len(attr_parts) == 2: + prefix, name = attr_parts + namespace = node.nsmap.get(prefix) + if namespace is not None: + value = attrs.get('{%s}%s' % (namespace, name, )) + return value + + +class GDSParseError(Exception): + pass + +def raise_parse_error(node, msg): + if XMLParser_import_library == XMLParser_import_lxml: + msg = '%s (element %s/line %d)' % (msg, node.tag, node.sourceline, ) + else: + msg = '%s (element %s)' % (msg, node.tag, ) + raise GDSParseError(msg) + + +class MixedContainer: + # Constants for category: + CategoryNone = 0 + CategoryText = 1 + CategorySimple = 2 + CategoryComplex = 3 + # Constants for content_type: + TypeNone = 0 + TypeText = 1 + TypeString = 2 + TypeInteger = 3 + TypeFloat = 4 + TypeDecimal = 5 + TypeDouble = 6 + TypeBoolean = 7 + def __init__(self, category, content_type, name, value): + self.category = category + self.content_type = content_type + self.name = name + self.value = value + def getCategory(self): + return self.category + def getContenttype(self, content_type): + return self.content_type + def getValue(self): + return self.value + def getName(self): + return self.name + def export(self, outfile, level, name, namespace): + if self.category == MixedContainer.CategoryText: + # Prevent exporting empty content as empty lines. + if self.value.strip(): + outfile.write(self.value) + elif self.category == MixedContainer.CategorySimple: + self.exportSimple(outfile, level, name) + else: # category == MixedContainer.CategoryComplex + self.value.export(outfile, level, namespace,name) + def exportSimple(self, outfile, level, name): + if self.content_type == MixedContainer.TypeString: + outfile.write('<%s>%s' % (self.name, self.value, self.name)) + elif self.content_type == MixedContainer.TypeInteger or \ + self.content_type == MixedContainer.TypeBoolean: + outfile.write('<%s>%d' % (self.name, self.value, self.name)) + elif self.content_type == MixedContainer.TypeFloat or \ + self.content_type == MixedContainer.TypeDecimal: + outfile.write('<%s>%f' % (self.name, self.value, self.name)) + elif self.content_type == MixedContainer.TypeDouble: + outfile.write('<%s>%g' % (self.name, self.value, self.name)) + def exportLiteral(self, outfile, level, name): + if self.category == MixedContainer.CategoryText: + showIndent(outfile, level) + outfile.write('model_.MixedContainer(%d, %d, "%s", "%s"),\n' % \ + (self.category, self.content_type, self.name, self.value)) + elif self.category == MixedContainer.CategorySimple: + showIndent(outfile, level) + outfile.write('model_.MixedContainer(%d, %d, "%s", "%s"),\n' % \ + (self.category, self.content_type, self.name, self.value)) + else: # category == MixedContainer.CategoryComplex + showIndent(outfile, level) + outfile.write('model_.MixedContainer(%d, %d, "%s",\n' % \ + (self.category, self.content_type, self.name,)) + self.value.exportLiteral(outfile, level + 1) + showIndent(outfile, level) + outfile.write(')\n') + + +class MemberSpec_(object): + def __init__(self, name='', data_type='', container=0): + self.name = name + self.data_type = data_type + self.container = container + def set_name(self, name): self.name = name + def get_name(self): return self.name + def set_data_type(self, data_type): self.data_type = data_type + def get_data_type_chain(self): return self.data_type + def get_data_type(self): + if isinstance(self.data_type, list): + if len(self.data_type) > 0: + return self.data_type[-1] + else: + return 'xs:string' + else: + return self.data_type + def set_container(self, container): self.container = container + def get_container(self): return self.container + +def _cast(typ, value): + if typ is None or value is None: + return value + return typ(value) + +# +# Data representation classes. +# + +class Address(GeneratedsSuper): + """Descriptive data for a physical location. May be used as an actual + physical address (place to which one could go), or as a + container of "address parts" which should be handled as a unit + (such as a city-state-ZIP combination within the US).""" + subclass = None + superclass = None + def __init__(self, StreetLines=None, City=None, StateOrProvinceCode=None, PostalCode=None, UrbanizationCode=None, CountryCode=None, Residential=None): + if StreetLines is None: + self.StreetLines = [] + else: + self.StreetLines = StreetLines + self.City = City + self.StateOrProvinceCode = StateOrProvinceCode + self.PostalCode = PostalCode + self.UrbanizationCode = UrbanizationCode + self.CountryCode = CountryCode + self.Residential = Residential + def factory(*args_, **kwargs_): + if Address.subclass: + return Address.subclass(*args_, **kwargs_) + else: + return Address(*args_, **kwargs_) + factory = staticmethod(factory) + def get_StreetLines(self): return self.StreetLines + def set_StreetLines(self, StreetLines): self.StreetLines = StreetLines + def add_StreetLines(self, value): self.StreetLines.append(value) + def insert_StreetLines(self, index, value): self.StreetLines[index] = value + def get_City(self): return self.City + def set_City(self, City): self.City = City + def get_StateOrProvinceCode(self): return self.StateOrProvinceCode + def set_StateOrProvinceCode(self, StateOrProvinceCode): self.StateOrProvinceCode = StateOrProvinceCode + def get_PostalCode(self): return self.PostalCode + def set_PostalCode(self, PostalCode): self.PostalCode = PostalCode + def get_UrbanizationCode(self): return self.UrbanizationCode + def set_UrbanizationCode(self, UrbanizationCode): self.UrbanizationCode = UrbanizationCode + def get_CountryCode(self): return self.CountryCode + def set_CountryCode(self, CountryCode): self.CountryCode = CountryCode + def get_Residential(self): return self.Residential + def set_Residential(self, Residential): self.Residential = Residential + def export(self, outfile, level, namespace_='ns:', name_='Address', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Address') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Address'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Address', fromsubclass_=False): + for StreetLines_ in self.StreetLines: + showIndent(outfile, level) + outfile.write('<%sStreetLines>%s\n' % (namespace_, self.gds_format_string(quote_xml(StreetLines_).encode(ExternalEncoding), input_name='StreetLines'), namespace_)) + if self.City is not None: + showIndent(outfile, level) + outfile.write('<%sCity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.City).encode(ExternalEncoding), input_name='City'), namespace_)) + if self.StateOrProvinceCode is not None: + showIndent(outfile, level) + outfile.write('<%sStateOrProvinceCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.StateOrProvinceCode).encode(ExternalEncoding), input_name='StateOrProvinceCode'), namespace_)) + if self.PostalCode is not None: + showIndent(outfile, level) + outfile.write('<%sPostalCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PostalCode).encode(ExternalEncoding), input_name='PostalCode'), namespace_)) + if self.UrbanizationCode is not None: + showIndent(outfile, level) + outfile.write('<%sUrbanizationCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.UrbanizationCode).encode(ExternalEncoding), input_name='UrbanizationCode'), namespace_)) + if self.CountryCode is not None: + showIndent(outfile, level) + outfile.write('<%sCountryCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CountryCode).encode(ExternalEncoding), input_name='CountryCode'), namespace_)) + if self.Residential is not None: + showIndent(outfile, level) + outfile.write('<%sResidential>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.Residential)), input_name='Residential'), namespace_)) + def hasContent_(self): + if ( + self.StreetLines or + self.City is not None or + self.StateOrProvinceCode is not None or + self.PostalCode is not None or + self.UrbanizationCode is not None or + self.CountryCode is not None or + self.Residential is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Address'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('StreetLines=[\n') + level += 1 + for StreetLines_ in self.StreetLines: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(StreetLines_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.City is not None: + showIndent(outfile, level) + outfile.write('City=%s,\n' % quote_python(self.City).encode(ExternalEncoding)) + if self.StateOrProvinceCode is not None: + showIndent(outfile, level) + outfile.write('StateOrProvinceCode=%s,\n' % quote_python(self.StateOrProvinceCode).encode(ExternalEncoding)) + if self.PostalCode is not None: + showIndent(outfile, level) + outfile.write('PostalCode=%s,\n' % quote_python(self.PostalCode).encode(ExternalEncoding)) + if self.UrbanizationCode is not None: + showIndent(outfile, level) + outfile.write('UrbanizationCode=%s,\n' % quote_python(self.UrbanizationCode).encode(ExternalEncoding)) + if self.CountryCode is not None: + showIndent(outfile, level) + outfile.write('CountryCode=%s,\n' % quote_python(self.CountryCode).encode(ExternalEncoding)) + if self.Residential is not None: + showIndent(outfile, level) + outfile.write('Residential=%s,\n' % self.Residential) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'StreetLines': + StreetLines_ = child_.text + StreetLines_ = self.gds_validate_string(StreetLines_, node, 'StreetLines') + self.StreetLines.append(StreetLines_) + elif nodeName_ == 'City': + City_ = child_.text + City_ = self.gds_validate_string(City_, node, 'City') + self.City = City_ + elif nodeName_ == 'StateOrProvinceCode': + StateOrProvinceCode_ = child_.text + StateOrProvinceCode_ = self.gds_validate_string(StateOrProvinceCode_, node, 'StateOrProvinceCode') + self.StateOrProvinceCode = StateOrProvinceCode_ + elif nodeName_ == 'PostalCode': + PostalCode_ = child_.text + PostalCode_ = self.gds_validate_string(PostalCode_, node, 'PostalCode') + self.PostalCode = PostalCode_ + elif nodeName_ == 'UrbanizationCode': + UrbanizationCode_ = child_.text + UrbanizationCode_ = self.gds_validate_string(UrbanizationCode_, node, 'UrbanizationCode') + self.UrbanizationCode = UrbanizationCode_ + elif nodeName_ == 'CountryCode': + CountryCode_ = child_.text + CountryCode_ = self.gds_validate_string(CountryCode_, node, 'CountryCode') + self.CountryCode = CountryCode_ + elif nodeName_ == 'Residential': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'Residential') + self.Residential = ival_ +# end class Address + + +class AssociatedAccount(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Type=None, AccountNumber=None): + self.Type = Type + self.AccountNumber = AccountNumber + def factory(*args_, **kwargs_): + if AssociatedAccount.subclass: + return AssociatedAccount.subclass(*args_, **kwargs_) + else: + return AssociatedAccount(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Type(self): return self.Type + def set_Type(self, Type): self.Type = Type + def validate_AssociatedAccountNumberType(self, value): + # Validate type AssociatedAccountNumberType, a restriction on xs:string. + pass + def get_AccountNumber(self): return self.AccountNumber + def set_AccountNumber(self, AccountNumber): self.AccountNumber = AccountNumber + def export(self, outfile, level, namespace_='ns:', name_='AssociatedAccount', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='AssociatedAccount') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='AssociatedAccount'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='AssociatedAccount', fromsubclass_=False): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('<%sType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Type).encode(ExternalEncoding), input_name='Type'), namespace_)) + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('<%sAccountNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AccountNumber).encode(ExternalEncoding), input_name='AccountNumber'), namespace_)) + def hasContent_(self): + if ( + self.Type is not None or + self.AccountNumber is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='AssociatedAccount'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('Type=%s,\n' % quote_python(self.Type).encode(ExternalEncoding)) + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('AccountNumber=%s,\n' % quote_python(self.AccountNumber).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Type': + Type_ = child_.text + Type_ = self.gds_validate_string(Type_, node, 'Type') + self.Type = Type_ + self.validate_AssociatedAccountNumberType(self.Type) # validate type AssociatedAccountNumberType + elif nodeName_ == 'AccountNumber': + AccountNumber_ = child_.text + AccountNumber_ = self.gds_validate_string(AccountNumber_, node, 'AccountNumber') + self.AccountNumber = AccountNumber_ +# end class AssociatedAccount + + +class CancelPickupReply(GeneratedsSuper): + """The descriptive data returned to a client in response to a cancel + dispatch request.""" + subclass = None + superclass = None + def __init__(self, HighestSeverity=None, Notifications=None, TransactionDetail=None, Version=None, Message=None): + self.HighestSeverity = HighestSeverity + if Notifications is None: + self.Notifications = [] + else: + self.Notifications = Notifications + self.TransactionDetail = TransactionDetail + self.Version = Version + self.Message = Message + def factory(*args_, **kwargs_): + if CancelPickupReply.subclass: + return CancelPickupReply.subclass(*args_, **kwargs_) + else: + return CancelPickupReply(*args_, **kwargs_) + factory = staticmethod(factory) + def get_HighestSeverity(self): return self.HighestSeverity + def set_HighestSeverity(self, HighestSeverity): self.HighestSeverity = HighestSeverity + def validate_NotificationSeverityType(self, value): + # Validate type NotificationSeverityType, a restriction on xs:string. + pass + def get_Notifications(self): return self.Notifications + def set_Notifications(self, Notifications): self.Notifications = Notifications + def add_Notifications(self, value): self.Notifications.append(value) + def insert_Notifications(self, index, value): self.Notifications[index] = value + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_Message(self): return self.Message + def set_Message(self, Message): self.Message = Message + def export(self, outfile, level, namespace_='ns:', name_='CancelPickupReply', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CancelPickupReply') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CancelPickupReply'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CancelPickupReply', fromsubclass_=False): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('<%sHighestSeverity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HighestSeverity).encode(ExternalEncoding), input_name='HighestSeverity'), namespace_)) + for Notifications_ in self.Notifications: + Notifications_.export(outfile, level, namespace_, name_='Notifications') + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.Message is not None: + showIndent(outfile, level) + outfile.write('<%sMessage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Message).encode(ExternalEncoding), input_name='Message'), namespace_)) + def hasContent_(self): + if ( + self.HighestSeverity is not None or + self.Notifications or + self.TransactionDetail is not None or + self.Version is not None or + self.Message is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CancelPickupReply'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('HighestSeverity=%s,\n' % quote_python(self.HighestSeverity).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Notifications=[\n') + level += 1 + for Notifications_ in self.Notifications: + showIndent(outfile, level) + outfile.write('model_.Notification(\n') + Notifications_.exportLiteral(outfile, level, name_='Notification') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.Message is not None: + showIndent(outfile, level) + outfile.write('Message=%s,\n' % quote_python(self.Message).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'HighestSeverity': + HighestSeverity_ = child_.text + HighestSeverity_ = self.gds_validate_string(HighestSeverity_, node, 'HighestSeverity') + self.HighestSeverity = HighestSeverity_ + self.validate_NotificationSeverityType(self.HighestSeverity) # validate type NotificationSeverityType + elif nodeName_ == 'Notifications': + obj_ = Notification.factory() + obj_.build(child_) + self.Notifications.append(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'Message': + Message_ = child_.text + Message_ = self.gds_validate_string(Message_, node, 'Message') + self.Message = Message_ +# end class CancelPickupReply + + +class CancelPickupRequest(GeneratedsSuper): + """The descriptive data to cancel a shipment pickup request.""" + subclass = None + superclass = None + def __init__(self, WebAuthenticationDetail=None, ClientDetail=None, TransactionDetail=None, Version=None, CarrierCode=None, PickupConfirmationNumber=None, ScheduledDate=None, EndDate=None, Location=None, Remarks=None, ShippingChargesPayment=None, Reason=None, ContactName=None, PhoneNumber=None, PhoneExtension=None): + self.WebAuthenticationDetail = WebAuthenticationDetail + self.ClientDetail = ClientDetail + self.TransactionDetail = TransactionDetail + self.Version = Version + self.CarrierCode = CarrierCode + self.PickupConfirmationNumber = PickupConfirmationNumber + self.ScheduledDate = ScheduledDate + self.EndDate = EndDate + self.Location = Location + self.Remarks = Remarks + self.ShippingChargesPayment = ShippingChargesPayment + self.Reason = Reason + self.ContactName = ContactName + self.PhoneNumber = PhoneNumber + self.PhoneExtension = PhoneExtension + def factory(*args_, **kwargs_): + if CancelPickupRequest.subclass: + return CancelPickupRequest.subclass(*args_, **kwargs_) + else: + return CancelPickupRequest(*args_, **kwargs_) + factory = staticmethod(factory) + def get_WebAuthenticationDetail(self): return self.WebAuthenticationDetail + def set_WebAuthenticationDetail(self, WebAuthenticationDetail): self.WebAuthenticationDetail = WebAuthenticationDetail + def get_ClientDetail(self): return self.ClientDetail + def set_ClientDetail(self, ClientDetail): self.ClientDetail = ClientDetail + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_CarrierCode(self): return self.CarrierCode + def set_CarrierCode(self, CarrierCode): self.CarrierCode = CarrierCode + def validate_CarrierCodeType(self, value): + # Validate type CarrierCodeType, a restriction on xs:string. + pass + def get_PickupConfirmationNumber(self): return self.PickupConfirmationNumber + def set_PickupConfirmationNumber(self, PickupConfirmationNumber): self.PickupConfirmationNumber = PickupConfirmationNumber + def get_ScheduledDate(self): return self.ScheduledDate + def set_ScheduledDate(self, ScheduledDate): self.ScheduledDate = ScheduledDate + def get_EndDate(self): return self.EndDate + def set_EndDate(self, EndDate): self.EndDate = EndDate + def get_Location(self): return self.Location + def set_Location(self, Location): self.Location = Location + def get_Remarks(self): return self.Remarks + def set_Remarks(self, Remarks): self.Remarks = Remarks + def get_ShippingChargesPayment(self): return self.ShippingChargesPayment + def set_ShippingChargesPayment(self, ShippingChargesPayment): self.ShippingChargesPayment = ShippingChargesPayment + def get_Reason(self): return self.Reason + def set_Reason(self, Reason): self.Reason = Reason + def get_ContactName(self): return self.ContactName + def set_ContactName(self, ContactName): self.ContactName = ContactName + def get_PhoneNumber(self): return self.PhoneNumber + def set_PhoneNumber(self, PhoneNumber): self.PhoneNumber = PhoneNumber + def get_PhoneExtension(self): return self.PhoneExtension + def set_PhoneExtension(self, PhoneExtension): self.PhoneExtension = PhoneExtension + def export(self, outfile, level, namespace_='ns:', name_='CancelPickupRequest', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CancelPickupRequest') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CancelPickupRequest'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CancelPickupRequest', fromsubclass_=False): + if self.WebAuthenticationDetail: + self.WebAuthenticationDetail.export(outfile, level, namespace_, name_='WebAuthenticationDetail', ) + if self.ClientDetail: + self.ClientDetail.export(outfile, level, namespace_, name_='ClientDetail', ) + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.CarrierCode is not None: + showIndent(outfile, level) + outfile.write('<%sCarrierCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CarrierCode).encode(ExternalEncoding), input_name='CarrierCode'), namespace_)) + if self.PickupConfirmationNumber is not None: + showIndent(outfile, level) + outfile.write('<%sPickupConfirmationNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PickupConfirmationNumber).encode(ExternalEncoding), input_name='PickupConfirmationNumber'), namespace_)) + if self.ScheduledDate is not None: + showIndent(outfile, level) + outfile.write('<%sScheduledDate>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ScheduledDate).encode(ExternalEncoding), input_name='ScheduledDate'), namespace_)) + if self.EndDate is not None: + showIndent(outfile, level) + outfile.write('<%sEndDate>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.EndDate).encode(ExternalEncoding), input_name='EndDate'), namespace_)) + if self.Location is not None: + showIndent(outfile, level) + outfile.write('<%sLocation>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Location).encode(ExternalEncoding), input_name='Location'), namespace_)) + if self.Remarks is not None: + showIndent(outfile, level) + outfile.write('<%sRemarks>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Remarks).encode(ExternalEncoding), input_name='Remarks'), namespace_)) + if self.ShippingChargesPayment: + self.ShippingChargesPayment.export(outfile, level, namespace_, name_='ShippingChargesPayment') + if self.Reason is not None: + showIndent(outfile, level) + outfile.write('<%sReason>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Reason).encode(ExternalEncoding), input_name='Reason'), namespace_)) + if self.ContactName is not None: + showIndent(outfile, level) + outfile.write('<%sContactName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ContactName).encode(ExternalEncoding), input_name='ContactName'), namespace_)) + if self.PhoneNumber is not None: + showIndent(outfile, level) + outfile.write('<%sPhoneNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PhoneNumber).encode(ExternalEncoding), input_name='PhoneNumber'), namespace_)) + if self.PhoneExtension is not None: + showIndent(outfile, level) + outfile.write('<%sPhoneExtension>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PhoneExtension).encode(ExternalEncoding), input_name='PhoneExtension'), namespace_)) + def hasContent_(self): + if ( + self.WebAuthenticationDetail is not None or + self.ClientDetail is not None or + self.TransactionDetail is not None or + self.Version is not None or + self.CarrierCode is not None or + self.PickupConfirmationNumber is not None or + self.ScheduledDate is not None or + self.EndDate is not None or + self.Location is not None or + self.Remarks is not None or + self.ShippingChargesPayment is not None or + self.Reason is not None or + self.ContactName is not None or + self.PhoneNumber is not None or + self.PhoneExtension is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CancelPickupRequest'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.WebAuthenticationDetail is not None: + showIndent(outfile, level) + outfile.write('WebAuthenticationDetail=model_.WebAuthenticationDetail(\n') + self.WebAuthenticationDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ClientDetail is not None: + showIndent(outfile, level) + outfile.write('ClientDetail=model_.ClientDetail(\n') + self.ClientDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.CarrierCode is not None: + showIndent(outfile, level) + outfile.write('CarrierCode=%s,\n' % quote_python(self.CarrierCode).encode(ExternalEncoding)) + if self.PickupConfirmationNumber is not None: + showIndent(outfile, level) + outfile.write('PickupConfirmationNumber=%s,\n' % quote_python(self.PickupConfirmationNumber).encode(ExternalEncoding)) + if self.ScheduledDate is not None: + showIndent(outfile, level) + outfile.write('ScheduledDate=%s,\n' % quote_python(self.ScheduledDate).encode(ExternalEncoding)) + if self.EndDate is not None: + showIndent(outfile, level) + outfile.write('EndDate=%s,\n' % quote_python(self.EndDate).encode(ExternalEncoding)) + if self.Location is not None: + showIndent(outfile, level) + outfile.write('Location=%s,\n' % quote_python(self.Location).encode(ExternalEncoding)) + if self.Remarks is not None: + showIndent(outfile, level) + outfile.write('Remarks=%s,\n' % quote_python(self.Remarks).encode(ExternalEncoding)) + if self.ShippingChargesPayment is not None: + showIndent(outfile, level) + outfile.write('ShippingChargesPayment=model_.Payment(\n') + self.ShippingChargesPayment.exportLiteral(outfile, level, name_='ShippingChargesPayment') + showIndent(outfile, level) + outfile.write('),\n') + if self.Reason is not None: + showIndent(outfile, level) + outfile.write('Reason=%s,\n' % quote_python(self.Reason).encode(ExternalEncoding)) + if self.ContactName is not None: + showIndent(outfile, level) + outfile.write('ContactName=%s,\n' % quote_python(self.ContactName).encode(ExternalEncoding)) + if self.PhoneNumber is not None: + showIndent(outfile, level) + outfile.write('PhoneNumber=%s,\n' % quote_python(self.PhoneNumber).encode(ExternalEncoding)) + if self.PhoneExtension is not None: + showIndent(outfile, level) + outfile.write('PhoneExtension=%s,\n' % quote_python(self.PhoneExtension).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'WebAuthenticationDetail': + obj_ = WebAuthenticationDetail.factory() + obj_.build(child_) + self.set_WebAuthenticationDetail(obj_) + elif nodeName_ == 'ClientDetail': + obj_ = ClientDetail.factory() + obj_.build(child_) + self.set_ClientDetail(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'CarrierCode': + CarrierCode_ = child_.text + CarrierCode_ = self.gds_validate_string(CarrierCode_, node, 'CarrierCode') + self.CarrierCode = CarrierCode_ + self.validate_CarrierCodeType(self.CarrierCode) # validate type CarrierCodeType + elif nodeName_ == 'PickupConfirmationNumber': + PickupConfirmationNumber_ = child_.text + PickupConfirmationNumber_ = self.gds_validate_string(PickupConfirmationNumber_, node, 'PickupConfirmationNumber') + self.PickupConfirmationNumber = PickupConfirmationNumber_ + elif nodeName_ == 'ScheduledDate': + ScheduledDate_ = child_.text + ScheduledDate_ = self.gds_validate_string(ScheduledDate_, node, 'ScheduledDate') + self.ScheduledDate = ScheduledDate_ + elif nodeName_ == 'EndDate': + EndDate_ = child_.text + EndDate_ = self.gds_validate_string(EndDate_, node, 'EndDate') + self.EndDate = EndDate_ + elif nodeName_ == 'Location': + Location_ = child_.text + Location_ = self.gds_validate_string(Location_, node, 'Location') + self.Location = Location_ + elif nodeName_ == 'Remarks': + Remarks_ = child_.text + Remarks_ = self.gds_validate_string(Remarks_, node, 'Remarks') + self.Remarks = Remarks_ + elif nodeName_ == 'ShippingChargesPayment': + obj_ = Payment.factory() + obj_.build(child_) + self.set_ShippingChargesPayment(obj_) + elif nodeName_ == 'Reason': + Reason_ = child_.text + Reason_ = self.gds_validate_string(Reason_, node, 'Reason') + self.Reason = Reason_ + elif nodeName_ == 'ContactName': + ContactName_ = child_.text + ContactName_ = self.gds_validate_string(ContactName_, node, 'ContactName') + self.ContactName = ContactName_ + elif nodeName_ == 'PhoneNumber': + PhoneNumber_ = child_.text + PhoneNumber_ = self.gds_validate_string(PhoneNumber_, node, 'PhoneNumber') + self.PhoneNumber = PhoneNumber_ + elif nodeName_ == 'PhoneExtension': + PhoneExtension_ = child_.text + PhoneExtension_ = self.gds_validate_string(PhoneExtension_, node, 'PhoneExtension') + self.PhoneExtension = PhoneExtension_ +# end class CancelPickupRequest + + +class ClientDetail(GeneratedsSuper): + """Descriptive data for the client submitting a transaction.""" + subclass = None + superclass = None + def __init__(self, AccountNumber=None, MeterNumber=None, MeterInstance=None, IntegratorId=None, Region=None, Localization=None): + self.AccountNumber = AccountNumber + self.MeterNumber = MeterNumber + self.MeterInstance = MeterInstance + self.IntegratorId = IntegratorId + self.Region = Region + self.Localization = Localization + def factory(*args_, **kwargs_): + if ClientDetail.subclass: + return ClientDetail.subclass(*args_, **kwargs_) + else: + return ClientDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_AccountNumber(self): return self.AccountNumber + def set_AccountNumber(self, AccountNumber): self.AccountNumber = AccountNumber + def get_MeterNumber(self): return self.MeterNumber + def set_MeterNumber(self, MeterNumber): self.MeterNumber = MeterNumber + def get_MeterInstance(self): return self.MeterInstance + def set_MeterInstance(self, MeterInstance): self.MeterInstance = MeterInstance + def get_IntegratorId(self): return self.IntegratorId + def set_IntegratorId(self, IntegratorId): self.IntegratorId = IntegratorId + def get_Region(self): return self.Region + def set_Region(self, Region): self.Region = Region + def validate_ExpressRegionCode(self, value): + # Validate type ExpressRegionCode, a restriction on xs:string. + pass + def get_Localization(self): return self.Localization + def set_Localization(self, Localization): self.Localization = Localization + def export(self, outfile, level, namespace_='ns:', name_='ClientDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ClientDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ClientDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ClientDetail', fromsubclass_=False): + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('<%sAccountNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AccountNumber).encode(ExternalEncoding), input_name='AccountNumber'), namespace_)) + if self.MeterNumber is not None: + showIndent(outfile, level) + outfile.write('<%sMeterNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.MeterNumber).encode(ExternalEncoding), input_name='MeterNumber'), namespace_)) + if self.MeterInstance is not None: + showIndent(outfile, level) + outfile.write('<%sMeterInstance>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.MeterInstance).encode(ExternalEncoding), input_name='MeterInstance'), namespace_)) + if self.IntegratorId is not None: + showIndent(outfile, level) + outfile.write('<%sIntegratorId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.IntegratorId).encode(ExternalEncoding), input_name='IntegratorId'), namespace_)) + if self.Region is not None: + showIndent(outfile, level) + outfile.write('<%sRegion>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Region).encode(ExternalEncoding), input_name='Region'), namespace_)) + if self.Localization: + self.Localization.export(outfile, level, namespace_, name_='Localization') + def hasContent_(self): + if ( + self.AccountNumber is not None or + self.MeterNumber is not None or + self.MeterInstance is not None or + self.IntegratorId is not None or + self.Region is not None or + self.Localization is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ClientDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('AccountNumber=%s,\n' % quote_python(self.AccountNumber).encode(ExternalEncoding)) + if self.MeterNumber is not None: + showIndent(outfile, level) + outfile.write('MeterNumber=%s,\n' % quote_python(self.MeterNumber).encode(ExternalEncoding)) + if self.MeterInstance is not None: + showIndent(outfile, level) + outfile.write('MeterInstance=%s,\n' % quote_python(self.MeterInstance).encode(ExternalEncoding)) + if self.IntegratorId is not None: + showIndent(outfile, level) + outfile.write('IntegratorId=%s,\n' % quote_python(self.IntegratorId).encode(ExternalEncoding)) + if self.Region is not None: + showIndent(outfile, level) + outfile.write('Region=%s,\n' % quote_python(self.Region).encode(ExternalEncoding)) + if self.Localization is not None: + showIndent(outfile, level) + outfile.write('Localization=model_.Localization(\n') + self.Localization.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'AccountNumber': + AccountNumber_ = child_.text + AccountNumber_ = self.gds_validate_string(AccountNumber_, node, 'AccountNumber') + self.AccountNumber = AccountNumber_ + elif nodeName_ == 'MeterNumber': + MeterNumber_ = child_.text + MeterNumber_ = self.gds_validate_string(MeterNumber_, node, 'MeterNumber') + self.MeterNumber = MeterNumber_ + elif nodeName_ == 'MeterInstance': + MeterInstance_ = child_.text + MeterInstance_ = self.gds_validate_string(MeterInstance_, node, 'MeterInstance') + self.MeterInstance = MeterInstance_ + elif nodeName_ == 'IntegratorId': + IntegratorId_ = child_.text + IntegratorId_ = self.gds_validate_string(IntegratorId_, node, 'IntegratorId') + self.IntegratorId = IntegratorId_ + elif nodeName_ == 'Region': + Region_ = child_.text + Region_ = self.gds_validate_string(Region_, node, 'Region') + self.Region = Region_ + self.validate_ExpressRegionCode(self.Region) # validate type ExpressRegionCode + elif nodeName_ == 'Localization': + obj_ = Localization.factory() + obj_.build(child_) + self.set_Localization(obj_) +# end class ClientDetail + + +class CodAddTransportationChargesDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, RateTypeBasis=None, ChargeBasis=None, ChargeBasisLevel=None): + self.RateTypeBasis = RateTypeBasis + self.ChargeBasis = ChargeBasis + self.ChargeBasisLevel = ChargeBasisLevel + def factory(*args_, **kwargs_): + if CodAddTransportationChargesDetail.subclass: + return CodAddTransportationChargesDetail.subclass(*args_, **kwargs_) + else: + return CodAddTransportationChargesDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_RateTypeBasis(self): return self.RateTypeBasis + def set_RateTypeBasis(self, RateTypeBasis): self.RateTypeBasis = RateTypeBasis + def validate_RateTypeBasisType(self, value): + # Validate type RateTypeBasisType, a restriction on xs:string. + pass + def get_ChargeBasis(self): return self.ChargeBasis + def set_ChargeBasis(self, ChargeBasis): self.ChargeBasis = ChargeBasis + def validate_CodAddTransportationChargeBasisType(self, value): + # Validate type CodAddTransportationChargeBasisType, a restriction on xs:string. + pass + def get_ChargeBasisLevel(self): return self.ChargeBasisLevel + def set_ChargeBasisLevel(self, ChargeBasisLevel): self.ChargeBasisLevel = ChargeBasisLevel + def validate_ChargeBasisLevelType(self, value): + # Validate type ChargeBasisLevelType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='CodAddTransportationChargesDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CodAddTransportationChargesDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CodAddTransportationChargesDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CodAddTransportationChargesDetail', fromsubclass_=False): + if self.RateTypeBasis is not None: + showIndent(outfile, level) + outfile.write('<%sRateTypeBasis>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RateTypeBasis).encode(ExternalEncoding), input_name='RateTypeBasis'), namespace_)) + if self.ChargeBasis is not None: + showIndent(outfile, level) + outfile.write('<%sChargeBasis>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ChargeBasis).encode(ExternalEncoding), input_name='ChargeBasis'), namespace_)) + if self.ChargeBasisLevel is not None: + showIndent(outfile, level) + outfile.write('<%sChargeBasisLevel>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ChargeBasisLevel).encode(ExternalEncoding), input_name='ChargeBasisLevel'), namespace_)) + def hasContent_(self): + if ( + self.RateTypeBasis is not None or + self.ChargeBasis is not None or + self.ChargeBasisLevel is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CodAddTransportationChargesDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.RateTypeBasis is not None: + showIndent(outfile, level) + outfile.write('RateTypeBasis=%s,\n' % quote_python(self.RateTypeBasis).encode(ExternalEncoding)) + if self.ChargeBasis is not None: + showIndent(outfile, level) + outfile.write('ChargeBasis=%s,\n' % quote_python(self.ChargeBasis).encode(ExternalEncoding)) + if self.ChargeBasisLevel is not None: + showIndent(outfile, level) + outfile.write('ChargeBasisLevel=%s,\n' % quote_python(self.ChargeBasisLevel).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'RateTypeBasis': + RateTypeBasis_ = child_.text + RateTypeBasis_ = self.gds_validate_string(RateTypeBasis_, node, 'RateTypeBasis') + self.RateTypeBasis = RateTypeBasis_ + self.validate_RateTypeBasisType(self.RateTypeBasis) # validate type RateTypeBasisType + elif nodeName_ == 'ChargeBasis': + ChargeBasis_ = child_.text + ChargeBasis_ = self.gds_validate_string(ChargeBasis_, node, 'ChargeBasis') + self.ChargeBasis = ChargeBasis_ + self.validate_CodAddTransportationChargeBasisType(self.ChargeBasis) # validate type CodAddTransportationChargeBasisType + elif nodeName_ == 'ChargeBasisLevel': + ChargeBasisLevel_ = child_.text + ChargeBasisLevel_ = self.gds_validate_string(ChargeBasisLevel_, node, 'ChargeBasisLevel') + self.ChargeBasisLevel = ChargeBasisLevel_ + self.validate_ChargeBasisLevelType(self.ChargeBasisLevel) # validate type ChargeBasisLevelType +# end class CodAddTransportationChargesDetail + + +class CodDetail(GeneratedsSuper): + """Descriptive data required for a FedEx COD (Collect-On-Delivery) + shipment.""" + subclass = None + superclass = None + def __init__(self, CodCollectionAmount=None, AddTransportationChargesDetail=None, CollectionType=None, CodRecipient=None, ReferenceIndicator=None): + self.CodCollectionAmount = CodCollectionAmount + self.AddTransportationChargesDetail = AddTransportationChargesDetail + self.CollectionType = CollectionType + self.CodRecipient = CodRecipient + self.ReferenceIndicator = ReferenceIndicator + def factory(*args_, **kwargs_): + if CodDetail.subclass: + return CodDetail.subclass(*args_, **kwargs_) + else: + return CodDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_CodCollectionAmount(self): return self.CodCollectionAmount + def set_CodCollectionAmount(self, CodCollectionAmount): self.CodCollectionAmount = CodCollectionAmount + def get_AddTransportationChargesDetail(self): return self.AddTransportationChargesDetail + def set_AddTransportationChargesDetail(self, AddTransportationChargesDetail): self.AddTransportationChargesDetail = AddTransportationChargesDetail + def get_CollectionType(self): return self.CollectionType + def set_CollectionType(self, CollectionType): self.CollectionType = CollectionType + def validate_CodCollectionType(self, value): + # Validate type CodCollectionType, a restriction on xs:string. + pass + def get_CodRecipient(self): return self.CodRecipient + def set_CodRecipient(self, CodRecipient): self.CodRecipient = CodRecipient + def get_ReferenceIndicator(self): return self.ReferenceIndicator + def set_ReferenceIndicator(self, ReferenceIndicator): self.ReferenceIndicator = ReferenceIndicator + def validate_CodReturnReferenceIndicatorType(self, value): + # Validate type CodReturnReferenceIndicatorType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='CodDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CodDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CodDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CodDetail', fromsubclass_=False): + if self.CodCollectionAmount: + self.CodCollectionAmount.export(outfile, level, namespace_, name_='CodCollectionAmount') + if self.AddTransportationChargesDetail: + self.AddTransportationChargesDetail.export(outfile, level, namespace_, name_='AddTransportationChargesDetail') + if self.CollectionType is not None: + showIndent(outfile, level) + outfile.write('<%sCollectionType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CollectionType).encode(ExternalEncoding), input_name='CollectionType'), namespace_)) + if self.CodRecipient: + self.CodRecipient.export(outfile, level, namespace_, name_='CodRecipient') + if self.ReferenceIndicator is not None: + showIndent(outfile, level) + outfile.write('<%sReferenceIndicator>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ReferenceIndicator).encode(ExternalEncoding), input_name='ReferenceIndicator'), namespace_)) + def hasContent_(self): + if ( + self.CodCollectionAmount is not None or + self.AddTransportationChargesDetail is not None or + self.CollectionType is not None or + self.CodRecipient is not None or + self.ReferenceIndicator is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CodDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.CodCollectionAmount is not None: + showIndent(outfile, level) + outfile.write('CodCollectionAmount=model_.Money(\n') + self.CodCollectionAmount.exportLiteral(outfile, level, name_='CodCollectionAmount') + showIndent(outfile, level) + outfile.write('),\n') + if self.AddTransportationChargesDetail is not None: + showIndent(outfile, level) + outfile.write('AddTransportationChargesDetail=model_.CodAddTransportationChargesDetail(\n') + self.AddTransportationChargesDetail.exportLiteral(outfile, level, name_='AddTransportationChargesDetail') + showIndent(outfile, level) + outfile.write('),\n') + if self.CollectionType is not None: + showIndent(outfile, level) + outfile.write('CollectionType=%s,\n' % quote_python(self.CollectionType).encode(ExternalEncoding)) + if self.CodRecipient is not None: + showIndent(outfile, level) + outfile.write('CodRecipient=model_.Party(\n') + self.CodRecipient.exportLiteral(outfile, level, name_='CodRecipient') + showIndent(outfile, level) + outfile.write('),\n') + if self.ReferenceIndicator is not None: + showIndent(outfile, level) + outfile.write('ReferenceIndicator=%s,\n' % quote_python(self.ReferenceIndicator).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'CodCollectionAmount': + obj_ = Money.factory() + obj_.build(child_) + self.set_CodCollectionAmount(obj_) + elif nodeName_ == 'AddTransportationChargesDetail': + obj_ = CodAddTransportationChargesDetail.factory() + obj_.build(child_) + self.set_AddTransportationChargesDetail(obj_) + elif nodeName_ == 'CollectionType': + CollectionType_ = child_.text + CollectionType_ = self.gds_validate_string(CollectionType_, node, 'CollectionType') + self.CollectionType = CollectionType_ + self.validate_CodCollectionType(self.CollectionType) # validate type CodCollectionType + elif nodeName_ == 'CodRecipient': + obj_ = Party.factory() + obj_.build(child_) + self.set_CodRecipient(obj_) + elif nodeName_ == 'ReferenceIndicator': + ReferenceIndicator_ = child_.text + ReferenceIndicator_ = self.gds_validate_string(ReferenceIndicator_, node, 'ReferenceIndicator') + self.ReferenceIndicator = ReferenceIndicator_ + self.validate_CodReturnReferenceIndicatorType(self.ReferenceIndicator) # validate type CodReturnReferenceIndicatorType +# end class CodDetail + + +class CompletedFreightPickupDetail(GeneratedsSuper): + """Data resulting from the processing of an LTL Freight pickup request.""" + subclass = None + superclass = None + def __init__(self, Origin=None, LineItems=None, TotalPieces=None, TotalWeight=None, TotalHandlingUnits=None, Status=None): + self.Origin = Origin + if LineItems is None: + self.LineItems = [] + else: + self.LineItems = LineItems + self.TotalPieces = TotalPieces + self.TotalWeight = TotalWeight + self.TotalHandlingUnits = TotalHandlingUnits + self.Status = Status + def factory(*args_, **kwargs_): + if CompletedFreightPickupDetail.subclass: + return CompletedFreightPickupDetail.subclass(*args_, **kwargs_) + else: + return CompletedFreightPickupDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Origin(self): return self.Origin + def set_Origin(self, Origin): self.Origin = Origin + def get_LineItems(self): return self.LineItems + def set_LineItems(self, LineItems): self.LineItems = LineItems + def add_LineItems(self, value): self.LineItems.append(value) + def insert_LineItems(self, index, value): self.LineItems[index] = value + def get_TotalPieces(self): return self.TotalPieces + def set_TotalPieces(self, TotalPieces): self.TotalPieces = TotalPieces + def get_TotalWeight(self): return self.TotalWeight + def set_TotalWeight(self, TotalWeight): self.TotalWeight = TotalWeight + def get_TotalHandlingUnits(self): return self.TotalHandlingUnits + def set_TotalHandlingUnits(self, TotalHandlingUnits): self.TotalHandlingUnits = TotalHandlingUnits + def get_Status(self): return self.Status + def set_Status(self, Status): self.Status = Status + def validate_PickupEventType(self, value): + # Validate type PickupEventType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='CompletedFreightPickupDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CompletedFreightPickupDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CompletedFreightPickupDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CompletedFreightPickupDetail', fromsubclass_=False): + if self.Origin: + self.Origin.export(outfile, level, namespace_, name_='Origin') + for LineItems_ in self.LineItems: + LineItems_.export(outfile, level, namespace_, name_='LineItems') + if self.TotalPieces is not None: + showIndent(outfile, level) + outfile.write('<%sTotalPieces>%s\n' % (namespace_, self.gds_format_integer(self.TotalPieces, input_name='TotalPieces'), namespace_)) + if self.TotalWeight: + self.TotalWeight.export(outfile, level, namespace_, name_='TotalWeight') + if self.TotalHandlingUnits is not None: + showIndent(outfile, level) + outfile.write('<%sTotalHandlingUnits>%s\n' % (namespace_, self.gds_format_integer(self.TotalHandlingUnits, input_name='TotalHandlingUnits'), namespace_)) + if self.Status is not None: + showIndent(outfile, level) + outfile.write('<%sStatus>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Status).encode(ExternalEncoding), input_name='Status'), namespace_)) + def hasContent_(self): + if ( + self.Origin is not None or + self.LineItems or + self.TotalPieces is not None or + self.TotalWeight is not None or + self.TotalHandlingUnits is not None or + self.Status is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CompletedFreightPickupDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Origin is not None: + showIndent(outfile, level) + outfile.write('Origin=model_.FreightServiceCenterDetail(\n') + self.Origin.exportLiteral(outfile, level, name_='Origin') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('LineItems=[\n') + level += 1 + for LineItems_ in self.LineItems: + showIndent(outfile, level) + outfile.write('model_.CompletedFreightPickupLineItem(\n') + LineItems_.exportLiteral(outfile, level, name_='CompletedFreightPickupLineItem') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.TotalPieces is not None: + showIndent(outfile, level) + outfile.write('TotalPieces=%d,\n' % self.TotalPieces) + if self.TotalWeight is not None: + showIndent(outfile, level) + outfile.write('TotalWeight=model_.Weight(\n') + self.TotalWeight.exportLiteral(outfile, level, name_='TotalWeight') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalHandlingUnits is not None: + showIndent(outfile, level) + outfile.write('TotalHandlingUnits=%d,\n' % self.TotalHandlingUnits) + if self.Status is not None: + showIndent(outfile, level) + outfile.write('Status=%s,\n' % quote_python(self.Status).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Origin': + obj_ = FreightServiceCenterDetail.factory() + obj_.build(child_) + self.set_Origin(obj_) + elif nodeName_ == 'LineItems': + obj_ = CompletedFreightPickupLineItem.factory() + obj_.build(child_) + self.LineItems.append(obj_) + elif nodeName_ == 'TotalPieces': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'TotalPieces') + self.TotalPieces = ival_ + elif nodeName_ == 'TotalWeight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_TotalWeight(obj_) + elif nodeName_ == 'TotalHandlingUnits': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'TotalHandlingUnits') + self.TotalHandlingUnits = ival_ + elif nodeName_ == 'Status': + Status_ = child_.text + Status_ = self.gds_validate_string(Status_, node, 'Status') + self.Status = Status_ + self.validate_PickupEventType(self.Status) # validate type PickupEventType +# end class CompletedFreightPickupDetail + + +class CompletedFreightPickupLineItem(GeneratedsSuper): + """Data resulting from the processing of an individual line item in a + LTL Freight pickup request.""" + subclass = None + superclass = None + def __init__(self, SequenceNumber=None, Destination=None, TotalTravelTime=None, EtaDeliveryTimestamp=None): + self.SequenceNumber = SequenceNumber + self.Destination = Destination + self.TotalTravelTime = TotalTravelTime + self.EtaDeliveryTimestamp = EtaDeliveryTimestamp + def factory(*args_, **kwargs_): + if CompletedFreightPickupLineItem.subclass: + return CompletedFreightPickupLineItem.subclass(*args_, **kwargs_) + else: + return CompletedFreightPickupLineItem(*args_, **kwargs_) + factory = staticmethod(factory) + def get_SequenceNumber(self): return self.SequenceNumber + def set_SequenceNumber(self, SequenceNumber): self.SequenceNumber = SequenceNumber + def get_Destination(self): return self.Destination + def set_Destination(self, Destination): self.Destination = Destination + def get_TotalTravelTime(self): return self.TotalTravelTime + def set_TotalTravelTime(self, TotalTravelTime): self.TotalTravelTime = TotalTravelTime + def get_EtaDeliveryTimestamp(self): return self.EtaDeliveryTimestamp + def set_EtaDeliveryTimestamp(self, EtaDeliveryTimestamp): self.EtaDeliveryTimestamp = EtaDeliveryTimestamp + def export(self, outfile, level, namespace_='ns:', name_='CompletedFreightPickupLineItem', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CompletedFreightPickupLineItem') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CompletedFreightPickupLineItem'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CompletedFreightPickupLineItem', fromsubclass_=False): + if self.SequenceNumber is not None: + showIndent(outfile, level) + outfile.write('<%sSequenceNumber>%s\n' % (namespace_, self.gds_format_integer(self.SequenceNumber, input_name='SequenceNumber'), namespace_)) + if self.Destination: + self.Destination.export(outfile, level, namespace_, name_='Destination') + if self.TotalTravelTime is not None: + showIndent(outfile, level) + outfile.write('<%sTotalTravelTime>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.TotalTravelTime).encode(ExternalEncoding), input_name='TotalTravelTime'), namespace_)) + if self.EtaDeliveryTimestamp is not None: + showIndent(outfile, level) + outfile.write('<%sEtaDeliveryTimestamp>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.EtaDeliveryTimestamp).encode(ExternalEncoding), input_name='EtaDeliveryTimestamp'), namespace_)) + def hasContent_(self): + if ( + self.SequenceNumber is not None or + self.Destination is not None or + self.TotalTravelTime is not None or + self.EtaDeliveryTimestamp is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CompletedFreightPickupLineItem'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.SequenceNumber is not None: + showIndent(outfile, level) + outfile.write('SequenceNumber=%d,\n' % self.SequenceNumber) + if self.Destination is not None: + showIndent(outfile, level) + outfile.write('Destination=model_.FreightServiceCenterDetail(\n') + self.Destination.exportLiteral(outfile, level, name_='Destination') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalTravelTime is not None: + showIndent(outfile, level) + outfile.write('TotalTravelTime=%s,\n' % quote_python(self.TotalTravelTime).encode(ExternalEncoding)) + if self.EtaDeliveryTimestamp is not None: + showIndent(outfile, level) + outfile.write('EtaDeliveryTimestamp=%s,\n' % quote_python(self.EtaDeliveryTimestamp).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'SequenceNumber': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'SequenceNumber') + self.SequenceNumber = ival_ + elif nodeName_ == 'Destination': + obj_ = FreightServiceCenterDetail.factory() + obj_.build(child_) + self.set_Destination(obj_) + elif nodeName_ == 'TotalTravelTime': + TotalTravelTime_ = child_.text + TotalTravelTime_ = self.gds_validate_string(TotalTravelTime_, node, 'TotalTravelTime') + self.TotalTravelTime = TotalTravelTime_ + elif nodeName_ == 'EtaDeliveryTimestamp': + EtaDeliveryTimestamp_ = child_.text + EtaDeliveryTimestamp_ = self.gds_validate_string(EtaDeliveryTimestamp_, node, 'EtaDeliveryTimestamp') + self.EtaDeliveryTimestamp = EtaDeliveryTimestamp_ +# end class CompletedFreightPickupLineItem + + +class Contact(GeneratedsSuper): + """The descriptive data for a point-of-contact person.""" + subclass = None + superclass = None + def __init__(self, ContactId=None, PersonName=None, Title=None, CompanyName=None, PhoneNumber=None, PhoneExtension=None, PagerNumber=None, FaxNumber=None, EMailAddress=None): + self.ContactId = ContactId + self.PersonName = PersonName + self.Title = Title + self.CompanyName = CompanyName + self.PhoneNumber = PhoneNumber + self.PhoneExtension = PhoneExtension + self.PagerNumber = PagerNumber + self.FaxNumber = FaxNumber + self.EMailAddress = EMailAddress + def factory(*args_, **kwargs_): + if Contact.subclass: + return Contact.subclass(*args_, **kwargs_) + else: + return Contact(*args_, **kwargs_) + factory = staticmethod(factory) + def get_ContactId(self): return self.ContactId + def set_ContactId(self, ContactId): self.ContactId = ContactId + def get_PersonName(self): return self.PersonName + def set_PersonName(self, PersonName): self.PersonName = PersonName + def get_Title(self): return self.Title + def set_Title(self, Title): self.Title = Title + def get_CompanyName(self): return self.CompanyName + def set_CompanyName(self, CompanyName): self.CompanyName = CompanyName + def get_PhoneNumber(self): return self.PhoneNumber + def set_PhoneNumber(self, PhoneNumber): self.PhoneNumber = PhoneNumber + def get_PhoneExtension(self): return self.PhoneExtension + def set_PhoneExtension(self, PhoneExtension): self.PhoneExtension = PhoneExtension + def get_PagerNumber(self): return self.PagerNumber + def set_PagerNumber(self, PagerNumber): self.PagerNumber = PagerNumber + def get_FaxNumber(self): return self.FaxNumber + def set_FaxNumber(self, FaxNumber): self.FaxNumber = FaxNumber + def get_EMailAddress(self): return self.EMailAddress + def set_EMailAddress(self, EMailAddress): self.EMailAddress = EMailAddress + def export(self, outfile, level, namespace_='ns:', name_='Contact', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Contact') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Contact'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Contact', fromsubclass_=False): + if self.ContactId is not None: + showIndent(outfile, level) + outfile.write('<%sContactId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ContactId).encode(ExternalEncoding), input_name='ContactId'), namespace_)) + if self.PersonName is not None: + showIndent(outfile, level) + outfile.write('<%sPersonName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PersonName).encode(ExternalEncoding), input_name='PersonName'), namespace_)) + if self.Title is not None: + showIndent(outfile, level) + outfile.write('<%sTitle>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Title).encode(ExternalEncoding), input_name='Title'), namespace_)) + if self.CompanyName is not None: + showIndent(outfile, level) + outfile.write('<%sCompanyName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CompanyName).encode(ExternalEncoding), input_name='CompanyName'), namespace_)) + if self.PhoneNumber is not None: + showIndent(outfile, level) + outfile.write('<%sPhoneNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PhoneNumber).encode(ExternalEncoding), input_name='PhoneNumber'), namespace_)) + if self.PhoneExtension is not None: + showIndent(outfile, level) + outfile.write('<%sPhoneExtension>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PhoneExtension).encode(ExternalEncoding), input_name='PhoneExtension'), namespace_)) + if self.PagerNumber is not None: + showIndent(outfile, level) + outfile.write('<%sPagerNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PagerNumber).encode(ExternalEncoding), input_name='PagerNumber'), namespace_)) + if self.FaxNumber is not None: + showIndent(outfile, level) + outfile.write('<%sFaxNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.FaxNumber).encode(ExternalEncoding), input_name='FaxNumber'), namespace_)) + if self.EMailAddress is not None: + showIndent(outfile, level) + outfile.write('<%sEMailAddress>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.EMailAddress).encode(ExternalEncoding), input_name='EMailAddress'), namespace_)) + def hasContent_(self): + if ( + self.ContactId is not None or + self.PersonName is not None or + self.Title is not None or + self.CompanyName is not None or + self.PhoneNumber is not None or + self.PhoneExtension is not None or + self.PagerNumber is not None or + self.FaxNumber is not None or + self.EMailAddress is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Contact'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.ContactId is not None: + showIndent(outfile, level) + outfile.write('ContactId=%s,\n' % quote_python(self.ContactId).encode(ExternalEncoding)) + if self.PersonName is not None: + showIndent(outfile, level) + outfile.write('PersonName=%s,\n' % quote_python(self.PersonName).encode(ExternalEncoding)) + if self.Title is not None: + showIndent(outfile, level) + outfile.write('Title=%s,\n' % quote_python(self.Title).encode(ExternalEncoding)) + if self.CompanyName is not None: + showIndent(outfile, level) + outfile.write('CompanyName=%s,\n' % quote_python(self.CompanyName).encode(ExternalEncoding)) + if self.PhoneNumber is not None: + showIndent(outfile, level) + outfile.write('PhoneNumber=%s,\n' % quote_python(self.PhoneNumber).encode(ExternalEncoding)) + if self.PhoneExtension is not None: + showIndent(outfile, level) + outfile.write('PhoneExtension=%s,\n' % quote_python(self.PhoneExtension).encode(ExternalEncoding)) + if self.PagerNumber is not None: + showIndent(outfile, level) + outfile.write('PagerNumber=%s,\n' % quote_python(self.PagerNumber).encode(ExternalEncoding)) + if self.FaxNumber is not None: + showIndent(outfile, level) + outfile.write('FaxNumber=%s,\n' % quote_python(self.FaxNumber).encode(ExternalEncoding)) + if self.EMailAddress is not None: + showIndent(outfile, level) + outfile.write('EMailAddress=%s,\n' % quote_python(self.EMailAddress).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'ContactId': + ContactId_ = child_.text + ContactId_ = self.gds_validate_string(ContactId_, node, 'ContactId') + self.ContactId = ContactId_ + elif nodeName_ == 'PersonName': + PersonName_ = child_.text + PersonName_ = self.gds_validate_string(PersonName_, node, 'PersonName') + self.PersonName = PersonName_ + elif nodeName_ == 'Title': + Title_ = child_.text + Title_ = self.gds_validate_string(Title_, node, 'Title') + self.Title = Title_ + elif nodeName_ == 'CompanyName': + CompanyName_ = child_.text + CompanyName_ = self.gds_validate_string(CompanyName_, node, 'CompanyName') + self.CompanyName = CompanyName_ + elif nodeName_ == 'PhoneNumber': + PhoneNumber_ = child_.text + PhoneNumber_ = self.gds_validate_string(PhoneNumber_, node, 'PhoneNumber') + self.PhoneNumber = PhoneNumber_ + elif nodeName_ == 'PhoneExtension': + PhoneExtension_ = child_.text + PhoneExtension_ = self.gds_validate_string(PhoneExtension_, node, 'PhoneExtension') + self.PhoneExtension = PhoneExtension_ + elif nodeName_ == 'PagerNumber': + PagerNumber_ = child_.text + PagerNumber_ = self.gds_validate_string(PagerNumber_, node, 'PagerNumber') + self.PagerNumber = PagerNumber_ + elif nodeName_ == 'FaxNumber': + FaxNumber_ = child_.text + FaxNumber_ = self.gds_validate_string(FaxNumber_, node, 'FaxNumber') + self.FaxNumber = FaxNumber_ + elif nodeName_ == 'EMailAddress': + EMailAddress_ = child_.text + EMailAddress_ = self.gds_validate_string(EMailAddress_, node, 'EMailAddress') + self.EMailAddress = EMailAddress_ +# end class Contact + + +class ContactAndAddress(GeneratedsSuper): + """The descriptive data for a person or company entitiy doing business + with FedEx.""" + subclass = None + superclass = None + def __init__(self, Contact=None, Address=None): + self.Contact = Contact + self.Address = Address + def factory(*args_, **kwargs_): + if ContactAndAddress.subclass: + return ContactAndAddress.subclass(*args_, **kwargs_) + else: + return ContactAndAddress(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Contact(self): return self.Contact + def set_Contact(self, Contact): self.Contact = Contact + def get_Address(self): return self.Address + def set_Address(self, Address): self.Address = Address + def export(self, outfile, level, namespace_='ns:', name_='ContactAndAddress', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ContactAndAddress') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ContactAndAddress'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ContactAndAddress', fromsubclass_=False): + if self.Contact: + self.Contact.export(outfile, level, namespace_, name_='Contact') + if self.Address: + self.Address.export(outfile, level, namespace_, name_='Address') + def hasContent_(self): + if ( + self.Contact is not None or + self.Address is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ContactAndAddress'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Contact is not None: + showIndent(outfile, level) + outfile.write('Contact=model_.Contact(\n') + self.Contact.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Address is not None: + showIndent(outfile, level) + outfile.write('Address=model_.Address(\n') + self.Address.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Contact': + obj_ = Contact.factory() + obj_.build(child_) + self.set_Contact(obj_) + elif nodeName_ == 'Address': + obj_ = Address.factory() + obj_.build(child_) + self.set_Address(obj_) +# end class ContactAndAddress + + +class CreatePickupReply(GeneratedsSuper): + """The descriptive data returned to a client in response to a shipment + pickup request.""" + subclass = None + superclass = None + def __init__(self, HighestSeverity=None, Notifications=None, TransactionDetail=None, Version=None, PickupConfirmationNumber=None, Location=None, MessageCode=None, Message=None, PRPControlNumber=None, LastAccessTime=None, CompletedFreightPickupDetail=None): + self.HighestSeverity = HighestSeverity + if Notifications is None: + self.Notifications = [] + else: + self.Notifications = Notifications + self.TransactionDetail = TransactionDetail + self.Version = Version + self.PickupConfirmationNumber = PickupConfirmationNumber + self.Location = Location + self.MessageCode = MessageCode + self.Message = Message + self.PRPControlNumber = PRPControlNumber + self.LastAccessTime = LastAccessTime + self.CompletedFreightPickupDetail = CompletedFreightPickupDetail + def factory(*args_, **kwargs_): + if CreatePickupReply.subclass: + return CreatePickupReply.subclass(*args_, **kwargs_) + else: + return CreatePickupReply(*args_, **kwargs_) + factory = staticmethod(factory) + def get_HighestSeverity(self): return self.HighestSeverity + def set_HighestSeverity(self, HighestSeverity): self.HighestSeverity = HighestSeverity + def validate_NotificationSeverityType(self, value): + # Validate type NotificationSeverityType, a restriction on xs:string. + pass + def get_Notifications(self): return self.Notifications + def set_Notifications(self, Notifications): self.Notifications = Notifications + def add_Notifications(self, value): self.Notifications.append(value) + def insert_Notifications(self, index, value): self.Notifications[index] = value + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_PickupConfirmationNumber(self): return self.PickupConfirmationNumber + def set_PickupConfirmationNumber(self, PickupConfirmationNumber): self.PickupConfirmationNumber = PickupConfirmationNumber + def get_Location(self): return self.Location + def set_Location(self, Location): self.Location = Location + def get_MessageCode(self): return self.MessageCode + def set_MessageCode(self, MessageCode): self.MessageCode = MessageCode + def get_Message(self): return self.Message + def set_Message(self, Message): self.Message = Message + def get_PRPControlNumber(self): return self.PRPControlNumber + def set_PRPControlNumber(self, PRPControlNumber): self.PRPControlNumber = PRPControlNumber + def get_LastAccessTime(self): return self.LastAccessTime + def set_LastAccessTime(self, LastAccessTime): self.LastAccessTime = LastAccessTime + def get_CompletedFreightPickupDetail(self): return self.CompletedFreightPickupDetail + def set_CompletedFreightPickupDetail(self, CompletedFreightPickupDetail): self.CompletedFreightPickupDetail = CompletedFreightPickupDetail + def export(self, outfile, level, namespace_='ns:', name_='CreatePickupReply', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CreatePickupReply') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CreatePickupReply'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CreatePickupReply', fromsubclass_=False): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('<%sHighestSeverity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HighestSeverity).encode(ExternalEncoding), input_name='HighestSeverity'), namespace_)) + for Notifications_ in self.Notifications: + Notifications_.export(outfile, level, namespace_, name_='Notifications') + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.PickupConfirmationNumber is not None: + showIndent(outfile, level) + outfile.write('<%sPickupConfirmationNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PickupConfirmationNumber).encode(ExternalEncoding), input_name='PickupConfirmationNumber'), namespace_)) + if self.Location is not None: + showIndent(outfile, level) + outfile.write('<%sLocation>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Location).encode(ExternalEncoding), input_name='Location'), namespace_)) + if self.MessageCode is not None: + showIndent(outfile, level) + outfile.write('<%sMessageCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.MessageCode).encode(ExternalEncoding), input_name='MessageCode'), namespace_)) + if self.Message is not None: + showIndent(outfile, level) + outfile.write('<%sMessage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Message).encode(ExternalEncoding), input_name='Message'), namespace_)) + if self.PRPControlNumber is not None: + showIndent(outfile, level) + outfile.write('<%sPRPControlNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PRPControlNumber).encode(ExternalEncoding), input_name='PRPControlNumber'), namespace_)) + if self.LastAccessTime: + self.LastAccessTime.export(outfile, level, namespace_, name_='LastAccessTime') + if self.CompletedFreightPickupDetail: + self.CompletedFreightPickupDetail.export(outfile, level, namespace_, name_='CompletedFreightPickupDetail') + def hasContent_(self): + if ( + self.HighestSeverity is not None or + self.Notifications or + self.TransactionDetail is not None or + self.Version is not None or + self.PickupConfirmationNumber is not None or + self.Location is not None or + self.MessageCode is not None or + self.Message is not None or + self.PRPControlNumber is not None or + self.LastAccessTime is not None or + self.CompletedFreightPickupDetail is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CreatePickupReply'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('HighestSeverity=%s,\n' % quote_python(self.HighestSeverity).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Notifications=[\n') + level += 1 + for Notifications_ in self.Notifications: + showIndent(outfile, level) + outfile.write('model_.Notification(\n') + Notifications_.exportLiteral(outfile, level, name_='Notification') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.PickupConfirmationNumber is not None: + showIndent(outfile, level) + outfile.write('PickupConfirmationNumber=%s,\n' % quote_python(self.PickupConfirmationNumber).encode(ExternalEncoding)) + if self.Location is not None: + showIndent(outfile, level) + outfile.write('Location=%s,\n' % quote_python(self.Location).encode(ExternalEncoding)) + if self.MessageCode is not None: + showIndent(outfile, level) + outfile.write('MessageCode=%s,\n' % quote_python(self.MessageCode).encode(ExternalEncoding)) + if self.Message is not None: + showIndent(outfile, level) + outfile.write('Message=%s,\n' % quote_python(self.Message).encode(ExternalEncoding)) + if self.PRPControlNumber is not None: + showIndent(outfile, level) + outfile.write('PRPControlNumber=%s,\n' % quote_python(self.PRPControlNumber).encode(ExternalEncoding)) + if self.LastAccessTime is not None: + showIndent(outfile, level) + outfile.write('LastAccessTime=model_.xs_time(\n') + self.LastAccessTime.exportLiteral(outfile, level, name_='LastAccessTime') + showIndent(outfile, level) + outfile.write('),\n') + if self.CompletedFreightPickupDetail is not None: + showIndent(outfile, level) + outfile.write('CompletedFreightPickupDetail=model_.CompletedFreightPickupDetail(\n') + self.CompletedFreightPickupDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'HighestSeverity': + HighestSeverity_ = child_.text + HighestSeverity_ = self.gds_validate_string(HighestSeverity_, node, 'HighestSeverity') + self.HighestSeverity = HighestSeverity_ + self.validate_NotificationSeverityType(self.HighestSeverity) # validate type NotificationSeverityType + elif nodeName_ == 'Notifications': + obj_ = Notification.factory() + obj_.build(child_) + self.Notifications.append(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'PickupConfirmationNumber': + PickupConfirmationNumber_ = child_.text + PickupConfirmationNumber_ = self.gds_validate_string(PickupConfirmationNumber_, node, 'PickupConfirmationNumber') + self.PickupConfirmationNumber = PickupConfirmationNumber_ + elif nodeName_ == 'Location': + Location_ = child_.text + Location_ = self.gds_validate_string(Location_, node, 'Location') + self.Location = Location_ + elif nodeName_ == 'MessageCode': + MessageCode_ = child_.text + MessageCode_ = self.gds_validate_string(MessageCode_, node, 'MessageCode') + self.MessageCode = MessageCode_ + elif nodeName_ == 'Message': + Message_ = child_.text + Message_ = self.gds_validate_string(Message_, node, 'Message') + self.Message = Message_ + elif nodeName_ == 'PRPControlNumber': + PRPControlNumber_ = child_.text + PRPControlNumber_ = self.gds_validate_string(PRPControlNumber_, node, 'PRPControlNumber') + self.PRPControlNumber = PRPControlNumber_ + elif nodeName_ == 'LastAccessTime': + obj_ = xs_time.factory() + obj_.build(child_) + self.set_LastAccessTime(obj_) + elif nodeName_ == 'CompletedFreightPickupDetail': + obj_ = CompletedFreightPickupDetail.factory() + obj_.build(child_) + self.set_CompletedFreightPickupDetail(obj_) +# end class CreatePickupReply + + +class CreatePickupRequest(GeneratedsSuper): + """The descriptive data to schedule a FedEx package pickup request.""" + subclass = None + superclass = None + def __init__(self, WebAuthenticationDetail=None, ClientDetail=None, TransactionDetail=None, Version=None, AssociatedAccountNumber=None, OriginDetail=None, FreightPickupDetail=None, ExpressFreightDetail=None, PackageCount=None, TotalWeight=None, CarrierCode=None, OversizePackageCount=None, Remarks=None, CommodityDescription=None, CountryRelationship=None): + self.WebAuthenticationDetail = WebAuthenticationDetail + self.ClientDetail = ClientDetail + self.TransactionDetail = TransactionDetail + self.Version = Version + self.AssociatedAccountNumber = AssociatedAccountNumber + self.OriginDetail = OriginDetail + self.FreightPickupDetail = FreightPickupDetail + self.ExpressFreightDetail = ExpressFreightDetail + self.PackageCount = PackageCount + self.TotalWeight = TotalWeight + self.CarrierCode = CarrierCode + self.OversizePackageCount = OversizePackageCount + self.Remarks = Remarks + self.CommodityDescription = CommodityDescription + self.CountryRelationship = CountryRelationship + def factory(*args_, **kwargs_): + if CreatePickupRequest.subclass: + return CreatePickupRequest.subclass(*args_, **kwargs_) + else: + return CreatePickupRequest(*args_, **kwargs_) + factory = staticmethod(factory) + def get_WebAuthenticationDetail(self): return self.WebAuthenticationDetail + def set_WebAuthenticationDetail(self, WebAuthenticationDetail): self.WebAuthenticationDetail = WebAuthenticationDetail + def get_ClientDetail(self): return self.ClientDetail + def set_ClientDetail(self, ClientDetail): self.ClientDetail = ClientDetail + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_AssociatedAccountNumber(self): return self.AssociatedAccountNumber + def set_AssociatedAccountNumber(self, AssociatedAccountNumber): self.AssociatedAccountNumber = AssociatedAccountNumber + def get_OriginDetail(self): return self.OriginDetail + def set_OriginDetail(self, OriginDetail): self.OriginDetail = OriginDetail + def get_FreightPickupDetail(self): return self.FreightPickupDetail + def set_FreightPickupDetail(self, FreightPickupDetail): self.FreightPickupDetail = FreightPickupDetail + def get_ExpressFreightDetail(self): return self.ExpressFreightDetail + def set_ExpressFreightDetail(self, ExpressFreightDetail): self.ExpressFreightDetail = ExpressFreightDetail + def get_PackageCount(self): return self.PackageCount + def set_PackageCount(self, PackageCount): self.PackageCount = PackageCount + def get_TotalWeight(self): return self.TotalWeight + def set_TotalWeight(self, TotalWeight): self.TotalWeight = TotalWeight + def get_CarrierCode(self): return self.CarrierCode + def set_CarrierCode(self, CarrierCode): self.CarrierCode = CarrierCode + def validate_CarrierCodeType(self, value): + # Validate type CarrierCodeType, a restriction on xs:string. + pass + def get_OversizePackageCount(self): return self.OversizePackageCount + def set_OversizePackageCount(self, OversizePackageCount): self.OversizePackageCount = OversizePackageCount + def get_Remarks(self): return self.Remarks + def set_Remarks(self, Remarks): self.Remarks = Remarks + def get_CommodityDescription(self): return self.CommodityDescription + def set_CommodityDescription(self, CommodityDescription): self.CommodityDescription = CommodityDescription + def get_CountryRelationship(self): return self.CountryRelationship + def set_CountryRelationship(self, CountryRelationship): self.CountryRelationship = CountryRelationship + def validate_CountryRelationshipType(self, value): + # Validate type CountryRelationshipType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='CreatePickupRequest', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CreatePickupRequest') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CreatePickupRequest'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CreatePickupRequest', fromsubclass_=False): + if self.WebAuthenticationDetail: + self.WebAuthenticationDetail.export(outfile, level, namespace_, name_='WebAuthenticationDetail', ) + if self.ClientDetail: + self.ClientDetail.export(outfile, level, namespace_, name_='ClientDetail', ) + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.AssociatedAccountNumber: + self.AssociatedAccountNumber.export(outfile, level, namespace_, name_='AssociatedAccountNumber') + if self.OriginDetail: + self.OriginDetail.export(outfile, level, namespace_, name_='OriginDetail') + if self.FreightPickupDetail: + self.FreightPickupDetail.export(outfile, level, namespace_, name_='FreightPickupDetail') + if self.ExpressFreightDetail: + self.ExpressFreightDetail.export(outfile, level, namespace_, name_='ExpressFreightDetail') + if self.PackageCount is not None: + showIndent(outfile, level) + outfile.write('<%sPackageCount>%s\n' % (namespace_, self.gds_format_integer(self.PackageCount, input_name='PackageCount'), namespace_)) + if self.TotalWeight: + self.TotalWeight.export(outfile, level, namespace_, name_='TotalWeight') + if self.CarrierCode is not None: + showIndent(outfile, level) + outfile.write('<%sCarrierCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CarrierCode).encode(ExternalEncoding), input_name='CarrierCode'), namespace_)) + if self.OversizePackageCount is not None: + showIndent(outfile, level) + outfile.write('<%sOversizePackageCount>%s\n' % (namespace_, self.gds_format_integer(self.OversizePackageCount, input_name='OversizePackageCount'), namespace_)) + if self.Remarks is not None: + showIndent(outfile, level) + outfile.write('<%sRemarks>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Remarks).encode(ExternalEncoding), input_name='Remarks'), namespace_)) + if self.CommodityDescription is not None: + showIndent(outfile, level) + outfile.write('<%sCommodityDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CommodityDescription).encode(ExternalEncoding), input_name='CommodityDescription'), namespace_)) + if self.CountryRelationship is not None: + showIndent(outfile, level) + outfile.write('<%sCountryRelationship>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CountryRelationship).encode(ExternalEncoding), input_name='CountryRelationship'), namespace_)) + def hasContent_(self): + if ( + self.WebAuthenticationDetail is not None or + self.ClientDetail is not None or + self.TransactionDetail is not None or + self.Version is not None or + self.AssociatedAccountNumber is not None or + self.OriginDetail is not None or + self.FreightPickupDetail is not None or + self.ExpressFreightDetail is not None or + self.PackageCount is not None or + self.TotalWeight is not None or + self.CarrierCode is not None or + self.OversizePackageCount is not None or + self.Remarks is not None or + self.CommodityDescription is not None or + self.CountryRelationship is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CreatePickupRequest'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.WebAuthenticationDetail is not None: + showIndent(outfile, level) + outfile.write('WebAuthenticationDetail=model_.WebAuthenticationDetail(\n') + self.WebAuthenticationDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ClientDetail is not None: + showIndent(outfile, level) + outfile.write('ClientDetail=model_.ClientDetail(\n') + self.ClientDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.AssociatedAccountNumber is not None: + showIndent(outfile, level) + outfile.write('AssociatedAccountNumber=model_.AssociatedAccount(\n') + self.AssociatedAccountNumber.exportLiteral(outfile, level, name_='AssociatedAccountNumber') + showIndent(outfile, level) + outfile.write('),\n') + if self.OriginDetail is not None: + showIndent(outfile, level) + outfile.write('OriginDetail=model_.PickupOriginDetail(\n') + self.OriginDetail.exportLiteral(outfile, level, name_='OriginDetail') + showIndent(outfile, level) + outfile.write('),\n') + if self.FreightPickupDetail is not None: + showIndent(outfile, level) + outfile.write('FreightPickupDetail=model_.FreightPickupDetail(\n') + self.FreightPickupDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ExpressFreightDetail is not None: + showIndent(outfile, level) + outfile.write('ExpressFreightDetail=model_.ExpressFreightPickupDetail(\n') + self.ExpressFreightDetail.exportLiteral(outfile, level, name_='ExpressFreightDetail') + showIndent(outfile, level) + outfile.write('),\n') + if self.PackageCount is not None: + showIndent(outfile, level) + outfile.write('PackageCount=%d,\n' % self.PackageCount) + if self.TotalWeight is not None: + showIndent(outfile, level) + outfile.write('TotalWeight=model_.Weight(\n') + self.TotalWeight.exportLiteral(outfile, level, name_='TotalWeight') + showIndent(outfile, level) + outfile.write('),\n') + if self.CarrierCode is not None: + showIndent(outfile, level) + outfile.write('CarrierCode=%s,\n' % quote_python(self.CarrierCode).encode(ExternalEncoding)) + if self.OversizePackageCount is not None: + showIndent(outfile, level) + outfile.write('OversizePackageCount=%d,\n' % self.OversizePackageCount) + if self.Remarks is not None: + showIndent(outfile, level) + outfile.write('Remarks=%s,\n' % quote_python(self.Remarks).encode(ExternalEncoding)) + if self.CommodityDescription is not None: + showIndent(outfile, level) + outfile.write('CommodityDescription=%s,\n' % quote_python(self.CommodityDescription).encode(ExternalEncoding)) + if self.CountryRelationship is not None: + showIndent(outfile, level) + outfile.write('CountryRelationship=%s,\n' % quote_python(self.CountryRelationship).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'WebAuthenticationDetail': + obj_ = WebAuthenticationDetail.factory() + obj_.build(child_) + self.set_WebAuthenticationDetail(obj_) + elif nodeName_ == 'ClientDetail': + obj_ = ClientDetail.factory() + obj_.build(child_) + self.set_ClientDetail(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'AssociatedAccountNumber': + obj_ = AssociatedAccount.factory() + obj_.build(child_) + self.set_AssociatedAccountNumber(obj_) + elif nodeName_ == 'OriginDetail': + obj_ = PickupOriginDetail.factory() + obj_.build(child_) + self.set_OriginDetail(obj_) + elif nodeName_ == 'FreightPickupDetail': + obj_ = FreightPickupDetail.factory() + obj_.build(child_) + self.set_FreightPickupDetail(obj_) + elif nodeName_ == 'ExpressFreightDetail': + obj_ = ExpressFreightPickupDetail.factory() + obj_.build(child_) + self.set_ExpressFreightDetail(obj_) + elif nodeName_ == 'PackageCount': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ <= 0: + raise_parse_error(child_, 'requires positiveInteger') + ival_ = self.gds_validate_integer(ival_, node, 'PackageCount') + self.PackageCount = ival_ + elif nodeName_ == 'TotalWeight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_TotalWeight(obj_) + elif nodeName_ == 'CarrierCode': + CarrierCode_ = child_.text + CarrierCode_ = self.gds_validate_string(CarrierCode_, node, 'CarrierCode') + self.CarrierCode = CarrierCode_ + self.validate_CarrierCodeType(self.CarrierCode) # validate type CarrierCodeType + elif nodeName_ == 'OversizePackageCount': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ <= 0: + raise_parse_error(child_, 'requires positiveInteger') + ival_ = self.gds_validate_integer(ival_, node, 'OversizePackageCount') + self.OversizePackageCount = ival_ + elif nodeName_ == 'Remarks': + Remarks_ = child_.text + Remarks_ = self.gds_validate_string(Remarks_, node, 'Remarks') + self.Remarks = Remarks_ + elif nodeName_ == 'CommodityDescription': + CommodityDescription_ = child_.text + CommodityDescription_ = self.gds_validate_string(CommodityDescription_, node, 'CommodityDescription') + self.CommodityDescription = CommodityDescription_ + elif nodeName_ == 'CountryRelationship': + CountryRelationship_ = child_.text + CountryRelationship_ = self.gds_validate_string(CountryRelationship_, node, 'CountryRelationship') + self.CountryRelationship = CountryRelationship_ + self.validate_CountryRelationshipType(self.CountryRelationship) # validate type CountryRelationshipType +# end class CreatePickupRequest + + +class CreditCard(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Number=None, CreditCardType=None, ExpirationDate=None, VerificationCode=None, CreditCardHolder=None): + self.Number = Number + self.CreditCardType = CreditCardType + self.ExpirationDate = ExpirationDate + self.VerificationCode = VerificationCode + self.CreditCardHolder = CreditCardHolder + def factory(*args_, **kwargs_): + if CreditCard.subclass: + return CreditCard.subclass(*args_, **kwargs_) + else: + return CreditCard(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Number(self): return self.Number + def set_Number(self, Number): self.Number = Number + def get_CreditCardType(self): return self.CreditCardType + def set_CreditCardType(self, CreditCardType): self.CreditCardType = CreditCardType + def validate_CreditCardType(self, value): + # Validate type CreditCardType, a restriction on xs:string. + pass + def get_ExpirationDate(self): return self.ExpirationDate + def set_ExpirationDate(self, ExpirationDate): self.ExpirationDate = ExpirationDate + def get_VerificationCode(self): return self.VerificationCode + def set_VerificationCode(self, VerificationCode): self.VerificationCode = VerificationCode + def get_CreditCardHolder(self): return self.CreditCardHolder + def set_CreditCardHolder(self, CreditCardHolder): self.CreditCardHolder = CreditCardHolder + def export(self, outfile, level, namespace_='ns:', name_='CreditCard', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CreditCard') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CreditCard'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CreditCard', fromsubclass_=False): + if self.Number is not None: + showIndent(outfile, level) + outfile.write('<%sNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Number).encode(ExternalEncoding), input_name='Number'), namespace_)) + if self.CreditCardType is not None: + showIndent(outfile, level) + outfile.write('<%sCreditCardType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CreditCardType).encode(ExternalEncoding), input_name='CreditCardType'), namespace_)) + if self.ExpirationDate is not None: + showIndent(outfile, level) + outfile.write('<%sExpirationDate>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ExpirationDate).encode(ExternalEncoding), input_name='ExpirationDate'), namespace_)) + if self.VerificationCode is not None: + showIndent(outfile, level) + outfile.write('<%sVerificationCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.VerificationCode).encode(ExternalEncoding), input_name='VerificationCode'), namespace_)) + if self.CreditCardHolder: + self.CreditCardHolder.export(outfile, level, namespace_, name_='CreditCardHolder') + def hasContent_(self): + if ( + self.Number is not None or + self.CreditCardType is not None or + self.ExpirationDate is not None or + self.VerificationCode is not None or + self.CreditCardHolder is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CreditCard'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Number is not None: + showIndent(outfile, level) + outfile.write('Number=%s,\n' % quote_python(self.Number).encode(ExternalEncoding)) + if self.CreditCardType is not None: + showIndent(outfile, level) + outfile.write('CreditCardType=%s,\n' % quote_python(self.CreditCardType).encode(ExternalEncoding)) + if self.ExpirationDate is not None: + showIndent(outfile, level) + outfile.write('ExpirationDate=%s,\n' % quote_python(self.ExpirationDate).encode(ExternalEncoding)) + if self.VerificationCode is not None: + showIndent(outfile, level) + outfile.write('VerificationCode=%s,\n' % quote_python(self.VerificationCode).encode(ExternalEncoding)) + if self.CreditCardHolder is not None: + showIndent(outfile, level) + outfile.write('CreditCardHolder=model_.ParsedContactAndAddress(\n') + self.CreditCardHolder.exportLiteral(outfile, level, name_='CreditCardHolder') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Number': + Number_ = child_.text + Number_ = self.gds_validate_string(Number_, node, 'Number') + self.Number = Number_ + elif nodeName_ == 'CreditCardType': + CreditCardType_ = child_.text + CreditCardType_ = self.gds_validate_string(CreditCardType_, node, 'CreditCardType') + self.CreditCardType = CreditCardType_ + self.validate_CreditCardType(self.CreditCardType) # validate type CreditCardType + elif nodeName_ == 'ExpirationDate': + ExpirationDate_ = child_.text + ExpirationDate_ = self.gds_validate_string(ExpirationDate_, node, 'ExpirationDate') + self.ExpirationDate = ExpirationDate_ + elif nodeName_ == 'VerificationCode': + VerificationCode_ = child_.text + VerificationCode_ = self.gds_validate_string(VerificationCode_, node, 'VerificationCode') + self.VerificationCode = VerificationCode_ + elif nodeName_ == 'CreditCardHolder': + obj_ = ParsedContactAndAddress.factory() + obj_.build(child_) + self.set_CreditCardHolder(obj_) +# end class CreditCard + + +class CreditCardTransactionDetail(GeneratedsSuper): + """This class represents data tied to the use of a credit card in a + specific transaction.""" + subclass = None + superclass = None + def __init__(self, AuthorizationId=None, AuthorizationType=None, FraudDetectionDetail=None): + self.AuthorizationId = AuthorizationId + self.AuthorizationType = AuthorizationType + self.FraudDetectionDetail = FraudDetectionDetail + def factory(*args_, **kwargs_): + if CreditCardTransactionDetail.subclass: + return CreditCardTransactionDetail.subclass(*args_, **kwargs_) + else: + return CreditCardTransactionDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_AuthorizationId(self): return self.AuthorizationId + def set_AuthorizationId(self, AuthorizationId): self.AuthorizationId = AuthorizationId + def get_AuthorizationType(self): return self.AuthorizationType + def set_AuthorizationType(self, AuthorizationType): self.AuthorizationType = AuthorizationType + def validate_CreditCardAuthorizationType(self, value): + # Validate type CreditCardAuthorizationType, a restriction on xs:string. + pass + def get_FraudDetectionDetail(self): return self.FraudDetectionDetail + def set_FraudDetectionDetail(self, FraudDetectionDetail): self.FraudDetectionDetail = FraudDetectionDetail + def export(self, outfile, level, namespace_='ns:', name_='CreditCardTransactionDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CreditCardTransactionDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CreditCardTransactionDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CreditCardTransactionDetail', fromsubclass_=False): + if self.AuthorizationId is not None: + showIndent(outfile, level) + outfile.write('<%sAuthorizationId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AuthorizationId).encode(ExternalEncoding), input_name='AuthorizationId'), namespace_)) + if self.AuthorizationType is not None: + showIndent(outfile, level) + outfile.write('<%sAuthorizationType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AuthorizationType).encode(ExternalEncoding), input_name='AuthorizationType'), namespace_)) + if self.FraudDetectionDetail: + self.FraudDetectionDetail.export(outfile, level, namespace_, name_='FraudDetectionDetail') + def hasContent_(self): + if ( + self.AuthorizationId is not None or + self.AuthorizationType is not None or + self.FraudDetectionDetail is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CreditCardTransactionDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.AuthorizationId is not None: + showIndent(outfile, level) + outfile.write('AuthorizationId=%s,\n' % quote_python(self.AuthorizationId).encode(ExternalEncoding)) + if self.AuthorizationType is not None: + showIndent(outfile, level) + outfile.write('AuthorizationType=%s,\n' % quote_python(self.AuthorizationType).encode(ExternalEncoding)) + if self.FraudDetectionDetail is not None: + showIndent(outfile, level) + outfile.write('FraudDetectionDetail=model_.CreditFraudDetectionDetail(\n') + self.FraudDetectionDetail.exportLiteral(outfile, level, name_='FraudDetectionDetail') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'AuthorizationId': + AuthorizationId_ = child_.text + AuthorizationId_ = self.gds_validate_string(AuthorizationId_, node, 'AuthorizationId') + self.AuthorizationId = AuthorizationId_ + elif nodeName_ == 'AuthorizationType': + AuthorizationType_ = child_.text + AuthorizationType_ = self.gds_validate_string(AuthorizationType_, node, 'AuthorizationType') + self.AuthorizationType = AuthorizationType_ + self.validate_CreditCardAuthorizationType(self.AuthorizationType) # validate type CreditCardAuthorizationType + elif nodeName_ == 'FraudDetectionDetail': + obj_ = CreditFraudDetectionDetail.factory() + obj_.build(child_) + self.set_FraudDetectionDetail(obj_) +# end class CreditCardTransactionDetail + + +class CreditFraudDetectionDetail(GeneratedsSuper): + """This class is a rename of the previous VerifyCreditFraudDetail; the + name change reflects the fact that it is no longer tied to a + "verify" usage.""" + subclass = None + superclass = None + def __init__(self, IpAddress=None, ClientCookiesEnabled=None, DevicePrint=None): + self.IpAddress = IpAddress + self.ClientCookiesEnabled = ClientCookiesEnabled + self.DevicePrint = DevicePrint + def factory(*args_, **kwargs_): + if CreditFraudDetectionDetail.subclass: + return CreditFraudDetectionDetail.subclass(*args_, **kwargs_) + else: + return CreditFraudDetectionDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_IpAddress(self): return self.IpAddress + def set_IpAddress(self, IpAddress): self.IpAddress = IpAddress + def get_ClientCookiesEnabled(self): return self.ClientCookiesEnabled + def set_ClientCookiesEnabled(self, ClientCookiesEnabled): self.ClientCookiesEnabled = ClientCookiesEnabled + def get_DevicePrint(self): return self.DevicePrint + def set_DevicePrint(self, DevicePrint): self.DevicePrint = DevicePrint + def export(self, outfile, level, namespace_='ns:', name_='CreditFraudDetectionDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CreditFraudDetectionDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CreditFraudDetectionDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CreditFraudDetectionDetail', fromsubclass_=False): + if self.IpAddress is not None: + showIndent(outfile, level) + outfile.write('<%sIpAddress>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.IpAddress).encode(ExternalEncoding), input_name='IpAddress'), namespace_)) + if self.ClientCookiesEnabled is not None: + showIndent(outfile, level) + outfile.write('<%sClientCookiesEnabled>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.ClientCookiesEnabled)), input_name='ClientCookiesEnabled'), namespace_)) + if self.DevicePrint is not None: + showIndent(outfile, level) + outfile.write('<%sDevicePrint>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DevicePrint).encode(ExternalEncoding), input_name='DevicePrint'), namespace_)) + def hasContent_(self): + if ( + self.IpAddress is not None or + self.ClientCookiesEnabled is not None or + self.DevicePrint is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CreditFraudDetectionDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.IpAddress is not None: + showIndent(outfile, level) + outfile.write('IpAddress=%s,\n' % quote_python(self.IpAddress).encode(ExternalEncoding)) + if self.ClientCookiesEnabled is not None: + showIndent(outfile, level) + outfile.write('ClientCookiesEnabled=%s,\n' % self.ClientCookiesEnabled) + if self.DevicePrint is not None: + showIndent(outfile, level) + outfile.write('DevicePrint=%s,\n' % quote_python(self.DevicePrint).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'IpAddress': + IpAddress_ = child_.text + IpAddress_ = self.gds_validate_string(IpAddress_, node, 'IpAddress') + self.IpAddress = IpAddress_ + elif nodeName_ == 'ClientCookiesEnabled': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'ClientCookiesEnabled') + self.ClientCookiesEnabled = ival_ + elif nodeName_ == 'DevicePrint': + DevicePrint_ = child_.text + DevicePrint_ = self.gds_validate_string(DevicePrint_, node, 'DevicePrint') + self.DevicePrint = DevicePrint_ +# end class CreditFraudDetectionDetail + + +class CustomDeliveryWindowDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Type=None, RequestTime=None, RequestRange=None, RequestDate=None): + self.Type = Type + self.RequestTime = RequestTime + self.RequestRange = RequestRange + self.RequestDate = RequestDate + def factory(*args_, **kwargs_): + if CustomDeliveryWindowDetail.subclass: + return CustomDeliveryWindowDetail.subclass(*args_, **kwargs_) + else: + return CustomDeliveryWindowDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Type(self): return self.Type + def set_Type(self, Type): self.Type = Type + def validate_CustomDeliveryWindowType(self, value): + # Validate type CustomDeliveryWindowType, a restriction on xs:string. + pass + def get_RequestTime(self): return self.RequestTime + def set_RequestTime(self, RequestTime): self.RequestTime = RequestTime + def get_RequestRange(self): return self.RequestRange + def set_RequestRange(self, RequestRange): self.RequestRange = RequestRange + def get_RequestDate(self): return self.RequestDate + def set_RequestDate(self, RequestDate): self.RequestDate = RequestDate + def export(self, outfile, level, namespace_='ns:', name_='CustomDeliveryWindowDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CustomDeliveryWindowDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CustomDeliveryWindowDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CustomDeliveryWindowDetail', fromsubclass_=False): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('<%sType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Type).encode(ExternalEncoding), input_name='Type'), namespace_)) + if self.RequestTime: + self.RequestTime.export(outfile, level, namespace_, name_='RequestTime') + if self.RequestRange: + self.RequestRange.export(outfile, level, namespace_, name_='RequestRange') + if self.RequestDate is not None: + showIndent(outfile, level) + outfile.write('<%sRequestDate>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RequestDate).encode(ExternalEncoding), input_name='RequestDate'), namespace_)) + def hasContent_(self): + if ( + self.Type is not None or + self.RequestTime is not None or + self.RequestRange is not None or + self.RequestDate is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CustomDeliveryWindowDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('Type=%s,\n' % quote_python(self.Type).encode(ExternalEncoding)) + if self.RequestTime is not None: + showIndent(outfile, level) + outfile.write('RequestTime=model_.xs_time(\n') + self.RequestTime.exportLiteral(outfile, level, name_='RequestTime') + showIndent(outfile, level) + outfile.write('),\n') + if self.RequestRange is not None: + showIndent(outfile, level) + outfile.write('RequestRange=model_.DateRange(\n') + self.RequestRange.exportLiteral(outfile, level, name_='RequestRange') + showIndent(outfile, level) + outfile.write('),\n') + if self.RequestDate is not None: + showIndent(outfile, level) + outfile.write('RequestDate=%s,\n' % quote_python(self.RequestDate).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Type': + Type_ = child_.text + Type_ = self.gds_validate_string(Type_, node, 'Type') + self.Type = Type_ + self.validate_CustomDeliveryWindowType(self.Type) # validate type CustomDeliveryWindowType + elif nodeName_ == 'RequestTime': + obj_ = xs_time.factory() + obj_.build(child_) + self.set_RequestTime(obj_) + elif nodeName_ == 'RequestRange': + obj_ = DateRange.factory() + obj_.build(child_) + self.set_RequestRange(obj_) + elif nodeName_ == 'RequestDate': + RequestDate_ = child_.text + RequestDate_ = self.gds_validate_string(RequestDate_, node, 'RequestDate') + self.RequestDate = RequestDate_ +# end class CustomDeliveryWindowDetail + + +class DateRange(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Begins=None, Ends=None): + self.Begins = Begins + self.Ends = Ends + def factory(*args_, **kwargs_): + if DateRange.subclass: + return DateRange.subclass(*args_, **kwargs_) + else: + return DateRange(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Begins(self): return self.Begins + def set_Begins(self, Begins): self.Begins = Begins + def get_Ends(self): return self.Ends + def set_Ends(self, Ends): self.Ends = Ends + def export(self, outfile, level, namespace_='ns:', name_='DateRange', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='DateRange') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='DateRange'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='DateRange', fromsubclass_=False): + if self.Begins is not None: + showIndent(outfile, level) + outfile.write('<%sBegins>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Begins).encode(ExternalEncoding), input_name='Begins'), namespace_)) + if self.Ends is not None: + showIndent(outfile, level) + outfile.write('<%sEnds>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Ends).encode(ExternalEncoding), input_name='Ends'), namespace_)) + def hasContent_(self): + if ( + self.Begins is not None or + self.Ends is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='DateRange'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Begins is not None: + showIndent(outfile, level) + outfile.write('Begins=%s,\n' % quote_python(self.Begins).encode(ExternalEncoding)) + if self.Ends is not None: + showIndent(outfile, level) + outfile.write('Ends=%s,\n' % quote_python(self.Ends).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Begins': + Begins_ = child_.text + Begins_ = self.gds_validate_string(Begins_, node, 'Begins') + self.Begins = Begins_ + elif nodeName_ == 'Ends': + Ends_ = child_.text + Ends_ = self.gds_validate_string(Ends_, node, 'Ends') + self.Ends = Ends_ +# end class DateRange + + +class DetentionDetail(GeneratedsSuper): + """Specifications for pup/set or vehicle delayed for loading or + unloading.""" + subclass = None + superclass = None + def __init__(self, Duration=None): + self.Duration = Duration + def factory(*args_, **kwargs_): + if DetentionDetail.subclass: + return DetentionDetail.subclass(*args_, **kwargs_) + else: + return DetentionDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Duration(self): return self.Duration + def set_Duration(self, Duration): self.Duration = Duration + def export(self, outfile, level, namespace_='ns:', name_='DetentionDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='DetentionDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='DetentionDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='DetentionDetail', fromsubclass_=False): + if self.Duration is not None: + showIndent(outfile, level) + outfile.write('<%sDuration>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Duration).encode(ExternalEncoding), input_name='Duration'), namespace_)) + def hasContent_(self): + if ( + self.Duration is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='DetentionDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Duration is not None: + showIndent(outfile, level) + outfile.write('Duration=%s,\n' % quote_python(self.Duration).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Duration': + Duration_ = child_.text + Duration_ = self.gds_validate_string(Duration_, node, 'Duration') + self.Duration = Duration_ +# end class DetentionDetail + + +class Dimensions(GeneratedsSuper): + """Descriptive data detailing the length, width, and height of a + package.""" + subclass = None + superclass = None + def __init__(self, Length=None, Width=None, Height=None, Units=None): + self.Length = Length + self.Width = Width + self.Height = Height + self.Units = Units + def factory(*args_, **kwargs_): + if Dimensions.subclass: + return Dimensions.subclass(*args_, **kwargs_) + else: + return Dimensions(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Length(self): return self.Length + def set_Length(self, Length): self.Length = Length + def get_Width(self): return self.Width + def set_Width(self, Width): self.Width = Width + def get_Height(self): return self.Height + def set_Height(self, Height): self.Height = Height + def get_Units(self): return self.Units + def set_Units(self, Units): self.Units = Units + def validate_LinearUnits(self, value): + # Validate type LinearUnits, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='Dimensions', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Dimensions') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Dimensions'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Dimensions', fromsubclass_=False): + if self.Length is not None: + showIndent(outfile, level) + outfile.write('<%sLength>%s\n' % (namespace_, self.gds_format_integer(self.Length, input_name='Length'), namespace_)) + if self.Width is not None: + showIndent(outfile, level) + outfile.write('<%sWidth>%s\n' % (namespace_, self.gds_format_integer(self.Width, input_name='Width'), namespace_)) + if self.Height is not None: + showIndent(outfile, level) + outfile.write('<%sHeight>%s\n' % (namespace_, self.gds_format_integer(self.Height, input_name='Height'), namespace_)) + if self.Units is not None: + showIndent(outfile, level) + outfile.write('<%sUnits>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Units).encode(ExternalEncoding), input_name='Units'), namespace_)) + def hasContent_(self): + if ( + self.Length is not None or + self.Width is not None or + self.Height is not None or + self.Units is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Dimensions'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Length is not None: + showIndent(outfile, level) + outfile.write('Length=%d,\n' % self.Length) + if self.Width is not None: + showIndent(outfile, level) + outfile.write('Width=%d,\n' % self.Width) + if self.Height is not None: + showIndent(outfile, level) + outfile.write('Height=%d,\n' % self.Height) + if self.Units is not None: + showIndent(outfile, level) + outfile.write('Units=%s,\n' % quote_python(self.Units).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Length': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'Length') + self.Length = ival_ + elif nodeName_ == 'Width': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'Width') + self.Width = ival_ + elif nodeName_ == 'Height': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'Height') + self.Height = ival_ + elif nodeName_ == 'Units': + Units_ = child_.text + Units_ = self.gds_validate_string(Units_, node, 'Units') + self.Units = Units_ + self.validate_LinearUnits(self.Units) # validate type LinearUnits +# end class Dimensions + + +class Distance(GeneratedsSuper): + """Driving or other transportation distances, distinct from dimension + measurements.""" + subclass = None + superclass = None + def __init__(self, Value=None, Units=None): + self.Value = Value + self.Units = Units + def factory(*args_, **kwargs_): + if Distance.subclass: + return Distance.subclass(*args_, **kwargs_) + else: + return Distance(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Value(self): return self.Value + def set_Value(self, Value): self.Value = Value + def get_Units(self): return self.Units + def set_Units(self, Units): self.Units = Units + def validate_DistanceUnits(self, value): + # Validate type DistanceUnits, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='Distance', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Distance') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Distance'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Distance', fromsubclass_=False): + if self.Value is not None: + showIndent(outfile, level) + outfile.write('<%sValue>%s\n' % (namespace_, self.gds_format_float(self.Value, input_name='Value'), namespace_)) + if self.Units is not None: + showIndent(outfile, level) + outfile.write('<%sUnits>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Units).encode(ExternalEncoding), input_name='Units'), namespace_)) + def hasContent_(self): + if ( + self.Value is not None or + self.Units is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Distance'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Value is not None: + showIndent(outfile, level) + outfile.write('Value=%f,\n' % self.Value) + if self.Units is not None: + showIndent(outfile, level) + outfile.write('Units=%s,\n' % quote_python(self.Units).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Value': + sval_ = child_.text + try: + fval_ = float(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires float or double: %s' % exp) + fval_ = self.gds_validate_float(fval_, node, 'Value') + self.Value = fval_ + elif nodeName_ == 'Units': + Units_ = child_.text + Units_ = self.gds_validate_string(Units_, node, 'Units') + self.Units = Units_ + self.validate_DistanceUnits(self.Units) # validate type DistanceUnits +# end class Distance + + +class EMailLabelDetail(GeneratedsSuper): + """Describes specific information about the email label shipment.""" + subclass = None + superclass = None + def __init__(self, NotificationEMailAddress=None, NotificationMessage=None): + self.NotificationEMailAddress = NotificationEMailAddress + self.NotificationMessage = NotificationMessage + def factory(*args_, **kwargs_): + if EMailLabelDetail.subclass: + return EMailLabelDetail.subclass(*args_, **kwargs_) + else: + return EMailLabelDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_NotificationEMailAddress(self): return self.NotificationEMailAddress + def set_NotificationEMailAddress(self, NotificationEMailAddress): self.NotificationEMailAddress = NotificationEMailAddress + def get_NotificationMessage(self): return self.NotificationMessage + def set_NotificationMessage(self, NotificationMessage): self.NotificationMessage = NotificationMessage + def export(self, outfile, level, namespace_='ns:', name_='EMailLabelDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='EMailLabelDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='EMailLabelDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='EMailLabelDetail', fromsubclass_=False): + if self.NotificationEMailAddress is not None: + showIndent(outfile, level) + outfile.write('<%sNotificationEMailAddress>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.NotificationEMailAddress).encode(ExternalEncoding), input_name='NotificationEMailAddress'), namespace_)) + if self.NotificationMessage is not None: + showIndent(outfile, level) + outfile.write('<%sNotificationMessage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.NotificationMessage).encode(ExternalEncoding), input_name='NotificationMessage'), namespace_)) + def hasContent_(self): + if ( + self.NotificationEMailAddress is not None or + self.NotificationMessage is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='EMailLabelDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.NotificationEMailAddress is not None: + showIndent(outfile, level) + outfile.write('NotificationEMailAddress=%s,\n' % quote_python(self.NotificationEMailAddress).encode(ExternalEncoding)) + if self.NotificationMessage is not None: + showIndent(outfile, level) + outfile.write('NotificationMessage=%s,\n' % quote_python(self.NotificationMessage).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'NotificationEMailAddress': + NotificationEMailAddress_ = child_.text + NotificationEMailAddress_ = self.gds_validate_string(NotificationEMailAddress_, node, 'NotificationEMailAddress') + self.NotificationEMailAddress = NotificationEMailAddress_ + elif nodeName_ == 'NotificationMessage': + NotificationMessage_ = child_.text + NotificationMessage_ = self.gds_validate_string(NotificationMessage_, node, 'NotificationMessage') + self.NotificationMessage = NotificationMessage_ +# end class EMailLabelDetail + + +class EMailNotificationDetail(GeneratedsSuper): + """Information describing email notifications that will be sent in + relation to events that occur during package movement""" + subclass = None + superclass = None + def __init__(self, AggregationType=None, PersonalMessage=None, Recipients=None): + self.AggregationType = AggregationType + self.PersonalMessage = PersonalMessage + if Recipients is None: + self.Recipients = [] + else: + self.Recipients = Recipients + def factory(*args_, **kwargs_): + if EMailNotificationDetail.subclass: + return EMailNotificationDetail.subclass(*args_, **kwargs_) + else: + return EMailNotificationDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_AggregationType(self): return self.AggregationType + def set_AggregationType(self, AggregationType): self.AggregationType = AggregationType + def validate_EMailNotificationAggregationType(self, value): + # Validate type EMailNotificationAggregationType, a restriction on xs:string. + pass + def get_PersonalMessage(self): return self.PersonalMessage + def set_PersonalMessage(self, PersonalMessage): self.PersonalMessage = PersonalMessage + def get_Recipients(self): return self.Recipients + def set_Recipients(self, Recipients): self.Recipients = Recipients + def add_Recipients(self, value): self.Recipients.append(value) + def insert_Recipients(self, index, value): self.Recipients[index] = value + def export(self, outfile, level, namespace_='ns:', name_='EMailNotificationDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='EMailNotificationDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='EMailNotificationDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='EMailNotificationDetail', fromsubclass_=False): + if self.AggregationType is not None: + showIndent(outfile, level) + outfile.write('<%sAggregationType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AggregationType).encode(ExternalEncoding), input_name='AggregationType'), namespace_)) + if self.PersonalMessage is not None: + showIndent(outfile, level) + outfile.write('<%sPersonalMessage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PersonalMessage).encode(ExternalEncoding), input_name='PersonalMessage'), namespace_)) + for Recipients_ in self.Recipients: + Recipients_.export(outfile, level, namespace_, name_='Recipients') + def hasContent_(self): + if ( + self.AggregationType is not None or + self.PersonalMessage is not None or + self.Recipients + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='EMailNotificationDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.AggregationType is not None: + showIndent(outfile, level) + outfile.write('AggregationType=%s,\n' % quote_python(self.AggregationType).encode(ExternalEncoding)) + if self.PersonalMessage is not None: + showIndent(outfile, level) + outfile.write('PersonalMessage=%s,\n' % quote_python(self.PersonalMessage).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Recipients=[\n') + level += 1 + for Recipients_ in self.Recipients: + showIndent(outfile, level) + outfile.write('model_.EMailNotificationRecipient(\n') + Recipients_.exportLiteral(outfile, level, name_='EMailNotificationRecipient') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'AggregationType': + AggregationType_ = child_.text + AggregationType_ = self.gds_validate_string(AggregationType_, node, 'AggregationType') + self.AggregationType = AggregationType_ + self.validate_EMailNotificationAggregationType(self.AggregationType) # validate type EMailNotificationAggregationType + elif nodeName_ == 'PersonalMessage': + PersonalMessage_ = child_.text + PersonalMessage_ = self.gds_validate_string(PersonalMessage_, node, 'PersonalMessage') + self.PersonalMessage = PersonalMessage_ + elif nodeName_ == 'Recipients': + obj_ = EMailNotificationRecipient.factory() + obj_.build(child_) + self.Recipients.append(obj_) +# end class EMailNotificationDetail + + +class EMailNotificationRecipient(GeneratedsSuper): + """The descriptive data for a FedEx email notification recipient.""" + subclass = None + superclass = None + def __init__(self, EMailNotificationRecipientType=None, EMailAddress=None, NotificationEventsRequested=None, Format=None, Localization=None): + self.EMailNotificationRecipientType = EMailNotificationRecipientType + self.EMailAddress = EMailAddress + if NotificationEventsRequested is None: + self.NotificationEventsRequested = [] + else: + self.NotificationEventsRequested = NotificationEventsRequested + self.Format = Format + self.Localization = Localization + def factory(*args_, **kwargs_): + if EMailNotificationRecipient.subclass: + return EMailNotificationRecipient.subclass(*args_, **kwargs_) + else: + return EMailNotificationRecipient(*args_, **kwargs_) + factory = staticmethod(factory) + def get_EMailNotificationRecipientType(self): return self.EMailNotificationRecipientType + def set_EMailNotificationRecipientType(self, EMailNotificationRecipientType): self.EMailNotificationRecipientType = EMailNotificationRecipientType + def validate_EMailNotificationRecipientType(self, value): + # Validate type EMailNotificationRecipientType, a restriction on xs:string. + pass + def get_EMailAddress(self): return self.EMailAddress + def set_EMailAddress(self, EMailAddress): self.EMailAddress = EMailAddress + def get_NotificationEventsRequested(self): return self.NotificationEventsRequested + def set_NotificationEventsRequested(self, NotificationEventsRequested): self.NotificationEventsRequested = NotificationEventsRequested + def add_NotificationEventsRequested(self, value): self.NotificationEventsRequested.append(value) + def insert_NotificationEventsRequested(self, index, value): self.NotificationEventsRequested[index] = value + def validate_EMailNotificationEventType(self, value): + # Validate type EMailNotificationEventType, a restriction on xs:string. + pass + def get_Format(self): return self.Format + def set_Format(self, Format): self.Format = Format + def validate_EMailNotificationFormatType(self, value): + # Validate type EMailNotificationFormatType, a restriction on xs:string. + pass + def get_Localization(self): return self.Localization + def set_Localization(self, Localization): self.Localization = Localization + def export(self, outfile, level, namespace_='ns:', name_='EMailNotificationRecipient', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='EMailNotificationRecipient') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='EMailNotificationRecipient'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='EMailNotificationRecipient', fromsubclass_=False): + if self.EMailNotificationRecipientType is not None: + showIndent(outfile, level) + outfile.write('<%sEMailNotificationRecipientType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.EMailNotificationRecipientType).encode(ExternalEncoding), input_name='EMailNotificationRecipientType'), namespace_)) + if self.EMailAddress is not None: + showIndent(outfile, level) + outfile.write('<%sEMailAddress>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.EMailAddress).encode(ExternalEncoding), input_name='EMailAddress'), namespace_)) + for NotificationEventsRequested_ in self.NotificationEventsRequested: + showIndent(outfile, level) + outfile.write('<%sNotificationEventsRequested>%s\n' % (namespace_, self.gds_format_string(quote_xml(NotificationEventsRequested_).encode(ExternalEncoding), input_name='NotificationEventsRequested'), namespace_)) + if self.Format is not None: + showIndent(outfile, level) + outfile.write('<%sFormat>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Format).encode(ExternalEncoding), input_name='Format'), namespace_)) + if self.Localization: + self.Localization.export(outfile, level, namespace_, name_='Localization') + def hasContent_(self): + if ( + self.EMailNotificationRecipientType is not None or + self.EMailAddress is not None or + self.NotificationEventsRequested or + self.Format is not None or + self.Localization is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='EMailNotificationRecipient'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.EMailNotificationRecipientType is not None: + showIndent(outfile, level) + outfile.write('EMailNotificationRecipientType=%s,\n' % quote_python(self.EMailNotificationRecipientType).encode(ExternalEncoding)) + if self.EMailAddress is not None: + showIndent(outfile, level) + outfile.write('EMailAddress=%s,\n' % quote_python(self.EMailAddress).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('NotificationEventsRequested=[\n') + level += 1 + for NotificationEventsRequested_ in self.NotificationEventsRequested: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(NotificationEventsRequested_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.Format is not None: + showIndent(outfile, level) + outfile.write('Format=%s,\n' % quote_python(self.Format).encode(ExternalEncoding)) + if self.Localization is not None: + showIndent(outfile, level) + outfile.write('Localization=model_.Localization(\n') + self.Localization.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'EMailNotificationRecipientType': + EMailNotificationRecipientType_ = child_.text + EMailNotificationRecipientType_ = self.gds_validate_string(EMailNotificationRecipientType_, node, 'EMailNotificationRecipientType') + self.EMailNotificationRecipientType = EMailNotificationRecipientType_ + self.validate_EMailNotificationRecipientType(self.EMailNotificationRecipientType) # validate type EMailNotificationRecipientType + elif nodeName_ == 'EMailAddress': + EMailAddress_ = child_.text + EMailAddress_ = self.gds_validate_string(EMailAddress_, node, 'EMailAddress') + self.EMailAddress = EMailAddress_ + elif nodeName_ == 'NotificationEventsRequested': + NotificationEventsRequested_ = child_.text + NotificationEventsRequested_ = self.gds_validate_string(NotificationEventsRequested_, node, 'NotificationEventsRequested') + self.NotificationEventsRequested.append(NotificationEventsRequested_) + self.validate_EMailNotificationEventType(self.NotificationEventsRequested) # validate type EMailNotificationEventType + elif nodeName_ == 'Format': + Format_ = child_.text + Format_ = self.gds_validate_string(Format_, node, 'Format') + self.Format = Format_ + self.validate_EMailNotificationFormatType(self.Format) # validate type EMailNotificationFormatType + elif nodeName_ == 'Localization': + obj_ = Localization.factory() + obj_.build(child_) + self.set_Localization(obj_) +# end class EMailNotificationRecipient + + +class EtdDetail(GeneratedsSuper): + """Electronic Trade document references used with the ETD special + service.""" + subclass = None + superclass = None + def __init__(self, Confirmation=None, RequestedDocumentCopies=None, Documents=None, DocumentReferences=None): + self.Confirmation = Confirmation + if RequestedDocumentCopies is None: + self.RequestedDocumentCopies = [] + else: + self.RequestedDocumentCopies = RequestedDocumentCopies + if Documents is None: + self.Documents = [] + else: + self.Documents = Documents + if DocumentReferences is None: + self.DocumentReferences = [] + else: + self.DocumentReferences = DocumentReferences + def factory(*args_, **kwargs_): + if EtdDetail.subclass: + return EtdDetail.subclass(*args_, **kwargs_) + else: + return EtdDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Confirmation(self): return self.Confirmation + def set_Confirmation(self, Confirmation): self.Confirmation = Confirmation + def validate_EtdConfirmationType(self, value): + # Validate type EtdConfirmationType, a restriction on xs:string. + pass + def get_RequestedDocumentCopies(self): return self.RequestedDocumentCopies + def set_RequestedDocumentCopies(self, RequestedDocumentCopies): self.RequestedDocumentCopies = RequestedDocumentCopies + def add_RequestedDocumentCopies(self, value): self.RequestedDocumentCopies.append(value) + def insert_RequestedDocumentCopies(self, index, value): self.RequestedDocumentCopies[index] = value + def validate_RequestedShippingDocumentType(self, value): + # Validate type RequestedShippingDocumentType, a restriction on xs:string. + pass + def get_Documents(self): return self.Documents + def set_Documents(self, Documents): self.Documents = Documents + def add_Documents(self, value): self.Documents.append(value) + def insert_Documents(self, index, value): self.Documents[index] = value + def get_DocumentReferences(self): return self.DocumentReferences + def set_DocumentReferences(self, DocumentReferences): self.DocumentReferences = DocumentReferences + def add_DocumentReferences(self, value): self.DocumentReferences.append(value) + def insert_DocumentReferences(self, index, value): self.DocumentReferences[index] = value + def export(self, outfile, level, namespace_='ns:', name_='EtdDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='EtdDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='EtdDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='EtdDetail', fromsubclass_=False): + if self.Confirmation is not None: + showIndent(outfile, level) + outfile.write('<%sConfirmation>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Confirmation).encode(ExternalEncoding), input_name='Confirmation'), namespace_)) + for RequestedDocumentCopies_ in self.RequestedDocumentCopies: + showIndent(outfile, level) + outfile.write('<%sRequestedDocumentCopies>%s\n' % (namespace_, self.gds_format_string(quote_xml(RequestedDocumentCopies_).encode(ExternalEncoding), input_name='RequestedDocumentCopies'), namespace_)) + for Documents_ in self.Documents: + Documents_.export(outfile, level, namespace_, name_='Documents') + for DocumentReferences_ in self.DocumentReferences: + DocumentReferences_.export(outfile, level, namespace_, name_='DocumentReferences') + def hasContent_(self): + if ( + self.Confirmation is not None or + self.RequestedDocumentCopies or + self.Documents or + self.DocumentReferences + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='EtdDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Confirmation is not None: + showIndent(outfile, level) + outfile.write('Confirmation=%s,\n' % quote_python(self.Confirmation).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('RequestedDocumentCopies=[\n') + level += 1 + for RequestedDocumentCopies_ in self.RequestedDocumentCopies: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(RequestedDocumentCopies_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('Documents=[\n') + level += 1 + for Documents_ in self.Documents: + showIndent(outfile, level) + outfile.write('model_.UploadDocumentDetail(\n') + Documents_.exportLiteral(outfile, level, name_='UploadDocumentDetail') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('DocumentReferences=[\n') + level += 1 + for DocumentReferences_ in self.DocumentReferences: + showIndent(outfile, level) + outfile.write('model_.UploadDocumentReferenceDetail(\n') + DocumentReferences_.exportLiteral(outfile, level, name_='UploadDocumentReferenceDetail') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Confirmation': + Confirmation_ = child_.text + Confirmation_ = self.gds_validate_string(Confirmation_, node, 'Confirmation') + self.Confirmation = Confirmation_ + self.validate_EtdConfirmationType(self.Confirmation) # validate type EtdConfirmationType + elif nodeName_ == 'RequestedDocumentCopies': + RequestedDocumentCopies_ = child_.text + RequestedDocumentCopies_ = self.gds_validate_string(RequestedDocumentCopies_, node, 'RequestedDocumentCopies') + self.RequestedDocumentCopies.append(RequestedDocumentCopies_) + self.validate_RequestedShippingDocumentType(self.RequestedDocumentCopies) # validate type RequestedShippingDocumentType + elif nodeName_ == 'Documents': + obj_ = UploadDocumentDetail.factory() + obj_.build(child_) + self.Documents.append(obj_) + elif nodeName_ == 'DocumentReferences': + obj_ = UploadDocumentReferenceDetail.factory() + obj_.build(child_) + self.DocumentReferences.append(obj_) +# end class EtdDetail + + +class ExpressFreightPickupDetail(GeneratedsSuper): + """Descriptive data regarding an express freight service pickup + request.""" + subclass = None + superclass = None + def __init__(self, Service=None, BookingNumber=None, Dimensions=None, TruckType=None, TrailerSize=None): + self.Service = Service + self.BookingNumber = BookingNumber + self.Dimensions = Dimensions + self.TruckType = TruckType + self.TrailerSize = TrailerSize + def factory(*args_, **kwargs_): + if ExpressFreightPickupDetail.subclass: + return ExpressFreightPickupDetail.subclass(*args_, **kwargs_) + else: + return ExpressFreightPickupDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Service(self): return self.Service + def set_Service(self, Service): self.Service = Service + def validate_ServiceType(self, value): + # Validate type ServiceType, a restriction on xs:string. + pass + def get_BookingNumber(self): return self.BookingNumber + def set_BookingNumber(self, BookingNumber): self.BookingNumber = BookingNumber + def get_Dimensions(self): return self.Dimensions + def set_Dimensions(self, Dimensions): self.Dimensions = Dimensions + def get_TruckType(self): return self.TruckType + def set_TruckType(self, TruckType): self.TruckType = TruckType + def validate_TruckType(self, value): + # Validate type TruckType, a restriction on xs:string. + pass + def get_TrailerSize(self): return self.TrailerSize + def set_TrailerSize(self, TrailerSize): self.TrailerSize = TrailerSize + def validate_TrailerSizeType(self, value): + # Validate type TrailerSizeType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='ExpressFreightPickupDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ExpressFreightPickupDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ExpressFreightPickupDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ExpressFreightPickupDetail', fromsubclass_=False): + if self.Service is not None: + showIndent(outfile, level) + outfile.write('<%sService>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Service).encode(ExternalEncoding), input_name='Service'), namespace_)) + if self.BookingNumber is not None: + showIndent(outfile, level) + outfile.write('<%sBookingNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.BookingNumber).encode(ExternalEncoding), input_name='BookingNumber'), namespace_)) + if self.Dimensions: + self.Dimensions.export(outfile, level, namespace_, name_='Dimensions') + if self.TruckType is not None: + showIndent(outfile, level) + outfile.write('<%sTruckType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.TruckType).encode(ExternalEncoding), input_name='TruckType'), namespace_)) + if self.TrailerSize is not None: + showIndent(outfile, level) + outfile.write('<%sTrailerSize>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.TrailerSize).encode(ExternalEncoding), input_name='TrailerSize'), namespace_)) + def hasContent_(self): + if ( + self.Service is not None or + self.BookingNumber is not None or + self.Dimensions is not None or + self.TruckType is not None or + self.TrailerSize is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ExpressFreightPickupDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Service is not None: + showIndent(outfile, level) + outfile.write('Service=%s,\n' % quote_python(self.Service).encode(ExternalEncoding)) + if self.BookingNumber is not None: + showIndent(outfile, level) + outfile.write('BookingNumber=%s,\n' % quote_python(self.BookingNumber).encode(ExternalEncoding)) + if self.Dimensions is not None: + showIndent(outfile, level) + outfile.write('Dimensions=model_.Dimensions(\n') + self.Dimensions.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.TruckType is not None: + showIndent(outfile, level) + outfile.write('TruckType=%s,\n' % quote_python(self.TruckType).encode(ExternalEncoding)) + if self.TrailerSize is not None: + showIndent(outfile, level) + outfile.write('TrailerSize=%s,\n' % quote_python(self.TrailerSize).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Service': + Service_ = child_.text + Service_ = self.gds_validate_string(Service_, node, 'Service') + self.Service = Service_ + self.validate_ServiceType(self.Service) # validate type ServiceType + elif nodeName_ == 'BookingNumber': + BookingNumber_ = child_.text + BookingNumber_ = self.gds_validate_string(BookingNumber_, node, 'BookingNumber') + self.BookingNumber = BookingNumber_ + elif nodeName_ == 'Dimensions': + obj_ = Dimensions.factory() + obj_.build(child_) + self.set_Dimensions(obj_) + elif nodeName_ == 'TruckType': + TruckType_ = child_.text + TruckType_ = self.gds_validate_string(TruckType_, node, 'TruckType') + self.TruckType = TruckType_ + self.validate_TruckType(self.TruckType) # validate type TruckType + elif nodeName_ == 'TrailerSize': + TrailerSize_ = child_.text + TrailerSize_ = self.gds_validate_string(TrailerSize_, node, 'TrailerSize') + self.TrailerSize = TrailerSize_ + self.validate_TrailerSizeType(self.TrailerSize) # validate type TrailerSizeType +# end class ExpressFreightPickupDetail + + +class ExtraLaborDetail(GeneratedsSuper): + """Specification for labor time spent handling shipment.""" + subclass = None + superclass = None + def __init__(self, Duration=None): + self.Duration = Duration + def factory(*args_, **kwargs_): + if ExtraLaborDetail.subclass: + return ExtraLaborDetail.subclass(*args_, **kwargs_) + else: + return ExtraLaborDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Duration(self): return self.Duration + def set_Duration(self, Duration): self.Duration = Duration + def export(self, outfile, level, namespace_='ns:', name_='ExtraLaborDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ExtraLaborDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ExtraLaborDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ExtraLaborDetail', fromsubclass_=False): + if self.Duration is not None: + showIndent(outfile, level) + outfile.write('<%sDuration>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Duration).encode(ExternalEncoding), input_name='Duration'), namespace_)) + def hasContent_(self): + if ( + self.Duration is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ExtraLaborDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Duration is not None: + showIndent(outfile, level) + outfile.write('Duration=%s,\n' % quote_python(self.Duration).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Duration': + Duration_ = child_.text + Duration_ = self.gds_validate_string(Duration_, node, 'Duration') + self.Duration = Duration_ +# end class ExtraLaborDetail + + +class FlatbedTrailerDetail(GeneratedsSuper): + """Specifies the optional features/characteristics requested for a + Freight shipment utilizing a flatbed trailer.""" + subclass = None + superclass = None + def __init__(self, Options=None): + if Options is None: + self.Options = [] + else: + self.Options = Options + def factory(*args_, **kwargs_): + if FlatbedTrailerDetail.subclass: + return FlatbedTrailerDetail.subclass(*args_, **kwargs_) + else: + return FlatbedTrailerDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Options(self): return self.Options + def set_Options(self, Options): self.Options = Options + def add_Options(self, value): self.Options.append(value) + def insert_Options(self, index, value): self.Options[index] = value + def validate_FlatbedTrailerOption(self, value): + # Validate type FlatbedTrailerOption, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='FlatbedTrailerDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='FlatbedTrailerDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='FlatbedTrailerDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='FlatbedTrailerDetail', fromsubclass_=False): + for Options_ in self.Options: + showIndent(outfile, level) + outfile.write('<%sOptions>%s\n' % (namespace_, self.gds_format_string(quote_xml(Options_).encode(ExternalEncoding), input_name='Options'), namespace_)) + def hasContent_(self): + if ( + self.Options + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='FlatbedTrailerDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('Options=[\n') + level += 1 + for Options_ in self.Options: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(Options_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Options': + Options_ = child_.text + Options_ = self.gds_validate_string(Options_, node, 'Options') + self.Options.append(Options_) + self.validate_FlatbedTrailerOption(self.Options) # validate type FlatbedTrailerOption +# end class FlatbedTrailerDetail + + +class FreightGuaranteeDetail(GeneratedsSuper): + """Descriptive data regarding a FedEx freight service pickup request.""" + subclass = None + superclass = None + def __init__(self, Type=None, Date=None): + self.Type = Type + self.Date = Date + def factory(*args_, **kwargs_): + if FreightGuaranteeDetail.subclass: + return FreightGuaranteeDetail.subclass(*args_, **kwargs_) + else: + return FreightGuaranteeDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Type(self): return self.Type + def set_Type(self, Type): self.Type = Type + def validate_FreightGuaranteeType(self, value): + # Validate type FreightGuaranteeType, a restriction on xs:string. + pass + def get_Date(self): return self.Date + def set_Date(self, Date): self.Date = Date + def export(self, outfile, level, namespace_='ns:', name_='FreightGuaranteeDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='FreightGuaranteeDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='FreightGuaranteeDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='FreightGuaranteeDetail', fromsubclass_=False): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('<%sType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Type).encode(ExternalEncoding), input_name='Type'), namespace_)) + if self.Date is not None: + showIndent(outfile, level) + outfile.write('<%sDate>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Date).encode(ExternalEncoding), input_name='Date'), namespace_)) + def hasContent_(self): + if ( + self.Type is not None or + self.Date is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='FreightGuaranteeDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('Type=%s,\n' % quote_python(self.Type).encode(ExternalEncoding)) + if self.Date is not None: + showIndent(outfile, level) + outfile.write('Date=%s,\n' % quote_python(self.Date).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Type': + Type_ = child_.text + Type_ = self.gds_validate_string(Type_, node, 'Type') + self.Type = Type_ + self.validate_FreightGuaranteeType(self.Type) # validate type FreightGuaranteeType + elif nodeName_ == 'Date': + Date_ = child_.text + Date_ = self.gds_validate_string(Date_, node, 'Date') + self.Date = Date_ +# end class FreightGuaranteeDetail + + +class FreightPickupDetail(GeneratedsSuper): + """Descriptive data regarding a FedEx freight service pickup request.""" + subclass = None + superclass = None + def __init__(self, ApprovedBy=None, Payment=None, Role=None, SubmittedBy=None, LineItems=None): + self.ApprovedBy = ApprovedBy + self.Payment = Payment + self.Role = Role + self.SubmittedBy = SubmittedBy + if LineItems is None: + self.LineItems = [] + else: + self.LineItems = LineItems + def factory(*args_, **kwargs_): + if FreightPickupDetail.subclass: + return FreightPickupDetail.subclass(*args_, **kwargs_) + else: + return FreightPickupDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_ApprovedBy(self): return self.ApprovedBy + def set_ApprovedBy(self, ApprovedBy): self.ApprovedBy = ApprovedBy + def get_Payment(self): return self.Payment + def set_Payment(self, Payment): self.Payment = Payment + def validate_FreightAccountPaymentType(self, value): + # Validate type FreightAccountPaymentType, a restriction on xs:string. + pass + def get_Role(self): return self.Role + def set_Role(self, Role): self.Role = Role + def validate_FreightShipmentRoleType(self, value): + # Validate type FreightShipmentRoleType, a restriction on xs:string. + pass + def get_SubmittedBy(self): return self.SubmittedBy + def set_SubmittedBy(self, SubmittedBy): self.SubmittedBy = SubmittedBy + def get_LineItems(self): return self.LineItems + def set_LineItems(self, LineItems): self.LineItems = LineItems + def add_LineItems(self, value): self.LineItems.append(value) + def insert_LineItems(self, index, value): self.LineItems[index] = value + def export(self, outfile, level, namespace_='ns:', name_='FreightPickupDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='FreightPickupDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='FreightPickupDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='FreightPickupDetail', fromsubclass_=False): + if self.ApprovedBy: + self.ApprovedBy.export(outfile, level, namespace_, name_='ApprovedBy') + if self.Payment is not None: + showIndent(outfile, level) + outfile.write('<%sPayment>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Payment).encode(ExternalEncoding), input_name='Payment'), namespace_)) + if self.Role is not None: + showIndent(outfile, level) + outfile.write('<%sRole>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Role).encode(ExternalEncoding), input_name='Role'), namespace_)) + if self.SubmittedBy: + self.SubmittedBy.export(outfile, level, namespace_, name_='SubmittedBy') + for LineItems_ in self.LineItems: + LineItems_.export(outfile, level, namespace_, name_='LineItems') + def hasContent_(self): + if ( + self.ApprovedBy is not None or + self.Payment is not None or + self.Role is not None or + self.SubmittedBy is not None or + self.LineItems + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='FreightPickupDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.ApprovedBy is not None: + showIndent(outfile, level) + outfile.write('ApprovedBy=model_.Contact(\n') + self.ApprovedBy.exportLiteral(outfile, level, name_='ApprovedBy') + showIndent(outfile, level) + outfile.write('),\n') + if self.Payment is not None: + showIndent(outfile, level) + outfile.write('Payment=%s,\n' % quote_python(self.Payment).encode(ExternalEncoding)) + if self.Role is not None: + showIndent(outfile, level) + outfile.write('Role=%s,\n' % quote_python(self.Role).encode(ExternalEncoding)) + if self.SubmittedBy is not None: + showIndent(outfile, level) + outfile.write('SubmittedBy=model_.Contact(\n') + self.SubmittedBy.exportLiteral(outfile, level, name_='SubmittedBy') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('LineItems=[\n') + level += 1 + for LineItems_ in self.LineItems: + showIndent(outfile, level) + outfile.write('model_.FreightPickupLineItem(\n') + LineItems_.exportLiteral(outfile, level, name_='FreightPickupLineItem') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'ApprovedBy': + obj_ = Contact.factory() + obj_.build(child_) + self.set_ApprovedBy(obj_) + elif nodeName_ == 'Payment': + Payment_ = child_.text + Payment_ = self.gds_validate_string(Payment_, node, 'Payment') + self.Payment = Payment_ + self.validate_FreightAccountPaymentType(self.Payment) # validate type FreightAccountPaymentType + elif nodeName_ == 'Role': + Role_ = child_.text + Role_ = self.gds_validate_string(Role_, node, 'Role') + self.Role = Role_ + self.validate_FreightShipmentRoleType(self.Role) # validate type FreightShipmentRoleType + elif nodeName_ == 'SubmittedBy': + obj_ = Contact.factory() + obj_.build(child_) + self.set_SubmittedBy(obj_) + elif nodeName_ == 'LineItems': + obj_ = FreightPickupLineItem.factory() + obj_.build(child_) + self.LineItems.append(obj_) +# end class FreightPickupDetail + + +class FreightPickupLineItem(GeneratedsSuper): + """Identifies details about the contents of the shipment to be picked + up.""" + subclass = None + superclass = None + def __init__(self, Service=None, SequenceNumber=None, Destination=None, Packaging=None, Pieces=None, Weight=None, TotalHandlingUnits=None, PurchaseOrderNumber=None, JustOneMore=None, SpecialServicesRequested=None, FreightGuaranteeDetail=None, Description=None): + self.Service = Service + self.SequenceNumber = SequenceNumber + self.Destination = Destination + self.Packaging = Packaging + self.Pieces = Pieces + self.Weight = Weight + self.TotalHandlingUnits = TotalHandlingUnits + self.PurchaseOrderNumber = PurchaseOrderNumber + self.JustOneMore = JustOneMore + self.SpecialServicesRequested = SpecialServicesRequested + self.FreightGuaranteeDetail = FreightGuaranteeDetail + self.Description = Description + def factory(*args_, **kwargs_): + if FreightPickupLineItem.subclass: + return FreightPickupLineItem.subclass(*args_, **kwargs_) + else: + return FreightPickupLineItem(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Service(self): return self.Service + def set_Service(self, Service): self.Service = Service + def validate_ServiceType(self, value): + # Validate type ServiceType, a restriction on xs:string. + pass + def get_SequenceNumber(self): return self.SequenceNumber + def set_SequenceNumber(self, SequenceNumber): self.SequenceNumber = SequenceNumber + def get_Destination(self): return self.Destination + def set_Destination(self, Destination): self.Destination = Destination + def get_Packaging(self): return self.Packaging + def set_Packaging(self, Packaging): self.Packaging = Packaging + def validate_PhysicalPackagingType(self, value): + # Validate type PhysicalPackagingType, a restriction on xs:string. + pass + def get_Pieces(self): return self.Pieces + def set_Pieces(self, Pieces): self.Pieces = Pieces + def get_Weight(self): return self.Weight + def set_Weight(self, Weight): self.Weight = Weight + def get_TotalHandlingUnits(self): return self.TotalHandlingUnits + def set_TotalHandlingUnits(self, TotalHandlingUnits): self.TotalHandlingUnits = TotalHandlingUnits + def get_PurchaseOrderNumber(self): return self.PurchaseOrderNumber + def set_PurchaseOrderNumber(self, PurchaseOrderNumber): self.PurchaseOrderNumber = PurchaseOrderNumber + def get_JustOneMore(self): return self.JustOneMore + def set_JustOneMore(self, JustOneMore): self.JustOneMore = JustOneMore + def get_SpecialServicesRequested(self): return self.SpecialServicesRequested + def set_SpecialServicesRequested(self, SpecialServicesRequested): self.SpecialServicesRequested = SpecialServicesRequested + def get_FreightGuaranteeDetail(self): return self.FreightGuaranteeDetail + def set_FreightGuaranteeDetail(self, FreightGuaranteeDetail): self.FreightGuaranteeDetail = FreightGuaranteeDetail + def get_Description(self): return self.Description + def set_Description(self, Description): self.Description = Description + def export(self, outfile, level, namespace_='ns:', name_='FreightPickupLineItem', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='FreightPickupLineItem') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='FreightPickupLineItem'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='FreightPickupLineItem', fromsubclass_=False): + if self.Service is not None: + showIndent(outfile, level) + outfile.write('<%sService>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Service).encode(ExternalEncoding), input_name='Service'), namespace_)) + if self.SequenceNumber is not None: + showIndent(outfile, level) + outfile.write('<%sSequenceNumber>%s\n' % (namespace_, self.gds_format_integer(self.SequenceNumber, input_name='SequenceNumber'), namespace_)) + if self.Destination: + self.Destination.export(outfile, level, namespace_, name_='Destination') + if self.Packaging is not None: + showIndent(outfile, level) + outfile.write('<%sPackaging>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Packaging).encode(ExternalEncoding), input_name='Packaging'), namespace_)) + if self.Pieces is not None: + showIndent(outfile, level) + outfile.write('<%sPieces>%s\n' % (namespace_, self.gds_format_integer(self.Pieces, input_name='Pieces'), namespace_)) + if self.Weight: + self.Weight.export(outfile, level, namespace_, name_='Weight') + if self.TotalHandlingUnits is not None: + showIndent(outfile, level) + outfile.write('<%sTotalHandlingUnits>%s\n' % (namespace_, self.gds_format_integer(self.TotalHandlingUnits, input_name='TotalHandlingUnits'), namespace_)) + if self.PurchaseOrderNumber is not None: + showIndent(outfile, level) + outfile.write('<%sPurchaseOrderNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PurchaseOrderNumber).encode(ExternalEncoding), input_name='PurchaseOrderNumber'), namespace_)) + if self.JustOneMore is not None: + showIndent(outfile, level) + outfile.write('<%sJustOneMore>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.JustOneMore)), input_name='JustOneMore'), namespace_)) + if self.SpecialServicesRequested: + self.SpecialServicesRequested.export(outfile, level, namespace_, name_='SpecialServicesRequested') + if self.FreightGuaranteeDetail: + self.FreightGuaranteeDetail.export(outfile, level, namespace_, name_='FreightGuaranteeDetail') + if self.Description is not None: + showIndent(outfile, level) + outfile.write('<%sDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Description).encode(ExternalEncoding), input_name='Description'), namespace_)) + def hasContent_(self): + if ( + self.Service is not None or + self.SequenceNumber is not None or + self.Destination is not None or + self.Packaging is not None or + self.Pieces is not None or + self.Weight is not None or + self.TotalHandlingUnits is not None or + self.PurchaseOrderNumber is not None or + self.JustOneMore is not None or + self.SpecialServicesRequested is not None or + self.FreightGuaranteeDetail is not None or + self.Description is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='FreightPickupLineItem'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Service is not None: + showIndent(outfile, level) + outfile.write('Service=%s,\n' % quote_python(self.Service).encode(ExternalEncoding)) + if self.SequenceNumber is not None: + showIndent(outfile, level) + outfile.write('SequenceNumber=%d,\n' % self.SequenceNumber) + if self.Destination is not None: + showIndent(outfile, level) + outfile.write('Destination=model_.Address(\n') + self.Destination.exportLiteral(outfile, level, name_='Destination') + showIndent(outfile, level) + outfile.write('),\n') + if self.Packaging is not None: + showIndent(outfile, level) + outfile.write('Packaging=%s,\n' % quote_python(self.Packaging).encode(ExternalEncoding)) + if self.Pieces is not None: + showIndent(outfile, level) + outfile.write('Pieces=%d,\n' % self.Pieces) + if self.Weight is not None: + showIndent(outfile, level) + outfile.write('Weight=model_.Weight(\n') + self.Weight.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalHandlingUnits is not None: + showIndent(outfile, level) + outfile.write('TotalHandlingUnits=%d,\n' % self.TotalHandlingUnits) + if self.PurchaseOrderNumber is not None: + showIndent(outfile, level) + outfile.write('PurchaseOrderNumber=%s,\n' % quote_python(self.PurchaseOrderNumber).encode(ExternalEncoding)) + if self.JustOneMore is not None: + showIndent(outfile, level) + outfile.write('JustOneMore=%s,\n' % self.JustOneMore) + if self.SpecialServicesRequested is not None: + showIndent(outfile, level) + outfile.write('SpecialServicesRequested=model_.ShipmentSpecialServicesRequested(\n') + self.SpecialServicesRequested.exportLiteral(outfile, level, name_='SpecialServicesRequested') + showIndent(outfile, level) + outfile.write('),\n') + if self.FreightGuaranteeDetail is not None: + showIndent(outfile, level) + outfile.write('FreightGuaranteeDetail=model_.FreightGuaranteeDetail(\n') + self.FreightGuaranteeDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Description is not None: + showIndent(outfile, level) + outfile.write('Description=%s,\n' % quote_python(self.Description).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Service': + Service_ = child_.text + Service_ = self.gds_validate_string(Service_, node, 'Service') + self.Service = Service_ + self.validate_ServiceType(self.Service) # validate type ServiceType + elif nodeName_ == 'SequenceNumber': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'SequenceNumber') + self.SequenceNumber = ival_ + elif nodeName_ == 'Destination': + obj_ = Address.factory() + obj_.build(child_) + self.set_Destination(obj_) + elif nodeName_ == 'Packaging': + Packaging_ = child_.text + Packaging_ = self.gds_validate_string(Packaging_, node, 'Packaging') + self.Packaging = Packaging_ + self.validate_PhysicalPackagingType(self.Packaging) # validate type PhysicalPackagingType + elif nodeName_ == 'Pieces': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'Pieces') + self.Pieces = ival_ + elif nodeName_ == 'Weight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_Weight(obj_) + elif nodeName_ == 'TotalHandlingUnits': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'TotalHandlingUnits') + self.TotalHandlingUnits = ival_ + elif nodeName_ == 'PurchaseOrderNumber': + PurchaseOrderNumber_ = child_.text + PurchaseOrderNumber_ = self.gds_validate_string(PurchaseOrderNumber_, node, 'PurchaseOrderNumber') + self.PurchaseOrderNumber = PurchaseOrderNumber_ + elif nodeName_ == 'JustOneMore': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'JustOneMore') + self.JustOneMore = ival_ + elif nodeName_ == 'SpecialServicesRequested': + obj_ = ShipmentSpecialServicesRequested.factory() + obj_.build(child_) + self.set_SpecialServicesRequested(obj_) + elif nodeName_ == 'FreightGuaranteeDetail': + obj_ = FreightGuaranteeDetail.factory() + obj_.build(child_) + self.set_FreightGuaranteeDetail(obj_) + elif nodeName_ == 'Description': + Description_ = child_.text + Description_ = self.gds_validate_string(Description_, node, 'Description') + self.Description = Description_ +# end class FreightPickupLineItem + + +class FreightServiceCenterDetail(GeneratedsSuper): + """This class describes the relationship between a customer-specified + address and the FedEx Freight / FedEx National Freight Service + Center that supports that address.""" + subclass = None + superclass = None + def __init__(self, InterlineCarrierCode=None, InterlineCarrierName=None, AdditionalDays=None, LocalService=None, LocalDistance=None, LocalDuration=None, LocalServiceScheduling=None, LimitedServiceDays=None, GatewayLocationId=None, Location=None, ContactAndAddress=None): + self.InterlineCarrierCode = InterlineCarrierCode + self.InterlineCarrierName = InterlineCarrierName + self.AdditionalDays = AdditionalDays + self.LocalService = LocalService + self.LocalDistance = LocalDistance + self.LocalDuration = LocalDuration + self.LocalServiceScheduling = LocalServiceScheduling + if LimitedServiceDays is None: + self.LimitedServiceDays = [] + else: + self.LimitedServiceDays = LimitedServiceDays + self.GatewayLocationId = GatewayLocationId + self.Location = Location + self.ContactAndAddress = ContactAndAddress + def factory(*args_, **kwargs_): + if FreightServiceCenterDetail.subclass: + return FreightServiceCenterDetail.subclass(*args_, **kwargs_) + else: + return FreightServiceCenterDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_InterlineCarrierCode(self): return self.InterlineCarrierCode + def set_InterlineCarrierCode(self, InterlineCarrierCode): self.InterlineCarrierCode = InterlineCarrierCode + def get_InterlineCarrierName(self): return self.InterlineCarrierName + def set_InterlineCarrierName(self, InterlineCarrierName): self.InterlineCarrierName = InterlineCarrierName + def get_AdditionalDays(self): return self.AdditionalDays + def set_AdditionalDays(self, AdditionalDays): self.AdditionalDays = AdditionalDays + def get_LocalService(self): return self.LocalService + def set_LocalService(self, LocalService): self.LocalService = LocalService + def validate_ServiceType(self, value): + # Validate type ServiceType, a restriction on xs:string. + pass + def get_LocalDistance(self): return self.LocalDistance + def set_LocalDistance(self, LocalDistance): self.LocalDistance = LocalDistance + def get_LocalDuration(self): return self.LocalDuration + def set_LocalDuration(self, LocalDuration): self.LocalDuration = LocalDuration + def get_LocalServiceScheduling(self): return self.LocalServiceScheduling + def set_LocalServiceScheduling(self, LocalServiceScheduling): self.LocalServiceScheduling = LocalServiceScheduling + def validate_FreightServiceSchedulingType(self, value): + # Validate type FreightServiceSchedulingType, a restriction on xs:string. + pass + def get_LimitedServiceDays(self): return self.LimitedServiceDays + def set_LimitedServiceDays(self, LimitedServiceDays): self.LimitedServiceDays = LimitedServiceDays + def add_LimitedServiceDays(self, value): self.LimitedServiceDays.append(value) + def insert_LimitedServiceDays(self, index, value): self.LimitedServiceDays[index] = value + def validate_DayOfWeekType(self, value): + # Validate type DayOfWeekType, a restriction on xs:string. + pass + def get_GatewayLocationId(self): return self.GatewayLocationId + def set_GatewayLocationId(self, GatewayLocationId): self.GatewayLocationId = GatewayLocationId + def get_Location(self): return self.Location + def set_Location(self, Location): self.Location = Location + def get_ContactAndAddress(self): return self.ContactAndAddress + def set_ContactAndAddress(self, ContactAndAddress): self.ContactAndAddress = ContactAndAddress + def export(self, outfile, level, namespace_='ns:', name_='FreightServiceCenterDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='FreightServiceCenterDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='FreightServiceCenterDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='FreightServiceCenterDetail', fromsubclass_=False): + if self.InterlineCarrierCode is not None: + showIndent(outfile, level) + outfile.write('<%sInterlineCarrierCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.InterlineCarrierCode).encode(ExternalEncoding), input_name='InterlineCarrierCode'), namespace_)) + if self.InterlineCarrierName is not None: + showIndent(outfile, level) + outfile.write('<%sInterlineCarrierName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.InterlineCarrierName).encode(ExternalEncoding), input_name='InterlineCarrierName'), namespace_)) + if self.AdditionalDays is not None: + showIndent(outfile, level) + outfile.write('<%sAdditionalDays>%s\n' % (namespace_, self.gds_format_integer(self.AdditionalDays, input_name='AdditionalDays'), namespace_)) + if self.LocalService is not None: + showIndent(outfile, level) + outfile.write('<%sLocalService>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LocalService).encode(ExternalEncoding), input_name='LocalService'), namespace_)) + if self.LocalDistance: + self.LocalDistance.export(outfile, level, namespace_, name_='LocalDistance') + if self.LocalDuration is not None: + showIndent(outfile, level) + outfile.write('<%sLocalDuration>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LocalDuration).encode(ExternalEncoding), input_name='LocalDuration'), namespace_)) + if self.LocalServiceScheduling is not None: + showIndent(outfile, level) + outfile.write('<%sLocalServiceScheduling>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LocalServiceScheduling).encode(ExternalEncoding), input_name='LocalServiceScheduling'), namespace_)) + for LimitedServiceDays_ in self.LimitedServiceDays: + showIndent(outfile, level) + outfile.write('<%sLimitedServiceDays>%s\n' % (namespace_, self.gds_format_string(quote_xml(LimitedServiceDays_).encode(ExternalEncoding), input_name='LimitedServiceDays'), namespace_)) + if self.GatewayLocationId is not None: + showIndent(outfile, level) + outfile.write('<%sGatewayLocationId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.GatewayLocationId).encode(ExternalEncoding), input_name='GatewayLocationId'), namespace_)) + if self.Location is not None: + showIndent(outfile, level) + outfile.write('<%sLocation>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Location).encode(ExternalEncoding), input_name='Location'), namespace_)) + if self.ContactAndAddress: + self.ContactAndAddress.export(outfile, level, namespace_, name_='ContactAndAddress') + def hasContent_(self): + if ( + self.InterlineCarrierCode is not None or + self.InterlineCarrierName is not None or + self.AdditionalDays is not None or + self.LocalService is not None or + self.LocalDistance is not None or + self.LocalDuration is not None or + self.LocalServiceScheduling is not None or + self.LimitedServiceDays or + self.GatewayLocationId is not None or + self.Location is not None or + self.ContactAndAddress is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='FreightServiceCenterDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.InterlineCarrierCode is not None: + showIndent(outfile, level) + outfile.write('InterlineCarrierCode=%s,\n' % quote_python(self.InterlineCarrierCode).encode(ExternalEncoding)) + if self.InterlineCarrierName is not None: + showIndent(outfile, level) + outfile.write('InterlineCarrierName=%s,\n' % quote_python(self.InterlineCarrierName).encode(ExternalEncoding)) + if self.AdditionalDays is not None: + showIndent(outfile, level) + outfile.write('AdditionalDays=%d,\n' % self.AdditionalDays) + if self.LocalService is not None: + showIndent(outfile, level) + outfile.write('LocalService=%s,\n' % quote_python(self.LocalService).encode(ExternalEncoding)) + if self.LocalDistance is not None: + showIndent(outfile, level) + outfile.write('LocalDistance=model_.Distance(\n') + self.LocalDistance.exportLiteral(outfile, level, name_='LocalDistance') + showIndent(outfile, level) + outfile.write('),\n') + if self.LocalDuration is not None: + showIndent(outfile, level) + outfile.write('LocalDuration=%s,\n' % quote_python(self.LocalDuration).encode(ExternalEncoding)) + if self.LocalServiceScheduling is not None: + showIndent(outfile, level) + outfile.write('LocalServiceScheduling=%s,\n' % quote_python(self.LocalServiceScheduling).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('LimitedServiceDays=[\n') + level += 1 + for LimitedServiceDays_ in self.LimitedServiceDays: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(LimitedServiceDays_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.GatewayLocationId is not None: + showIndent(outfile, level) + outfile.write('GatewayLocationId=%s,\n' % quote_python(self.GatewayLocationId).encode(ExternalEncoding)) + if self.Location is not None: + showIndent(outfile, level) + outfile.write('Location=%s,\n' % quote_python(self.Location).encode(ExternalEncoding)) + if self.ContactAndAddress is not None: + showIndent(outfile, level) + outfile.write('ContactAndAddress=model_.ContactAndAddress(\n') + self.ContactAndAddress.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'InterlineCarrierCode': + InterlineCarrierCode_ = child_.text + InterlineCarrierCode_ = self.gds_validate_string(InterlineCarrierCode_, node, 'InterlineCarrierCode') + self.InterlineCarrierCode = InterlineCarrierCode_ + elif nodeName_ == 'InterlineCarrierName': + InterlineCarrierName_ = child_.text + InterlineCarrierName_ = self.gds_validate_string(InterlineCarrierName_, node, 'InterlineCarrierName') + self.InterlineCarrierName = InterlineCarrierName_ + elif nodeName_ == 'AdditionalDays': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'AdditionalDays') + self.AdditionalDays = ival_ + elif nodeName_ == 'LocalService': + LocalService_ = child_.text + LocalService_ = self.gds_validate_string(LocalService_, node, 'LocalService') + self.LocalService = LocalService_ + self.validate_ServiceType(self.LocalService) # validate type ServiceType + elif nodeName_ == 'LocalDistance': + obj_ = Distance.factory() + obj_.build(child_) + self.set_LocalDistance(obj_) + elif nodeName_ == 'LocalDuration': + LocalDuration_ = child_.text + LocalDuration_ = self.gds_validate_string(LocalDuration_, node, 'LocalDuration') + self.LocalDuration = LocalDuration_ + elif nodeName_ == 'LocalServiceScheduling': + LocalServiceScheduling_ = child_.text + LocalServiceScheduling_ = self.gds_validate_string(LocalServiceScheduling_, node, 'LocalServiceScheduling') + self.LocalServiceScheduling = LocalServiceScheduling_ + self.validate_FreightServiceSchedulingType(self.LocalServiceScheduling) # validate type FreightServiceSchedulingType + elif nodeName_ == 'LimitedServiceDays': + LimitedServiceDays_ = child_.text + LimitedServiceDays_ = self.gds_validate_string(LimitedServiceDays_, node, 'LimitedServiceDays') + self.LimitedServiceDays.append(LimitedServiceDays_) + self.validate_DayOfWeekType(self.LimitedServiceDays) # validate type DayOfWeekType + elif nodeName_ == 'GatewayLocationId': + GatewayLocationId_ = child_.text + GatewayLocationId_ = self.gds_validate_string(GatewayLocationId_, node, 'GatewayLocationId') + self.GatewayLocationId = GatewayLocationId_ + elif nodeName_ == 'Location': + Location_ = child_.text + Location_ = self.gds_validate_string(Location_, node, 'Location') + self.Location = Location_ + elif nodeName_ == 'ContactAndAddress': + obj_ = ContactAndAddress.factory() + obj_.build(child_) + self.set_ContactAndAddress(obj_) +# end class FreightServiceCenterDetail + + +class HoldAtLocationDetail(GeneratedsSuper): + """Descriptive data required for a FedEx shipment that is to be held at + the destination FedEx location for pickup by the recipient.""" + subclass = None + superclass = None + def __init__(self, PhoneNumber=None, LocationContactAndAddress=None, LocationType=None, LocationId=None, LocationNumber=None): + self.PhoneNumber = PhoneNumber + self.LocationContactAndAddress = LocationContactAndAddress + self.LocationType = LocationType + self.LocationId = LocationId + self.LocationNumber = LocationNumber + def factory(*args_, **kwargs_): + if HoldAtLocationDetail.subclass: + return HoldAtLocationDetail.subclass(*args_, **kwargs_) + else: + return HoldAtLocationDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_PhoneNumber(self): return self.PhoneNumber + def set_PhoneNumber(self, PhoneNumber): self.PhoneNumber = PhoneNumber + def get_LocationContactAndAddress(self): return self.LocationContactAndAddress + def set_LocationContactAndAddress(self, LocationContactAndAddress): self.LocationContactAndAddress = LocationContactAndAddress + def get_LocationType(self): return self.LocationType + def set_LocationType(self, LocationType): self.LocationType = LocationType + def validate_FedExLocationType(self, value): + # Validate type FedExLocationType, a restriction on xs:string. + pass + def get_LocationId(self): return self.LocationId + def set_LocationId(self, LocationId): self.LocationId = LocationId + def get_LocationNumber(self): return self.LocationNumber + def set_LocationNumber(self, LocationNumber): self.LocationNumber = LocationNumber + def export(self, outfile, level, namespace_='ns:', name_='HoldAtLocationDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='HoldAtLocationDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='HoldAtLocationDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='HoldAtLocationDetail', fromsubclass_=False): + if self.PhoneNumber is not None: + showIndent(outfile, level) + outfile.write('<%sPhoneNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PhoneNumber).encode(ExternalEncoding), input_name='PhoneNumber'), namespace_)) + if self.LocationContactAndAddress: + self.LocationContactAndAddress.export(outfile, level, namespace_, name_='LocationContactAndAddress') + if self.LocationType is not None: + showIndent(outfile, level) + outfile.write('<%sLocationType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LocationType).encode(ExternalEncoding), input_name='LocationType'), namespace_)) + if self.LocationId is not None: + showIndent(outfile, level) + outfile.write('<%sLocationId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LocationId).encode(ExternalEncoding), input_name='LocationId'), namespace_)) + if self.LocationNumber is not None: + showIndent(outfile, level) + outfile.write('<%sLocationNumber>%s\n' % (namespace_, self.gds_format_integer(self.LocationNumber, input_name='LocationNumber'), namespace_)) + def hasContent_(self): + if ( + self.PhoneNumber is not None or + self.LocationContactAndAddress is not None or + self.LocationType is not None or + self.LocationId is not None or + self.LocationNumber is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='HoldAtLocationDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.PhoneNumber is not None: + showIndent(outfile, level) + outfile.write('PhoneNumber=%s,\n' % quote_python(self.PhoneNumber).encode(ExternalEncoding)) + if self.LocationContactAndAddress is not None: + showIndent(outfile, level) + outfile.write('LocationContactAndAddress=model_.ContactAndAddress(\n') + self.LocationContactAndAddress.exportLiteral(outfile, level, name_='LocationContactAndAddress') + showIndent(outfile, level) + outfile.write('),\n') + if self.LocationType is not None: + showIndent(outfile, level) + outfile.write('LocationType=%s,\n' % quote_python(self.LocationType).encode(ExternalEncoding)) + if self.LocationId is not None: + showIndent(outfile, level) + outfile.write('LocationId=%s,\n' % quote_python(self.LocationId).encode(ExternalEncoding)) + if self.LocationNumber is not None: + showIndent(outfile, level) + outfile.write('LocationNumber=%d,\n' % self.LocationNumber) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'PhoneNumber': + PhoneNumber_ = child_.text + PhoneNumber_ = self.gds_validate_string(PhoneNumber_, node, 'PhoneNumber') + self.PhoneNumber = PhoneNumber_ + elif nodeName_ == 'LocationContactAndAddress': + obj_ = ContactAndAddress.factory() + obj_.build(child_) + self.set_LocationContactAndAddress(obj_) + elif nodeName_ == 'LocationType': + LocationType_ = child_.text + LocationType_ = self.gds_validate_string(LocationType_, node, 'LocationType') + self.LocationType = LocationType_ + self.validate_FedExLocationType(self.LocationType) # validate type FedExLocationType + elif nodeName_ == 'LocationId': + LocationId_ = child_.text + LocationId_ = self.gds_validate_string(LocationId_, node, 'LocationId') + self.LocationId = LocationId_ + elif nodeName_ == 'LocationNumber': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'LocationNumber') + self.LocationNumber = ival_ +# end class HoldAtLocationDetail + + +class HomeDeliveryPremiumDetail(GeneratedsSuper): + """The descriptive data required by FedEx for home delivery services.""" + subclass = None + superclass = None + def __init__(self, HomeDeliveryPremiumType=None, Date=None, PhoneNumber=None): + self.HomeDeliveryPremiumType = HomeDeliveryPremiumType + self.Date = Date + self.PhoneNumber = PhoneNumber + def factory(*args_, **kwargs_): + if HomeDeliveryPremiumDetail.subclass: + return HomeDeliveryPremiumDetail.subclass(*args_, **kwargs_) + else: + return HomeDeliveryPremiumDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_HomeDeliveryPremiumType(self): return self.HomeDeliveryPremiumType + def set_HomeDeliveryPremiumType(self, HomeDeliveryPremiumType): self.HomeDeliveryPremiumType = HomeDeliveryPremiumType + def validate_HomeDeliveryPremiumType(self, value): + # Validate type HomeDeliveryPremiumType, a restriction on xs:string. + pass + def get_Date(self): return self.Date + def set_Date(self, Date): self.Date = Date + def get_PhoneNumber(self): return self.PhoneNumber + def set_PhoneNumber(self, PhoneNumber): self.PhoneNumber = PhoneNumber + def export(self, outfile, level, namespace_='ns:', name_='HomeDeliveryPremiumDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='HomeDeliveryPremiumDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='HomeDeliveryPremiumDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='HomeDeliveryPremiumDetail', fromsubclass_=False): + if self.HomeDeliveryPremiumType is not None: + showIndent(outfile, level) + outfile.write('<%sHomeDeliveryPremiumType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HomeDeliveryPremiumType).encode(ExternalEncoding), input_name='HomeDeliveryPremiumType'), namespace_)) + if self.Date is not None: + showIndent(outfile, level) + outfile.write('<%sDate>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Date).encode(ExternalEncoding), input_name='Date'), namespace_)) + if self.PhoneNumber is not None: + showIndent(outfile, level) + outfile.write('<%sPhoneNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PhoneNumber).encode(ExternalEncoding), input_name='PhoneNumber'), namespace_)) + def hasContent_(self): + if ( + self.HomeDeliveryPremiumType is not None or + self.Date is not None or + self.PhoneNumber is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='HomeDeliveryPremiumDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.HomeDeliveryPremiumType is not None: + showIndent(outfile, level) + outfile.write('HomeDeliveryPremiumType=%s,\n' % quote_python(self.HomeDeliveryPremiumType).encode(ExternalEncoding)) + if self.Date is not None: + showIndent(outfile, level) + outfile.write('Date=%s,\n' % quote_python(self.Date).encode(ExternalEncoding)) + if self.PhoneNumber is not None: + showIndent(outfile, level) + outfile.write('PhoneNumber=%s,\n' % quote_python(self.PhoneNumber).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'HomeDeliveryPremiumType': + HomeDeliveryPremiumType_ = child_.text + HomeDeliveryPremiumType_ = self.gds_validate_string(HomeDeliveryPremiumType_, node, 'HomeDeliveryPremiumType') + self.HomeDeliveryPremiumType = HomeDeliveryPremiumType_ + self.validate_HomeDeliveryPremiumType(self.HomeDeliveryPremiumType) # validate type HomeDeliveryPremiumType + elif nodeName_ == 'Date': + Date_ = child_.text + Date_ = self.gds_validate_string(Date_, node, 'Date') + self.Date = Date_ + elif nodeName_ == 'PhoneNumber': + PhoneNumber_ = child_.text + PhoneNumber_ = self.gds_validate_string(PhoneNumber_, node, 'PhoneNumber') + self.PhoneNumber = PhoneNumber_ +# end class HomeDeliveryPremiumDetail + + +class InternationalControlledExportDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Type=None, ForeignTradeZoneCode=None, EntryNumber=None, LicenseOrPermitNumber=None, LicenseOrPermitExpirationDate=None): + self.Type = Type + self.ForeignTradeZoneCode = ForeignTradeZoneCode + self.EntryNumber = EntryNumber + self.LicenseOrPermitNumber = LicenseOrPermitNumber + self.LicenseOrPermitExpirationDate = LicenseOrPermitExpirationDate + def factory(*args_, **kwargs_): + if InternationalControlledExportDetail.subclass: + return InternationalControlledExportDetail.subclass(*args_, **kwargs_) + else: + return InternationalControlledExportDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Type(self): return self.Type + def set_Type(self, Type): self.Type = Type + def validate_InternationalControlledExportType(self, value): + # Validate type InternationalControlledExportType, a restriction on xs:string. + pass + def get_ForeignTradeZoneCode(self): return self.ForeignTradeZoneCode + def set_ForeignTradeZoneCode(self, ForeignTradeZoneCode): self.ForeignTradeZoneCode = ForeignTradeZoneCode + def get_EntryNumber(self): return self.EntryNumber + def set_EntryNumber(self, EntryNumber): self.EntryNumber = EntryNumber + def get_LicenseOrPermitNumber(self): return self.LicenseOrPermitNumber + def set_LicenseOrPermitNumber(self, LicenseOrPermitNumber): self.LicenseOrPermitNumber = LicenseOrPermitNumber + def get_LicenseOrPermitExpirationDate(self): return self.LicenseOrPermitExpirationDate + def set_LicenseOrPermitExpirationDate(self, LicenseOrPermitExpirationDate): self.LicenseOrPermitExpirationDate = LicenseOrPermitExpirationDate + def export(self, outfile, level, namespace_='ns:', name_='InternationalControlledExportDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='InternationalControlledExportDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='InternationalControlledExportDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='InternationalControlledExportDetail', fromsubclass_=False): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('<%sType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Type).encode(ExternalEncoding), input_name='Type'), namespace_)) + if self.ForeignTradeZoneCode is not None: + showIndent(outfile, level) + outfile.write('<%sForeignTradeZoneCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ForeignTradeZoneCode).encode(ExternalEncoding), input_name='ForeignTradeZoneCode'), namespace_)) + if self.EntryNumber is not None: + showIndent(outfile, level) + outfile.write('<%sEntryNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.EntryNumber).encode(ExternalEncoding), input_name='EntryNumber'), namespace_)) + if self.LicenseOrPermitNumber is not None: + showIndent(outfile, level) + outfile.write('<%sLicenseOrPermitNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LicenseOrPermitNumber).encode(ExternalEncoding), input_name='LicenseOrPermitNumber'), namespace_)) + if self.LicenseOrPermitExpirationDate is not None: + showIndent(outfile, level) + outfile.write('<%sLicenseOrPermitExpirationDate>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LicenseOrPermitExpirationDate).encode(ExternalEncoding), input_name='LicenseOrPermitExpirationDate'), namespace_)) + def hasContent_(self): + if ( + self.Type is not None or + self.ForeignTradeZoneCode is not None or + self.EntryNumber is not None or + self.LicenseOrPermitNumber is not None or + self.LicenseOrPermitExpirationDate is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='InternationalControlledExportDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('Type=%s,\n' % quote_python(self.Type).encode(ExternalEncoding)) + if self.ForeignTradeZoneCode is not None: + showIndent(outfile, level) + outfile.write('ForeignTradeZoneCode=%s,\n' % quote_python(self.ForeignTradeZoneCode).encode(ExternalEncoding)) + if self.EntryNumber is not None: + showIndent(outfile, level) + outfile.write('EntryNumber=%s,\n' % quote_python(self.EntryNumber).encode(ExternalEncoding)) + if self.LicenseOrPermitNumber is not None: + showIndent(outfile, level) + outfile.write('LicenseOrPermitNumber=%s,\n' % quote_python(self.LicenseOrPermitNumber).encode(ExternalEncoding)) + if self.LicenseOrPermitExpirationDate is not None: + showIndent(outfile, level) + outfile.write('LicenseOrPermitExpirationDate=%s,\n' % quote_python(self.LicenseOrPermitExpirationDate).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Type': + Type_ = child_.text + Type_ = self.gds_validate_string(Type_, node, 'Type') + self.Type = Type_ + self.validate_InternationalControlledExportType(self.Type) # validate type InternationalControlledExportType + elif nodeName_ == 'ForeignTradeZoneCode': + ForeignTradeZoneCode_ = child_.text + ForeignTradeZoneCode_ = self.gds_validate_string(ForeignTradeZoneCode_, node, 'ForeignTradeZoneCode') + self.ForeignTradeZoneCode = ForeignTradeZoneCode_ + elif nodeName_ == 'EntryNumber': + EntryNumber_ = child_.text + EntryNumber_ = self.gds_validate_string(EntryNumber_, node, 'EntryNumber') + self.EntryNumber = EntryNumber_ + elif nodeName_ == 'LicenseOrPermitNumber': + LicenseOrPermitNumber_ = child_.text + LicenseOrPermitNumber_ = self.gds_validate_string(LicenseOrPermitNumber_, node, 'LicenseOrPermitNumber') + self.LicenseOrPermitNumber = LicenseOrPermitNumber_ + elif nodeName_ == 'LicenseOrPermitExpirationDate': + LicenseOrPermitExpirationDate_ = child_.text + LicenseOrPermitExpirationDate_ = self.gds_validate_string(LicenseOrPermitExpirationDate_, node, 'LicenseOrPermitExpirationDate') + self.LicenseOrPermitExpirationDate = LicenseOrPermitExpirationDate_ +# end class InternationalControlledExportDetail + + +class Localization(GeneratedsSuper): + """Identifies the representation of human-readable text.""" + subclass = None + superclass = None + def __init__(self, LanguageCode=None, LocaleCode=None): + self.LanguageCode = LanguageCode + self.LocaleCode = LocaleCode + def factory(*args_, **kwargs_): + if Localization.subclass: + return Localization.subclass(*args_, **kwargs_) + else: + return Localization(*args_, **kwargs_) + factory = staticmethod(factory) + def get_LanguageCode(self): return self.LanguageCode + def set_LanguageCode(self, LanguageCode): self.LanguageCode = LanguageCode + def get_LocaleCode(self): return self.LocaleCode + def set_LocaleCode(self, LocaleCode): self.LocaleCode = LocaleCode + def export(self, outfile, level, namespace_='ns:', name_='Localization', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Localization') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Localization'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Localization', fromsubclass_=False): + if self.LanguageCode is not None: + showIndent(outfile, level) + outfile.write('<%sLanguageCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LanguageCode).encode(ExternalEncoding), input_name='LanguageCode'), namespace_)) + if self.LocaleCode is not None: + showIndent(outfile, level) + outfile.write('<%sLocaleCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LocaleCode).encode(ExternalEncoding), input_name='LocaleCode'), namespace_)) + def hasContent_(self): + if ( + self.LanguageCode is not None or + self.LocaleCode is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Localization'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.LanguageCode is not None: + showIndent(outfile, level) + outfile.write('LanguageCode=%s,\n' % quote_python(self.LanguageCode).encode(ExternalEncoding)) + if self.LocaleCode is not None: + showIndent(outfile, level) + outfile.write('LocaleCode=%s,\n' % quote_python(self.LocaleCode).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'LanguageCode': + LanguageCode_ = child_.text + LanguageCode_ = self.gds_validate_string(LanguageCode_, node, 'LanguageCode') + self.LanguageCode = LanguageCode_ + elif nodeName_ == 'LocaleCode': + LocaleCode_ = child_.text + LocaleCode_ = self.gds_validate_string(LocaleCode_, node, 'LocaleCode') + self.LocaleCode = LocaleCode_ +# end class Localization + + +class MarkingOrTaggingDetail(GeneratedsSuper): + """Specification for marking or tagging of pieces in shipment.""" + subclass = None + superclass = None + def __init__(self, Count=None): + self.Count = Count + def factory(*args_, **kwargs_): + if MarkingOrTaggingDetail.subclass: + return MarkingOrTaggingDetail.subclass(*args_, **kwargs_) + else: + return MarkingOrTaggingDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Count(self): return self.Count + def set_Count(self, Count): self.Count = Count + def export(self, outfile, level, namespace_='ns:', name_='MarkingOrTaggingDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='MarkingOrTaggingDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='MarkingOrTaggingDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='MarkingOrTaggingDetail', fromsubclass_=False): + if self.Count is not None: + showIndent(outfile, level) + outfile.write('<%sCount>%s\n' % (namespace_, self.gds_format_integer(self.Count, input_name='Count'), namespace_)) + def hasContent_(self): + if ( + self.Count is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='MarkingOrTaggingDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Count is not None: + showIndent(outfile, level) + outfile.write('Count=%d,\n' % self.Count) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Count': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ <= 0: + raise_parse_error(child_, 'requires positiveInteger') + ival_ = self.gds_validate_integer(ival_, node, 'Count') + self.Count = ival_ +# end class MarkingOrTaggingDetail + + +class Money(GeneratedsSuper): + """The descriptive data for the medium of exchange for FedEx services.""" + subclass = None + superclass = None + def __init__(self, Currency=None, Amount=None): + self.Currency = Currency + self.Amount = Amount + def factory(*args_, **kwargs_): + if Money.subclass: + return Money.subclass(*args_, **kwargs_) + else: + return Money(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Currency(self): return self.Currency + def set_Currency(self, Currency): self.Currency = Currency + def get_Amount(self): return self.Amount + def set_Amount(self, Amount): self.Amount = Amount + def export(self, outfile, level, namespace_='ns:', name_='Money', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Money') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Money'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Money', fromsubclass_=False): + if self.Currency is not None: + showIndent(outfile, level) + outfile.write('<%sCurrency>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Currency).encode(ExternalEncoding), input_name='Currency'), namespace_)) + if self.Amount is not None: + showIndent(outfile, level) + outfile.write('<%sAmount>%s\n' % (namespace_, self.gds_format_float(self.Amount, input_name='Amount'), namespace_)) + def hasContent_(self): + if ( + self.Currency is not None or + self.Amount is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Money'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Currency is not None: + showIndent(outfile, level) + outfile.write('Currency=%s,\n' % quote_python(self.Currency).encode(ExternalEncoding)) + if self.Amount is not None: + showIndent(outfile, level) + outfile.write('Amount=%f,\n' % self.Amount) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Currency': + Currency_ = child_.text + Currency_ = self.gds_validate_string(Currency_, node, 'Currency') + self.Currency = Currency_ + elif nodeName_ == 'Amount': + sval_ = child_.text + try: + fval_ = float(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires float or double: %s' % exp) + fval_ = self.gds_validate_float(fval_, node, 'Amount') + self.Amount = fval_ +# end class Money + + +class NonBusinessTimeDetail(GeneratedsSuper): + """Specification for services performed during non-business hours + and/or days.""" + subclass = None + superclass = None + def __init__(self, PersonDays=None, PersonHours=None): + self.PersonDays = PersonDays + self.PersonHours = PersonHours + def factory(*args_, **kwargs_): + if NonBusinessTimeDetail.subclass: + return NonBusinessTimeDetail.subclass(*args_, **kwargs_) + else: + return NonBusinessTimeDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_PersonDays(self): return self.PersonDays + def set_PersonDays(self, PersonDays): self.PersonDays = PersonDays + def get_PersonHours(self): return self.PersonHours + def set_PersonHours(self, PersonHours): self.PersonHours = PersonHours + def export(self, outfile, level, namespace_='ns:', name_='NonBusinessTimeDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='NonBusinessTimeDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='NonBusinessTimeDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='NonBusinessTimeDetail', fromsubclass_=False): + if self.PersonDays is not None: + showIndent(outfile, level) + outfile.write('<%sPersonDays>%s\n' % (namespace_, self.gds_format_integer(self.PersonDays, input_name='PersonDays'), namespace_)) + if self.PersonHours is not None: + showIndent(outfile, level) + outfile.write('<%sPersonHours>%s\n' % (namespace_, self.gds_format_integer(self.PersonHours, input_name='PersonHours'), namespace_)) + def hasContent_(self): + if ( + self.PersonDays is not None or + self.PersonHours is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='NonBusinessTimeDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.PersonDays is not None: + showIndent(outfile, level) + outfile.write('PersonDays=%d,\n' % self.PersonDays) + if self.PersonHours is not None: + showIndent(outfile, level) + outfile.write('PersonHours=%d,\n' % self.PersonHours) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'PersonDays': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'PersonDays') + self.PersonDays = ival_ + elif nodeName_ == 'PersonHours': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'PersonHours') + self.PersonHours = ival_ +# end class NonBusinessTimeDetail + + +class Notification(GeneratedsSuper): + """The descriptive data regarding the result of the submitted + transaction.""" + subclass = None + superclass = None + def __init__(self, Severity=None, Source=None, Code=None, Message=None, LocalizedMessage=None, MessageParameters=None): + self.Severity = Severity + self.Source = Source + self.Code = Code + self.Message = Message + self.LocalizedMessage = LocalizedMessage + if MessageParameters is None: + self.MessageParameters = [] + else: + self.MessageParameters = MessageParameters + def factory(*args_, **kwargs_): + if Notification.subclass: + return Notification.subclass(*args_, **kwargs_) + else: + return Notification(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Severity(self): return self.Severity + def set_Severity(self, Severity): self.Severity = Severity + def validate_NotificationSeverityType(self, value): + # Validate type NotificationSeverityType, a restriction on xs:string. + pass + def get_Source(self): return self.Source + def set_Source(self, Source): self.Source = Source + def get_Code(self): return self.Code + def set_Code(self, Code): self.Code = Code + def get_Message(self): return self.Message + def set_Message(self, Message): self.Message = Message + def get_LocalizedMessage(self): return self.LocalizedMessage + def set_LocalizedMessage(self, LocalizedMessage): self.LocalizedMessage = LocalizedMessage + def get_MessageParameters(self): return self.MessageParameters + def set_MessageParameters(self, MessageParameters): self.MessageParameters = MessageParameters + def add_MessageParameters(self, value): self.MessageParameters.append(value) + def insert_MessageParameters(self, index, value): self.MessageParameters[index] = value + def export(self, outfile, level, namespace_='ns:', name_='Notification', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Notification') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Notification'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Notification', fromsubclass_=False): + if self.Severity is not None: + showIndent(outfile, level) + outfile.write('<%sSeverity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Severity).encode(ExternalEncoding), input_name='Severity'), namespace_)) + if self.Source is not None: + showIndent(outfile, level) + outfile.write('<%sSource>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Source).encode(ExternalEncoding), input_name='Source'), namespace_)) + if self.Code is not None: + showIndent(outfile, level) + outfile.write('<%sCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Code).encode(ExternalEncoding), input_name='Code'), namespace_)) + if self.Message is not None: + showIndent(outfile, level) + outfile.write('<%sMessage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Message).encode(ExternalEncoding), input_name='Message'), namespace_)) + if self.LocalizedMessage is not None: + showIndent(outfile, level) + outfile.write('<%sLocalizedMessage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LocalizedMessage).encode(ExternalEncoding), input_name='LocalizedMessage'), namespace_)) + for MessageParameters_ in self.MessageParameters: + MessageParameters_.export(outfile, level, namespace_, name_='MessageParameters') + def hasContent_(self): + if ( + self.Severity is not None or + self.Source is not None or + self.Code is not None or + self.Message is not None or + self.LocalizedMessage is not None or + self.MessageParameters + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Notification'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Severity is not None: + showIndent(outfile, level) + outfile.write('Severity=%s,\n' % quote_python(self.Severity).encode(ExternalEncoding)) + if self.Source is not None: + showIndent(outfile, level) + outfile.write('Source=%s,\n' % quote_python(self.Source).encode(ExternalEncoding)) + if self.Code is not None: + showIndent(outfile, level) + outfile.write('Code=%s,\n' % quote_python(self.Code).encode(ExternalEncoding)) + if self.Message is not None: + showIndent(outfile, level) + outfile.write('Message=%s,\n' % quote_python(self.Message).encode(ExternalEncoding)) + if self.LocalizedMessage is not None: + showIndent(outfile, level) + outfile.write('LocalizedMessage=%s,\n' % quote_python(self.LocalizedMessage).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('MessageParameters=[\n') + level += 1 + for MessageParameters_ in self.MessageParameters: + showIndent(outfile, level) + outfile.write('model_.NotificationParameter(\n') + MessageParameters_.exportLiteral(outfile, level, name_='NotificationParameter') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Severity': + Severity_ = child_.text + Severity_ = self.gds_validate_string(Severity_, node, 'Severity') + self.Severity = Severity_ + self.validate_NotificationSeverityType(self.Severity) # validate type NotificationSeverityType + elif nodeName_ == 'Source': + Source_ = child_.text + Source_ = self.gds_validate_string(Source_, node, 'Source') + self.Source = Source_ + elif nodeName_ == 'Code': + Code_ = child_.text + Code_ = self.gds_validate_string(Code_, node, 'Code') + self.Code = Code_ + elif nodeName_ == 'Message': + Message_ = child_.text + Message_ = self.gds_validate_string(Message_, node, 'Message') + self.Message = Message_ + elif nodeName_ == 'LocalizedMessage': + LocalizedMessage_ = child_.text + LocalizedMessage_ = self.gds_validate_string(LocalizedMessage_, node, 'LocalizedMessage') + self.LocalizedMessage = LocalizedMessage_ + elif nodeName_ == 'MessageParameters': + obj_ = NotificationParameter.factory() + obj_.build(child_) + self.MessageParameters.append(obj_) +# end class Notification + + +class NotificationParameter(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Id=None, Value=None): + self.Id = Id + self.Value = Value + def factory(*args_, **kwargs_): + if NotificationParameter.subclass: + return NotificationParameter.subclass(*args_, **kwargs_) + else: + return NotificationParameter(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Id(self): return self.Id + def set_Id(self, Id): self.Id = Id + def get_Value(self): return self.Value + def set_Value(self, Value): self.Value = Value + def export(self, outfile, level, namespace_='ns:', name_='NotificationParameter', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='NotificationParameter') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='NotificationParameter'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='NotificationParameter', fromsubclass_=False): + if self.Id is not None: + showIndent(outfile, level) + outfile.write('<%sId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Id).encode(ExternalEncoding), input_name='Id'), namespace_)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('<%sValue>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Value).encode(ExternalEncoding), input_name='Value'), namespace_)) + def hasContent_(self): + if ( + self.Id is not None or + self.Value is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='NotificationParameter'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Id is not None: + showIndent(outfile, level) + outfile.write('Id=%s,\n' % quote_python(self.Id).encode(ExternalEncoding)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('Value=%s,\n' % quote_python(self.Value).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Id': + Id_ = child_.text + Id_ = self.gds_validate_string(Id_, node, 'Id') + self.Id = Id_ + elif nodeName_ == 'Value': + Value_ = child_.text + Value_ = self.gds_validate_string(Value_, node, 'Value') + self.Value = Value_ +# end class NotificationParameter + + +class PalletShrinkwrapDetail(GeneratedsSuper): + """Specifications for pallets to be shrinkwrapped as part of a Freight + shipment.""" + subclass = None + superclass = None + def __init__(self, PalletCount=None): + self.PalletCount = PalletCount + def factory(*args_, **kwargs_): + if PalletShrinkwrapDetail.subclass: + return PalletShrinkwrapDetail.subclass(*args_, **kwargs_) + else: + return PalletShrinkwrapDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_PalletCount(self): return self.PalletCount + def set_PalletCount(self, PalletCount): self.PalletCount = PalletCount + def export(self, outfile, level, namespace_='ns:', name_='PalletShrinkwrapDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='PalletShrinkwrapDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='PalletShrinkwrapDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='PalletShrinkwrapDetail', fromsubclass_=False): + if self.PalletCount is not None: + showIndent(outfile, level) + outfile.write('<%sPalletCount>%s\n' % (namespace_, self.gds_format_integer(self.PalletCount, input_name='PalletCount'), namespace_)) + def hasContent_(self): + if ( + self.PalletCount is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='PalletShrinkwrapDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.PalletCount is not None: + showIndent(outfile, level) + outfile.write('PalletCount=%d,\n' % self.PalletCount) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'PalletCount': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ <= 0: + raise_parse_error(child_, 'requires positiveInteger') + ival_ = self.gds_validate_integer(ival_, node, 'PalletCount') + self.PalletCount = ival_ +# end class PalletShrinkwrapDetail + + +class PalletsProvidedDetail(GeneratedsSuper): + """Specifications for pallets to be provided on Freight shipment.""" + subclass = None + superclass = None + def __init__(self, PalletCount=None): + self.PalletCount = PalletCount + def factory(*args_, **kwargs_): + if PalletsProvidedDetail.subclass: + return PalletsProvidedDetail.subclass(*args_, **kwargs_) + else: + return PalletsProvidedDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_PalletCount(self): return self.PalletCount + def set_PalletCount(self, PalletCount): self.PalletCount = PalletCount + def export(self, outfile, level, namespace_='ns:', name_='PalletsProvidedDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='PalletsProvidedDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='PalletsProvidedDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='PalletsProvidedDetail', fromsubclass_=False): + if self.PalletCount is not None: + showIndent(outfile, level) + outfile.write('<%sPalletCount>%s\n' % (namespace_, self.gds_format_integer(self.PalletCount, input_name='PalletCount'), namespace_)) + def hasContent_(self): + if ( + self.PalletCount is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='PalletsProvidedDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.PalletCount is not None: + showIndent(outfile, level) + outfile.write('PalletCount=%d,\n' % self.PalletCount) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'PalletCount': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ <= 0: + raise_parse_error(child_, 'requires positiveInteger') + ival_ = self.gds_validate_integer(ival_, node, 'PalletCount') + self.PalletCount = ival_ +# end class PalletsProvidedDetail + + +class ParsedContact(GeneratedsSuper): + """This type contains equivalent data to Contact, but uses a form of + person name with separate first and last names.""" + subclass = None + superclass = None + def __init__(self, PersonName=None, Title=None, CompanyName=None, PhoneNumber=None, PagerNumber=None, FaxNumber=None, EMailAddress=None): + self.PersonName = PersonName + self.Title = Title + self.CompanyName = CompanyName + self.PhoneNumber = PhoneNumber + self.PagerNumber = PagerNumber + self.FaxNumber = FaxNumber + self.EMailAddress = EMailAddress + def factory(*args_, **kwargs_): + if ParsedContact.subclass: + return ParsedContact.subclass(*args_, **kwargs_) + else: + return ParsedContact(*args_, **kwargs_) + factory = staticmethod(factory) + def get_PersonName(self): return self.PersonName + def set_PersonName(self, PersonName): self.PersonName = PersonName + def get_Title(self): return self.Title + def set_Title(self, Title): self.Title = Title + def get_CompanyName(self): return self.CompanyName + def set_CompanyName(self, CompanyName): self.CompanyName = CompanyName + def get_PhoneNumber(self): return self.PhoneNumber + def set_PhoneNumber(self, PhoneNumber): self.PhoneNumber = PhoneNumber + def get_PagerNumber(self): return self.PagerNumber + def set_PagerNumber(self, PagerNumber): self.PagerNumber = PagerNumber + def get_FaxNumber(self): return self.FaxNumber + def set_FaxNumber(self, FaxNumber): self.FaxNumber = FaxNumber + def get_EMailAddress(self): return self.EMailAddress + def set_EMailAddress(self, EMailAddress): self.EMailAddress = EMailAddress + def export(self, outfile, level, namespace_='ns:', name_='ParsedContact', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ParsedContact') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ParsedContact'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ParsedContact', fromsubclass_=False): + if self.PersonName: + self.PersonName.export(outfile, level, namespace_, name_='PersonName') + if self.Title is not None: + showIndent(outfile, level) + outfile.write('<%sTitle>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Title).encode(ExternalEncoding), input_name='Title'), namespace_)) + if self.CompanyName is not None: + showIndent(outfile, level) + outfile.write('<%sCompanyName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CompanyName).encode(ExternalEncoding), input_name='CompanyName'), namespace_)) + if self.PhoneNumber is not None: + showIndent(outfile, level) + outfile.write('<%sPhoneNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PhoneNumber).encode(ExternalEncoding), input_name='PhoneNumber'), namespace_)) + if self.PagerNumber is not None: + showIndent(outfile, level) + outfile.write('<%sPagerNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PagerNumber).encode(ExternalEncoding), input_name='PagerNumber'), namespace_)) + if self.FaxNumber is not None: + showIndent(outfile, level) + outfile.write('<%sFaxNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.FaxNumber).encode(ExternalEncoding), input_name='FaxNumber'), namespace_)) + if self.EMailAddress is not None: + showIndent(outfile, level) + outfile.write('<%sEMailAddress>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.EMailAddress).encode(ExternalEncoding), input_name='EMailAddress'), namespace_)) + def hasContent_(self): + if ( + self.PersonName is not None or + self.Title is not None or + self.CompanyName is not None or + self.PhoneNumber is not None or + self.PagerNumber is not None or + self.FaxNumber is not None or + self.EMailAddress is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ParsedContact'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.PersonName is not None: + showIndent(outfile, level) + outfile.write('PersonName=model_.ParsedPersonName(\n') + self.PersonName.exportLiteral(outfile, level, name_='PersonName') + showIndent(outfile, level) + outfile.write('),\n') + if self.Title is not None: + showIndent(outfile, level) + outfile.write('Title=%s,\n' % quote_python(self.Title).encode(ExternalEncoding)) + if self.CompanyName is not None: + showIndent(outfile, level) + outfile.write('CompanyName=%s,\n' % quote_python(self.CompanyName).encode(ExternalEncoding)) + if self.PhoneNumber is not None: + showIndent(outfile, level) + outfile.write('PhoneNumber=%s,\n' % quote_python(self.PhoneNumber).encode(ExternalEncoding)) + if self.PagerNumber is not None: + showIndent(outfile, level) + outfile.write('PagerNumber=%s,\n' % quote_python(self.PagerNumber).encode(ExternalEncoding)) + if self.FaxNumber is not None: + showIndent(outfile, level) + outfile.write('FaxNumber=%s,\n' % quote_python(self.FaxNumber).encode(ExternalEncoding)) + if self.EMailAddress is not None: + showIndent(outfile, level) + outfile.write('EMailAddress=%s,\n' % quote_python(self.EMailAddress).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'PersonName': + obj_ = ParsedPersonName.factory() + obj_.build(child_) + self.set_PersonName(obj_) + elif nodeName_ == 'Title': + Title_ = child_.text + Title_ = self.gds_validate_string(Title_, node, 'Title') + self.Title = Title_ + elif nodeName_ == 'CompanyName': + CompanyName_ = child_.text + CompanyName_ = self.gds_validate_string(CompanyName_, node, 'CompanyName') + self.CompanyName = CompanyName_ + elif nodeName_ == 'PhoneNumber': + PhoneNumber_ = child_.text + PhoneNumber_ = self.gds_validate_string(PhoneNumber_, node, 'PhoneNumber') + self.PhoneNumber = PhoneNumber_ + elif nodeName_ == 'PagerNumber': + PagerNumber_ = child_.text + PagerNumber_ = self.gds_validate_string(PagerNumber_, node, 'PagerNumber') + self.PagerNumber = PagerNumber_ + elif nodeName_ == 'FaxNumber': + FaxNumber_ = child_.text + FaxNumber_ = self.gds_validate_string(FaxNumber_, node, 'FaxNumber') + self.FaxNumber = FaxNumber_ + elif nodeName_ == 'EMailAddress': + EMailAddress_ = child_.text + EMailAddress_ = self.gds_validate_string(EMailAddress_, node, 'EMailAddress') + self.EMailAddress = EMailAddress_ +# end class ParsedContact + + +class ParsedContactAndAddress(GeneratedsSuper): + """This type contains equivalent data to ContactAndAddress, but uses a + form of person name with separate first, middle and last names.""" + subclass = None + superclass = None + def __init__(self, Contact=None, Address=None): + self.Contact = Contact + self.Address = Address + def factory(*args_, **kwargs_): + if ParsedContactAndAddress.subclass: + return ParsedContactAndAddress.subclass(*args_, **kwargs_) + else: + return ParsedContactAndAddress(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Contact(self): return self.Contact + def set_Contact(self, Contact): self.Contact = Contact + def get_Address(self): return self.Address + def set_Address(self, Address): self.Address = Address + def export(self, outfile, level, namespace_='ns:', name_='ParsedContactAndAddress', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ParsedContactAndAddress') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ParsedContactAndAddress'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ParsedContactAndAddress', fromsubclass_=False): + if self.Contact: + self.Contact.export(outfile, level, namespace_, name_='Contact') + if self.Address: + self.Address.export(outfile, level, namespace_, name_='Address') + def hasContent_(self): + if ( + self.Contact is not None or + self.Address is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ParsedContactAndAddress'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Contact is not None: + showIndent(outfile, level) + outfile.write('Contact=model_.ParsedContact(\n') + self.Contact.exportLiteral(outfile, level, name_='Contact') + showIndent(outfile, level) + outfile.write('),\n') + if self.Address is not None: + showIndent(outfile, level) + outfile.write('Address=model_.Address(\n') + self.Address.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Contact': + obj_ = ParsedContact.factory() + obj_.build(child_) + self.set_Contact(obj_) + elif nodeName_ == 'Address': + obj_ = Address.factory() + obj_.build(child_) + self.set_Address(obj_) +# end class ParsedContactAndAddress + + +class ParsedPersonName(GeneratedsSuper): + """Middle name added to support credit card fraud detection.""" + subclass = None + superclass = None + def __init__(self, FirstName=None, MiddleName=None, LastName=None): + self.FirstName = FirstName + self.MiddleName = MiddleName + self.LastName = LastName + def factory(*args_, **kwargs_): + if ParsedPersonName.subclass: + return ParsedPersonName.subclass(*args_, **kwargs_) + else: + return ParsedPersonName(*args_, **kwargs_) + factory = staticmethod(factory) + def get_FirstName(self): return self.FirstName + def set_FirstName(self, FirstName): self.FirstName = FirstName + def get_MiddleName(self): return self.MiddleName + def set_MiddleName(self, MiddleName): self.MiddleName = MiddleName + def get_LastName(self): return self.LastName + def set_LastName(self, LastName): self.LastName = LastName + def export(self, outfile, level, namespace_='ns:', name_='ParsedPersonName', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ParsedPersonName') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ParsedPersonName'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ParsedPersonName', fromsubclass_=False): + if self.FirstName is not None: + showIndent(outfile, level) + outfile.write('<%sFirstName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.FirstName).encode(ExternalEncoding), input_name='FirstName'), namespace_)) + if self.MiddleName is not None: + showIndent(outfile, level) + outfile.write('<%sMiddleName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.MiddleName).encode(ExternalEncoding), input_name='MiddleName'), namespace_)) + if self.LastName is not None: + showIndent(outfile, level) + outfile.write('<%sLastName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LastName).encode(ExternalEncoding), input_name='LastName'), namespace_)) + def hasContent_(self): + if ( + self.FirstName is not None or + self.MiddleName is not None or + self.LastName is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ParsedPersonName'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.FirstName is not None: + showIndent(outfile, level) + outfile.write('FirstName=%s,\n' % quote_python(self.FirstName).encode(ExternalEncoding)) + if self.MiddleName is not None: + showIndent(outfile, level) + outfile.write('MiddleName=%s,\n' % quote_python(self.MiddleName).encode(ExternalEncoding)) + if self.LastName is not None: + showIndent(outfile, level) + outfile.write('LastName=%s,\n' % quote_python(self.LastName).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'FirstName': + FirstName_ = child_.text + FirstName_ = self.gds_validate_string(FirstName_, node, 'FirstName') + self.FirstName = FirstName_ + elif nodeName_ == 'MiddleName': + MiddleName_ = child_.text + MiddleName_ = self.gds_validate_string(MiddleName_, node, 'MiddleName') + self.MiddleName = MiddleName_ + elif nodeName_ == 'LastName': + LastName_ = child_.text + LastName_ = self.gds_validate_string(LastName_, node, 'LastName') + self.LastName = LastName_ +# end class ParsedPersonName + + +class Party(GeneratedsSuper): + """The descriptive data for a person or company entitiy doing business + with FedEx.""" + subclass = None + superclass = None + def __init__(self, AccountNumber=None, Tins=None, Contact=None, Address=None): + self.AccountNumber = AccountNumber + if Tins is None: + self.Tins = [] + else: + self.Tins = Tins + self.Contact = Contact + self.Address = Address + def factory(*args_, **kwargs_): + if Party.subclass: + return Party.subclass(*args_, **kwargs_) + else: + return Party(*args_, **kwargs_) + factory = staticmethod(factory) + def get_AccountNumber(self): return self.AccountNumber + def set_AccountNumber(self, AccountNumber): self.AccountNumber = AccountNumber + def get_Tins(self): return self.Tins + def set_Tins(self, Tins): self.Tins = Tins + def add_Tins(self, value): self.Tins.append(value) + def insert_Tins(self, index, value): self.Tins[index] = value + def get_Contact(self): return self.Contact + def set_Contact(self, Contact): self.Contact = Contact + def get_Address(self): return self.Address + def set_Address(self, Address): self.Address = Address + def export(self, outfile, level, namespace_='ns:', name_='Party', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Party') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Party'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Party', fromsubclass_=False): + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('<%sAccountNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AccountNumber).encode(ExternalEncoding), input_name='AccountNumber'), namespace_)) + for Tins_ in self.Tins: + Tins_.export(outfile, level, namespace_, name_='Tins') + if self.Contact: + self.Contact.export(outfile, level, namespace_, name_='Contact') + if self.Address: + self.Address.export(outfile, level, namespace_, name_='Address') + def hasContent_(self): + if ( + self.AccountNumber is not None or + self.Tins or + self.Contact is not None or + self.Address is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Party'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('AccountNumber=%s,\n' % quote_python(self.AccountNumber).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Tins=[\n') + level += 1 + for Tins_ in self.Tins: + showIndent(outfile, level) + outfile.write('model_.TaxpayerIdentification(\n') + Tins_.exportLiteral(outfile, level, name_='TaxpayerIdentification') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.Contact is not None: + showIndent(outfile, level) + outfile.write('Contact=model_.Contact(\n') + self.Contact.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Address is not None: + showIndent(outfile, level) + outfile.write('Address=model_.Address(\n') + self.Address.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'AccountNumber': + AccountNumber_ = child_.text + AccountNumber_ = self.gds_validate_string(AccountNumber_, node, 'AccountNumber') + self.AccountNumber = AccountNumber_ + elif nodeName_ == 'Tins': + obj_ = TaxpayerIdentification.factory() + obj_.build(child_) + self.Tins.append(obj_) + elif nodeName_ == 'Contact': + obj_ = Contact.factory() + obj_.build(child_) + self.set_Contact(obj_) + elif nodeName_ == 'Address': + obj_ = Address.factory() + obj_.build(child_) + self.set_Address(obj_) +# end class Party + + +class Payment(GeneratedsSuper): + """The descriptive data for the monetary compensation given to FedEx + for services rendered to the customer.""" + subclass = None + superclass = None + def __init__(self, PaymentType=None, Payor=None, CreditCard=None, CreditCardTransactionDetail=None, Amount=None): + self.PaymentType = PaymentType + self.Payor = Payor + self.CreditCard = CreditCard + self.CreditCardTransactionDetail = CreditCardTransactionDetail + self.Amount = Amount + def factory(*args_, **kwargs_): + if Payment.subclass: + return Payment.subclass(*args_, **kwargs_) + else: + return Payment(*args_, **kwargs_) + factory = staticmethod(factory) + def get_PaymentType(self): return self.PaymentType + def set_PaymentType(self, PaymentType): self.PaymentType = PaymentType + def validate_PaymentType(self, value): + # Validate type PaymentType, a restriction on xs:string. + pass + def get_Payor(self): return self.Payor + def set_Payor(self, Payor): self.Payor = Payor + def get_CreditCard(self): return self.CreditCard + def set_CreditCard(self, CreditCard): self.CreditCard = CreditCard + def get_CreditCardTransactionDetail(self): return self.CreditCardTransactionDetail + def set_CreditCardTransactionDetail(self, CreditCardTransactionDetail): self.CreditCardTransactionDetail = CreditCardTransactionDetail + def get_Amount(self): return self.Amount + def set_Amount(self, Amount): self.Amount = Amount + def export(self, outfile, level, namespace_='ns:', name_='Payment', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Payment') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Payment'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Payment', fromsubclass_=False): + if self.PaymentType is not None: + showIndent(outfile, level) + outfile.write('<%sPaymentType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PaymentType).encode(ExternalEncoding), input_name='PaymentType'), namespace_)) + if self.Payor: + self.Payor.export(outfile, level, namespace_, name_='Payor') + if self.CreditCard: + self.CreditCard.export(outfile, level, namespace_, name_='CreditCard') + if self.CreditCardTransactionDetail: + self.CreditCardTransactionDetail.export(outfile, level, namespace_, name_='CreditCardTransactionDetail') + if self.Amount: + self.Amount.export(outfile, level, namespace_, name_='Amount') + def hasContent_(self): + if ( + self.PaymentType is not None or + self.Payor is not None or + self.CreditCard is not None or + self.CreditCardTransactionDetail is not None or + self.Amount is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Payment'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.PaymentType is not None: + showIndent(outfile, level) + outfile.write('PaymentType=%s,\n' % quote_python(self.PaymentType).encode(ExternalEncoding)) + if self.Payor is not None: + showIndent(outfile, level) + outfile.write('Payor=model_.Payor(\n') + self.Payor.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.CreditCard is not None: + showIndent(outfile, level) + outfile.write('CreditCard=model_.CreditCard(\n') + self.CreditCard.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.CreditCardTransactionDetail is not None: + showIndent(outfile, level) + outfile.write('CreditCardTransactionDetail=model_.CreditCardTransactionDetail(\n') + self.CreditCardTransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Amount is not None: + showIndent(outfile, level) + outfile.write('Amount=model_.Money(\n') + self.Amount.exportLiteral(outfile, level, name_='Amount') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'PaymentType': + PaymentType_ = child_.text + PaymentType_ = self.gds_validate_string(PaymentType_, node, 'PaymentType') + self.PaymentType = PaymentType_ + self.validate_PaymentType(self.PaymentType) # validate type PaymentType + elif nodeName_ == 'Payor': + obj_ = Payor.factory() + obj_.build(child_) + self.set_Payor(obj_) + elif nodeName_ == 'CreditCard': + obj_ = CreditCard.factory() + obj_.build(child_) + self.set_CreditCard(obj_) + elif nodeName_ == 'CreditCardTransactionDetail': + obj_ = CreditCardTransactionDetail.factory() + obj_.build(child_) + self.set_CreditCardTransactionDetail(obj_) + elif nodeName_ == 'Amount': + obj_ = Money.factory() + obj_.build(child_) + self.set_Amount(obj_) +# end class Payment + + +class Payor(GeneratedsSuper): + """The descriptive data identifying the party responsible for payment + for a service.""" + subclass = None + superclass = None + def __init__(self, AccountNumber=None, CountryCode=None, AssociatedAccounts=None): + self.AccountNumber = AccountNumber + self.CountryCode = CountryCode + if AssociatedAccounts is None: + self.AssociatedAccounts = [] + else: + self.AssociatedAccounts = AssociatedAccounts + def factory(*args_, **kwargs_): + if Payor.subclass: + return Payor.subclass(*args_, **kwargs_) + else: + return Payor(*args_, **kwargs_) + factory = staticmethod(factory) + def get_AccountNumber(self): return self.AccountNumber + def set_AccountNumber(self, AccountNumber): self.AccountNumber = AccountNumber + def get_CountryCode(self): return self.CountryCode + def set_CountryCode(self, CountryCode): self.CountryCode = CountryCode + def get_AssociatedAccounts(self): return self.AssociatedAccounts + def set_AssociatedAccounts(self, AssociatedAccounts): self.AssociatedAccounts = AssociatedAccounts + def add_AssociatedAccounts(self, value): self.AssociatedAccounts.append(value) + def insert_AssociatedAccounts(self, index, value): self.AssociatedAccounts[index] = value + def export(self, outfile, level, namespace_='ns:', name_='Payor', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Payor') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Payor'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Payor', fromsubclass_=False): + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('<%sAccountNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AccountNumber).encode(ExternalEncoding), input_name='AccountNumber'), namespace_)) + if self.CountryCode is not None: + showIndent(outfile, level) + outfile.write('<%sCountryCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CountryCode).encode(ExternalEncoding), input_name='CountryCode'), namespace_)) + for AssociatedAccounts_ in self.AssociatedAccounts: + AssociatedAccounts_.export(outfile, level, namespace_, name_='AssociatedAccounts') + def hasContent_(self): + if ( + self.AccountNumber is not None or + self.CountryCode is not None or + self.AssociatedAccounts + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Payor'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('AccountNumber=%s,\n' % quote_python(self.AccountNumber).encode(ExternalEncoding)) + if self.CountryCode is not None: + showIndent(outfile, level) + outfile.write('CountryCode=%s,\n' % quote_python(self.CountryCode).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('AssociatedAccounts=[\n') + level += 1 + for AssociatedAccounts_ in self.AssociatedAccounts: + showIndent(outfile, level) + outfile.write('model_.AssociatedAccount(\n') + AssociatedAccounts_.exportLiteral(outfile, level, name_='AssociatedAccount') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'AccountNumber': + AccountNumber_ = child_.text + AccountNumber_ = self.gds_validate_string(AccountNumber_, node, 'AccountNumber') + self.AccountNumber = AccountNumber_ + elif nodeName_ == 'CountryCode': + CountryCode_ = child_.text + CountryCode_ = self.gds_validate_string(CountryCode_, node, 'CountryCode') + self.CountryCode = CountryCode_ + elif nodeName_ == 'AssociatedAccounts': + obj_ = AssociatedAccount.factory() + obj_.build(child_) + self.AssociatedAccounts.append(obj_) +# end class Payor + + +class PendingShipmentDetail(GeneratedsSuper): + """This information describes the kind of pending shipment being + requested.""" + subclass = None + superclass = None + def __init__(self, Type=None, ExpirationDate=None, EmailLabelDetail=None): + self.Type = Type + self.ExpirationDate = ExpirationDate + self.EmailLabelDetail = EmailLabelDetail + def factory(*args_, **kwargs_): + if PendingShipmentDetail.subclass: + return PendingShipmentDetail.subclass(*args_, **kwargs_) + else: + return PendingShipmentDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Type(self): return self.Type + def set_Type(self, Type): self.Type = Type + def validate_PendingShipmentType(self, value): + # Validate type PendingShipmentType, a restriction on xs:string. + pass + def get_ExpirationDate(self): return self.ExpirationDate + def set_ExpirationDate(self, ExpirationDate): self.ExpirationDate = ExpirationDate + def get_EmailLabelDetail(self): return self.EmailLabelDetail + def set_EmailLabelDetail(self, EmailLabelDetail): self.EmailLabelDetail = EmailLabelDetail + def export(self, outfile, level, namespace_='ns:', name_='PendingShipmentDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='PendingShipmentDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='PendingShipmentDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='PendingShipmentDetail', fromsubclass_=False): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('<%sType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Type).encode(ExternalEncoding), input_name='Type'), namespace_)) + if self.ExpirationDate is not None: + showIndent(outfile, level) + outfile.write('<%sExpirationDate>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ExpirationDate).encode(ExternalEncoding), input_name='ExpirationDate'), namespace_)) + if self.EmailLabelDetail: + self.EmailLabelDetail.export(outfile, level, namespace_, name_='EmailLabelDetail') + def hasContent_(self): + if ( + self.Type is not None or + self.ExpirationDate is not None or + self.EmailLabelDetail is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='PendingShipmentDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('Type=%s,\n' % quote_python(self.Type).encode(ExternalEncoding)) + if self.ExpirationDate is not None: + showIndent(outfile, level) + outfile.write('ExpirationDate=%s,\n' % quote_python(self.ExpirationDate).encode(ExternalEncoding)) + if self.EmailLabelDetail is not None: + showIndent(outfile, level) + outfile.write('EmailLabelDetail=model_.EMailLabelDetail(\n') + self.EmailLabelDetail.exportLiteral(outfile, level, name_='EmailLabelDetail') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Type': + Type_ = child_.text + Type_ = self.gds_validate_string(Type_, node, 'Type') + self.Type = Type_ + self.validate_PendingShipmentType(self.Type) # validate type PendingShipmentType + elif nodeName_ == 'ExpirationDate': + ExpirationDate_ = child_.text + ExpirationDate_ = self.gds_validate_string(ExpirationDate_, node, 'ExpirationDate') + self.ExpirationDate = ExpirationDate_ + elif nodeName_ == 'EmailLabelDetail': + obj_ = EMailLabelDetail.factory() + obj_.build(child_) + self.set_EmailLabelDetail(obj_) +# end class PendingShipmentDetail + + +class PickupAvailabilityReply(GeneratedsSuper): + """The descriptive data returned to a client in response to a cancel + dispatch request.""" + subclass = None + superclass = None + def __init__(self, HighestSeverity=None, Notifications=None, TransactionDetail=None, Version=None, RequestTimestamp=None, Options=None, CloseTimeType=None, CloseTime=None, LocalTime=None): + self.HighestSeverity = HighestSeverity + if Notifications is None: + self.Notifications = [] + else: + self.Notifications = Notifications + self.TransactionDetail = TransactionDetail + self.Version = Version + self.RequestTimestamp = RequestTimestamp + if Options is None: + self.Options = [] + else: + self.Options = Options + self.CloseTimeType = CloseTimeType + self.CloseTime = CloseTime + self.LocalTime = LocalTime + def factory(*args_, **kwargs_): + if PickupAvailabilityReply.subclass: + return PickupAvailabilityReply.subclass(*args_, **kwargs_) + else: + return PickupAvailabilityReply(*args_, **kwargs_) + factory = staticmethod(factory) + def get_HighestSeverity(self): return self.HighestSeverity + def set_HighestSeverity(self, HighestSeverity): self.HighestSeverity = HighestSeverity + def validate_NotificationSeverityType(self, value): + # Validate type NotificationSeverityType, a restriction on xs:string. + pass + def get_Notifications(self): return self.Notifications + def set_Notifications(self, Notifications): self.Notifications = Notifications + def add_Notifications(self, value): self.Notifications.append(value) + def insert_Notifications(self, index, value): self.Notifications[index] = value + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_RequestTimestamp(self): return self.RequestTimestamp + def set_RequestTimestamp(self, RequestTimestamp): self.RequestTimestamp = RequestTimestamp + def get_Options(self): return self.Options + def set_Options(self, Options): self.Options = Options + def add_Options(self, value): self.Options.append(value) + def insert_Options(self, index, value): self.Options[index] = value + def get_CloseTimeType(self): return self.CloseTimeType + def set_CloseTimeType(self, CloseTimeType): self.CloseTimeType = CloseTimeType + def validate_CloseTimeType(self, value): + # Validate type CloseTimeType, a restriction on xs:string. + pass + def get_CloseTime(self): return self.CloseTime + def set_CloseTime(self, CloseTime): self.CloseTime = CloseTime + def get_LocalTime(self): return self.LocalTime + def set_LocalTime(self, LocalTime): self.LocalTime = LocalTime + def export(self, outfile, level, namespace_='ns:', name_='PickupAvailabilityReply', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='PickupAvailabilityReply') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='PickupAvailabilityReply'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='PickupAvailabilityReply', fromsubclass_=False): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('<%sHighestSeverity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HighestSeverity).encode(ExternalEncoding), input_name='HighestSeverity'), namespace_)) + for Notifications_ in self.Notifications: + Notifications_.export(outfile, level, namespace_, name_='Notifications') + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.RequestTimestamp is not None: + showIndent(outfile, level) + outfile.write('<%sRequestTimestamp>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RequestTimestamp).encode(ExternalEncoding), input_name='RequestTimestamp'), namespace_)) + for Options_ in self.Options: + Options_.export(outfile, level, namespace_, name_='Options') + if self.CloseTimeType is not None: + showIndent(outfile, level) + outfile.write('<%sCloseTimeType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CloseTimeType).encode(ExternalEncoding), input_name='CloseTimeType'), namespace_)) + if self.CloseTime: + self.CloseTime.export(outfile, level, namespace_, name_='CloseTime') + if self.LocalTime: + self.LocalTime.export(outfile, level, namespace_, name_='LocalTime') + def hasContent_(self): + if ( + self.HighestSeverity is not None or + self.Notifications or + self.TransactionDetail is not None or + self.Version is not None or + self.RequestTimestamp is not None or + self.Options or + self.CloseTimeType is not None or + self.CloseTime is not None or + self.LocalTime is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='PickupAvailabilityReply'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('HighestSeverity=%s,\n' % quote_python(self.HighestSeverity).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Notifications=[\n') + level += 1 + for Notifications_ in self.Notifications: + showIndent(outfile, level) + outfile.write('model_.Notification(\n') + Notifications_.exportLiteral(outfile, level, name_='Notification') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.RequestTimestamp is not None: + showIndent(outfile, level) + outfile.write('RequestTimestamp=%s,\n' % quote_python(self.RequestTimestamp).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Options=[\n') + level += 1 + for Options_ in self.Options: + showIndent(outfile, level) + outfile.write('model_.PickupScheduleOption(\n') + Options_.exportLiteral(outfile, level, name_='PickupScheduleOption') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.CloseTimeType is not None: + showIndent(outfile, level) + outfile.write('CloseTimeType=%s,\n' % quote_python(self.CloseTimeType).encode(ExternalEncoding)) + if self.CloseTime is not None: + showIndent(outfile, level) + outfile.write('CloseTime=model_.xs_time(\n') + self.CloseTime.exportLiteral(outfile, level, name_='CloseTime') + showIndent(outfile, level) + outfile.write('),\n') + if self.LocalTime is not None: + showIndent(outfile, level) + outfile.write('LocalTime=model_.xs_time(\n') + self.LocalTime.exportLiteral(outfile, level, name_='LocalTime') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'HighestSeverity': + HighestSeverity_ = child_.text + HighestSeverity_ = self.gds_validate_string(HighestSeverity_, node, 'HighestSeverity') + self.HighestSeverity = HighestSeverity_ + self.validate_NotificationSeverityType(self.HighestSeverity) # validate type NotificationSeverityType + elif nodeName_ == 'Notifications': + obj_ = Notification.factory() + obj_.build(child_) + self.Notifications.append(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'RequestTimestamp': + RequestTimestamp_ = child_.text + RequestTimestamp_ = self.gds_validate_string(RequestTimestamp_, node, 'RequestTimestamp') + self.RequestTimestamp = RequestTimestamp_ + elif nodeName_ == 'Options': + obj_ = PickupScheduleOption.factory() + obj_.build(child_) + self.Options.append(obj_) + elif nodeName_ == 'CloseTimeType': + CloseTimeType_ = child_.text + CloseTimeType_ = self.gds_validate_string(CloseTimeType_, node, 'CloseTimeType') + self.CloseTimeType = CloseTimeType_ + self.validate_CloseTimeType(self.CloseTimeType) # validate type CloseTimeType + elif nodeName_ == 'CloseTime': + obj_ = xs_time.factory() + obj_.build(child_) + self.set_CloseTime(obj_) + elif nodeName_ == 'LocalTime': + obj_ = xs_time.factory() + obj_.build(child_) + self.set_LocalTime(obj_) +# end class PickupAvailabilityReply + + +class PickupAvailabilityRequest(GeneratedsSuper): + """The descriptive data to request availability of pickup.""" + subclass = None + superclass = None + def __init__(self, WebAuthenticationDetail=None, ClientDetail=None, TransactionDetail=None, Version=None, AccountNumber=None, PickupAddress=None, PickupRequestType=None, DispatchDate=None, NumberOfBusinessDays=None, PackageReadyTime=None, CustomerCloseTime=None, Carriers=None, ShipmentAttributes=None): + self.WebAuthenticationDetail = WebAuthenticationDetail + self.ClientDetail = ClientDetail + self.TransactionDetail = TransactionDetail + self.Version = Version + self.AccountNumber = AccountNumber + self.PickupAddress = PickupAddress + if PickupRequestType is None: + self.PickupRequestType = [] + else: + self.PickupRequestType = PickupRequestType + self.DispatchDate = DispatchDate + self.NumberOfBusinessDays = NumberOfBusinessDays + self.PackageReadyTime = PackageReadyTime + self.CustomerCloseTime = CustomerCloseTime + if Carriers is None: + self.Carriers = [] + else: + self.Carriers = Carriers + self.ShipmentAttributes = ShipmentAttributes + def factory(*args_, **kwargs_): + if PickupAvailabilityRequest.subclass: + return PickupAvailabilityRequest.subclass(*args_, **kwargs_) + else: + return PickupAvailabilityRequest(*args_, **kwargs_) + factory = staticmethod(factory) + def get_WebAuthenticationDetail(self): return self.WebAuthenticationDetail + def set_WebAuthenticationDetail(self, WebAuthenticationDetail): self.WebAuthenticationDetail = WebAuthenticationDetail + def get_ClientDetail(self): return self.ClientDetail + def set_ClientDetail(self, ClientDetail): self.ClientDetail = ClientDetail + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_AccountNumber(self): return self.AccountNumber + def set_AccountNumber(self, AccountNumber): self.AccountNumber = AccountNumber + def get_PickupAddress(self): return self.PickupAddress + def set_PickupAddress(self, PickupAddress): self.PickupAddress = PickupAddress + def get_PickupRequestType(self): return self.PickupRequestType + def set_PickupRequestType(self, PickupRequestType): self.PickupRequestType = PickupRequestType + def add_PickupRequestType(self, value): self.PickupRequestType.append(value) + def insert_PickupRequestType(self, index, value): self.PickupRequestType[index] = value + def validate_PickupRequestType(self, value): + # Validate type PickupRequestType, a restriction on xs:string. + pass + def get_DispatchDate(self): return self.DispatchDate + def set_DispatchDate(self, DispatchDate): self.DispatchDate = DispatchDate + def get_NumberOfBusinessDays(self): return self.NumberOfBusinessDays + def set_NumberOfBusinessDays(self, NumberOfBusinessDays): self.NumberOfBusinessDays = NumberOfBusinessDays + def get_PackageReadyTime(self): return self.PackageReadyTime + def set_PackageReadyTime(self, PackageReadyTime): self.PackageReadyTime = PackageReadyTime + def get_CustomerCloseTime(self): return self.CustomerCloseTime + def set_CustomerCloseTime(self, CustomerCloseTime): self.CustomerCloseTime = CustomerCloseTime + def get_Carriers(self): return self.Carriers + def set_Carriers(self, Carriers): self.Carriers = Carriers + def add_Carriers(self, value): self.Carriers.append(value) + def insert_Carriers(self, index, value): self.Carriers[index] = value + def validate_CarrierCodeType(self, value): + # Validate type CarrierCodeType, a restriction on xs:string. + pass + def get_ShipmentAttributes(self): return self.ShipmentAttributes + def set_ShipmentAttributes(self, ShipmentAttributes): self.ShipmentAttributes = ShipmentAttributes + def export(self, outfile, level, namespace_='ns:', name_='PickupAvailabilityRequest', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='PickupAvailabilityRequest') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='PickupAvailabilityRequest'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='PickupAvailabilityRequest', fromsubclass_=False): + if self.WebAuthenticationDetail: + self.WebAuthenticationDetail.export(outfile, level, namespace_, name_='WebAuthenticationDetail', ) + if self.ClientDetail: + self.ClientDetail.export(outfile, level, namespace_, name_='ClientDetail', ) + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.AccountNumber: + self.AccountNumber.export(outfile, level, namespace_, name_='AccountNumber') + if self.PickupAddress: + self.PickupAddress.export(outfile, level, namespace_, name_='PickupAddress') + for PickupRequestType_ in self.PickupRequestType: + showIndent(outfile, level) + outfile.write('<%sPickupRequestType>%s\n' % (namespace_, self.gds_format_string(quote_xml(PickupRequestType_).encode(ExternalEncoding), input_name='PickupRequestType'), namespace_)) + if self.DispatchDate is not None: + showIndent(outfile, level) + outfile.write('<%sDispatchDate>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DispatchDate).encode(ExternalEncoding), input_name='DispatchDate'), namespace_)) + if self.NumberOfBusinessDays is not None: + showIndent(outfile, level) + outfile.write('<%sNumberOfBusinessDays>%s\n' % (namespace_, self.gds_format_integer(self.NumberOfBusinessDays, input_name='NumberOfBusinessDays'), namespace_)) + if self.PackageReadyTime: + self.PackageReadyTime.export(outfile, level, namespace_, name_='PackageReadyTime') + if self.CustomerCloseTime: + self.CustomerCloseTime.export(outfile, level, namespace_, name_='CustomerCloseTime') + for Carriers_ in self.Carriers: + showIndent(outfile, level) + outfile.write('<%sCarriers>%s\n' % (namespace_, self.gds_format_string(quote_xml(Carriers_).encode(ExternalEncoding), input_name='Carriers'), namespace_)) + if self.ShipmentAttributes: + self.ShipmentAttributes.export(outfile, level, namespace_, name_='ShipmentAttributes') + def hasContent_(self): + if ( + self.WebAuthenticationDetail is not None or + self.ClientDetail is not None or + self.TransactionDetail is not None or + self.Version is not None or + self.AccountNumber is not None or + self.PickupAddress is not None or + self.PickupRequestType or + self.DispatchDate is not None or + self.NumberOfBusinessDays is not None or + self.PackageReadyTime is not None or + self.CustomerCloseTime is not None or + self.Carriers or + self.ShipmentAttributes is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='PickupAvailabilityRequest'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.WebAuthenticationDetail is not None: + showIndent(outfile, level) + outfile.write('WebAuthenticationDetail=model_.WebAuthenticationDetail(\n') + self.WebAuthenticationDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ClientDetail is not None: + showIndent(outfile, level) + outfile.write('ClientDetail=model_.ClientDetail(\n') + self.ClientDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('AccountNumber=model_.AssociatedAccount(\n') + self.AccountNumber.exportLiteral(outfile, level, name_='AccountNumber') + showIndent(outfile, level) + outfile.write('),\n') + if self.PickupAddress is not None: + showIndent(outfile, level) + outfile.write('PickupAddress=model_.Address(\n') + self.PickupAddress.exportLiteral(outfile, level, name_='PickupAddress') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('PickupRequestType=[\n') + level += 1 + for PickupRequestType_ in self.PickupRequestType: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(PickupRequestType_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.DispatchDate is not None: + showIndent(outfile, level) + outfile.write('DispatchDate=%s,\n' % quote_python(self.DispatchDate).encode(ExternalEncoding)) + if self.NumberOfBusinessDays is not None: + showIndent(outfile, level) + outfile.write('NumberOfBusinessDays=%d,\n' % self.NumberOfBusinessDays) + if self.PackageReadyTime is not None: + showIndent(outfile, level) + outfile.write('PackageReadyTime=model_.xs_time(\n') + self.PackageReadyTime.exportLiteral(outfile, level, name_='PackageReadyTime') + showIndent(outfile, level) + outfile.write('),\n') + if self.CustomerCloseTime is not None: + showIndent(outfile, level) + outfile.write('CustomerCloseTime=model_.xs_time(\n') + self.CustomerCloseTime.exportLiteral(outfile, level, name_='CustomerCloseTime') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('Carriers=[\n') + level += 1 + for Carriers_ in self.Carriers: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(Carriers_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.ShipmentAttributes is not None: + showIndent(outfile, level) + outfile.write('ShipmentAttributes=model_.PickupShipmentAttributes(\n') + self.ShipmentAttributes.exportLiteral(outfile, level, name_='ShipmentAttributes') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'WebAuthenticationDetail': + obj_ = WebAuthenticationDetail.factory() + obj_.build(child_) + self.set_WebAuthenticationDetail(obj_) + elif nodeName_ == 'ClientDetail': + obj_ = ClientDetail.factory() + obj_.build(child_) + self.set_ClientDetail(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'AccountNumber': + obj_ = AssociatedAccount.factory() + obj_.build(child_) + self.set_AccountNumber(obj_) + elif nodeName_ == 'PickupAddress': + obj_ = Address.factory() + obj_.build(child_) + self.set_PickupAddress(obj_) + elif nodeName_ == 'PickupRequestType': + PickupRequestType_ = child_.text + PickupRequestType_ = self.gds_validate_string(PickupRequestType_, node, 'PickupRequestType') + self.PickupRequestType.append(PickupRequestType_) + self.validate_PickupRequestType(self.PickupRequestType) # validate type PickupRequestType + elif nodeName_ == 'DispatchDate': + DispatchDate_ = child_.text + DispatchDate_ = self.gds_validate_string(DispatchDate_, node, 'DispatchDate') + self.DispatchDate = DispatchDate_ + elif nodeName_ == 'NumberOfBusinessDays': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ <= 0: + raise_parse_error(child_, 'requires positiveInteger') + ival_ = self.gds_validate_integer(ival_, node, 'NumberOfBusinessDays') + self.NumberOfBusinessDays = ival_ + elif nodeName_ == 'PackageReadyTime': + obj_ = xs_time.factory() + obj_.build(child_) + self.set_PackageReadyTime(obj_) + elif nodeName_ == 'CustomerCloseTime': + obj_ = xs_time.factory() + obj_.build(child_) + self.set_CustomerCloseTime(obj_) + elif nodeName_ == 'Carriers': + Carriers_ = child_.text + Carriers_ = self.gds_validate_string(Carriers_, node, 'Carriers') + self.Carriers.append(Carriers_) + self.validate_CarrierCodeType(self.Carriers) # validate type CarrierCodeType + elif nodeName_ == 'ShipmentAttributes': + obj_ = PickupShipmentAttributes.factory() + obj_.build(child_) + self.set_ShipmentAttributes(obj_) +# end class PickupAvailabilityRequest + + +class PickupOriginDetail(GeneratedsSuper): + """Descriptive data about the origin of the shipment being picked up by + FedEx.""" + subclass = None + superclass = None + def __init__(self, UseAccountAddress=None, AddressId=None, PickupLocation=None, PackageLocation=None, BuildingPart=None, BuildingPartDescription=None, ReadyTimestamp=None, CompanyCloseTime=None, StayLate=None, PickupDateType=None, LastAccessTime=None, GeographicalPostalCode=None, Location=None, DeleteLastUsed=None, SuppliesRequested=None, EarlyPickup=None): + self.UseAccountAddress = UseAccountAddress + self.AddressId = AddressId + self.PickupLocation = PickupLocation + self.PackageLocation = PackageLocation + self.BuildingPart = BuildingPart + self.BuildingPartDescription = BuildingPartDescription + self.ReadyTimestamp = ReadyTimestamp + self.CompanyCloseTime = CompanyCloseTime + self.StayLate = StayLate + self.PickupDateType = PickupDateType + self.LastAccessTime = LastAccessTime + self.GeographicalPostalCode = GeographicalPostalCode + self.Location = Location + self.DeleteLastUsed = DeleteLastUsed + self.SuppliesRequested = SuppliesRequested + self.EarlyPickup = EarlyPickup + def factory(*args_, **kwargs_): + if PickupOriginDetail.subclass: + return PickupOriginDetail.subclass(*args_, **kwargs_) + else: + return PickupOriginDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_UseAccountAddress(self): return self.UseAccountAddress + def set_UseAccountAddress(self, UseAccountAddress): self.UseAccountAddress = UseAccountAddress + def get_AddressId(self): return self.AddressId + def set_AddressId(self, AddressId): self.AddressId = AddressId + def get_PickupLocation(self): return self.PickupLocation + def set_PickupLocation(self, PickupLocation): self.PickupLocation = PickupLocation + def get_PackageLocation(self): return self.PackageLocation + def set_PackageLocation(self, PackageLocation): self.PackageLocation = PackageLocation + def validate_PickupBuildingLocationType(self, value): + # Validate type PickupBuildingLocationType, a restriction on xs:string. + pass + def get_BuildingPart(self): return self.BuildingPart + def set_BuildingPart(self, BuildingPart): self.BuildingPart = BuildingPart + def validate_BuildingPartCode(self, value): + # Validate type BuildingPartCode, a restriction on xs:string. + pass + def get_BuildingPartDescription(self): return self.BuildingPartDescription + def set_BuildingPartDescription(self, BuildingPartDescription): self.BuildingPartDescription = BuildingPartDescription + def get_ReadyTimestamp(self): return self.ReadyTimestamp + def set_ReadyTimestamp(self, ReadyTimestamp): self.ReadyTimestamp = ReadyTimestamp + def get_CompanyCloseTime(self): return self.CompanyCloseTime + def set_CompanyCloseTime(self, CompanyCloseTime): self.CompanyCloseTime = CompanyCloseTime + def get_StayLate(self): return self.StayLate + def set_StayLate(self, StayLate): self.StayLate = StayLate + def get_PickupDateType(self): return self.PickupDateType + def set_PickupDateType(self, PickupDateType): self.PickupDateType = PickupDateType + def validate_PickupRequestType(self, value): + # Validate type PickupRequestType, a restriction on xs:string. + pass + def get_LastAccessTime(self): return self.LastAccessTime + def set_LastAccessTime(self, LastAccessTime): self.LastAccessTime = LastAccessTime + def get_GeographicalPostalCode(self): return self.GeographicalPostalCode + def set_GeographicalPostalCode(self, GeographicalPostalCode): self.GeographicalPostalCode = GeographicalPostalCode + def get_Location(self): return self.Location + def set_Location(self, Location): self.Location = Location + def get_DeleteLastUsed(self): return self.DeleteLastUsed + def set_DeleteLastUsed(self, DeleteLastUsed): self.DeleteLastUsed = DeleteLastUsed + def get_SuppliesRequested(self): return self.SuppliesRequested + def set_SuppliesRequested(self, SuppliesRequested): self.SuppliesRequested = SuppliesRequested + def get_EarlyPickup(self): return self.EarlyPickup + def set_EarlyPickup(self, EarlyPickup): self.EarlyPickup = EarlyPickup + def export(self, outfile, level, namespace_='ns:', name_='PickupOriginDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='PickupOriginDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='PickupOriginDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='PickupOriginDetail', fromsubclass_=False): + if self.UseAccountAddress is not None: + showIndent(outfile, level) + outfile.write('<%sUseAccountAddress>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.UseAccountAddress)), input_name='UseAccountAddress'), namespace_)) + if self.AddressId is not None: + showIndent(outfile, level) + outfile.write('<%sAddressId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AddressId).encode(ExternalEncoding), input_name='AddressId'), namespace_)) + if self.PickupLocation: + self.PickupLocation.export(outfile, level, namespace_, name_='PickupLocation') + if self.PackageLocation is not None: + showIndent(outfile, level) + outfile.write('<%sPackageLocation>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PackageLocation).encode(ExternalEncoding), input_name='PackageLocation'), namespace_)) + if self.BuildingPart is not None: + showIndent(outfile, level) + outfile.write('<%sBuildingPart>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.BuildingPart).encode(ExternalEncoding), input_name='BuildingPart'), namespace_)) + if self.BuildingPartDescription is not None: + showIndent(outfile, level) + outfile.write('<%sBuildingPartDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.BuildingPartDescription).encode(ExternalEncoding), input_name='BuildingPartDescription'), namespace_)) + if self.ReadyTimestamp is not None: + showIndent(outfile, level) + outfile.write('<%sReadyTimestamp>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ReadyTimestamp).encode(ExternalEncoding), input_name='ReadyTimestamp'), namespace_)) + if self.CompanyCloseTime: + self.CompanyCloseTime.export(outfile, level, namespace_, name_='CompanyCloseTime') + if self.StayLate is not None: + showIndent(outfile, level) + outfile.write('<%sStayLate>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.StayLate)), input_name='StayLate'), namespace_)) + if self.PickupDateType is not None: + showIndent(outfile, level) + outfile.write('<%sPickupDateType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PickupDateType).encode(ExternalEncoding), input_name='PickupDateType'), namespace_)) + if self.LastAccessTime: + self.LastAccessTime.export(outfile, level, namespace_, name_='LastAccessTime') + if self.GeographicalPostalCode is not None: + showIndent(outfile, level) + outfile.write('<%sGeographicalPostalCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.GeographicalPostalCode).encode(ExternalEncoding), input_name='GeographicalPostalCode'), namespace_)) + if self.Location is not None: + showIndent(outfile, level) + outfile.write('<%sLocation>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Location).encode(ExternalEncoding), input_name='Location'), namespace_)) + if self.DeleteLastUsed is not None: + showIndent(outfile, level) + outfile.write('<%sDeleteLastUsed>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.DeleteLastUsed)), input_name='DeleteLastUsed'), namespace_)) + if self.SuppliesRequested is not None: + showIndent(outfile, level) + outfile.write('<%sSuppliesRequested>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.SuppliesRequested).encode(ExternalEncoding), input_name='SuppliesRequested'), namespace_)) + if self.EarlyPickup is not None: + showIndent(outfile, level) + outfile.write('<%sEarlyPickup>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.EarlyPickup)), input_name='EarlyPickup'), namespace_)) + def hasContent_(self): + if ( + self.UseAccountAddress is not None or + self.AddressId is not None or + self.PickupLocation is not None or + self.PackageLocation is not None or + self.BuildingPart is not None or + self.BuildingPartDescription is not None or + self.ReadyTimestamp is not None or + self.CompanyCloseTime is not None or + self.StayLate is not None or + self.PickupDateType is not None or + self.LastAccessTime is not None or + self.GeographicalPostalCode is not None or + self.Location is not None or + self.DeleteLastUsed is not None or + self.SuppliesRequested is not None or + self.EarlyPickup is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='PickupOriginDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.UseAccountAddress is not None: + showIndent(outfile, level) + outfile.write('UseAccountAddress=%s,\n' % self.UseAccountAddress) + if self.AddressId is not None: + showIndent(outfile, level) + outfile.write('AddressId=%s,\n' % quote_python(self.AddressId).encode(ExternalEncoding)) + if self.PickupLocation is not None: + showIndent(outfile, level) + outfile.write('PickupLocation=model_.ContactAndAddress(\n') + self.PickupLocation.exportLiteral(outfile, level, name_='PickupLocation') + showIndent(outfile, level) + outfile.write('),\n') + if self.PackageLocation is not None: + showIndent(outfile, level) + outfile.write('PackageLocation=%s,\n' % quote_python(self.PackageLocation).encode(ExternalEncoding)) + if self.BuildingPart is not None: + showIndent(outfile, level) + outfile.write('BuildingPart=%s,\n' % quote_python(self.BuildingPart).encode(ExternalEncoding)) + if self.BuildingPartDescription is not None: + showIndent(outfile, level) + outfile.write('BuildingPartDescription=%s,\n' % quote_python(self.BuildingPartDescription).encode(ExternalEncoding)) + if self.ReadyTimestamp is not None: + showIndent(outfile, level) + outfile.write('ReadyTimestamp=%s,\n' % quote_python(self.ReadyTimestamp).encode(ExternalEncoding)) + if self.CompanyCloseTime is not None: + showIndent(outfile, level) + outfile.write('CompanyCloseTime=model_.xs_time(\n') + self.CompanyCloseTime.exportLiteral(outfile, level, name_='CompanyCloseTime') + showIndent(outfile, level) + outfile.write('),\n') + if self.StayLate is not None: + showIndent(outfile, level) + outfile.write('StayLate=%s,\n' % self.StayLate) + if self.PickupDateType is not None: + showIndent(outfile, level) + outfile.write('PickupDateType=%s,\n' % quote_python(self.PickupDateType).encode(ExternalEncoding)) + if self.LastAccessTime is not None: + showIndent(outfile, level) + outfile.write('LastAccessTime=model_.xs_time(\n') + self.LastAccessTime.exportLiteral(outfile, level, name_='LastAccessTime') + showIndent(outfile, level) + outfile.write('),\n') + if self.GeographicalPostalCode is not None: + showIndent(outfile, level) + outfile.write('GeographicalPostalCode=%s,\n' % quote_python(self.GeographicalPostalCode).encode(ExternalEncoding)) + if self.Location is not None: + showIndent(outfile, level) + outfile.write('Location=%s,\n' % quote_python(self.Location).encode(ExternalEncoding)) + if self.DeleteLastUsed is not None: + showIndent(outfile, level) + outfile.write('DeleteLastUsed=%s,\n' % self.DeleteLastUsed) + if self.SuppliesRequested is not None: + showIndent(outfile, level) + outfile.write('SuppliesRequested=%s,\n' % quote_python(self.SuppliesRequested).encode(ExternalEncoding)) + if self.EarlyPickup is not None: + showIndent(outfile, level) + outfile.write('EarlyPickup=%s,\n' % self.EarlyPickup) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'UseAccountAddress': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'UseAccountAddress') + self.UseAccountAddress = ival_ + elif nodeName_ == 'AddressId': + AddressId_ = child_.text + AddressId_ = self.gds_validate_string(AddressId_, node, 'AddressId') + self.AddressId = AddressId_ + elif nodeName_ == 'PickupLocation': + obj_ = ContactAndAddress.factory() + obj_.build(child_) + self.set_PickupLocation(obj_) + elif nodeName_ == 'PackageLocation': + PackageLocation_ = child_.text + PackageLocation_ = self.gds_validate_string(PackageLocation_, node, 'PackageLocation') + self.PackageLocation = PackageLocation_ + self.validate_PickupBuildingLocationType(self.PackageLocation) # validate type PickupBuildingLocationType + elif nodeName_ == 'BuildingPart': + BuildingPart_ = child_.text + BuildingPart_ = self.gds_validate_string(BuildingPart_, node, 'BuildingPart') + self.BuildingPart = BuildingPart_ + self.validate_BuildingPartCode(self.BuildingPart) # validate type BuildingPartCode + elif nodeName_ == 'BuildingPartDescription': + BuildingPartDescription_ = child_.text + BuildingPartDescription_ = self.gds_validate_string(BuildingPartDescription_, node, 'BuildingPartDescription') + self.BuildingPartDescription = BuildingPartDescription_ + elif nodeName_ == 'ReadyTimestamp': + ReadyTimestamp_ = child_.text + ReadyTimestamp_ = self.gds_validate_string(ReadyTimestamp_, node, 'ReadyTimestamp') + self.ReadyTimestamp = ReadyTimestamp_ + elif nodeName_ == 'CompanyCloseTime': + obj_ = xs_time.factory() + obj_.build(child_) + self.set_CompanyCloseTime(obj_) + elif nodeName_ == 'StayLate': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'StayLate') + self.StayLate = ival_ + elif nodeName_ == 'PickupDateType': + PickupDateType_ = child_.text + PickupDateType_ = self.gds_validate_string(PickupDateType_, node, 'PickupDateType') + self.PickupDateType = PickupDateType_ + self.validate_PickupRequestType(self.PickupDateType) # validate type PickupRequestType + elif nodeName_ == 'LastAccessTime': + obj_ = xs_time.factory() + obj_.build(child_) + self.set_LastAccessTime(obj_) + elif nodeName_ == 'GeographicalPostalCode': + GeographicalPostalCode_ = child_.text + GeographicalPostalCode_ = self.gds_validate_string(GeographicalPostalCode_, node, 'GeographicalPostalCode') + self.GeographicalPostalCode = GeographicalPostalCode_ + elif nodeName_ == 'Location': + Location_ = child_.text + Location_ = self.gds_validate_string(Location_, node, 'Location') + self.Location = Location_ + elif nodeName_ == 'DeleteLastUsed': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'DeleteLastUsed') + self.DeleteLastUsed = ival_ + elif nodeName_ == 'SuppliesRequested': + SuppliesRequested_ = child_.text + SuppliesRequested_ = self.gds_validate_string(SuppliesRequested_, node, 'SuppliesRequested') + self.SuppliesRequested = SuppliesRequested_ + elif nodeName_ == 'EarlyPickup': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'EarlyPickup') + self.EarlyPickup = ival_ +# end class PickupOriginDetail + + +class PickupScheduleOption(GeneratedsSuper): + """The constraints on the scheduling of a dispatch, where that dispatch + would be made by the Carrier, occur on the PickupDate, and would + be scheduled (created by means of a CourierDispatchRequest) on a + date related to the PickupDate as described by the "ScheduleDay" + (SAME_DAY meaning that the creation would occur on the + PickupDate, and FUTURE_DAY meaning that the creation would occur + on a date prior to the PickupDate).""" + subclass = None + superclass = None + def __init__(self, Carrier=None, Description=None, ScheduleDay=None, Available=None, PickupDate=None, CutOffTime=None, AccessTime=None, ResidentialAvailable=None, CountryRelationship=None): + self.Carrier = Carrier + self.Description = Description + self.ScheduleDay = ScheduleDay + self.Available = Available + self.PickupDate = PickupDate + self.CutOffTime = CutOffTime + self.AccessTime = AccessTime + self.ResidentialAvailable = ResidentialAvailable + self.CountryRelationship = CountryRelationship + def factory(*args_, **kwargs_): + if PickupScheduleOption.subclass: + return PickupScheduleOption.subclass(*args_, **kwargs_) + else: + return PickupScheduleOption(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Carrier(self): return self.Carrier + def set_Carrier(self, Carrier): self.Carrier = Carrier + def validate_CarrierCodeType(self, value): + # Validate type CarrierCodeType, a restriction on xs:string. + pass + def get_Description(self): return self.Description + def set_Description(self, Description): self.Description = Description + def get_ScheduleDay(self): return self.ScheduleDay + def set_ScheduleDay(self, ScheduleDay): self.ScheduleDay = ScheduleDay + def validate_PickupRequestType(self, value): + # Validate type PickupRequestType, a restriction on xs:string. + pass + def get_Available(self): return self.Available + def set_Available(self, Available): self.Available = Available + def get_PickupDate(self): return self.PickupDate + def set_PickupDate(self, PickupDate): self.PickupDate = PickupDate + def get_CutOffTime(self): return self.CutOffTime + def set_CutOffTime(self, CutOffTime): self.CutOffTime = CutOffTime + def get_AccessTime(self): return self.AccessTime + def set_AccessTime(self, AccessTime): self.AccessTime = AccessTime + def get_ResidentialAvailable(self): return self.ResidentialAvailable + def set_ResidentialAvailable(self, ResidentialAvailable): self.ResidentialAvailable = ResidentialAvailable + def get_CountryRelationship(self): return self.CountryRelationship + def set_CountryRelationship(self, CountryRelationship): self.CountryRelationship = CountryRelationship + def validate_CountryRelationshipType(self, value): + # Validate type CountryRelationshipType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='PickupScheduleOption', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='PickupScheduleOption') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='PickupScheduleOption'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='PickupScheduleOption', fromsubclass_=False): + if self.Carrier is not None: + showIndent(outfile, level) + outfile.write('<%sCarrier>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Carrier).encode(ExternalEncoding), input_name='Carrier'), namespace_)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('<%sDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Description).encode(ExternalEncoding), input_name='Description'), namespace_)) + if self.ScheduleDay is not None: + showIndent(outfile, level) + outfile.write('<%sScheduleDay>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ScheduleDay).encode(ExternalEncoding), input_name='ScheduleDay'), namespace_)) + if self.Available is not None: + showIndent(outfile, level) + outfile.write('<%sAvailable>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.Available)), input_name='Available'), namespace_)) + if self.PickupDate is not None: + showIndent(outfile, level) + outfile.write('<%sPickupDate>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PickupDate).encode(ExternalEncoding), input_name='PickupDate'), namespace_)) + if self.CutOffTime: + self.CutOffTime.export(outfile, level, namespace_, name_='CutOffTime') + if self.AccessTime is not None: + showIndent(outfile, level) + outfile.write('<%sAccessTime>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AccessTime).encode(ExternalEncoding), input_name='AccessTime'), namespace_)) + if self.ResidentialAvailable is not None: + showIndent(outfile, level) + outfile.write('<%sResidentialAvailable>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.ResidentialAvailable)), input_name='ResidentialAvailable'), namespace_)) + if self.CountryRelationship is not None: + showIndent(outfile, level) + outfile.write('<%sCountryRelationship>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CountryRelationship).encode(ExternalEncoding), input_name='CountryRelationship'), namespace_)) + def hasContent_(self): + if ( + self.Carrier is not None or + self.Description is not None or + self.ScheduleDay is not None or + self.Available is not None or + self.PickupDate is not None or + self.CutOffTime is not None or + self.AccessTime is not None or + self.ResidentialAvailable is not None or + self.CountryRelationship is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='PickupScheduleOption'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Carrier is not None: + showIndent(outfile, level) + outfile.write('Carrier=%s,\n' % quote_python(self.Carrier).encode(ExternalEncoding)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('Description=%s,\n' % quote_python(self.Description).encode(ExternalEncoding)) + if self.ScheduleDay is not None: + showIndent(outfile, level) + outfile.write('ScheduleDay=%s,\n' % quote_python(self.ScheduleDay).encode(ExternalEncoding)) + if self.Available is not None: + showIndent(outfile, level) + outfile.write('Available=%s,\n' % self.Available) + if self.PickupDate is not None: + showIndent(outfile, level) + outfile.write('PickupDate=%s,\n' % quote_python(self.PickupDate).encode(ExternalEncoding)) + if self.CutOffTime is not None: + showIndent(outfile, level) + outfile.write('CutOffTime=model_.xs_time(\n') + self.CutOffTime.exportLiteral(outfile, level, name_='CutOffTime') + showIndent(outfile, level) + outfile.write('),\n') + if self.AccessTime is not None: + showIndent(outfile, level) + outfile.write('AccessTime=%s,\n' % quote_python(self.AccessTime).encode(ExternalEncoding)) + if self.ResidentialAvailable is not None: + showIndent(outfile, level) + outfile.write('ResidentialAvailable=%s,\n' % self.ResidentialAvailable) + if self.CountryRelationship is not None: + showIndent(outfile, level) + outfile.write('CountryRelationship=%s,\n' % quote_python(self.CountryRelationship).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Carrier': + Carrier_ = child_.text + Carrier_ = self.gds_validate_string(Carrier_, node, 'Carrier') + self.Carrier = Carrier_ + self.validate_CarrierCodeType(self.Carrier) # validate type CarrierCodeType + elif nodeName_ == 'Description': + Description_ = child_.text + Description_ = self.gds_validate_string(Description_, node, 'Description') + self.Description = Description_ + elif nodeName_ == 'ScheduleDay': + ScheduleDay_ = child_.text + ScheduleDay_ = self.gds_validate_string(ScheduleDay_, node, 'ScheduleDay') + self.ScheduleDay = ScheduleDay_ + self.validate_PickupRequestType(self.ScheduleDay) # validate type PickupRequestType + elif nodeName_ == 'Available': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'Available') + self.Available = ival_ + elif nodeName_ == 'PickupDate': + PickupDate_ = child_.text + PickupDate_ = self.gds_validate_string(PickupDate_, node, 'PickupDate') + self.PickupDate = PickupDate_ + elif nodeName_ == 'CutOffTime': + obj_ = xs_time.factory() + obj_.build(child_) + self.set_CutOffTime(obj_) + elif nodeName_ == 'AccessTime': + AccessTime_ = child_.text + AccessTime_ = self.gds_validate_string(AccessTime_, node, 'AccessTime') + self.AccessTime = AccessTime_ + elif nodeName_ == 'ResidentialAvailable': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'ResidentialAvailable') + self.ResidentialAvailable = ival_ + elif nodeName_ == 'CountryRelationship': + CountryRelationship_ = child_.text + CountryRelationship_ = self.gds_validate_string(CountryRelationship_, node, 'CountryRelationship') + self.CountryRelationship = CountryRelationship_ + self.validate_CountryRelationshipType(self.CountryRelationship) # validate type CountryRelationshipType +# end class PickupScheduleOption + + +class PickupShipmentAttributes(GeneratedsSuper): + """Descriptive information about the shipment.""" + subclass = None + superclass = None + def __init__(self, ServiceType=None, PackagingType=None, Dimensions=None, Weight=None): + self.ServiceType = ServiceType + self.PackagingType = PackagingType + self.Dimensions = Dimensions + self.Weight = Weight + def factory(*args_, **kwargs_): + if PickupShipmentAttributes.subclass: + return PickupShipmentAttributes.subclass(*args_, **kwargs_) + else: + return PickupShipmentAttributes(*args_, **kwargs_) + factory = staticmethod(factory) + def get_ServiceType(self): return self.ServiceType + def set_ServiceType(self, ServiceType): self.ServiceType = ServiceType + def validate_ServiceType(self, value): + # Validate type ServiceType, a restriction on xs:string. + pass + def get_PackagingType(self): return self.PackagingType + def set_PackagingType(self, PackagingType): self.PackagingType = PackagingType + def validate_PackagingType(self, value): + # Validate type PackagingType, a restriction on xs:string. + pass + def get_Dimensions(self): return self.Dimensions + def set_Dimensions(self, Dimensions): self.Dimensions = Dimensions + def get_Weight(self): return self.Weight + def set_Weight(self, Weight): self.Weight = Weight + def export(self, outfile, level, namespace_='ns:', name_='PickupShipmentAttributes', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='PickupShipmentAttributes') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='PickupShipmentAttributes'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='PickupShipmentAttributes', fromsubclass_=False): + if self.ServiceType is not None: + showIndent(outfile, level) + outfile.write('<%sServiceType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ServiceType).encode(ExternalEncoding), input_name='ServiceType'), namespace_)) + if self.PackagingType is not None: + showIndent(outfile, level) + outfile.write('<%sPackagingType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PackagingType).encode(ExternalEncoding), input_name='PackagingType'), namespace_)) + if self.Dimensions: + self.Dimensions.export(outfile, level, namespace_, name_='Dimensions') + if self.Weight: + self.Weight.export(outfile, level, namespace_, name_='Weight') + def hasContent_(self): + if ( + self.ServiceType is not None or + self.PackagingType is not None or + self.Dimensions is not None or + self.Weight is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='PickupShipmentAttributes'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.ServiceType is not None: + showIndent(outfile, level) + outfile.write('ServiceType=%s,\n' % quote_python(self.ServiceType).encode(ExternalEncoding)) + if self.PackagingType is not None: + showIndent(outfile, level) + outfile.write('PackagingType=%s,\n' % quote_python(self.PackagingType).encode(ExternalEncoding)) + if self.Dimensions is not None: + showIndent(outfile, level) + outfile.write('Dimensions=model_.Dimensions(\n') + self.Dimensions.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Weight is not None: + showIndent(outfile, level) + outfile.write('Weight=model_.Weight(\n') + self.Weight.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'ServiceType': + ServiceType_ = child_.text + ServiceType_ = self.gds_validate_string(ServiceType_, node, 'ServiceType') + self.ServiceType = ServiceType_ + self.validate_ServiceType(self.ServiceType) # validate type ServiceType + elif nodeName_ == 'PackagingType': + PackagingType_ = child_.text + PackagingType_ = self.gds_validate_string(PackagingType_, node, 'PackagingType') + self.PackagingType = PackagingType_ + self.validate_PackagingType(self.PackagingType) # validate type PackagingType + elif nodeName_ == 'Dimensions': + obj_ = Dimensions.factory() + obj_.build(child_) + self.set_Dimensions(obj_) + elif nodeName_ == 'Weight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_Weight(obj_) +# end class PickupShipmentAttributes + + +class ReturnEMailDetail(GeneratedsSuper): + """Return Email Details""" + subclass = None + superclass = None + def __init__(self, MerchantPhoneNumber=None, AllowedSpecialServices=None): + self.MerchantPhoneNumber = MerchantPhoneNumber + if AllowedSpecialServices is None: + self.AllowedSpecialServices = [] + else: + self.AllowedSpecialServices = AllowedSpecialServices + def factory(*args_, **kwargs_): + if ReturnEMailDetail.subclass: + return ReturnEMailDetail.subclass(*args_, **kwargs_) + else: + return ReturnEMailDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_MerchantPhoneNumber(self): return self.MerchantPhoneNumber + def set_MerchantPhoneNumber(self, MerchantPhoneNumber): self.MerchantPhoneNumber = MerchantPhoneNumber + def get_AllowedSpecialServices(self): return self.AllowedSpecialServices + def set_AllowedSpecialServices(self, AllowedSpecialServices): self.AllowedSpecialServices = AllowedSpecialServices + def add_AllowedSpecialServices(self, value): self.AllowedSpecialServices.append(value) + def insert_AllowedSpecialServices(self, index, value): self.AllowedSpecialServices[index] = value + def validate_ReturnEMailAllowedSpecialServiceType(self, value): + # Validate type ReturnEMailAllowedSpecialServiceType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='ReturnEMailDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ReturnEMailDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ReturnEMailDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ReturnEMailDetail', fromsubclass_=False): + if self.MerchantPhoneNumber is not None: + showIndent(outfile, level) + outfile.write('<%sMerchantPhoneNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.MerchantPhoneNumber).encode(ExternalEncoding), input_name='MerchantPhoneNumber'), namespace_)) + for AllowedSpecialServices_ in self.AllowedSpecialServices: + showIndent(outfile, level) + outfile.write('<%sAllowedSpecialServices>%s\n' % (namespace_, self.gds_format_string(quote_xml(AllowedSpecialServices_).encode(ExternalEncoding), input_name='AllowedSpecialServices'), namespace_)) + def hasContent_(self): + if ( + self.MerchantPhoneNumber is not None or + self.AllowedSpecialServices + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ReturnEMailDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.MerchantPhoneNumber is not None: + showIndent(outfile, level) + outfile.write('MerchantPhoneNumber=%s,\n' % quote_python(self.MerchantPhoneNumber).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('AllowedSpecialServices=[\n') + level += 1 + for AllowedSpecialServices_ in self.AllowedSpecialServices: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(AllowedSpecialServices_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'MerchantPhoneNumber': + MerchantPhoneNumber_ = child_.text + MerchantPhoneNumber_ = self.gds_validate_string(MerchantPhoneNumber_, node, 'MerchantPhoneNumber') + self.MerchantPhoneNumber = MerchantPhoneNumber_ + elif nodeName_ == 'AllowedSpecialServices': + AllowedSpecialServices_ = child_.text + AllowedSpecialServices_ = self.gds_validate_string(AllowedSpecialServices_, node, 'AllowedSpecialServices') + self.AllowedSpecialServices.append(AllowedSpecialServices_) + self.validate_ReturnEMailAllowedSpecialServiceType(self.AllowedSpecialServices) # validate type ReturnEMailAllowedSpecialServiceType +# end class ReturnEMailDetail + + +class ReturnShipmentDetail(GeneratedsSuper): + """Information relating to a return shipment.""" + subclass = None + superclass = None + def __init__(self, ReturnType=None, Rma=None, ReturnEMailDetail=None): + self.ReturnType = ReturnType + self.Rma = Rma + self.ReturnEMailDetail = ReturnEMailDetail + def factory(*args_, **kwargs_): + if ReturnShipmentDetail.subclass: + return ReturnShipmentDetail.subclass(*args_, **kwargs_) + else: + return ReturnShipmentDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_ReturnType(self): return self.ReturnType + def set_ReturnType(self, ReturnType): self.ReturnType = ReturnType + def validate_ReturnType(self, value): + # Validate type ReturnType, a restriction on xs:string. + pass + def get_Rma(self): return self.Rma + def set_Rma(self, Rma): self.Rma = Rma + def get_ReturnEMailDetail(self): return self.ReturnEMailDetail + def set_ReturnEMailDetail(self, ReturnEMailDetail): self.ReturnEMailDetail = ReturnEMailDetail + def export(self, outfile, level, namespace_='ns:', name_='ReturnShipmentDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ReturnShipmentDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ReturnShipmentDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ReturnShipmentDetail', fromsubclass_=False): + if self.ReturnType is not None: + showIndent(outfile, level) + outfile.write('<%sReturnType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ReturnType).encode(ExternalEncoding), input_name='ReturnType'), namespace_)) + if self.Rma: + self.Rma.export(outfile, level, namespace_, name_='Rma') + if self.ReturnEMailDetail: + self.ReturnEMailDetail.export(outfile, level, namespace_, name_='ReturnEMailDetail') + def hasContent_(self): + if ( + self.ReturnType is not None or + self.Rma is not None or + self.ReturnEMailDetail is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ReturnShipmentDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.ReturnType is not None: + showIndent(outfile, level) + outfile.write('ReturnType=%s,\n' % quote_python(self.ReturnType).encode(ExternalEncoding)) + if self.Rma is not None: + showIndent(outfile, level) + outfile.write('Rma=model_.Rma(\n') + self.Rma.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ReturnEMailDetail is not None: + showIndent(outfile, level) + outfile.write('ReturnEMailDetail=model_.ReturnEMailDetail(\n') + self.ReturnEMailDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'ReturnType': + ReturnType_ = child_.text + ReturnType_ = self.gds_validate_string(ReturnType_, node, 'ReturnType') + self.ReturnType = ReturnType_ + self.validate_ReturnType(self.ReturnType) # validate type ReturnType + elif nodeName_ == 'Rma': + obj_ = Rma.factory() + obj_.build(child_) + self.set_Rma(obj_) + elif nodeName_ == 'ReturnEMailDetail': + obj_ = ReturnEMailDetail.factory() + obj_.build(child_) + self.set_ReturnEMailDetail(obj_) +# end class ReturnShipmentDetail + + +class Rma(GeneratedsSuper): + """Return Merchant Authorization""" + subclass = None + superclass = None + def __init__(self, Number=None, Reason=None): + self.Number = Number + self.Reason = Reason + def factory(*args_, **kwargs_): + if Rma.subclass: + return Rma.subclass(*args_, **kwargs_) + else: + return Rma(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Number(self): return self.Number + def set_Number(self, Number): self.Number = Number + def get_Reason(self): return self.Reason + def set_Reason(self, Reason): self.Reason = Reason + def export(self, outfile, level, namespace_='ns:', name_='Rma', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Rma') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Rma'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Rma', fromsubclass_=False): + if self.Number is not None: + showIndent(outfile, level) + outfile.write('<%sNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Number).encode(ExternalEncoding), input_name='Number'), namespace_)) + if self.Reason is not None: + showIndent(outfile, level) + outfile.write('<%sReason>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Reason).encode(ExternalEncoding), input_name='Reason'), namespace_)) + def hasContent_(self): + if ( + self.Number is not None or + self.Reason is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Rma'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Number is not None: + showIndent(outfile, level) + outfile.write('Number=%s,\n' % quote_python(self.Number).encode(ExternalEncoding)) + if self.Reason is not None: + showIndent(outfile, level) + outfile.write('Reason=%s,\n' % quote_python(self.Reason).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Number': + Number_ = child_.text + Number_ = self.gds_validate_string(Number_, node, 'Number') + self.Number = Number_ + elif nodeName_ == 'Reason': + Reason_ = child_.text + Reason_ = self.gds_validate_string(Reason_, node, 'Reason') + self.Reason = Reason_ +# end class Rma + + +class ShipmentAssemblyDetail(GeneratedsSuper): + """Specification for assembly performed on shipment.""" + subclass = None + superclass = None + def __init__(self, PieceCount=None, Weight=None): + self.PieceCount = PieceCount + self.Weight = Weight + def factory(*args_, **kwargs_): + if ShipmentAssemblyDetail.subclass: + return ShipmentAssemblyDetail.subclass(*args_, **kwargs_) + else: + return ShipmentAssemblyDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_PieceCount(self): return self.PieceCount + def set_PieceCount(self, PieceCount): self.PieceCount = PieceCount + def get_Weight(self): return self.Weight + def set_Weight(self, Weight): self.Weight = Weight + def export(self, outfile, level, namespace_='ns:', name_='ShipmentAssemblyDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ShipmentAssemblyDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ShipmentAssemblyDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ShipmentAssemblyDetail', fromsubclass_=False): + if self.PieceCount is not None: + showIndent(outfile, level) + outfile.write('<%sPieceCount>%s\n' % (namespace_, self.gds_format_integer(self.PieceCount, input_name='PieceCount'), namespace_)) + if self.Weight: + self.Weight.export(outfile, level, namespace_, name_='Weight') + def hasContent_(self): + if ( + self.PieceCount is not None or + self.Weight is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ShipmentAssemblyDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.PieceCount is not None: + showIndent(outfile, level) + outfile.write('PieceCount=%d,\n' % self.PieceCount) + if self.Weight is not None: + showIndent(outfile, level) + outfile.write('Weight=model_.Weight(\n') + self.Weight.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'PieceCount': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'PieceCount') + self.PieceCount = ival_ + elif nodeName_ == 'Weight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_Weight(obj_) +# end class ShipmentAssemblyDetail + + +class ShipmentDryIceDetail(GeneratedsSuper): + """Shipment-level totals of dry ice data across all packages.""" + subclass = None + superclass = None + def __init__(self, PackageCount=None, TotalWeight=None): + self.PackageCount = PackageCount + self.TotalWeight = TotalWeight + def factory(*args_, **kwargs_): + if ShipmentDryIceDetail.subclass: + return ShipmentDryIceDetail.subclass(*args_, **kwargs_) + else: + return ShipmentDryIceDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_PackageCount(self): return self.PackageCount + def set_PackageCount(self, PackageCount): self.PackageCount = PackageCount + def get_TotalWeight(self): return self.TotalWeight + def set_TotalWeight(self, TotalWeight): self.TotalWeight = TotalWeight + def export(self, outfile, level, namespace_='ns:', name_='ShipmentDryIceDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ShipmentDryIceDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ShipmentDryIceDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ShipmentDryIceDetail', fromsubclass_=False): + if self.PackageCount is not None: + showIndent(outfile, level) + outfile.write('<%sPackageCount>%s\n' % (namespace_, self.gds_format_integer(self.PackageCount, input_name='PackageCount'), namespace_)) + if self.TotalWeight: + self.TotalWeight.export(outfile, level, namespace_, name_='TotalWeight') + def hasContent_(self): + if ( + self.PackageCount is not None or + self.TotalWeight is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ShipmentDryIceDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.PackageCount is not None: + showIndent(outfile, level) + outfile.write('PackageCount=%d,\n' % self.PackageCount) + if self.TotalWeight is not None: + showIndent(outfile, level) + outfile.write('TotalWeight=model_.Weight(\n') + self.TotalWeight.exportLiteral(outfile, level, name_='TotalWeight') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'PackageCount': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'PackageCount') + self.PackageCount = ival_ + elif nodeName_ == 'TotalWeight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_TotalWeight(obj_) +# end class ShipmentDryIceDetail + + +class ShipmentSpecialServicesRequested(GeneratedsSuper): + """These special services are available at the shipment level for some + or all service types. If the shipper is requesting a special + service which requires additional data (such as the COD amount), + the shipment special service type must be present in the + specialServiceTypes collection, and the supporting detail must + be provided in the appropriate sub-object below.""" + subclass = None + superclass = None + def __init__(self, SpecialServiceTypes=None, CodDetail=None, HoldAtLocationDetail=None, EMailNotificationDetail=None, ReturnShipmentDetail=None, PendingShipmentDetail=None, InternationalControlledExportDetail=None, ShipmentDryIceDetail=None, HomeDeliveryPremiumDetail=None, FlatbedTrailerDetail=None, FreightGuaranteeDetail=None, EtdDetail=None, ExtraLaborDetail=None, PalletShrinkwrapDetail=None, PalletsProvidedDetail=None, DetentionDetail=None, MarkingOrTaggingDetail=None, NonBusinessTimeDetail=None, ShipmentAssemblyDetail=None, SortAndSegregateDetail=None, SpecialEquipmentDetail=None, StorageDetail=None, WeighingDetail=None, CustomDeliveryWindowDetail=None): + if SpecialServiceTypes is None: + self.SpecialServiceTypes = [] + else: + self.SpecialServiceTypes = SpecialServiceTypes + self.CodDetail = CodDetail + self.HoldAtLocationDetail = HoldAtLocationDetail + self.EMailNotificationDetail = EMailNotificationDetail + self.ReturnShipmentDetail = ReturnShipmentDetail + self.PendingShipmentDetail = PendingShipmentDetail + self.InternationalControlledExportDetail = InternationalControlledExportDetail + self.ShipmentDryIceDetail = ShipmentDryIceDetail + self.HomeDeliveryPremiumDetail = HomeDeliveryPremiumDetail + self.FlatbedTrailerDetail = FlatbedTrailerDetail + self.FreightGuaranteeDetail = FreightGuaranteeDetail + self.EtdDetail = EtdDetail + self.ExtraLaborDetail = ExtraLaborDetail + self.PalletShrinkwrapDetail = PalletShrinkwrapDetail + self.PalletsProvidedDetail = PalletsProvidedDetail + self.DetentionDetail = DetentionDetail + self.MarkingOrTaggingDetail = MarkingOrTaggingDetail + self.NonBusinessTimeDetail = NonBusinessTimeDetail + self.ShipmentAssemblyDetail = ShipmentAssemblyDetail + self.SortAndSegregateDetail = SortAndSegregateDetail + self.SpecialEquipmentDetail = SpecialEquipmentDetail + self.StorageDetail = StorageDetail + self.WeighingDetail = WeighingDetail + self.CustomDeliveryWindowDetail = CustomDeliveryWindowDetail + def factory(*args_, **kwargs_): + if ShipmentSpecialServicesRequested.subclass: + return ShipmentSpecialServicesRequested.subclass(*args_, **kwargs_) + else: + return ShipmentSpecialServicesRequested(*args_, **kwargs_) + factory = staticmethod(factory) + def get_SpecialServiceTypes(self): return self.SpecialServiceTypes + def set_SpecialServiceTypes(self, SpecialServiceTypes): self.SpecialServiceTypes = SpecialServiceTypes + def add_SpecialServiceTypes(self, value): self.SpecialServiceTypes.append(value) + def insert_SpecialServiceTypes(self, index, value): self.SpecialServiceTypes[index] = value + def validate_ShipmentSpecialServiceType(self, value): + # Validate type ShipmentSpecialServiceType, a restriction on xs:string. + pass + def get_CodDetail(self): return self.CodDetail + def set_CodDetail(self, CodDetail): self.CodDetail = CodDetail + def get_HoldAtLocationDetail(self): return self.HoldAtLocationDetail + def set_HoldAtLocationDetail(self, HoldAtLocationDetail): self.HoldAtLocationDetail = HoldAtLocationDetail + def get_EMailNotificationDetail(self): return self.EMailNotificationDetail + def set_EMailNotificationDetail(self, EMailNotificationDetail): self.EMailNotificationDetail = EMailNotificationDetail + def get_ReturnShipmentDetail(self): return self.ReturnShipmentDetail + def set_ReturnShipmentDetail(self, ReturnShipmentDetail): self.ReturnShipmentDetail = ReturnShipmentDetail + def get_PendingShipmentDetail(self): return self.PendingShipmentDetail + def set_PendingShipmentDetail(self, PendingShipmentDetail): self.PendingShipmentDetail = PendingShipmentDetail + def get_InternationalControlledExportDetail(self): return self.InternationalControlledExportDetail + def set_InternationalControlledExportDetail(self, InternationalControlledExportDetail): self.InternationalControlledExportDetail = InternationalControlledExportDetail + def get_ShipmentDryIceDetail(self): return self.ShipmentDryIceDetail + def set_ShipmentDryIceDetail(self, ShipmentDryIceDetail): self.ShipmentDryIceDetail = ShipmentDryIceDetail + def get_HomeDeliveryPremiumDetail(self): return self.HomeDeliveryPremiumDetail + def set_HomeDeliveryPremiumDetail(self, HomeDeliveryPremiumDetail): self.HomeDeliveryPremiumDetail = HomeDeliveryPremiumDetail + def get_FlatbedTrailerDetail(self): return self.FlatbedTrailerDetail + def set_FlatbedTrailerDetail(self, FlatbedTrailerDetail): self.FlatbedTrailerDetail = FlatbedTrailerDetail + def get_FreightGuaranteeDetail(self): return self.FreightGuaranteeDetail + def set_FreightGuaranteeDetail(self, FreightGuaranteeDetail): self.FreightGuaranteeDetail = FreightGuaranteeDetail + def get_EtdDetail(self): return self.EtdDetail + def set_EtdDetail(self, EtdDetail): self.EtdDetail = EtdDetail + def get_ExtraLaborDetail(self): return self.ExtraLaborDetail + def set_ExtraLaborDetail(self, ExtraLaborDetail): self.ExtraLaborDetail = ExtraLaborDetail + def get_PalletShrinkwrapDetail(self): return self.PalletShrinkwrapDetail + def set_PalletShrinkwrapDetail(self, PalletShrinkwrapDetail): self.PalletShrinkwrapDetail = PalletShrinkwrapDetail + def get_PalletsProvidedDetail(self): return self.PalletsProvidedDetail + def set_PalletsProvidedDetail(self, PalletsProvidedDetail): self.PalletsProvidedDetail = PalletsProvidedDetail + def get_DetentionDetail(self): return self.DetentionDetail + def set_DetentionDetail(self, DetentionDetail): self.DetentionDetail = DetentionDetail + def get_MarkingOrTaggingDetail(self): return self.MarkingOrTaggingDetail + def set_MarkingOrTaggingDetail(self, MarkingOrTaggingDetail): self.MarkingOrTaggingDetail = MarkingOrTaggingDetail + def get_NonBusinessTimeDetail(self): return self.NonBusinessTimeDetail + def set_NonBusinessTimeDetail(self, NonBusinessTimeDetail): self.NonBusinessTimeDetail = NonBusinessTimeDetail + def get_ShipmentAssemblyDetail(self): return self.ShipmentAssemblyDetail + def set_ShipmentAssemblyDetail(self, ShipmentAssemblyDetail): self.ShipmentAssemblyDetail = ShipmentAssemblyDetail + def get_SortAndSegregateDetail(self): return self.SortAndSegregateDetail + def set_SortAndSegregateDetail(self, SortAndSegregateDetail): self.SortAndSegregateDetail = SortAndSegregateDetail + def get_SpecialEquipmentDetail(self): return self.SpecialEquipmentDetail + def set_SpecialEquipmentDetail(self, SpecialEquipmentDetail): self.SpecialEquipmentDetail = SpecialEquipmentDetail + def get_StorageDetail(self): return self.StorageDetail + def set_StorageDetail(self, StorageDetail): self.StorageDetail = StorageDetail + def get_WeighingDetail(self): return self.WeighingDetail + def set_WeighingDetail(self, WeighingDetail): self.WeighingDetail = WeighingDetail + def get_CustomDeliveryWindowDetail(self): return self.CustomDeliveryWindowDetail + def set_CustomDeliveryWindowDetail(self, CustomDeliveryWindowDetail): self.CustomDeliveryWindowDetail = CustomDeliveryWindowDetail + def export(self, outfile, level, namespace_='ns:', name_='ShipmentSpecialServicesRequested', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ShipmentSpecialServicesRequested') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ShipmentSpecialServicesRequested'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ShipmentSpecialServicesRequested', fromsubclass_=False): + for SpecialServiceTypes_ in self.SpecialServiceTypes: + showIndent(outfile, level) + outfile.write('<%sSpecialServiceTypes>%s\n' % (namespace_, self.gds_format_string(quote_xml(SpecialServiceTypes_).encode(ExternalEncoding), input_name='SpecialServiceTypes'), namespace_)) + if self.CodDetail: + self.CodDetail.export(outfile, level, namespace_, name_='CodDetail') + if self.HoldAtLocationDetail: + self.HoldAtLocationDetail.export(outfile, level, namespace_, name_='HoldAtLocationDetail') + if self.EMailNotificationDetail: + self.EMailNotificationDetail.export(outfile, level, namespace_, name_='EMailNotificationDetail') + if self.ReturnShipmentDetail: + self.ReturnShipmentDetail.export(outfile, level, namespace_, name_='ReturnShipmentDetail') + if self.PendingShipmentDetail: + self.PendingShipmentDetail.export(outfile, level, namespace_, name_='PendingShipmentDetail') + if self.InternationalControlledExportDetail: + self.InternationalControlledExportDetail.export(outfile, level, namespace_, name_='InternationalControlledExportDetail') + if self.ShipmentDryIceDetail: + self.ShipmentDryIceDetail.export(outfile, level, namespace_, name_='ShipmentDryIceDetail') + if self.HomeDeliveryPremiumDetail: + self.HomeDeliveryPremiumDetail.export(outfile, level, namespace_, name_='HomeDeliveryPremiumDetail') + if self.FlatbedTrailerDetail: + self.FlatbedTrailerDetail.export(outfile, level, namespace_, name_='FlatbedTrailerDetail') + if self.FreightGuaranteeDetail: + self.FreightGuaranteeDetail.export(outfile, level, namespace_, name_='FreightGuaranteeDetail') + if self.EtdDetail: + self.EtdDetail.export(outfile, level, namespace_, name_='EtdDetail') + if self.ExtraLaborDetail: + self.ExtraLaborDetail.export(outfile, level, namespace_, name_='ExtraLaborDetail') + if self.PalletShrinkwrapDetail: + self.PalletShrinkwrapDetail.export(outfile, level, namespace_, name_='PalletShrinkwrapDetail') + if self.PalletsProvidedDetail: + self.PalletsProvidedDetail.export(outfile, level, namespace_, name_='PalletsProvidedDetail') + if self.DetentionDetail: + self.DetentionDetail.export(outfile, level, namespace_, name_='DetentionDetail') + if self.MarkingOrTaggingDetail: + self.MarkingOrTaggingDetail.export(outfile, level, namespace_, name_='MarkingOrTaggingDetail') + if self.NonBusinessTimeDetail: + self.NonBusinessTimeDetail.export(outfile, level, namespace_, name_='NonBusinessTimeDetail') + if self.ShipmentAssemblyDetail: + self.ShipmentAssemblyDetail.export(outfile, level, namespace_, name_='ShipmentAssemblyDetail') + if self.SortAndSegregateDetail: + self.SortAndSegregateDetail.export(outfile, level, namespace_, name_='SortAndSegregateDetail') + if self.SpecialEquipmentDetail: + self.SpecialEquipmentDetail.export(outfile, level, namespace_, name_='SpecialEquipmentDetail') + if self.StorageDetail: + self.StorageDetail.export(outfile, level, namespace_, name_='StorageDetail') + if self.WeighingDetail: + self.WeighingDetail.export(outfile, level, namespace_, name_='WeighingDetail') + if self.CustomDeliveryWindowDetail: + self.CustomDeliveryWindowDetail.export(outfile, level, namespace_, name_='CustomDeliveryWindowDetail') + def hasContent_(self): + if ( + self.SpecialServiceTypes or + self.CodDetail is not None or + self.HoldAtLocationDetail is not None or + self.EMailNotificationDetail is not None or + self.ReturnShipmentDetail is not None or + self.PendingShipmentDetail is not None or + self.InternationalControlledExportDetail is not None or + self.ShipmentDryIceDetail is not None or + self.HomeDeliveryPremiumDetail is not None or + self.FlatbedTrailerDetail is not None or + self.FreightGuaranteeDetail is not None or + self.EtdDetail is not None or + self.ExtraLaborDetail is not None or + self.PalletShrinkwrapDetail is not None or + self.PalletsProvidedDetail is not None or + self.DetentionDetail is not None or + self.MarkingOrTaggingDetail is not None or + self.NonBusinessTimeDetail is not None or + self.ShipmentAssemblyDetail is not None or + self.SortAndSegregateDetail is not None or + self.SpecialEquipmentDetail is not None or + self.StorageDetail is not None or + self.WeighingDetail is not None or + self.CustomDeliveryWindowDetail is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ShipmentSpecialServicesRequested'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('SpecialServiceTypes=[\n') + level += 1 + for SpecialServiceTypes_ in self.SpecialServiceTypes: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(SpecialServiceTypes_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.CodDetail is not None: + showIndent(outfile, level) + outfile.write('CodDetail=model_.CodDetail(\n') + self.CodDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.HoldAtLocationDetail is not None: + showIndent(outfile, level) + outfile.write('HoldAtLocationDetail=model_.HoldAtLocationDetail(\n') + self.HoldAtLocationDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.EMailNotificationDetail is not None: + showIndent(outfile, level) + outfile.write('EMailNotificationDetail=model_.EMailNotificationDetail(\n') + self.EMailNotificationDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ReturnShipmentDetail is not None: + showIndent(outfile, level) + outfile.write('ReturnShipmentDetail=model_.ReturnShipmentDetail(\n') + self.ReturnShipmentDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.PendingShipmentDetail is not None: + showIndent(outfile, level) + outfile.write('PendingShipmentDetail=model_.PendingShipmentDetail(\n') + self.PendingShipmentDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.InternationalControlledExportDetail is not None: + showIndent(outfile, level) + outfile.write('InternationalControlledExportDetail=model_.InternationalControlledExportDetail(\n') + self.InternationalControlledExportDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ShipmentDryIceDetail is not None: + showIndent(outfile, level) + outfile.write('ShipmentDryIceDetail=model_.ShipmentDryIceDetail(\n') + self.ShipmentDryIceDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.HomeDeliveryPremiumDetail is not None: + showIndent(outfile, level) + outfile.write('HomeDeliveryPremiumDetail=model_.HomeDeliveryPremiumDetail(\n') + self.HomeDeliveryPremiumDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.FlatbedTrailerDetail is not None: + showIndent(outfile, level) + outfile.write('FlatbedTrailerDetail=model_.FlatbedTrailerDetail(\n') + self.FlatbedTrailerDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.FreightGuaranteeDetail is not None: + showIndent(outfile, level) + outfile.write('FreightGuaranteeDetail=model_.FreightGuaranteeDetail(\n') + self.FreightGuaranteeDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.EtdDetail is not None: + showIndent(outfile, level) + outfile.write('EtdDetail=model_.EtdDetail(\n') + self.EtdDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ExtraLaborDetail is not None: + showIndent(outfile, level) + outfile.write('ExtraLaborDetail=model_.ExtraLaborDetail(\n') + self.ExtraLaborDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.PalletShrinkwrapDetail is not None: + showIndent(outfile, level) + outfile.write('PalletShrinkwrapDetail=model_.PalletShrinkwrapDetail(\n') + self.PalletShrinkwrapDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.PalletsProvidedDetail is not None: + showIndent(outfile, level) + outfile.write('PalletsProvidedDetail=model_.PalletsProvidedDetail(\n') + self.PalletsProvidedDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.DetentionDetail is not None: + showIndent(outfile, level) + outfile.write('DetentionDetail=model_.DetentionDetail(\n') + self.DetentionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.MarkingOrTaggingDetail is not None: + showIndent(outfile, level) + outfile.write('MarkingOrTaggingDetail=model_.MarkingOrTaggingDetail(\n') + self.MarkingOrTaggingDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.NonBusinessTimeDetail is not None: + showIndent(outfile, level) + outfile.write('NonBusinessTimeDetail=model_.NonBusinessTimeDetail(\n') + self.NonBusinessTimeDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ShipmentAssemblyDetail is not None: + showIndent(outfile, level) + outfile.write('ShipmentAssemblyDetail=model_.ShipmentAssemblyDetail(\n') + self.ShipmentAssemblyDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.SortAndSegregateDetail is not None: + showIndent(outfile, level) + outfile.write('SortAndSegregateDetail=model_.SortAndSegregateDetail(\n') + self.SortAndSegregateDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.SpecialEquipmentDetail is not None: + showIndent(outfile, level) + outfile.write('SpecialEquipmentDetail=model_.SpecialEquipmentDetail(\n') + self.SpecialEquipmentDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.StorageDetail is not None: + showIndent(outfile, level) + outfile.write('StorageDetail=model_.StorageDetail(\n') + self.StorageDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.WeighingDetail is not None: + showIndent(outfile, level) + outfile.write('WeighingDetail=model_.WeighingDetail(\n') + self.WeighingDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.CustomDeliveryWindowDetail is not None: + showIndent(outfile, level) + outfile.write('CustomDeliveryWindowDetail=model_.CustomDeliveryWindowDetail(\n') + self.CustomDeliveryWindowDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'SpecialServiceTypes': + SpecialServiceTypes_ = child_.text + SpecialServiceTypes_ = self.gds_validate_string(SpecialServiceTypes_, node, 'SpecialServiceTypes') + self.SpecialServiceTypes.append(SpecialServiceTypes_) + self.validate_ShipmentSpecialServiceType(self.SpecialServiceTypes) # validate type ShipmentSpecialServiceType + elif nodeName_ == 'CodDetail': + obj_ = CodDetail.factory() + obj_.build(child_) + self.set_CodDetail(obj_) + elif nodeName_ == 'HoldAtLocationDetail': + obj_ = HoldAtLocationDetail.factory() + obj_.build(child_) + self.set_HoldAtLocationDetail(obj_) + elif nodeName_ == 'EMailNotificationDetail': + obj_ = EMailNotificationDetail.factory() + obj_.build(child_) + self.set_EMailNotificationDetail(obj_) + elif nodeName_ == 'ReturnShipmentDetail': + obj_ = ReturnShipmentDetail.factory() + obj_.build(child_) + self.set_ReturnShipmentDetail(obj_) + elif nodeName_ == 'PendingShipmentDetail': + obj_ = PendingShipmentDetail.factory() + obj_.build(child_) + self.set_PendingShipmentDetail(obj_) + elif nodeName_ == 'InternationalControlledExportDetail': + obj_ = InternationalControlledExportDetail.factory() + obj_.build(child_) + self.set_InternationalControlledExportDetail(obj_) + elif nodeName_ == 'ShipmentDryIceDetail': + obj_ = ShipmentDryIceDetail.factory() + obj_.build(child_) + self.set_ShipmentDryIceDetail(obj_) + elif nodeName_ == 'HomeDeliveryPremiumDetail': + obj_ = HomeDeliveryPremiumDetail.factory() + obj_.build(child_) + self.set_HomeDeliveryPremiumDetail(obj_) + elif nodeName_ == 'FlatbedTrailerDetail': + obj_ = FlatbedTrailerDetail.factory() + obj_.build(child_) + self.set_FlatbedTrailerDetail(obj_) + elif nodeName_ == 'FreightGuaranteeDetail': + obj_ = FreightGuaranteeDetail.factory() + obj_.build(child_) + self.set_FreightGuaranteeDetail(obj_) + elif nodeName_ == 'EtdDetail': + obj_ = EtdDetail.factory() + obj_.build(child_) + self.set_EtdDetail(obj_) + elif nodeName_ == 'ExtraLaborDetail': + obj_ = ExtraLaborDetail.factory() + obj_.build(child_) + self.set_ExtraLaborDetail(obj_) + elif nodeName_ == 'PalletShrinkwrapDetail': + obj_ = PalletShrinkwrapDetail.factory() + obj_.build(child_) + self.set_PalletShrinkwrapDetail(obj_) + elif nodeName_ == 'PalletsProvidedDetail': + obj_ = PalletsProvidedDetail.factory() + obj_.build(child_) + self.set_PalletsProvidedDetail(obj_) + elif nodeName_ == 'DetentionDetail': + obj_ = DetentionDetail.factory() + obj_.build(child_) + self.set_DetentionDetail(obj_) + elif nodeName_ == 'MarkingOrTaggingDetail': + obj_ = MarkingOrTaggingDetail.factory() + obj_.build(child_) + self.set_MarkingOrTaggingDetail(obj_) + elif nodeName_ == 'NonBusinessTimeDetail': + obj_ = NonBusinessTimeDetail.factory() + obj_.build(child_) + self.set_NonBusinessTimeDetail(obj_) + elif nodeName_ == 'ShipmentAssemblyDetail': + obj_ = ShipmentAssemblyDetail.factory() + obj_.build(child_) + self.set_ShipmentAssemblyDetail(obj_) + elif nodeName_ == 'SortAndSegregateDetail': + obj_ = SortAndSegregateDetail.factory() + obj_.build(child_) + self.set_SortAndSegregateDetail(obj_) + elif nodeName_ == 'SpecialEquipmentDetail': + obj_ = SpecialEquipmentDetail.factory() + obj_.build(child_) + self.set_SpecialEquipmentDetail(obj_) + elif nodeName_ == 'StorageDetail': + obj_ = StorageDetail.factory() + obj_.build(child_) + self.set_StorageDetail(obj_) + elif nodeName_ == 'WeighingDetail': + obj_ = WeighingDetail.factory() + obj_.build(child_) + self.set_WeighingDetail(obj_) + elif nodeName_ == 'CustomDeliveryWindowDetail': + obj_ = CustomDeliveryWindowDetail.factory() + obj_.build(child_) + self.set_CustomDeliveryWindowDetail(obj_) +# end class ShipmentSpecialServicesRequested + + +class SortAndSegregateDetail(GeneratedsSuper): + """Specification for sorting and/or segregating performed on shipment.""" + subclass = None + superclass = None + def __init__(self, PieceCount=None, Weight=None): + self.PieceCount = PieceCount + self.Weight = Weight + def factory(*args_, **kwargs_): + if SortAndSegregateDetail.subclass: + return SortAndSegregateDetail.subclass(*args_, **kwargs_) + else: + return SortAndSegregateDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_PieceCount(self): return self.PieceCount + def set_PieceCount(self, PieceCount): self.PieceCount = PieceCount + def get_Weight(self): return self.Weight + def set_Weight(self, Weight): self.Weight = Weight + def export(self, outfile, level, namespace_='ns:', name_='SortAndSegregateDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='SortAndSegregateDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='SortAndSegregateDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='SortAndSegregateDetail', fromsubclass_=False): + if self.PieceCount is not None: + showIndent(outfile, level) + outfile.write('<%sPieceCount>%s\n' % (namespace_, self.gds_format_integer(self.PieceCount, input_name='PieceCount'), namespace_)) + if self.Weight: + self.Weight.export(outfile, level, namespace_, name_='Weight') + def hasContent_(self): + if ( + self.PieceCount is not None or + self.Weight is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='SortAndSegregateDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.PieceCount is not None: + showIndent(outfile, level) + outfile.write('PieceCount=%d,\n' % self.PieceCount) + if self.Weight is not None: + showIndent(outfile, level) + outfile.write('Weight=model_.Weight(\n') + self.Weight.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'PieceCount': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'PieceCount') + self.PieceCount = ival_ + elif nodeName_ == 'Weight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_Weight(obj_) +# end class SortAndSegregateDetail + + +class SpecialEquipmentDetail(GeneratedsSuper): + """Specification for special equipment used in loading/unloading + shipment.""" + subclass = None + superclass = None + def __init__(self, LineItems=None): + if LineItems is None: + self.LineItems = [] + else: + self.LineItems = LineItems + def factory(*args_, **kwargs_): + if SpecialEquipmentDetail.subclass: + return SpecialEquipmentDetail.subclass(*args_, **kwargs_) + else: + return SpecialEquipmentDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_LineItems(self): return self.LineItems + def set_LineItems(self, LineItems): self.LineItems = LineItems + def add_LineItems(self, value): self.LineItems.append(value) + def insert_LineItems(self, index, value): self.LineItems[index] = value + def export(self, outfile, level, namespace_='ns:', name_='SpecialEquipmentDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='SpecialEquipmentDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='SpecialEquipmentDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='SpecialEquipmentDetail', fromsubclass_=False): + for LineItems_ in self.LineItems: + LineItems_.export(outfile, level, namespace_, name_='LineItems') + def hasContent_(self): + if ( + self.LineItems + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='SpecialEquipmentDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('LineItems=[\n') + level += 1 + for LineItems_ in self.LineItems: + showIndent(outfile, level) + outfile.write('model_.SpecialEquipmentLineItem(\n') + LineItems_.exportLiteral(outfile, level, name_='SpecialEquipmentLineItem') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'LineItems': + obj_ = SpecialEquipmentLineItem.factory() + obj_.build(child_) + self.LineItems.append(obj_) +# end class SpecialEquipmentDetail + + +class SpecialEquipmentLineItem(GeneratedsSuper): + """Specifies the usage of a single type of special equipment while + loading/unloading a shipment""" + subclass = None + superclass = None + def __init__(self, Type=None, Duration=None): + self.Type = Type + self.Duration = Duration + def factory(*args_, **kwargs_): + if SpecialEquipmentLineItem.subclass: + return SpecialEquipmentLineItem.subclass(*args_, **kwargs_) + else: + return SpecialEquipmentLineItem(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Type(self): return self.Type + def set_Type(self, Type): self.Type = Type + def validate_SpecialEquipmentType(self, value): + # Validate type SpecialEquipmentType, a restriction on xs:string. + pass + def get_Duration(self): return self.Duration + def set_Duration(self, Duration): self.Duration = Duration + def export(self, outfile, level, namespace_='ns:', name_='SpecialEquipmentLineItem', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='SpecialEquipmentLineItem') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='SpecialEquipmentLineItem'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='SpecialEquipmentLineItem', fromsubclass_=False): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('<%sType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Type).encode(ExternalEncoding), input_name='Type'), namespace_)) + if self.Duration is not None: + showIndent(outfile, level) + outfile.write('<%sDuration>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Duration).encode(ExternalEncoding), input_name='Duration'), namespace_)) + def hasContent_(self): + if ( + self.Type is not None or + self.Duration is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='SpecialEquipmentLineItem'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('Type=%s,\n' % quote_python(self.Type).encode(ExternalEncoding)) + if self.Duration is not None: + showIndent(outfile, level) + outfile.write('Duration=%s,\n' % quote_python(self.Duration).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Type': + Type_ = child_.text + Type_ = self.gds_validate_string(Type_, node, 'Type') + self.Type = Type_ + self.validate_SpecialEquipmentType(self.Type) # validate type SpecialEquipmentType + elif nodeName_ == 'Duration': + Duration_ = child_.text + Duration_ = self.gds_validate_string(Duration_, node, 'Duration') + self.Duration = Duration_ +# end class SpecialEquipmentLineItem + + +class StorageDetail(GeneratedsSuper): + """Specification for storage provided for shipment.""" + subclass = None + superclass = None + def __init__(self, Duration=None): + self.Duration = Duration + def factory(*args_, **kwargs_): + if StorageDetail.subclass: + return StorageDetail.subclass(*args_, **kwargs_) + else: + return StorageDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Duration(self): return self.Duration + def set_Duration(self, Duration): self.Duration = Duration + def export(self, outfile, level, namespace_='ns:', name_='StorageDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='StorageDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='StorageDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='StorageDetail', fromsubclass_=False): + if self.Duration is not None: + showIndent(outfile, level) + outfile.write('<%sDuration>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Duration).encode(ExternalEncoding), input_name='Duration'), namespace_)) + def hasContent_(self): + if ( + self.Duration is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='StorageDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Duration is not None: + showIndent(outfile, level) + outfile.write('Duration=%s,\n' % quote_python(self.Duration).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Duration': + Duration_ = child_.text + Duration_ = self.gds_validate_string(Duration_, node, 'Duration') + self.Duration = Duration_ +# end class StorageDetail + + +class TaxpayerIdentification(GeneratedsSuper): + """The descriptive data for taxpayer identification information.""" + subclass = None + superclass = None + def __init__(self, TinType=None, Number=None, Usage=None): + self.TinType = TinType + self.Number = Number + self.Usage = Usage + def factory(*args_, **kwargs_): + if TaxpayerIdentification.subclass: + return TaxpayerIdentification.subclass(*args_, **kwargs_) + else: + return TaxpayerIdentification(*args_, **kwargs_) + factory = staticmethod(factory) + def get_TinType(self): return self.TinType + def set_TinType(self, TinType): self.TinType = TinType + def validate_TinType(self, value): + # Validate type TinType, a restriction on xs:string. + pass + def get_Number(self): return self.Number + def set_Number(self, Number): self.Number = Number + def get_Usage(self): return self.Usage + def set_Usage(self, Usage): self.Usage = Usage + def export(self, outfile, level, namespace_='ns:', name_='TaxpayerIdentification', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='TaxpayerIdentification') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='TaxpayerIdentification'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='TaxpayerIdentification', fromsubclass_=False): + if self.TinType is not None: + showIndent(outfile, level) + outfile.write('<%sTinType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.TinType).encode(ExternalEncoding), input_name='TinType'), namespace_)) + if self.Number is not None: + showIndent(outfile, level) + outfile.write('<%sNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Number).encode(ExternalEncoding), input_name='Number'), namespace_)) + if self.Usage is not None: + showIndent(outfile, level) + outfile.write('<%sUsage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Usage).encode(ExternalEncoding), input_name='Usage'), namespace_)) + def hasContent_(self): + if ( + self.TinType is not None or + self.Number is not None or + self.Usage is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='TaxpayerIdentification'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.TinType is not None: + showIndent(outfile, level) + outfile.write('TinType=%s,\n' % quote_python(self.TinType).encode(ExternalEncoding)) + if self.Number is not None: + showIndent(outfile, level) + outfile.write('Number=%s,\n' % quote_python(self.Number).encode(ExternalEncoding)) + if self.Usage is not None: + showIndent(outfile, level) + outfile.write('Usage=%s,\n' % quote_python(self.Usage).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'TinType': + TinType_ = child_.text + TinType_ = self.gds_validate_string(TinType_, node, 'TinType') + self.TinType = TinType_ + self.validate_TinType(self.TinType) # validate type TinType + elif nodeName_ == 'Number': + Number_ = child_.text + Number_ = self.gds_validate_string(Number_, node, 'Number') + self.Number = Number_ + elif nodeName_ == 'Usage': + Usage_ = child_.text + Usage_ = self.gds_validate_string(Usage_, node, 'Usage') + self.Usage = Usage_ +# end class TaxpayerIdentification + + +class TransactionDetail(GeneratedsSuper): + """The descriptive data that governs data payload + language/translations.""" + subclass = None + superclass = None + def __init__(self, CustomerTransactionId=None, Localization=None): + self.CustomerTransactionId = CustomerTransactionId + self.Localization = Localization + def factory(*args_, **kwargs_): + if TransactionDetail.subclass: + return TransactionDetail.subclass(*args_, **kwargs_) + else: + return TransactionDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_CustomerTransactionId(self): return self.CustomerTransactionId + def set_CustomerTransactionId(self, CustomerTransactionId): self.CustomerTransactionId = CustomerTransactionId + def get_Localization(self): return self.Localization + def set_Localization(self, Localization): self.Localization = Localization + def export(self, outfile, level, namespace_='ns:', name_='TransactionDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='TransactionDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='TransactionDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='TransactionDetail', fromsubclass_=False): + if self.CustomerTransactionId is not None: + showIndent(outfile, level) + outfile.write('<%sCustomerTransactionId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CustomerTransactionId).encode(ExternalEncoding), input_name='CustomerTransactionId'), namespace_)) + if self.Localization: + self.Localization.export(outfile, level, namespace_, name_='Localization') + def hasContent_(self): + if ( + self.CustomerTransactionId is not None or + self.Localization is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='TransactionDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.CustomerTransactionId is not None: + showIndent(outfile, level) + outfile.write('CustomerTransactionId=%s,\n' % quote_python(self.CustomerTransactionId).encode(ExternalEncoding)) + if self.Localization is not None: + showIndent(outfile, level) + outfile.write('Localization=model_.Localization(\n') + self.Localization.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'CustomerTransactionId': + CustomerTransactionId_ = child_.text + CustomerTransactionId_ = self.gds_validate_string(CustomerTransactionId_, node, 'CustomerTransactionId') + self.CustomerTransactionId = CustomerTransactionId_ + elif nodeName_ == 'Localization': + obj_ = Localization.factory() + obj_.build(child_) + self.set_Localization(obj_) +# end class TransactionDetail + + +class UploadDocumentDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, LineNumber=None, CustomerReference=None, DocumentProducer=None, DocumentType=None, FileName=None, DocumentContent=None): + self.LineNumber = LineNumber + self.CustomerReference = CustomerReference + self.DocumentProducer = DocumentProducer + self.DocumentType = DocumentType + self.FileName = FileName + self.DocumentContent = DocumentContent + def factory(*args_, **kwargs_): + if UploadDocumentDetail.subclass: + return UploadDocumentDetail.subclass(*args_, **kwargs_) + else: + return UploadDocumentDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_LineNumber(self): return self.LineNumber + def set_LineNumber(self, LineNumber): self.LineNumber = LineNumber + def get_CustomerReference(self): return self.CustomerReference + def set_CustomerReference(self, CustomerReference): self.CustomerReference = CustomerReference + def get_DocumentProducer(self): return self.DocumentProducer + def set_DocumentProducer(self, DocumentProducer): self.DocumentProducer = DocumentProducer + def validate_UploadDocumentProducerType(self, value): + # Validate type UploadDocumentProducerType, a restriction on xs:string. + pass + def get_DocumentType(self): return self.DocumentType + def set_DocumentType(self, DocumentType): self.DocumentType = DocumentType + def validate_UploadDocumentType(self, value): + # Validate type UploadDocumentType, a restriction on xs:string. + pass + def get_FileName(self): return self.FileName + def set_FileName(self, FileName): self.FileName = FileName + def get_DocumentContent(self): return self.DocumentContent + def set_DocumentContent(self, DocumentContent): self.DocumentContent = DocumentContent + def export(self, outfile, level, namespace_='ns:', name_='UploadDocumentDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='UploadDocumentDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='UploadDocumentDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='UploadDocumentDetail', fromsubclass_=False): + if self.LineNumber is not None: + showIndent(outfile, level) + outfile.write('<%sLineNumber>%s\n' % (namespace_, self.gds_format_integer(self.LineNumber, input_name='LineNumber'), namespace_)) + if self.CustomerReference is not None: + showIndent(outfile, level) + outfile.write('<%sCustomerReference>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CustomerReference).encode(ExternalEncoding), input_name='CustomerReference'), namespace_)) + if self.DocumentProducer is not None: + showIndent(outfile, level) + outfile.write('<%sDocumentProducer>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DocumentProducer).encode(ExternalEncoding), input_name='DocumentProducer'), namespace_)) + if self.DocumentType is not None: + showIndent(outfile, level) + outfile.write('<%sDocumentType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DocumentType).encode(ExternalEncoding), input_name='DocumentType'), namespace_)) + if self.FileName is not None: + showIndent(outfile, level) + outfile.write('<%sFileName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.FileName).encode(ExternalEncoding), input_name='FileName'), namespace_)) + if self.DocumentContent: + self.DocumentContent.export(outfile, level, namespace_, name_='DocumentContent') + def hasContent_(self): + if ( + self.LineNumber is not None or + self.CustomerReference is not None or + self.DocumentProducer is not None or + self.DocumentType is not None or + self.FileName is not None or + self.DocumentContent is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='UploadDocumentDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.LineNumber is not None: + showIndent(outfile, level) + outfile.write('LineNumber=%d,\n' % self.LineNumber) + if self.CustomerReference is not None: + showIndent(outfile, level) + outfile.write('CustomerReference=%s,\n' % quote_python(self.CustomerReference).encode(ExternalEncoding)) + if self.DocumentProducer is not None: + showIndent(outfile, level) + outfile.write('DocumentProducer=%s,\n' % quote_python(self.DocumentProducer).encode(ExternalEncoding)) + if self.DocumentType is not None: + showIndent(outfile, level) + outfile.write('DocumentType=%s,\n' % quote_python(self.DocumentType).encode(ExternalEncoding)) + if self.FileName is not None: + showIndent(outfile, level) + outfile.write('FileName=%s,\n' % quote_python(self.FileName).encode(ExternalEncoding)) + if self.DocumentContent is not None: + showIndent(outfile, level) + outfile.write('DocumentContent=model_.xs_base64Binary(\n') + self.DocumentContent.exportLiteral(outfile, level, name_='DocumentContent') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'LineNumber': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'LineNumber') + self.LineNumber = ival_ + elif nodeName_ == 'CustomerReference': + CustomerReference_ = child_.text + CustomerReference_ = self.gds_validate_string(CustomerReference_, node, 'CustomerReference') + self.CustomerReference = CustomerReference_ + elif nodeName_ == 'DocumentProducer': + DocumentProducer_ = child_.text + DocumentProducer_ = self.gds_validate_string(DocumentProducer_, node, 'DocumentProducer') + self.DocumentProducer = DocumentProducer_ + self.validate_UploadDocumentProducerType(self.DocumentProducer) # validate type UploadDocumentProducerType + elif nodeName_ == 'DocumentType': + DocumentType_ = child_.text + DocumentType_ = self.gds_validate_string(DocumentType_, node, 'DocumentType') + self.DocumentType = DocumentType_ + self.validate_UploadDocumentType(self.DocumentType) # validate type UploadDocumentType + elif nodeName_ == 'FileName': + FileName_ = child_.text + FileName_ = self.gds_validate_string(FileName_, node, 'FileName') + self.FileName = FileName_ + elif nodeName_ == 'DocumentContent': + obj_ = xs_base64Binary.factory() + obj_.build(child_) + self.set_DocumentContent(obj_) +# end class UploadDocumentDetail + + +class UploadDocumentReferenceDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, LineNumber=None, CustomerReference=None, DocumentProducer=None, DocumentType=None, DocumentId=None, DocumentIdProducer=None): + self.LineNumber = LineNumber + self.CustomerReference = CustomerReference + self.DocumentProducer = DocumentProducer + self.DocumentType = DocumentType + self.DocumentId = DocumentId + self.DocumentIdProducer = DocumentIdProducer + def factory(*args_, **kwargs_): + if UploadDocumentReferenceDetail.subclass: + return UploadDocumentReferenceDetail.subclass(*args_, **kwargs_) + else: + return UploadDocumentReferenceDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_LineNumber(self): return self.LineNumber + def set_LineNumber(self, LineNumber): self.LineNumber = LineNumber + def get_CustomerReference(self): return self.CustomerReference + def set_CustomerReference(self, CustomerReference): self.CustomerReference = CustomerReference + def get_DocumentProducer(self): return self.DocumentProducer + def set_DocumentProducer(self, DocumentProducer): self.DocumentProducer = DocumentProducer + def validate_UploadDocumentProducerType(self, value): + # Validate type UploadDocumentProducerType, a restriction on xs:string. + pass + def get_DocumentType(self): return self.DocumentType + def set_DocumentType(self, DocumentType): self.DocumentType = DocumentType + def validate_UploadDocumentType(self, value): + # Validate type UploadDocumentType, a restriction on xs:string. + pass + def get_DocumentId(self): return self.DocumentId + def set_DocumentId(self, DocumentId): self.DocumentId = DocumentId + def get_DocumentIdProducer(self): return self.DocumentIdProducer + def set_DocumentIdProducer(self, DocumentIdProducer): self.DocumentIdProducer = DocumentIdProducer + def validate_UploadDocumentIdProducer(self, value): + # Validate type UploadDocumentIdProducer, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='UploadDocumentReferenceDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='UploadDocumentReferenceDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='UploadDocumentReferenceDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='UploadDocumentReferenceDetail', fromsubclass_=False): + if self.LineNumber is not None: + showIndent(outfile, level) + outfile.write('<%sLineNumber>%s\n' % (namespace_, self.gds_format_integer(self.LineNumber, input_name='LineNumber'), namespace_)) + if self.CustomerReference is not None: + showIndent(outfile, level) + outfile.write('<%sCustomerReference>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CustomerReference).encode(ExternalEncoding), input_name='CustomerReference'), namespace_)) + if self.DocumentProducer is not None: + showIndent(outfile, level) + outfile.write('<%sDocumentProducer>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DocumentProducer).encode(ExternalEncoding), input_name='DocumentProducer'), namespace_)) + if self.DocumentType is not None: + showIndent(outfile, level) + outfile.write('<%sDocumentType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DocumentType).encode(ExternalEncoding), input_name='DocumentType'), namespace_)) + if self.DocumentId is not None: + showIndent(outfile, level) + outfile.write('<%sDocumentId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DocumentId).encode(ExternalEncoding), input_name='DocumentId'), namespace_)) + if self.DocumentIdProducer is not None: + showIndent(outfile, level) + outfile.write('<%sDocumentIdProducer>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DocumentIdProducer).encode(ExternalEncoding), input_name='DocumentIdProducer'), namespace_)) + def hasContent_(self): + if ( + self.LineNumber is not None or + self.CustomerReference is not None or + self.DocumentProducer is not None or + self.DocumentType is not None or + self.DocumentId is not None or + self.DocumentIdProducer is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='UploadDocumentReferenceDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.LineNumber is not None: + showIndent(outfile, level) + outfile.write('LineNumber=%d,\n' % self.LineNumber) + if self.CustomerReference is not None: + showIndent(outfile, level) + outfile.write('CustomerReference=%s,\n' % quote_python(self.CustomerReference).encode(ExternalEncoding)) + if self.DocumentProducer is not None: + showIndent(outfile, level) + outfile.write('DocumentProducer=%s,\n' % quote_python(self.DocumentProducer).encode(ExternalEncoding)) + if self.DocumentType is not None: + showIndent(outfile, level) + outfile.write('DocumentType=%s,\n' % quote_python(self.DocumentType).encode(ExternalEncoding)) + if self.DocumentId is not None: + showIndent(outfile, level) + outfile.write('DocumentId=%s,\n' % quote_python(self.DocumentId).encode(ExternalEncoding)) + if self.DocumentIdProducer is not None: + showIndent(outfile, level) + outfile.write('DocumentIdProducer=%s,\n' % quote_python(self.DocumentIdProducer).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'LineNumber': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'LineNumber') + self.LineNumber = ival_ + elif nodeName_ == 'CustomerReference': + CustomerReference_ = child_.text + CustomerReference_ = self.gds_validate_string(CustomerReference_, node, 'CustomerReference') + self.CustomerReference = CustomerReference_ + elif nodeName_ == 'DocumentProducer': + DocumentProducer_ = child_.text + DocumentProducer_ = self.gds_validate_string(DocumentProducer_, node, 'DocumentProducer') + self.DocumentProducer = DocumentProducer_ + self.validate_UploadDocumentProducerType(self.DocumentProducer) # validate type UploadDocumentProducerType + elif nodeName_ == 'DocumentType': + DocumentType_ = child_.text + DocumentType_ = self.gds_validate_string(DocumentType_, node, 'DocumentType') + self.DocumentType = DocumentType_ + self.validate_UploadDocumentType(self.DocumentType) # validate type UploadDocumentType + elif nodeName_ == 'DocumentId': + DocumentId_ = child_.text + DocumentId_ = self.gds_validate_string(DocumentId_, node, 'DocumentId') + self.DocumentId = DocumentId_ + elif nodeName_ == 'DocumentIdProducer': + DocumentIdProducer_ = child_.text + DocumentIdProducer_ = self.gds_validate_string(DocumentIdProducer_, node, 'DocumentIdProducer') + self.DocumentIdProducer = DocumentIdProducer_ + self.validate_UploadDocumentIdProducer(self.DocumentIdProducer) # validate type UploadDocumentIdProducer +# end class UploadDocumentReferenceDetail + + +class WeighingDetail(GeneratedsSuper): + """Specifies a single type of weighing performed on a shipment""" + subclass = None + superclass = None + def __init__(self, Type=None): + self.Type = Type + def factory(*args_, **kwargs_): + if WeighingDetail.subclass: + return WeighingDetail.subclass(*args_, **kwargs_) + else: + return WeighingDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Type(self): return self.Type + def set_Type(self, Type): self.Type = Type + def validate_WeighingScaleType(self, value): + # Validate type WeighingScaleType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='WeighingDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='WeighingDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='WeighingDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='WeighingDetail', fromsubclass_=False): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('<%sType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Type).encode(ExternalEncoding), input_name='Type'), namespace_)) + def hasContent_(self): + if ( + self.Type is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='WeighingDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('Type=%s,\n' % quote_python(self.Type).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Type': + Type_ = child_.text + Type_ = self.gds_validate_string(Type_, node, 'Type') + self.Type = Type_ + self.validate_WeighingScaleType(self.Type) # validate type WeighingScaleType +# end class WeighingDetail + + +class Weight(GeneratedsSuper): + """The descriptive data for the heaviness of an object.""" + subclass = None + superclass = None + def __init__(self, Units=None, Value=None): + self.Units = Units + self.Value = Value + def factory(*args_, **kwargs_): + if Weight.subclass: + return Weight.subclass(*args_, **kwargs_) + else: + return Weight(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Units(self): return self.Units + def set_Units(self, Units): self.Units = Units + def validate_WeightUnits(self, value): + # Validate type WeightUnits, a restriction on xs:string. + pass + def get_Value(self): return self.Value + def set_Value(self, Value): self.Value = Value + def export(self, outfile, level, namespace_='ns:', name_='Weight', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Weight') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Weight'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Weight', fromsubclass_=False): + if self.Units is not None: + showIndent(outfile, level) + outfile.write('<%sUnits>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Units).encode(ExternalEncoding), input_name='Units'), namespace_)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('<%sValue>%s\n' % (namespace_, self.gds_format_float(self.Value, input_name='Value'), namespace_)) + def hasContent_(self): + if ( + self.Units is not None or + self.Value is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Weight'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Units is not None: + showIndent(outfile, level) + outfile.write('Units=%s,\n' % quote_python(self.Units).encode(ExternalEncoding)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('Value=%f,\n' % self.Value) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Units': + Units_ = child_.text + Units_ = self.gds_validate_string(Units_, node, 'Units') + self.Units = Units_ + self.validate_WeightUnits(self.Units) # validate type WeightUnits + elif nodeName_ == 'Value': + sval_ = child_.text + try: + fval_ = float(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires float or double: %s' % exp) + fval_ = self.gds_validate_float(fval_, node, 'Value') + self.Value = fval_ +# end class Weight + + +class WebAuthenticationDetail(GeneratedsSuper): + """Used in authentication of the sender's identity.""" + subclass = None + superclass = None + def __init__(self, UserCredential=None): + self.UserCredential = UserCredential + def factory(*args_, **kwargs_): + if WebAuthenticationDetail.subclass: + return WebAuthenticationDetail.subclass(*args_, **kwargs_) + else: + return WebAuthenticationDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_UserCredential(self): return self.UserCredential + def set_UserCredential(self, UserCredential): self.UserCredential = UserCredential + def export(self, outfile, level, namespace_='ns:', name_='WebAuthenticationDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='WebAuthenticationDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='WebAuthenticationDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='WebAuthenticationDetail', fromsubclass_=False): + if self.UserCredential: + self.UserCredential.export(outfile, level, namespace_, name_='UserCredential', ) + def hasContent_(self): + if ( + self.UserCredential is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='WebAuthenticationDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.UserCredential is not None: + showIndent(outfile, level) + outfile.write('UserCredential=model_.WebAuthenticationCredential(\n') + self.UserCredential.exportLiteral(outfile, level, name_='UserCredential') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'UserCredential': + obj_ = WebAuthenticationCredential.factory() + obj_.build(child_) + self.set_UserCredential(obj_) +# end class WebAuthenticationDetail + + +class WebAuthenticationCredential(GeneratedsSuper): + """Two part authentication string used for the sender's identity""" + subclass = None + superclass = None + def __init__(self, Key=None, Password=None): + self.Key = Key + self.Password = Password + def factory(*args_, **kwargs_): + if WebAuthenticationCredential.subclass: + return WebAuthenticationCredential.subclass(*args_, **kwargs_) + else: + return WebAuthenticationCredential(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Key(self): return self.Key + def set_Key(self, Key): self.Key = Key + def get_Password(self): return self.Password + def set_Password(self, Password): self.Password = Password + def export(self, outfile, level, namespace_='ns:', name_='WebAuthenticationCredential', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='WebAuthenticationCredential') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='WebAuthenticationCredential'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='WebAuthenticationCredential', fromsubclass_=False): + if self.Key is not None: + showIndent(outfile, level) + outfile.write('<%sKey>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Key).encode(ExternalEncoding), input_name='Key'), namespace_)) + if self.Password is not None: + showIndent(outfile, level) + outfile.write('<%sPassword>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Password).encode(ExternalEncoding), input_name='Password'), namespace_)) + def hasContent_(self): + if ( + self.Key is not None or + self.Password is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='WebAuthenticationCredential'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Key is not None: + showIndent(outfile, level) + outfile.write('Key=%s,\n' % quote_python(self.Key).encode(ExternalEncoding)) + if self.Password is not None: + showIndent(outfile, level) + outfile.write('Password=%s,\n' % quote_python(self.Password).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Key': + Key_ = child_.text + Key_ = self.gds_validate_string(Key_, node, 'Key') + self.Key = Key_ + elif nodeName_ == 'Password': + Password_ = child_.text + Password_ = self.gds_validate_string(Password_, node, 'Password') + self.Password = Password_ +# end class WebAuthenticationCredential + + +class VersionId(GeneratedsSuper): + """Identifies the version/level of a service operation expected by a + caller (in each request) and performed by the callee (in each + reply).""" + subclass = None + superclass = None + def __init__(self, ServiceId=None, Major=None, Intermediate=None, Minor=None): + self.ServiceId = ServiceId + self.Major = Major + self.Intermediate = Intermediate + self.Minor = Minor + def factory(*args_, **kwargs_): + if VersionId.subclass: + return VersionId.subclass(*args_, **kwargs_) + else: + return VersionId(*args_, **kwargs_) + factory = staticmethod(factory) + def get_ServiceId(self): return self.ServiceId + def set_ServiceId(self, ServiceId): self.ServiceId = ServiceId + def get_Major(self): return self.Major + def set_Major(self, Major): self.Major = Major + def get_Intermediate(self): return self.Intermediate + def set_Intermediate(self, Intermediate): self.Intermediate = Intermediate + def get_Minor(self): return self.Minor + def set_Minor(self, Minor): self.Minor = Minor + def export(self, outfile, level, namespace_='ns:', name_='VersionId', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='VersionId') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='VersionId'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='VersionId', fromsubclass_=False): + if self.ServiceId is not None: + showIndent(outfile, level) + outfile.write('<%sServiceId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ServiceId).encode(ExternalEncoding), input_name='ServiceId'), namespace_)) + if self.Major is not None: + showIndent(outfile, level) + outfile.write('<%sMajor>%s\n' % (namespace_, self.gds_format_integer(self.Major, input_name='Major'), namespace_)) + if self.Intermediate is not None: + showIndent(outfile, level) + outfile.write('<%sIntermediate>%s\n' % (namespace_, self.gds_format_integer(self.Intermediate, input_name='Intermediate'), namespace_)) + if self.Minor is not None: + showIndent(outfile, level) + outfile.write('<%sMinor>%s\n' % (namespace_, self.gds_format_integer(self.Minor, input_name='Minor'), namespace_)) + def hasContent_(self): + if ( + self.ServiceId is not None or + self.Major is not None or + self.Intermediate is not None or + self.Minor is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='VersionId'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.ServiceId is not None: + showIndent(outfile, level) + outfile.write('ServiceId=%s,\n' % quote_python(self.ServiceId).encode(ExternalEncoding)) + if self.Major is not None: + showIndent(outfile, level) + outfile.write('Major=%d,\n' % self.Major) + if self.Intermediate is not None: + showIndent(outfile, level) + outfile.write('Intermediate=%d,\n' % self.Intermediate) + if self.Minor is not None: + showIndent(outfile, level) + outfile.write('Minor=%d,\n' % self.Minor) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'ServiceId': + ServiceId_ = child_.text + ServiceId_ = self.gds_validate_string(ServiceId_, node, 'ServiceId') + self.ServiceId = ServiceId_ + elif nodeName_ == 'Major': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'Major') + self.Major = ival_ + elif nodeName_ == 'Intermediate': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'Intermediate') + self.Intermediate = ival_ + elif nodeName_ == 'Minor': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'Minor') + self.Minor = ival_ +# end class VersionId + + +USAGE_TEXT = """ +Usage: python .py [ -s ] +""" + +def usage(): + print USAGE_TEXT + sys.exit(1) + + +def get_root_tag(node): + tag = Tag_pattern_.match(node.tag).groups()[-1] + rootClass = globals().get(tag) + return tag, rootClass + + +def parse(inFileName): + doc = parsexml_(inFileName) + rootNode = doc.getroot() + rootTag, rootClass = get_root_tag(rootNode) + if rootClass is None: + rootTag = 'CancelPickupReply' + rootClass = CancelPickupReply + rootObj = rootClass.factory() + rootObj.build(rootNode) + # Enable Python to collect the space used by the DOM. + doc = None + sys.stdout.write('\n') + rootObj.export(sys.stdout, 0, name_=rootTag, + namespacedef_='') + return rootObj + + +def parseString(inString): + from StringIO import StringIO + doc = parsexml_(StringIO(inString)) + rootNode = doc.getroot() + rootTag, rootClass = get_root_tag(rootNode) + if rootClass is None: + rootTag = 'CancelPickupReply' + rootClass = CancelPickupReply + rootObj = rootClass.factory() + rootObj.build(rootNode) + # Enable Python to collect the space used by the DOM. + doc = None + sys.stdout.write('\n') + rootObj.export(sys.stdout, 0, name_="CancelPickupReply", + namespacedef_='') + return rootObj + + +def parseLiteral(inFileName): + doc = parsexml_(inFileName) + rootNode = doc.getroot() + rootTag, rootClass = get_root_tag(rootNode) + if rootClass is None: + rootTag = 'CancelPickupReply' + rootClass = CancelPickupReply + rootObj = rootClass.factory() + rootObj.build(rootNode) + # Enable Python to collect the space used by the DOM. + doc = None + sys.stdout.write('#from pickup import *\n\n') + sys.stdout.write('import pickup as model_\n\n') + sys.stdout.write('rootObj = model_.rootTag(\n') + rootObj.exportLiteral(sys.stdout, 0, name_=rootTag) + sys.stdout.write(')\n') + return rootObj + + +def main(): + args = sys.argv[1:] + if len(args) == 1: + parse(args[0]) + else: + usage() + + +if __name__ == '__main__': + #import pdb; pdb.set_trace() + main() + + +__all__ = [ + "Address", + "AssociatedAccount", + "CancelPickupReply", + "CancelPickupRequest", + "ClientDetail", + "CodAddTransportationChargesDetail", + "CodDetail", + "CompletedFreightPickupDetail", + "CompletedFreightPickupLineItem", + "Contact", + "ContactAndAddress", + "CreatePickupReply", + "CreatePickupRequest", + "CreditCard", + "CreditCardTransactionDetail", + "CreditFraudDetectionDetail", + "CustomDeliveryWindowDetail", + "DateRange", + "DetentionDetail", + "Dimensions", + "Distance", + "EMailLabelDetail", + "EMailNotificationDetail", + "EMailNotificationRecipient", + "EtdDetail", + "ExpressFreightPickupDetail", + "ExtraLaborDetail", + "FlatbedTrailerDetail", + "FreightGuaranteeDetail", + "FreightPickupDetail", + "FreightPickupLineItem", + "FreightServiceCenterDetail", + "HoldAtLocationDetail", + "HomeDeliveryPremiumDetail", + "InternationalControlledExportDetail", + "Localization", + "MarkingOrTaggingDetail", + "Money", + "NonBusinessTimeDetail", + "Notification", + "NotificationParameter", + "PalletShrinkwrapDetail", + "PalletsProvidedDetail", + "ParsedContact", + "ParsedContactAndAddress", + "ParsedPersonName", + "Party", + "Payment", + "Payor", + "PendingShipmentDetail", + "PickupAvailabilityReply", + "PickupAvailabilityRequest", + "PickupOriginDetail", + "PickupScheduleOption", + "PickupShipmentAttributes", + "ReturnEMailDetail", + "ReturnShipmentDetail", + "Rma", + "ShipmentAssemblyDetail", + "ShipmentDryIceDetail", + "ShipmentSpecialServicesRequested", + "SortAndSegregateDetail", + "SpecialEquipmentDetail", + "SpecialEquipmentLineItem", + "StorageDetail", + "TaxpayerIdentification", + "TransactionDetail", + "UploadDocumentDetail", + "UploadDocumentReferenceDetail", + "VersionId", + "WebAuthenticationCredential", + "WebAuthenticationDetail", + "WeighingDetail", + "Weight" + ] diff --git a/webxml/fedex/rate.py b/webxml/fedex/rate.py new file mode 100644 index 0000000..a0af7ef --- /dev/null +++ b/webxml/fedex/rate.py @@ -0,0 +1,18412 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# +# Generated Thu Sep 29 16:56:06 2011 by generateDS.py version 2.6a. +# + +import sys +import getopt +import re as re_ + +etree_ = None +Verbose_import_ = False +( XMLParser_import_none, XMLParser_import_lxml, + XMLParser_import_elementtree + ) = range(3) +XMLParser_import_library = None +try: + # lxml + from lxml import etree as etree_ + XMLParser_import_library = XMLParser_import_lxml + if Verbose_import_: + print("running with lxml.etree") +except ImportError: + try: + # cElementTree from Python 2.5+ + import xml.etree.cElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with cElementTree on Python 2.5+") + except ImportError: + try: + # ElementTree from Python 2.5+ + import xml.etree.ElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with ElementTree on Python 2.5+") + except ImportError: + try: + # normal cElementTree install + import cElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with cElementTree") + except ImportError: + try: + # normal ElementTree install + import elementtree.ElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with ElementTree") + except ImportError: + raise ImportError("Failed to import ElementTree from any known place") + +def parsexml_(*args, **kwargs): + if (XMLParser_import_library == XMLParser_import_lxml and + 'parser' not in kwargs): + # Use the lxml ElementTree compatible parser so that, e.g., + # we ignore comments. + kwargs['parser'] = etree_.ETCompatXMLParser() + doc = etree_.parse(*args, **kwargs) + return doc + +# +# User methods +# +# Calls to the methods in these classes are generated by generateDS.py. +# You can replace these methods by re-implementing the following class +# in a module named generatedssuper.py. + +try: + from generatedssuper import GeneratedsSuper +except ImportError, exp: + + class GeneratedsSuper(object): + def gds_format_string(self, input_data, input_name=''): + return input_data + def gds_validate_string(self, input_data, node, input_name=''): + return input_data + def gds_format_integer(self, input_data, input_name=''): + return '%d' % input_data + def gds_validate_integer(self, input_data, node, input_name=''): + return input_data + def gds_format_integer_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_integer_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + try: + fvalue = float(value) + except (TypeError, ValueError), exp: + raise_parse_error(node, 'Requires sequence of integers') + return input_data + def gds_format_float(self, input_data, input_name=''): + return '%f' % input_data + def gds_validate_float(self, input_data, node, input_name=''): + return input_data + def gds_format_float_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_float_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + try: + fvalue = float(value) + except (TypeError, ValueError), exp: + raise_parse_error(node, 'Requires sequence of floats') + return input_data + def gds_format_double(self, input_data, input_name=''): + return '%e' % input_data + def gds_validate_double(self, input_data, node, input_name=''): + return input_data + def gds_format_double_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_double_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + try: + fvalue = float(value) + except (TypeError, ValueError), exp: + raise_parse_error(node, 'Requires sequence of doubles') + return input_data + def gds_format_boolean(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_boolean(self, input_data, node, input_name=''): + return input_data + def gds_format_boolean_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_boolean_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + if value not in ('true', '1', 'false', '0', ): + raise_parse_error(node, 'Requires sequence of booleans ("true", "1", "false", "0")') + return input_data + def gds_str_lower(self, instring): + return instring.lower() + def get_path_(self, node): + path_list = [] + self.get_path_list_(node, path_list) + path_list.reverse() + path = '/'.join(path_list) + return path + Tag_strip_pattern_ = re_.compile(r'\{.*\}') + def get_path_list_(self, node, path_list): + if node is None: + return + tag = GeneratedsSuper.Tag_strip_pattern_.sub('', node.tag) + if tag: + path_list.append(tag) + self.get_path_list_(node.getparent(), path_list) + def get_class_obj_(self, node, default_class=None): + class_obj1 = default_class + if 'xsi' in node.nsmap: + classname = node.get('{%s}type' % node.nsmap['xsi']) + if classname is not None: + names = classname.split(':') + if len(names) == 2: + classname = names[1] + class_obj2 = globals().get(classname) + if class_obj2 is not None: + class_obj1 = class_obj2 + return class_obj1 + + +# +# If you have installed IPython you can uncomment and use the following. +# IPython is available from http://ipython.scipy.org/. +# + +## from IPython.Shell import IPShellEmbed +## args = '' +## ipshell = IPShellEmbed(args, +## banner = 'Dropping into IPython', +## exit_msg = 'Leaving Interpreter, back to program.') + +# Then use the following line where and when you want to drop into the +# IPython shell: +# ipshell(' -- Entering ipshell.\nHit Ctrl-D to exit') + +# +# Globals +# + +ExternalEncoding = 'ascii' +Tag_pattern_ = re_.compile(r'({.*})?(.*)') +String_cleanup_pat_ = re_.compile(r"[\n\r\s]+") +Namespace_extract_pat_ = re_.compile(r'{(.*)}(.*)') + +# +# Support/utility functions. +# + +def showIndent(outfile, level): + for idx in range(level): + outfile.write(' ') + +def quote_xml(inStr): + if not inStr: + return '' + s1 = (isinstance(inStr, basestring) and inStr or + '%s' % inStr) + s1 = s1.replace('&', '&') + s1 = s1.replace('<', '<') + s1 = s1.replace('>', '>') + return s1 + +def quote_attrib(inStr): + s1 = (isinstance(inStr, basestring) and inStr or + '%s' % inStr) + s1 = s1.replace('&', '&') + s1 = s1.replace('<', '<') + s1 = s1.replace('>', '>') + if '"' in s1: + if "'" in s1: + s1 = '"%s"' % s1.replace('"', """) + else: + s1 = "'%s'" % s1 + else: + s1 = '"%s"' % s1 + return s1 + +def quote_python(inStr): + s1 = inStr + if s1.find("'") == -1: + if s1.find('\n') == -1: + return "'%s'" % s1 + else: + return "'''%s'''" % s1 + else: + if s1.find('"') != -1: + s1 = s1.replace('"', '\\"') + if s1.find('\n') == -1: + return '"%s"' % s1 + else: + return '"""%s"""' % s1 + +def get_all_text_(node): + if node.text is not None: + text = node.text + else: + text = '' + for child in node: + if child.tail is not None: + text += child.tail + return text + +def find_attr_value_(attr_name, node): + attrs = node.attrib + attr_parts = attr_name.split(':') + value = None + if len(attr_parts) == 1: + value = attrs.get(attr_name) + elif len(attr_parts) == 2: + prefix, name = attr_parts + namespace = node.nsmap.get(prefix) + if namespace is not None: + value = attrs.get('{%s}%s' % (namespace, name, )) + return value + + +class GDSParseError(Exception): + pass + +def raise_parse_error(node, msg): + if XMLParser_import_library == XMLParser_import_lxml: + msg = '%s (element %s/line %d)' % (msg, node.tag, node.sourceline, ) + else: + msg = '%s (element %s)' % (msg, node.tag, ) + raise GDSParseError(msg) + + +class MixedContainer: + # Constants for category: + CategoryNone = 0 + CategoryText = 1 + CategorySimple = 2 + CategoryComplex = 3 + # Constants for content_type: + TypeNone = 0 + TypeText = 1 + TypeString = 2 + TypeInteger = 3 + TypeFloat = 4 + TypeDecimal = 5 + TypeDouble = 6 + TypeBoolean = 7 + def __init__(self, category, content_type, name, value): + self.category = category + self.content_type = content_type + self.name = name + self.value = value + def getCategory(self): + return self.category + def getContenttype(self, content_type): + return self.content_type + def getValue(self): + return self.value + def getName(self): + return self.name + def export(self, outfile, level, name, namespace): + if self.category == MixedContainer.CategoryText: + # Prevent exporting empty content as empty lines. + if self.value.strip(): + outfile.write(self.value) + elif self.category == MixedContainer.CategorySimple: + self.exportSimple(outfile, level, name) + else: # category == MixedContainer.CategoryComplex + self.value.export(outfile, level, namespace,name) + def exportSimple(self, outfile, level, name): + if self.content_type == MixedContainer.TypeString: + outfile.write('<%s>%s' % (self.name, self.value, self.name)) + elif self.content_type == MixedContainer.TypeInteger or \ + self.content_type == MixedContainer.TypeBoolean: + outfile.write('<%s>%d' % (self.name, self.value, self.name)) + elif self.content_type == MixedContainer.TypeFloat or \ + self.content_type == MixedContainer.TypeDecimal: + outfile.write('<%s>%f' % (self.name, self.value, self.name)) + elif self.content_type == MixedContainer.TypeDouble: + outfile.write('<%s>%g' % (self.name, self.value, self.name)) + def exportLiteral(self, outfile, level, name): + if self.category == MixedContainer.CategoryText: + showIndent(outfile, level) + outfile.write('model_.MixedContainer(%d, %d, "%s", "%s"),\n' % \ + (self.category, self.content_type, self.name, self.value)) + elif self.category == MixedContainer.CategorySimple: + showIndent(outfile, level) + outfile.write('model_.MixedContainer(%d, %d, "%s", "%s"),\n' % \ + (self.category, self.content_type, self.name, self.value)) + else: # category == MixedContainer.CategoryComplex + showIndent(outfile, level) + outfile.write('model_.MixedContainer(%d, %d, "%s",\n' % \ + (self.category, self.content_type, self.name,)) + self.value.exportLiteral(outfile, level + 1) + showIndent(outfile, level) + outfile.write(')\n') + + +class MemberSpec_(object): + def __init__(self, name='', data_type='', container=0): + self.name = name + self.data_type = data_type + self.container = container + def set_name(self, name): self.name = name + def get_name(self): return self.name + def set_data_type(self, data_type): self.data_type = data_type + def get_data_type_chain(self): return self.data_type + def get_data_type(self): + if isinstance(self.data_type, list): + if len(self.data_type) > 0: + return self.data_type[-1] + else: + return 'xs:string' + else: + return self.data_type + def set_container(self, container): self.container = container + def get_container(self): return self.container + +def _cast(typ, value): + if typ is None or value is None: + return value + return typ(value) + +# +# Data representation classes. +# + +class AdditionalLabelsDetail(GeneratedsSuper): + """Specifies additional labels to be produced. All required labels for + shipments will be produced without the need to request + additional labels. These are only available as thermal labels.""" + subclass = None + superclass = None + def __init__(self, Type=None, Count=None): + self.Type = Type + self.Count = Count + def factory(*args_, **kwargs_): + if AdditionalLabelsDetail.subclass: + return AdditionalLabelsDetail.subclass(*args_, **kwargs_) + else: + return AdditionalLabelsDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Type(self): return self.Type + def set_Type(self, Type): self.Type = Type + def validate_AdditionalLabelsType(self, value): + # Validate type AdditionalLabelsType, a restriction on xs:string. + pass + def get_Count(self): return self.Count + def set_Count(self, Count): self.Count = Count + def export(self, outfile, level, namespace_='ns:', name_='AdditionalLabelsDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='AdditionalLabelsDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='AdditionalLabelsDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='AdditionalLabelsDetail', fromsubclass_=False): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('<%sType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Type).encode(ExternalEncoding), input_name='Type'), namespace_)) + if self.Count is not None: + showIndent(outfile, level) + outfile.write('<%sCount>%s\n' % (namespace_, self.gds_format_integer(self.Count, input_name='Count'), namespace_)) + def hasContent_(self): + if ( + self.Type is not None or + self.Count is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='AdditionalLabelsDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('Type=%s,\n' % quote_python(self.Type).encode(ExternalEncoding)) + if self.Count is not None: + showIndent(outfile, level) + outfile.write('Count=%d,\n' % self.Count) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Type': + Type_ = child_.text + Type_ = self.gds_validate_string(Type_, node, 'Type') + self.Type = Type_ + self.validate_AdditionalLabelsType(self.Type) # validate type AdditionalLabelsType + elif nodeName_ == 'Count': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'Count') + self.Count = ival_ +# end class AdditionalLabelsDetail + + +class Address(GeneratedsSuper): + """Descriptive data for a physical location. May be used as an actual + physical address (place to which one could go), or as a + container of "address parts" which should be handled as a unit + (such as a city-state-ZIP combination within the US).""" + subclass = None + superclass = None + def __init__(self, StreetLines=None, City=None, StateOrProvinceCode=None, PostalCode=None, UrbanizationCode=None, CountryCode=None, Residential=None): + if StreetLines is None: + self.StreetLines = [] + else: + self.StreetLines = StreetLines + self.City = City + self.StateOrProvinceCode = StateOrProvinceCode + self.PostalCode = PostalCode + self.UrbanizationCode = UrbanizationCode + self.CountryCode = CountryCode + self.Residential = Residential + def factory(*args_, **kwargs_): + if Address.subclass: + return Address.subclass(*args_, **kwargs_) + else: + return Address(*args_, **kwargs_) + factory = staticmethod(factory) + def get_StreetLines(self): return self.StreetLines + def set_StreetLines(self, StreetLines): self.StreetLines = StreetLines + def add_StreetLines(self, value): self.StreetLines.append(value) + def insert_StreetLines(self, index, value): self.StreetLines[index] = value + def get_City(self): return self.City + def set_City(self, City): self.City = City + def get_StateOrProvinceCode(self): return self.StateOrProvinceCode + def set_StateOrProvinceCode(self, StateOrProvinceCode): self.StateOrProvinceCode = StateOrProvinceCode + def get_PostalCode(self): return self.PostalCode + def set_PostalCode(self, PostalCode): self.PostalCode = PostalCode + def get_UrbanizationCode(self): return self.UrbanizationCode + def set_UrbanizationCode(self, UrbanizationCode): self.UrbanizationCode = UrbanizationCode + def get_CountryCode(self): return self.CountryCode + def set_CountryCode(self, CountryCode): self.CountryCode = CountryCode + def get_Residential(self): return self.Residential + def set_Residential(self, Residential): self.Residential = Residential + def export(self, outfile, level, namespace_='ns:', name_='Address', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Address') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Address'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Address', fromsubclass_=False): + for StreetLines_ in self.StreetLines: + showIndent(outfile, level) + outfile.write('<%sStreetLines>%s\n' % (namespace_, self.gds_format_string(quote_xml(StreetLines_).encode(ExternalEncoding), input_name='StreetLines'), namespace_)) + if self.City is not None: + showIndent(outfile, level) + outfile.write('<%sCity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.City).encode(ExternalEncoding), input_name='City'), namespace_)) + if self.StateOrProvinceCode is not None: + showIndent(outfile, level) + outfile.write('<%sStateOrProvinceCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.StateOrProvinceCode).encode(ExternalEncoding), input_name='StateOrProvinceCode'), namespace_)) + if self.PostalCode is not None: + showIndent(outfile, level) + outfile.write('<%sPostalCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PostalCode).encode(ExternalEncoding), input_name='PostalCode'), namespace_)) + if self.UrbanizationCode is not None: + showIndent(outfile, level) + outfile.write('<%sUrbanizationCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.UrbanizationCode).encode(ExternalEncoding), input_name='UrbanizationCode'), namespace_)) + if self.CountryCode is not None: + showIndent(outfile, level) + outfile.write('<%sCountryCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CountryCode).encode(ExternalEncoding), input_name='CountryCode'), namespace_)) + if self.Residential is not None: + showIndent(outfile, level) + outfile.write('<%sResidential>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.Residential)), input_name='Residential'), namespace_)) + def hasContent_(self): + if ( + self.StreetLines or + self.City is not None or + self.StateOrProvinceCode is not None or + self.PostalCode is not None or + self.UrbanizationCode is not None or + self.CountryCode is not None or + self.Residential is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Address'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('StreetLines=[\n') + level += 1 + for StreetLines_ in self.StreetLines: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(StreetLines_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.City is not None: + showIndent(outfile, level) + outfile.write('City=%s,\n' % quote_python(self.City).encode(ExternalEncoding)) + if self.StateOrProvinceCode is not None: + showIndent(outfile, level) + outfile.write('StateOrProvinceCode=%s,\n' % quote_python(self.StateOrProvinceCode).encode(ExternalEncoding)) + if self.PostalCode is not None: + showIndent(outfile, level) + outfile.write('PostalCode=%s,\n' % quote_python(self.PostalCode).encode(ExternalEncoding)) + if self.UrbanizationCode is not None: + showIndent(outfile, level) + outfile.write('UrbanizationCode=%s,\n' % quote_python(self.UrbanizationCode).encode(ExternalEncoding)) + if self.CountryCode is not None: + showIndent(outfile, level) + outfile.write('CountryCode=%s,\n' % quote_python(self.CountryCode).encode(ExternalEncoding)) + if self.Residential is not None: + showIndent(outfile, level) + outfile.write('Residential=%s,\n' % self.Residential) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'StreetLines': + StreetLines_ = child_.text + StreetLines_ = self.gds_validate_string(StreetLines_, node, 'StreetLines') + self.StreetLines.append(StreetLines_) + elif nodeName_ == 'City': + City_ = child_.text + City_ = self.gds_validate_string(City_, node, 'City') + self.City = City_ + elif nodeName_ == 'StateOrProvinceCode': + StateOrProvinceCode_ = child_.text + StateOrProvinceCode_ = self.gds_validate_string(StateOrProvinceCode_, node, 'StateOrProvinceCode') + self.StateOrProvinceCode = StateOrProvinceCode_ + elif nodeName_ == 'PostalCode': + PostalCode_ = child_.text + PostalCode_ = self.gds_validate_string(PostalCode_, node, 'PostalCode') + self.PostalCode = PostalCode_ + elif nodeName_ == 'UrbanizationCode': + UrbanizationCode_ = child_.text + UrbanizationCode_ = self.gds_validate_string(UrbanizationCode_, node, 'UrbanizationCode') + self.UrbanizationCode = UrbanizationCode_ + elif nodeName_ == 'CountryCode': + CountryCode_ = child_.text + CountryCode_ = self.gds_validate_string(CountryCode_, node, 'CountryCode') + self.CountryCode = CountryCode_ + elif nodeName_ == 'Residential': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'Residential') + self.Residential = ival_ +# end class Address + + +class CertificateOfOriginDetail(GeneratedsSuper): + """The instructions indicating how to print the Certificate of Origin ( + e.g. whether or not to include the instructions, image type, etc + ...)""" + subclass = None + superclass = None + def __init__(self, DocumentFormat=None, CustomerImageUsages=None): + self.DocumentFormat = DocumentFormat + if CustomerImageUsages is None: + self.CustomerImageUsages = [] + else: + self.CustomerImageUsages = CustomerImageUsages + def factory(*args_, **kwargs_): + if CertificateOfOriginDetail.subclass: + return CertificateOfOriginDetail.subclass(*args_, **kwargs_) + else: + return CertificateOfOriginDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_DocumentFormat(self): return self.DocumentFormat + def set_DocumentFormat(self, DocumentFormat): self.DocumentFormat = DocumentFormat + def get_CustomerImageUsages(self): return self.CustomerImageUsages + def set_CustomerImageUsages(self, CustomerImageUsages): self.CustomerImageUsages = CustomerImageUsages + def add_CustomerImageUsages(self, value): self.CustomerImageUsages.append(value) + def insert_CustomerImageUsages(self, index, value): self.CustomerImageUsages[index] = value + def export(self, outfile, level, namespace_='ns:', name_='CertificateOfOriginDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CertificateOfOriginDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CertificateOfOriginDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CertificateOfOriginDetail', fromsubclass_=False): + if self.DocumentFormat: + self.DocumentFormat.export(outfile, level, namespace_, name_='DocumentFormat') + for CustomerImageUsages_ in self.CustomerImageUsages: + CustomerImageUsages_.export(outfile, level, namespace_, name_='CustomerImageUsages') + def hasContent_(self): + if ( + self.DocumentFormat is not None or + self.CustomerImageUsages + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CertificateOfOriginDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.DocumentFormat is not None: + showIndent(outfile, level) + outfile.write('DocumentFormat=model_.ShippingDocumentFormat(\n') + self.DocumentFormat.exportLiteral(outfile, level, name_='DocumentFormat') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('CustomerImageUsages=[\n') + level += 1 + for CustomerImageUsages_ in self.CustomerImageUsages: + showIndent(outfile, level) + outfile.write('model_.CustomerImageUsage(\n') + CustomerImageUsages_.exportLiteral(outfile, level, name_='CustomerImageUsage') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'DocumentFormat': + obj_ = ShippingDocumentFormat.factory() + obj_.build(child_) + self.set_DocumentFormat(obj_) + elif nodeName_ == 'CustomerImageUsages': + obj_ = CustomerImageUsage.factory() + obj_.build(child_) + self.CustomerImageUsages.append(obj_) +# end class CertificateOfOriginDetail + + +class ClientDetail(GeneratedsSuper): + """Descriptive data for the client submitting a transaction.""" + subclass = None + superclass = None + def __init__(self, AccountNumber=None, MeterNumber=None, IntegratorId=None, Region=None, Localization=None): + self.AccountNumber = AccountNumber + self.MeterNumber = MeterNumber + self.IntegratorId = IntegratorId + self.Region = Region + self.Localization = Localization + def factory(*args_, **kwargs_): + if ClientDetail.subclass: + return ClientDetail.subclass(*args_, **kwargs_) + else: + return ClientDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_AccountNumber(self): return self.AccountNumber + def set_AccountNumber(self, AccountNumber): self.AccountNumber = AccountNumber + def get_MeterNumber(self): return self.MeterNumber + def set_MeterNumber(self, MeterNumber): self.MeterNumber = MeterNumber + def get_IntegratorId(self): return self.IntegratorId + def set_IntegratorId(self, IntegratorId): self.IntegratorId = IntegratorId + def get_Region(self): return self.Region + def set_Region(self, Region): self.Region = Region + def validate_ExpressRegionCode(self, value): + # Validate type ExpressRegionCode, a restriction on xs:string. + pass + def get_Localization(self): return self.Localization + def set_Localization(self, Localization): self.Localization = Localization + def export(self, outfile, level, namespace_='ns:', name_='ClientDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ClientDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ClientDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ClientDetail', fromsubclass_=False): + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('<%sAccountNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AccountNumber).encode(ExternalEncoding), input_name='AccountNumber'), namespace_)) + if self.MeterNumber is not None: + showIndent(outfile, level) + outfile.write('<%sMeterNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.MeterNumber).encode(ExternalEncoding), input_name='MeterNumber'), namespace_)) + if self.IntegratorId is not None: + showIndent(outfile, level) + outfile.write('<%sIntegratorId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.IntegratorId).encode(ExternalEncoding), input_name='IntegratorId'), namespace_)) + if self.Region is not None: + showIndent(outfile, level) + outfile.write('<%sRegion>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Region).encode(ExternalEncoding), input_name='Region'), namespace_)) + if self.Localization: + self.Localization.export(outfile, level, namespace_, name_='Localization') + def hasContent_(self): + if ( + self.AccountNumber is not None or + self.MeterNumber is not None or + self.IntegratorId is not None or + self.Region is not None or + self.Localization is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ClientDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('AccountNumber=%s,\n' % quote_python(self.AccountNumber).encode(ExternalEncoding)) + if self.MeterNumber is not None: + showIndent(outfile, level) + outfile.write('MeterNumber=%s,\n' % quote_python(self.MeterNumber).encode(ExternalEncoding)) + if self.IntegratorId is not None: + showIndent(outfile, level) + outfile.write('IntegratorId=%s,\n' % quote_python(self.IntegratorId).encode(ExternalEncoding)) + if self.Region is not None: + showIndent(outfile, level) + outfile.write('Region=%s,\n' % quote_python(self.Region).encode(ExternalEncoding)) + if self.Localization is not None: + showIndent(outfile, level) + outfile.write('Localization=model_.Localization(\n') + self.Localization.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'AccountNumber': + AccountNumber_ = child_.text + AccountNumber_ = self.gds_validate_string(AccountNumber_, node, 'AccountNumber') + self.AccountNumber = AccountNumber_ + elif nodeName_ == 'MeterNumber': + MeterNumber_ = child_.text + MeterNumber_ = self.gds_validate_string(MeterNumber_, node, 'MeterNumber') + self.MeterNumber = MeterNumber_ + elif nodeName_ == 'IntegratorId': + IntegratorId_ = child_.text + IntegratorId_ = self.gds_validate_string(IntegratorId_, node, 'IntegratorId') + self.IntegratorId = IntegratorId_ + elif nodeName_ == 'Region': + Region_ = child_.text + Region_ = self.gds_validate_string(Region_, node, 'Region') + self.Region = Region_ + self.validate_ExpressRegionCode(self.Region) # validate type ExpressRegionCode + elif nodeName_ == 'Localization': + obj_ = Localization.factory() + obj_.build(child_) + self.set_Localization(obj_) +# end class ClientDetail + + +class CodAddTransportationChargesDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, RateTypeBasis=None, ChargeBasis=None, ChargeBasisLevel=None): + self.RateTypeBasis = RateTypeBasis + self.ChargeBasis = ChargeBasis + self.ChargeBasisLevel = ChargeBasisLevel + def factory(*args_, **kwargs_): + if CodAddTransportationChargesDetail.subclass: + return CodAddTransportationChargesDetail.subclass(*args_, **kwargs_) + else: + return CodAddTransportationChargesDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_RateTypeBasis(self): return self.RateTypeBasis + def set_RateTypeBasis(self, RateTypeBasis): self.RateTypeBasis = RateTypeBasis + def validate_RateTypeBasisType(self, value): + # Validate type RateTypeBasisType, a restriction on xs:string. + pass + def get_ChargeBasis(self): return self.ChargeBasis + def set_ChargeBasis(self, ChargeBasis): self.ChargeBasis = ChargeBasis + def validate_CodAddTransportationChargeBasisType(self, value): + # Validate type CodAddTransportationChargeBasisType, a restriction on xs:string. + pass + def get_ChargeBasisLevel(self): return self.ChargeBasisLevel + def set_ChargeBasisLevel(self, ChargeBasisLevel): self.ChargeBasisLevel = ChargeBasisLevel + def validate_ChargeBasisLevelType(self, value): + # Validate type ChargeBasisLevelType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='CodAddTransportationChargesDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CodAddTransportationChargesDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CodAddTransportationChargesDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CodAddTransportationChargesDetail', fromsubclass_=False): + if self.RateTypeBasis is not None: + showIndent(outfile, level) + outfile.write('<%sRateTypeBasis>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RateTypeBasis).encode(ExternalEncoding), input_name='RateTypeBasis'), namespace_)) + if self.ChargeBasis is not None: + showIndent(outfile, level) + outfile.write('<%sChargeBasis>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ChargeBasis).encode(ExternalEncoding), input_name='ChargeBasis'), namespace_)) + if self.ChargeBasisLevel is not None: + showIndent(outfile, level) + outfile.write('<%sChargeBasisLevel>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ChargeBasisLevel).encode(ExternalEncoding), input_name='ChargeBasisLevel'), namespace_)) + def hasContent_(self): + if ( + self.RateTypeBasis is not None or + self.ChargeBasis is not None or + self.ChargeBasisLevel is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CodAddTransportationChargesDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.RateTypeBasis is not None: + showIndent(outfile, level) + outfile.write('RateTypeBasis=%s,\n' % quote_python(self.RateTypeBasis).encode(ExternalEncoding)) + if self.ChargeBasis is not None: + showIndent(outfile, level) + outfile.write('ChargeBasis=%s,\n' % quote_python(self.ChargeBasis).encode(ExternalEncoding)) + if self.ChargeBasisLevel is not None: + showIndent(outfile, level) + outfile.write('ChargeBasisLevel=%s,\n' % quote_python(self.ChargeBasisLevel).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'RateTypeBasis': + RateTypeBasis_ = child_.text + RateTypeBasis_ = self.gds_validate_string(RateTypeBasis_, node, 'RateTypeBasis') + self.RateTypeBasis = RateTypeBasis_ + self.validate_RateTypeBasisType(self.RateTypeBasis) # validate type RateTypeBasisType + elif nodeName_ == 'ChargeBasis': + ChargeBasis_ = child_.text + ChargeBasis_ = self.gds_validate_string(ChargeBasis_, node, 'ChargeBasis') + self.ChargeBasis = ChargeBasis_ + self.validate_CodAddTransportationChargeBasisType(self.ChargeBasis) # validate type CodAddTransportationChargeBasisType + elif nodeName_ == 'ChargeBasisLevel': + ChargeBasisLevel_ = child_.text + ChargeBasisLevel_ = self.gds_validate_string(ChargeBasisLevel_, node, 'ChargeBasisLevel') + self.ChargeBasisLevel = ChargeBasisLevel_ + self.validate_ChargeBasisLevelType(self.ChargeBasisLevel) # validate type ChargeBasisLevelType +# end class CodAddTransportationChargesDetail + + +class CodDetail(GeneratedsSuper): + """Descriptive data required for a FedEx COD (Collect-On-Delivery) + shipment.""" + subclass = None + superclass = None + def __init__(self, CodCollectionAmount=None, AddTransportationChargesDetail=None, CollectionType=None, CodRecipient=None, ReferenceIndicator=None): + self.CodCollectionAmount = CodCollectionAmount + self.AddTransportationChargesDetail = AddTransportationChargesDetail + self.CollectionType = CollectionType + self.CodRecipient = CodRecipient + self.ReferenceIndicator = ReferenceIndicator + def factory(*args_, **kwargs_): + if CodDetail.subclass: + return CodDetail.subclass(*args_, **kwargs_) + else: + return CodDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_CodCollectionAmount(self): return self.CodCollectionAmount + def set_CodCollectionAmount(self, CodCollectionAmount): self.CodCollectionAmount = CodCollectionAmount + def get_AddTransportationChargesDetail(self): return self.AddTransportationChargesDetail + def set_AddTransportationChargesDetail(self, AddTransportationChargesDetail): self.AddTransportationChargesDetail = AddTransportationChargesDetail + def get_CollectionType(self): return self.CollectionType + def set_CollectionType(self, CollectionType): self.CollectionType = CollectionType + def validate_CodCollectionType(self, value): + # Validate type CodCollectionType, a restriction on xs:string. + pass + def get_CodRecipient(self): return self.CodRecipient + def set_CodRecipient(self, CodRecipient): self.CodRecipient = CodRecipient + def get_ReferenceIndicator(self): return self.ReferenceIndicator + def set_ReferenceIndicator(self, ReferenceIndicator): self.ReferenceIndicator = ReferenceIndicator + def validate_CodReturnReferenceIndicatorType(self, value): + # Validate type CodReturnReferenceIndicatorType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='CodDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CodDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CodDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CodDetail', fromsubclass_=False): + if self.CodCollectionAmount: + self.CodCollectionAmount.export(outfile, level, namespace_, name_='CodCollectionAmount') + if self.AddTransportationChargesDetail: + self.AddTransportationChargesDetail.export(outfile, level, namespace_, name_='AddTransportationChargesDetail') + if self.CollectionType is not None: + showIndent(outfile, level) + outfile.write('<%sCollectionType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CollectionType).encode(ExternalEncoding), input_name='CollectionType'), namespace_)) + if self.CodRecipient: + self.CodRecipient.export(outfile, level, namespace_, name_='CodRecipient') + if self.ReferenceIndicator is not None: + showIndent(outfile, level) + outfile.write('<%sReferenceIndicator>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ReferenceIndicator).encode(ExternalEncoding), input_name='ReferenceIndicator'), namespace_)) + def hasContent_(self): + if ( + self.CodCollectionAmount is not None or + self.AddTransportationChargesDetail is not None or + self.CollectionType is not None or + self.CodRecipient is not None or + self.ReferenceIndicator is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CodDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.CodCollectionAmount is not None: + showIndent(outfile, level) + outfile.write('CodCollectionAmount=model_.Money(\n') + self.CodCollectionAmount.exportLiteral(outfile, level, name_='CodCollectionAmount') + showIndent(outfile, level) + outfile.write('),\n') + if self.AddTransportationChargesDetail is not None: + showIndent(outfile, level) + outfile.write('AddTransportationChargesDetail=model_.CodAddTransportationChargesDetail(\n') + self.AddTransportationChargesDetail.exportLiteral(outfile, level, name_='AddTransportationChargesDetail') + showIndent(outfile, level) + outfile.write('),\n') + if self.CollectionType is not None: + showIndent(outfile, level) + outfile.write('CollectionType=%s,\n' % quote_python(self.CollectionType).encode(ExternalEncoding)) + if self.CodRecipient is not None: + showIndent(outfile, level) + outfile.write('CodRecipient=model_.Party(\n') + self.CodRecipient.exportLiteral(outfile, level, name_='CodRecipient') + showIndent(outfile, level) + outfile.write('),\n') + if self.ReferenceIndicator is not None: + showIndent(outfile, level) + outfile.write('ReferenceIndicator=%s,\n' % quote_python(self.ReferenceIndicator).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'CodCollectionAmount': + obj_ = Money.factory() + obj_.build(child_) + self.set_CodCollectionAmount(obj_) + elif nodeName_ == 'AddTransportationChargesDetail': + obj_ = CodAddTransportationChargesDetail.factory() + obj_.build(child_) + self.set_AddTransportationChargesDetail(obj_) + elif nodeName_ == 'CollectionType': + CollectionType_ = child_.text + CollectionType_ = self.gds_validate_string(CollectionType_, node, 'CollectionType') + self.CollectionType = CollectionType_ + self.validate_CodCollectionType(self.CollectionType) # validate type CodCollectionType + elif nodeName_ == 'CodRecipient': + obj_ = Party.factory() + obj_.build(child_) + self.set_CodRecipient(obj_) + elif nodeName_ == 'ReferenceIndicator': + ReferenceIndicator_ = child_.text + ReferenceIndicator_ = self.gds_validate_string(ReferenceIndicator_, node, 'ReferenceIndicator') + self.ReferenceIndicator = ReferenceIndicator_ + self.validate_CodReturnReferenceIndicatorType(self.ReferenceIndicator) # validate type CodReturnReferenceIndicatorType +# end class CodDetail + + +class CommercialInvoice(GeneratedsSuper): + """CommercialInvoice element is required for electronic upload of CI + data. It will serve to create/transmit an Electronic Commercial + Invoice through the FedEx Systems. Customers are responsible for + printing their own Commercial Invoice.If you would likeFedEx to + generate a Commercial Invoice and transmit it to Customs. for + clearance purposes, you need to specify that in the + ShippingDocumentSpecification element. If you would like a copy + of the Commercial Invoice that FedEx generated returned to you + in reply it needs to be specified in the + ETDDetail/RequestedDocumentCopies element. Commercial Invoice + support consists of maximum of 99 commodity line items.""" + subclass = None + superclass = None + def __init__(self, Comments=None, FreightCharge=None, TaxesOrMiscellaneousCharge=None, TaxesOrMiscellaneousChargeType=None, PackingCosts=None, HandlingCosts=None, SpecialInstructions=None, DeclarationStatment=None, PaymentTerms=None, Purpose=None, CustomerInvoiceNumber=None, OriginatorName=None, TermsOfSale=None): + if Comments is None: + self.Comments = [] + else: + self.Comments = Comments + self.FreightCharge = FreightCharge + self.TaxesOrMiscellaneousCharge = TaxesOrMiscellaneousCharge + self.TaxesOrMiscellaneousChargeType = TaxesOrMiscellaneousChargeType + self.PackingCosts = PackingCosts + self.HandlingCosts = HandlingCosts + self.SpecialInstructions = SpecialInstructions + self.DeclarationStatment = DeclarationStatment + self.PaymentTerms = PaymentTerms + self.Purpose = Purpose + self.CustomerInvoiceNumber = CustomerInvoiceNumber + self.OriginatorName = OriginatorName + self.TermsOfSale = TermsOfSale + def factory(*args_, **kwargs_): + if CommercialInvoice.subclass: + return CommercialInvoice.subclass(*args_, **kwargs_) + else: + return CommercialInvoice(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Comments(self): return self.Comments + def set_Comments(self, Comments): self.Comments = Comments + def add_Comments(self, value): self.Comments.append(value) + def insert_Comments(self, index, value): self.Comments[index] = value + def get_FreightCharge(self): return self.FreightCharge + def set_FreightCharge(self, FreightCharge): self.FreightCharge = FreightCharge + def get_TaxesOrMiscellaneousCharge(self): return self.TaxesOrMiscellaneousCharge + def set_TaxesOrMiscellaneousCharge(self, TaxesOrMiscellaneousCharge): self.TaxesOrMiscellaneousCharge = TaxesOrMiscellaneousCharge + def get_TaxesOrMiscellaneousChargeType(self): return self.TaxesOrMiscellaneousChargeType + def set_TaxesOrMiscellaneousChargeType(self, TaxesOrMiscellaneousChargeType): self.TaxesOrMiscellaneousChargeType = TaxesOrMiscellaneousChargeType + def validate_TaxesOrMiscellaneousChargeType(self, value): + # Validate type TaxesOrMiscellaneousChargeType, a restriction on xs:string. + pass + def get_PackingCosts(self): return self.PackingCosts + def set_PackingCosts(self, PackingCosts): self.PackingCosts = PackingCosts + def get_HandlingCosts(self): return self.HandlingCosts + def set_HandlingCosts(self, HandlingCosts): self.HandlingCosts = HandlingCosts + def get_SpecialInstructions(self): return self.SpecialInstructions + def set_SpecialInstructions(self, SpecialInstructions): self.SpecialInstructions = SpecialInstructions + def get_DeclarationStatment(self): return self.DeclarationStatment + def set_DeclarationStatment(self, DeclarationStatment): self.DeclarationStatment = DeclarationStatment + def get_PaymentTerms(self): return self.PaymentTerms + def set_PaymentTerms(self, PaymentTerms): self.PaymentTerms = PaymentTerms + def get_Purpose(self): return self.Purpose + def set_Purpose(self, Purpose): self.Purpose = Purpose + def validate_PurposeOfShipmentType(self, value): + # Validate type PurposeOfShipmentType, a restriction on xs:string. + pass + def get_CustomerInvoiceNumber(self): return self.CustomerInvoiceNumber + def set_CustomerInvoiceNumber(self, CustomerInvoiceNumber): self.CustomerInvoiceNumber = CustomerInvoiceNumber + def get_OriginatorName(self): return self.OriginatorName + def set_OriginatorName(self, OriginatorName): self.OriginatorName = OriginatorName + def get_TermsOfSale(self): return self.TermsOfSale + def set_TermsOfSale(self, TermsOfSale): self.TermsOfSale = TermsOfSale + def validate_TermsOfSaleType(self, value): + # Validate type TermsOfSaleType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='CommercialInvoice', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CommercialInvoice') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CommercialInvoice'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CommercialInvoice', fromsubclass_=False): + for Comments_ in self.Comments: + showIndent(outfile, level) + outfile.write('<%sComments>%s\n' % (namespace_, self.gds_format_string(quote_xml(Comments_).encode(ExternalEncoding), input_name='Comments'), namespace_)) + if self.FreightCharge: + self.FreightCharge.export(outfile, level, namespace_, name_='FreightCharge') + if self.TaxesOrMiscellaneousCharge: + self.TaxesOrMiscellaneousCharge.export(outfile, level, namespace_, name_='TaxesOrMiscellaneousCharge') + if self.TaxesOrMiscellaneousChargeType is not None: + showIndent(outfile, level) + outfile.write('<%sTaxesOrMiscellaneousChargeType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.TaxesOrMiscellaneousChargeType).encode(ExternalEncoding), input_name='TaxesOrMiscellaneousChargeType'), namespace_)) + if self.PackingCosts: + self.PackingCosts.export(outfile, level, namespace_, name_='PackingCosts') + if self.HandlingCosts: + self.HandlingCosts.export(outfile, level, namespace_, name_='HandlingCosts') + if self.SpecialInstructions is not None: + showIndent(outfile, level) + outfile.write('<%sSpecialInstructions>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.SpecialInstructions).encode(ExternalEncoding), input_name='SpecialInstructions'), namespace_)) + if self.DeclarationStatment is not None: + showIndent(outfile, level) + outfile.write('<%sDeclarationStatment>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DeclarationStatment).encode(ExternalEncoding), input_name='DeclarationStatment'), namespace_)) + if self.PaymentTerms is not None: + showIndent(outfile, level) + outfile.write('<%sPaymentTerms>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PaymentTerms).encode(ExternalEncoding), input_name='PaymentTerms'), namespace_)) + if self.Purpose is not None: + showIndent(outfile, level) + outfile.write('<%sPurpose>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Purpose).encode(ExternalEncoding), input_name='Purpose'), namespace_)) + if self.CustomerInvoiceNumber is not None: + showIndent(outfile, level) + outfile.write('<%sCustomerInvoiceNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CustomerInvoiceNumber).encode(ExternalEncoding), input_name='CustomerInvoiceNumber'), namespace_)) + if self.OriginatorName is not None: + showIndent(outfile, level) + outfile.write('<%sOriginatorName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.OriginatorName).encode(ExternalEncoding), input_name='OriginatorName'), namespace_)) + if self.TermsOfSale is not None: + showIndent(outfile, level) + outfile.write('<%sTermsOfSale>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.TermsOfSale).encode(ExternalEncoding), input_name='TermsOfSale'), namespace_)) + def hasContent_(self): + if ( + self.Comments or + self.FreightCharge is not None or + self.TaxesOrMiscellaneousCharge is not None or + self.TaxesOrMiscellaneousChargeType is not None or + self.PackingCosts is not None or + self.HandlingCosts is not None or + self.SpecialInstructions is not None or + self.DeclarationStatment is not None or + self.PaymentTerms is not None or + self.Purpose is not None or + self.CustomerInvoiceNumber is not None or + self.OriginatorName is not None or + self.TermsOfSale is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CommercialInvoice'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('Comments=[\n') + level += 1 + for Comments_ in self.Comments: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(Comments_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.FreightCharge is not None: + showIndent(outfile, level) + outfile.write('FreightCharge=model_.Money(\n') + self.FreightCharge.exportLiteral(outfile, level, name_='FreightCharge') + showIndent(outfile, level) + outfile.write('),\n') + if self.TaxesOrMiscellaneousCharge is not None: + showIndent(outfile, level) + outfile.write('TaxesOrMiscellaneousCharge=model_.Money(\n') + self.TaxesOrMiscellaneousCharge.exportLiteral(outfile, level, name_='TaxesOrMiscellaneousCharge') + showIndent(outfile, level) + outfile.write('),\n') + if self.TaxesOrMiscellaneousChargeType is not None: + showIndent(outfile, level) + outfile.write('TaxesOrMiscellaneousChargeType=%s,\n' % quote_python(self.TaxesOrMiscellaneousChargeType).encode(ExternalEncoding)) + if self.PackingCosts is not None: + showIndent(outfile, level) + outfile.write('PackingCosts=model_.Money(\n') + self.PackingCosts.exportLiteral(outfile, level, name_='PackingCosts') + showIndent(outfile, level) + outfile.write('),\n') + if self.HandlingCosts is not None: + showIndent(outfile, level) + outfile.write('HandlingCosts=model_.Money(\n') + self.HandlingCosts.exportLiteral(outfile, level, name_='HandlingCosts') + showIndent(outfile, level) + outfile.write('),\n') + if self.SpecialInstructions is not None: + showIndent(outfile, level) + outfile.write('SpecialInstructions=%s,\n' % quote_python(self.SpecialInstructions).encode(ExternalEncoding)) + if self.DeclarationStatment is not None: + showIndent(outfile, level) + outfile.write('DeclarationStatment=%s,\n' % quote_python(self.DeclarationStatment).encode(ExternalEncoding)) + if self.PaymentTerms is not None: + showIndent(outfile, level) + outfile.write('PaymentTerms=%s,\n' % quote_python(self.PaymentTerms).encode(ExternalEncoding)) + if self.Purpose is not None: + showIndent(outfile, level) + outfile.write('Purpose=%s,\n' % quote_python(self.Purpose).encode(ExternalEncoding)) + if self.CustomerInvoiceNumber is not None: + showIndent(outfile, level) + outfile.write('CustomerInvoiceNumber=%s,\n' % quote_python(self.CustomerInvoiceNumber).encode(ExternalEncoding)) + if self.OriginatorName is not None: + showIndent(outfile, level) + outfile.write('OriginatorName=%s,\n' % quote_python(self.OriginatorName).encode(ExternalEncoding)) + if self.TermsOfSale is not None: + showIndent(outfile, level) + outfile.write('TermsOfSale=%s,\n' % quote_python(self.TermsOfSale).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Comments': + Comments_ = child_.text + Comments_ = self.gds_validate_string(Comments_, node, 'Comments') + self.Comments.append(Comments_) + elif nodeName_ == 'FreightCharge': + obj_ = Money.factory() + obj_.build(child_) + self.set_FreightCharge(obj_) + elif nodeName_ == 'TaxesOrMiscellaneousCharge': + obj_ = Money.factory() + obj_.build(child_) + self.set_TaxesOrMiscellaneousCharge(obj_) + elif nodeName_ == 'TaxesOrMiscellaneousChargeType': + TaxesOrMiscellaneousChargeType_ = child_.text + TaxesOrMiscellaneousChargeType_ = self.gds_validate_string(TaxesOrMiscellaneousChargeType_, node, 'TaxesOrMiscellaneousChargeType') + self.TaxesOrMiscellaneousChargeType = TaxesOrMiscellaneousChargeType_ + self.validate_TaxesOrMiscellaneousChargeType(self.TaxesOrMiscellaneousChargeType) # validate type TaxesOrMiscellaneousChargeType + elif nodeName_ == 'PackingCosts': + obj_ = Money.factory() + obj_.build(child_) + self.set_PackingCosts(obj_) + elif nodeName_ == 'HandlingCosts': + obj_ = Money.factory() + obj_.build(child_) + self.set_HandlingCosts(obj_) + elif nodeName_ == 'SpecialInstructions': + SpecialInstructions_ = child_.text + SpecialInstructions_ = self.gds_validate_string(SpecialInstructions_, node, 'SpecialInstructions') + self.SpecialInstructions = SpecialInstructions_ + elif nodeName_ == 'DeclarationStatment': + DeclarationStatment_ = child_.text + DeclarationStatment_ = self.gds_validate_string(DeclarationStatment_, node, 'DeclarationStatment') + self.DeclarationStatment = DeclarationStatment_ + elif nodeName_ == 'PaymentTerms': + PaymentTerms_ = child_.text + PaymentTerms_ = self.gds_validate_string(PaymentTerms_, node, 'PaymentTerms') + self.PaymentTerms = PaymentTerms_ + elif nodeName_ == 'Purpose': + Purpose_ = child_.text + Purpose_ = self.gds_validate_string(Purpose_, node, 'Purpose') + self.Purpose = Purpose_ + self.validate_PurposeOfShipmentType(self.Purpose) # validate type PurposeOfShipmentType + elif nodeName_ == 'CustomerInvoiceNumber': + CustomerInvoiceNumber_ = child_.text + CustomerInvoiceNumber_ = self.gds_validate_string(CustomerInvoiceNumber_, node, 'CustomerInvoiceNumber') + self.CustomerInvoiceNumber = CustomerInvoiceNumber_ + elif nodeName_ == 'OriginatorName': + OriginatorName_ = child_.text + OriginatorName_ = self.gds_validate_string(OriginatorName_, node, 'OriginatorName') + self.OriginatorName = OriginatorName_ + elif nodeName_ == 'TermsOfSale': + TermsOfSale_ = child_.text + TermsOfSale_ = self.gds_validate_string(TermsOfSale_, node, 'TermsOfSale') + self.TermsOfSale = TermsOfSale_ + self.validate_TermsOfSaleType(self.TermsOfSale) # validate type TermsOfSaleType +# end class CommercialInvoice + + +class CommercialInvoiceDetail(GeneratedsSuper): + """The instructions indicating how to print the Commercial Invoice( + e.g. image type) Specifies characteristics of a shipping + document to be produced.""" + subclass = None + superclass = None + def __init__(self, Format=None, CustomerImageUsages=None): + self.Format = Format + if CustomerImageUsages is None: + self.CustomerImageUsages = [] + else: + self.CustomerImageUsages = CustomerImageUsages + def factory(*args_, **kwargs_): + if CommercialInvoiceDetail.subclass: + return CommercialInvoiceDetail.subclass(*args_, **kwargs_) + else: + return CommercialInvoiceDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Format(self): return self.Format + def set_Format(self, Format): self.Format = Format + def get_CustomerImageUsages(self): return self.CustomerImageUsages + def set_CustomerImageUsages(self, CustomerImageUsages): self.CustomerImageUsages = CustomerImageUsages + def add_CustomerImageUsages(self, value): self.CustomerImageUsages.append(value) + def insert_CustomerImageUsages(self, index, value): self.CustomerImageUsages[index] = value + def export(self, outfile, level, namespace_='ns:', name_='CommercialInvoiceDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CommercialInvoiceDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CommercialInvoiceDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CommercialInvoiceDetail', fromsubclass_=False): + if self.Format: + self.Format.export(outfile, level, namespace_, name_='Format') + for CustomerImageUsages_ in self.CustomerImageUsages: + CustomerImageUsages_.export(outfile, level, namespace_, name_='CustomerImageUsages') + def hasContent_(self): + if ( + self.Format is not None or + self.CustomerImageUsages + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CommercialInvoiceDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Format is not None: + showIndent(outfile, level) + outfile.write('Format=model_.ShippingDocumentFormat(\n') + self.Format.exportLiteral(outfile, level, name_='Format') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('CustomerImageUsages=[\n') + level += 1 + for CustomerImageUsages_ in self.CustomerImageUsages: + showIndent(outfile, level) + outfile.write('model_.CustomerImageUsage(\n') + CustomerImageUsages_.exportLiteral(outfile, level, name_='CustomerImageUsage') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Format': + obj_ = ShippingDocumentFormat.factory() + obj_.build(child_) + self.set_Format(obj_) + elif nodeName_ == 'CustomerImageUsages': + obj_ = CustomerImageUsage.factory() + obj_.build(child_) + self.CustomerImageUsages.append(obj_) +# end class CommercialInvoiceDetail + + +class CommitDetail(GeneratedsSuper): + """Information about the transit time and delivery commitment date and + time.""" + subclass = None + superclass = None + def __init__(self, CommodityName=None, ServiceType=None, AppliedOptions=None, AppliedSubOptions=None, CommitTimestamp=None, DayOfWeek=None, TransitTime=None, MaximumTransitTime=None, DestinationServiceArea=None, BrokerAddress=None, BrokerLocationId=None, BrokerCommitTimestamp=None, BrokerCommitDayOfWeek=None, BrokerToDestinationDays=None, ProofOfDeliveryDate=None, ProofOfDeliveryDayOfWeek=None, CommitMessages=None, DeliveryMessages=None, DelayDetails=None, DocumentContent=None, RequiredDocuments=None, FreightCommitDetail=None): + self.CommodityName = CommodityName + self.ServiceType = ServiceType + if AppliedOptions is None: + self.AppliedOptions = [] + else: + self.AppliedOptions = AppliedOptions + self.AppliedSubOptions = AppliedSubOptions + self.CommitTimestamp = CommitTimestamp + self.DayOfWeek = DayOfWeek + self.TransitTime = TransitTime + self.MaximumTransitTime = MaximumTransitTime + self.DestinationServiceArea = DestinationServiceArea + self.BrokerAddress = BrokerAddress + self.BrokerLocationId = BrokerLocationId + self.BrokerCommitTimestamp = BrokerCommitTimestamp + self.BrokerCommitDayOfWeek = BrokerCommitDayOfWeek + self.BrokerToDestinationDays = BrokerToDestinationDays + self.ProofOfDeliveryDate = ProofOfDeliveryDate + self.ProofOfDeliveryDayOfWeek = ProofOfDeliveryDayOfWeek + if CommitMessages is None: + self.CommitMessages = [] + else: + self.CommitMessages = CommitMessages + if DeliveryMessages is None: + self.DeliveryMessages = [] + else: + self.DeliveryMessages = DeliveryMessages + if DelayDetails is None: + self.DelayDetails = [] + else: + self.DelayDetails = DelayDetails + self.DocumentContent = DocumentContent + if RequiredDocuments is None: + self.RequiredDocuments = [] + else: + self.RequiredDocuments = RequiredDocuments + self.FreightCommitDetail = FreightCommitDetail + def factory(*args_, **kwargs_): + if CommitDetail.subclass: + return CommitDetail.subclass(*args_, **kwargs_) + else: + return CommitDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_CommodityName(self): return self.CommodityName + def set_CommodityName(self, CommodityName): self.CommodityName = CommodityName + def get_ServiceType(self): return self.ServiceType + def set_ServiceType(self, ServiceType): self.ServiceType = ServiceType + def validate_ServiceType(self, value): + # Validate type ServiceType, a restriction on xs:string. + pass + def get_AppliedOptions(self): return self.AppliedOptions + def set_AppliedOptions(self, AppliedOptions): self.AppliedOptions = AppliedOptions + def add_AppliedOptions(self, value): self.AppliedOptions.append(value) + def insert_AppliedOptions(self, index, value): self.AppliedOptions[index] = value + def validate_ServiceOptionType(self, value): + # Validate type ServiceOptionType, a restriction on xs:string. + pass + def get_AppliedSubOptions(self): return self.AppliedSubOptions + def set_AppliedSubOptions(self, AppliedSubOptions): self.AppliedSubOptions = AppliedSubOptions + def get_CommitTimestamp(self): return self.CommitTimestamp + def set_CommitTimestamp(self, CommitTimestamp): self.CommitTimestamp = CommitTimestamp + def get_DayOfWeek(self): return self.DayOfWeek + def set_DayOfWeek(self, DayOfWeek): self.DayOfWeek = DayOfWeek + def validate_DayOfWeekType(self, value): + # Validate type DayOfWeekType, a restriction on xs:string. + pass + def get_TransitTime(self): return self.TransitTime + def set_TransitTime(self, TransitTime): self.TransitTime = TransitTime + def validate_TransitTimeType(self, value): + # Validate type TransitTimeType, a restriction on xs:string. + pass + def get_MaximumTransitTime(self): return self.MaximumTransitTime + def set_MaximumTransitTime(self, MaximumTransitTime): self.MaximumTransitTime = MaximumTransitTime + def get_DestinationServiceArea(self): return self.DestinationServiceArea + def set_DestinationServiceArea(self, DestinationServiceArea): self.DestinationServiceArea = DestinationServiceArea + def get_BrokerAddress(self): return self.BrokerAddress + def set_BrokerAddress(self, BrokerAddress): self.BrokerAddress = BrokerAddress + def get_BrokerLocationId(self): return self.BrokerLocationId + def set_BrokerLocationId(self, BrokerLocationId): self.BrokerLocationId = BrokerLocationId + def get_BrokerCommitTimestamp(self): return self.BrokerCommitTimestamp + def set_BrokerCommitTimestamp(self, BrokerCommitTimestamp): self.BrokerCommitTimestamp = BrokerCommitTimestamp + def get_BrokerCommitDayOfWeek(self): return self.BrokerCommitDayOfWeek + def set_BrokerCommitDayOfWeek(self, BrokerCommitDayOfWeek): self.BrokerCommitDayOfWeek = BrokerCommitDayOfWeek + def get_BrokerToDestinationDays(self): return self.BrokerToDestinationDays + def set_BrokerToDestinationDays(self, BrokerToDestinationDays): self.BrokerToDestinationDays = BrokerToDestinationDays + def get_ProofOfDeliveryDate(self): return self.ProofOfDeliveryDate + def set_ProofOfDeliveryDate(self, ProofOfDeliveryDate): self.ProofOfDeliveryDate = ProofOfDeliveryDate + def get_ProofOfDeliveryDayOfWeek(self): return self.ProofOfDeliveryDayOfWeek + def set_ProofOfDeliveryDayOfWeek(self, ProofOfDeliveryDayOfWeek): self.ProofOfDeliveryDayOfWeek = ProofOfDeliveryDayOfWeek + def get_CommitMessages(self): return self.CommitMessages + def set_CommitMessages(self, CommitMessages): self.CommitMessages = CommitMessages + def add_CommitMessages(self, value): self.CommitMessages.append(value) + def insert_CommitMessages(self, index, value): self.CommitMessages[index] = value + def get_DeliveryMessages(self): return self.DeliveryMessages + def set_DeliveryMessages(self, DeliveryMessages): self.DeliveryMessages = DeliveryMessages + def add_DeliveryMessages(self, value): self.DeliveryMessages.append(value) + def insert_DeliveryMessages(self, index, value): self.DeliveryMessages[index] = value + def get_DelayDetails(self): return self.DelayDetails + def set_DelayDetails(self, DelayDetails): self.DelayDetails = DelayDetails + def add_DelayDetails(self, value): self.DelayDetails.append(value) + def insert_DelayDetails(self, index, value): self.DelayDetails[index] = value + def get_DocumentContent(self): return self.DocumentContent + def set_DocumentContent(self, DocumentContent): self.DocumentContent = DocumentContent + def validate_InternationalDocumentContentType(self, value): + # Validate type InternationalDocumentContentType, a restriction on xs:string. + pass + def get_RequiredDocuments(self): return self.RequiredDocuments + def set_RequiredDocuments(self, RequiredDocuments): self.RequiredDocuments = RequiredDocuments + def add_RequiredDocuments(self, value): self.RequiredDocuments.append(value) + def insert_RequiredDocuments(self, index, value): self.RequiredDocuments[index] = value + def validate_RequiredShippingDocumentType(self, value): + # Validate type RequiredShippingDocumentType, a restriction on xs:string. + pass + def get_FreightCommitDetail(self): return self.FreightCommitDetail + def set_FreightCommitDetail(self, FreightCommitDetail): self.FreightCommitDetail = FreightCommitDetail + def export(self, outfile, level, namespace_='ns:', name_='CommitDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CommitDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CommitDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CommitDetail', fromsubclass_=False): + if self.CommodityName is not None: + showIndent(outfile, level) + outfile.write('<%sCommodityName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CommodityName).encode(ExternalEncoding), input_name='CommodityName'), namespace_)) + if self.ServiceType is not None: + showIndent(outfile, level) + outfile.write('<%sServiceType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ServiceType).encode(ExternalEncoding), input_name='ServiceType'), namespace_)) + for AppliedOptions_ in self.AppliedOptions: + showIndent(outfile, level) + outfile.write('<%sAppliedOptions>%s\n' % (namespace_, self.gds_format_string(quote_xml(AppliedOptions_).encode(ExternalEncoding), input_name='AppliedOptions'), namespace_)) + if self.AppliedSubOptions: + self.AppliedSubOptions.export(outfile, level, namespace_, name_='AppliedSubOptions') + if self.CommitTimestamp is not None: + showIndent(outfile, level) + outfile.write('<%sCommitTimestamp>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CommitTimestamp).encode(ExternalEncoding), input_name='CommitTimestamp'), namespace_)) + if self.DayOfWeek is not None: + showIndent(outfile, level) + outfile.write('<%sDayOfWeek>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DayOfWeek).encode(ExternalEncoding), input_name='DayOfWeek'), namespace_)) + if self.TransitTime is not None: + showIndent(outfile, level) + outfile.write('<%sTransitTime>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.TransitTime).encode(ExternalEncoding), input_name='TransitTime'), namespace_)) + if self.MaximumTransitTime is not None: + showIndent(outfile, level) + outfile.write('<%sMaximumTransitTime>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.MaximumTransitTime).encode(ExternalEncoding), input_name='MaximumTransitTime'), namespace_)) + if self.DestinationServiceArea is not None: + showIndent(outfile, level) + outfile.write('<%sDestinationServiceArea>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DestinationServiceArea).encode(ExternalEncoding), input_name='DestinationServiceArea'), namespace_)) + if self.BrokerAddress: + self.BrokerAddress.export(outfile, level, namespace_, name_='BrokerAddress') + if self.BrokerLocationId is not None: + showIndent(outfile, level) + outfile.write('<%sBrokerLocationId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.BrokerLocationId).encode(ExternalEncoding), input_name='BrokerLocationId'), namespace_)) + if self.BrokerCommitTimestamp is not None: + showIndent(outfile, level) + outfile.write('<%sBrokerCommitTimestamp>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.BrokerCommitTimestamp).encode(ExternalEncoding), input_name='BrokerCommitTimestamp'), namespace_)) + if self.BrokerCommitDayOfWeek is not None: + showIndent(outfile, level) + outfile.write('<%sBrokerCommitDayOfWeek>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.BrokerCommitDayOfWeek).encode(ExternalEncoding), input_name='BrokerCommitDayOfWeek'), namespace_)) + if self.BrokerToDestinationDays is not None: + showIndent(outfile, level) + outfile.write('<%sBrokerToDestinationDays>%s\n' % (namespace_, self.gds_format_integer(self.BrokerToDestinationDays, input_name='BrokerToDestinationDays'), namespace_)) + if self.ProofOfDeliveryDate is not None: + showIndent(outfile, level) + outfile.write('<%sProofOfDeliveryDate>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ProofOfDeliveryDate).encode(ExternalEncoding), input_name='ProofOfDeliveryDate'), namespace_)) + if self.ProofOfDeliveryDayOfWeek is not None: + showIndent(outfile, level) + outfile.write('<%sProofOfDeliveryDayOfWeek>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ProofOfDeliveryDayOfWeek).encode(ExternalEncoding), input_name='ProofOfDeliveryDayOfWeek'), namespace_)) + for CommitMessages_ in self.CommitMessages: + CommitMessages_.export(outfile, level, namespace_, name_='CommitMessages') + for DeliveryMessages_ in self.DeliveryMessages: + showIndent(outfile, level) + outfile.write('<%sDeliveryMessages>%s\n' % (namespace_, self.gds_format_string(quote_xml(DeliveryMessages_).encode(ExternalEncoding), input_name='DeliveryMessages'), namespace_)) + for DelayDetails_ in self.DelayDetails: + DelayDetails_.export(outfile, level, namespace_, name_='DelayDetails') + if self.DocumentContent is not None: + showIndent(outfile, level) + outfile.write('<%sDocumentContent>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DocumentContent).encode(ExternalEncoding), input_name='DocumentContent'), namespace_)) + for RequiredDocuments_ in self.RequiredDocuments: + showIndent(outfile, level) + outfile.write('<%sRequiredDocuments>%s\n' % (namespace_, self.gds_format_string(quote_xml(RequiredDocuments_).encode(ExternalEncoding), input_name='RequiredDocuments'), namespace_)) + if self.FreightCommitDetail: + self.FreightCommitDetail.export(outfile, level, namespace_, name_='FreightCommitDetail') + def hasContent_(self): + if ( + self.CommodityName is not None or + self.ServiceType is not None or + self.AppliedOptions or + self.AppliedSubOptions is not None or + self.CommitTimestamp is not None or + self.DayOfWeek is not None or + self.TransitTime is not None or + self.MaximumTransitTime is not None or + self.DestinationServiceArea is not None or + self.BrokerAddress is not None or + self.BrokerLocationId is not None or + self.BrokerCommitTimestamp is not None or + self.BrokerCommitDayOfWeek is not None or + self.BrokerToDestinationDays is not None or + self.ProofOfDeliveryDate is not None or + self.ProofOfDeliveryDayOfWeek is not None or + self.CommitMessages or + self.DeliveryMessages or + self.DelayDetails or + self.DocumentContent is not None or + self.RequiredDocuments or + self.FreightCommitDetail is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CommitDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.CommodityName is not None: + showIndent(outfile, level) + outfile.write('CommodityName=%s,\n' % quote_python(self.CommodityName).encode(ExternalEncoding)) + if self.ServiceType is not None: + showIndent(outfile, level) + outfile.write('ServiceType=%s,\n' % quote_python(self.ServiceType).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('AppliedOptions=[\n') + level += 1 + for AppliedOptions_ in self.AppliedOptions: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(AppliedOptions_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.AppliedSubOptions is not None: + showIndent(outfile, level) + outfile.write('AppliedSubOptions=model_.ServiceSubOptionDetail(\n') + self.AppliedSubOptions.exportLiteral(outfile, level, name_='AppliedSubOptions') + showIndent(outfile, level) + outfile.write('),\n') + if self.CommitTimestamp is not None: + showIndent(outfile, level) + outfile.write('CommitTimestamp=%s,\n' % quote_python(self.CommitTimestamp).encode(ExternalEncoding)) + if self.DayOfWeek is not None: + showIndent(outfile, level) + outfile.write('DayOfWeek=%s,\n' % quote_python(self.DayOfWeek).encode(ExternalEncoding)) + if self.TransitTime is not None: + showIndent(outfile, level) + outfile.write('TransitTime=%s,\n' % quote_python(self.TransitTime).encode(ExternalEncoding)) + if self.MaximumTransitTime is not None: + showIndent(outfile, level) + outfile.write('MaximumTransitTime=%s,\n' % quote_python(self.MaximumTransitTime).encode(ExternalEncoding)) + if self.DestinationServiceArea is not None: + showIndent(outfile, level) + outfile.write('DestinationServiceArea=%s,\n' % quote_python(self.DestinationServiceArea).encode(ExternalEncoding)) + if self.BrokerAddress is not None: + showIndent(outfile, level) + outfile.write('BrokerAddress=model_.Address(\n') + self.BrokerAddress.exportLiteral(outfile, level, name_='BrokerAddress') + showIndent(outfile, level) + outfile.write('),\n') + if self.BrokerLocationId is not None: + showIndent(outfile, level) + outfile.write('BrokerLocationId=%s,\n' % quote_python(self.BrokerLocationId).encode(ExternalEncoding)) + if self.BrokerCommitTimestamp is not None: + showIndent(outfile, level) + outfile.write('BrokerCommitTimestamp=%s,\n' % quote_python(self.BrokerCommitTimestamp).encode(ExternalEncoding)) + if self.BrokerCommitDayOfWeek is not None: + showIndent(outfile, level) + outfile.write('BrokerCommitDayOfWeek=%s,\n' % quote_python(self.BrokerCommitDayOfWeek).encode(ExternalEncoding)) + if self.BrokerToDestinationDays is not None: + showIndent(outfile, level) + outfile.write('BrokerToDestinationDays=%d,\n' % self.BrokerToDestinationDays) + if self.ProofOfDeliveryDate is not None: + showIndent(outfile, level) + outfile.write('ProofOfDeliveryDate=%s,\n' % quote_python(self.ProofOfDeliveryDate).encode(ExternalEncoding)) + if self.ProofOfDeliveryDayOfWeek is not None: + showIndent(outfile, level) + outfile.write('ProofOfDeliveryDayOfWeek=%s,\n' % quote_python(self.ProofOfDeliveryDayOfWeek).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('CommitMessages=[\n') + level += 1 + for CommitMessages_ in self.CommitMessages: + showIndent(outfile, level) + outfile.write('model_.Notification(\n') + CommitMessages_.exportLiteral(outfile, level, name_='Notification') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('DeliveryMessages=[\n') + level += 1 + for DeliveryMessages_ in self.DeliveryMessages: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(DeliveryMessages_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('DelayDetails=[\n') + level += 1 + for DelayDetails_ in self.DelayDetails: + showIndent(outfile, level) + outfile.write('model_.DelayDetail(\n') + DelayDetails_.exportLiteral(outfile, level, name_='DelayDetail') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.DocumentContent is not None: + showIndent(outfile, level) + outfile.write('DocumentContent=%s,\n' % quote_python(self.DocumentContent).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('RequiredDocuments=[\n') + level += 1 + for RequiredDocuments_ in self.RequiredDocuments: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(RequiredDocuments_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.FreightCommitDetail is not None: + showIndent(outfile, level) + outfile.write('FreightCommitDetail=model_.FreightCommitDetail(\n') + self.FreightCommitDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'CommodityName': + CommodityName_ = child_.text + CommodityName_ = self.gds_validate_string(CommodityName_, node, 'CommodityName') + self.CommodityName = CommodityName_ + elif nodeName_ == 'ServiceType': + ServiceType_ = child_.text + ServiceType_ = self.gds_validate_string(ServiceType_, node, 'ServiceType') + self.ServiceType = ServiceType_ + self.validate_ServiceType(self.ServiceType) # validate type ServiceType + elif nodeName_ == 'AppliedOptions': + AppliedOptions_ = child_.text + AppliedOptions_ = self.gds_validate_string(AppliedOptions_, node, 'AppliedOptions') + self.AppliedOptions.append(AppliedOptions_) + self.validate_ServiceOptionType(self.AppliedOptions) # validate type ServiceOptionType + elif nodeName_ == 'AppliedSubOptions': + obj_ = ServiceSubOptionDetail.factory() + obj_.build(child_) + self.set_AppliedSubOptions(obj_) + elif nodeName_ == 'CommitTimestamp': + CommitTimestamp_ = child_.text + CommitTimestamp_ = self.gds_validate_string(CommitTimestamp_, node, 'CommitTimestamp') + self.CommitTimestamp = CommitTimestamp_ + elif nodeName_ == 'DayOfWeek': + DayOfWeek_ = child_.text + DayOfWeek_ = self.gds_validate_string(DayOfWeek_, node, 'DayOfWeek') + self.DayOfWeek = DayOfWeek_ + self.validate_DayOfWeekType(self.DayOfWeek) # validate type DayOfWeekType + elif nodeName_ == 'TransitTime': + TransitTime_ = child_.text + TransitTime_ = self.gds_validate_string(TransitTime_, node, 'TransitTime') + self.TransitTime = TransitTime_ + self.validate_TransitTimeType(self.TransitTime) # validate type TransitTimeType + elif nodeName_ == 'MaximumTransitTime': + MaximumTransitTime_ = child_.text + MaximumTransitTime_ = self.gds_validate_string(MaximumTransitTime_, node, 'MaximumTransitTime') + self.MaximumTransitTime = MaximumTransitTime_ + self.validate_TransitTimeType(self.MaximumTransitTime) # validate type TransitTimeType + elif nodeName_ == 'DestinationServiceArea': + DestinationServiceArea_ = child_.text + DestinationServiceArea_ = self.gds_validate_string(DestinationServiceArea_, node, 'DestinationServiceArea') + self.DestinationServiceArea = DestinationServiceArea_ + elif nodeName_ == 'BrokerAddress': + obj_ = Address.factory() + obj_.build(child_) + self.set_BrokerAddress(obj_) + elif nodeName_ == 'BrokerLocationId': + BrokerLocationId_ = child_.text + BrokerLocationId_ = self.gds_validate_string(BrokerLocationId_, node, 'BrokerLocationId') + self.BrokerLocationId = BrokerLocationId_ + elif nodeName_ == 'BrokerCommitTimestamp': + BrokerCommitTimestamp_ = child_.text + BrokerCommitTimestamp_ = self.gds_validate_string(BrokerCommitTimestamp_, node, 'BrokerCommitTimestamp') + self.BrokerCommitTimestamp = BrokerCommitTimestamp_ + elif nodeName_ == 'BrokerCommitDayOfWeek': + BrokerCommitDayOfWeek_ = child_.text + BrokerCommitDayOfWeek_ = self.gds_validate_string(BrokerCommitDayOfWeek_, node, 'BrokerCommitDayOfWeek') + self.BrokerCommitDayOfWeek = BrokerCommitDayOfWeek_ + self.validate_DayOfWeekType(self.BrokerCommitDayOfWeek) # validate type DayOfWeekType + elif nodeName_ == 'BrokerToDestinationDays': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'BrokerToDestinationDays') + self.BrokerToDestinationDays = ival_ + elif nodeName_ == 'ProofOfDeliveryDate': + ProofOfDeliveryDate_ = child_.text + ProofOfDeliveryDate_ = self.gds_validate_string(ProofOfDeliveryDate_, node, 'ProofOfDeliveryDate') + self.ProofOfDeliveryDate = ProofOfDeliveryDate_ + elif nodeName_ == 'ProofOfDeliveryDayOfWeek': + ProofOfDeliveryDayOfWeek_ = child_.text + ProofOfDeliveryDayOfWeek_ = self.gds_validate_string(ProofOfDeliveryDayOfWeek_, node, 'ProofOfDeliveryDayOfWeek') + self.ProofOfDeliveryDayOfWeek = ProofOfDeliveryDayOfWeek_ + self.validate_DayOfWeekType(self.ProofOfDeliveryDayOfWeek) # validate type DayOfWeekType + elif nodeName_ == 'CommitMessages': + obj_ = Notification.factory() + obj_.build(child_) + self.CommitMessages.append(obj_) + elif nodeName_ == 'DeliveryMessages': + DeliveryMessages_ = child_.text + DeliveryMessages_ = self.gds_validate_string(DeliveryMessages_, node, 'DeliveryMessages') + self.DeliveryMessages.append(DeliveryMessages_) + elif nodeName_ == 'DelayDetails': + obj_ = DelayDetail.factory() + obj_.build(child_) + self.DelayDetails.append(obj_) + elif nodeName_ == 'DocumentContent': + DocumentContent_ = child_.text + DocumentContent_ = self.gds_validate_string(DocumentContent_, node, 'DocumentContent') + self.DocumentContent = DocumentContent_ + self.validate_InternationalDocumentContentType(self.DocumentContent) # validate type InternationalDocumentContentType + elif nodeName_ == 'RequiredDocuments': + RequiredDocuments_ = child_.text + RequiredDocuments_ = self.gds_validate_string(RequiredDocuments_, node, 'RequiredDocuments') + self.RequiredDocuments.append(RequiredDocuments_) + self.validate_RequiredShippingDocumentType(self.RequiredDocuments) # validate type RequiredShippingDocumentType + elif nodeName_ == 'FreightCommitDetail': + obj_ = FreightCommitDetail.factory() + obj_.build(child_) + self.set_FreightCommitDetail(obj_) +# end class CommitDetail + + +class Commodity(GeneratedsSuper): + """For international multiple piece shipments, commodity information + must be passed in the Master and on each child transaction. If + this shipment cotains more than four commodities line items, the + four highest valued should be included in the first 4 occurances + for this request.""" + subclass = None + superclass = None + def __init__(self, Name=None, NumberOfPieces=None, Description=None, CountryOfManufacture=None, HarmonizedCode=None, Weight=None, Quantity=None, QuantityUnits=None, AdditionalMeasures=None, UnitPrice=None, CustomsValue=None, ExciseConditions=None, ExportLicenseNumber=None, ExportLicenseExpirationDate=None, CIMarksAndNumbers=None, NaftaDetail=None): + self.Name = Name + self.NumberOfPieces = NumberOfPieces + self.Description = Description + self.CountryOfManufacture = CountryOfManufacture + self.HarmonizedCode = HarmonizedCode + self.Weight = Weight + self.Quantity = Quantity + self.QuantityUnits = QuantityUnits + if AdditionalMeasures is None: + self.AdditionalMeasures = [] + else: + self.AdditionalMeasures = AdditionalMeasures + self.UnitPrice = UnitPrice + self.CustomsValue = CustomsValue + if ExciseConditions is None: + self.ExciseConditions = [] + else: + self.ExciseConditions = ExciseConditions + self.ExportLicenseNumber = ExportLicenseNumber + self.ExportLicenseExpirationDate = ExportLicenseExpirationDate + self.CIMarksAndNumbers = CIMarksAndNumbers + self.NaftaDetail = NaftaDetail + def factory(*args_, **kwargs_): + if Commodity.subclass: + return Commodity.subclass(*args_, **kwargs_) + else: + return Commodity(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Name(self): return self.Name + def set_Name(self, Name): self.Name = Name + def get_NumberOfPieces(self): return self.NumberOfPieces + def set_NumberOfPieces(self, NumberOfPieces): self.NumberOfPieces = NumberOfPieces + def get_Description(self): return self.Description + def set_Description(self, Description): self.Description = Description + def get_CountryOfManufacture(self): return self.CountryOfManufacture + def set_CountryOfManufacture(self, CountryOfManufacture): self.CountryOfManufacture = CountryOfManufacture + def get_HarmonizedCode(self): return self.HarmonizedCode + def set_HarmonizedCode(self, HarmonizedCode): self.HarmonizedCode = HarmonizedCode + def get_Weight(self): return self.Weight + def set_Weight(self, Weight): self.Weight = Weight + def get_Quantity(self): return self.Quantity + def set_Quantity(self, Quantity): self.Quantity = Quantity + def get_QuantityUnits(self): return self.QuantityUnits + def set_QuantityUnits(self, QuantityUnits): self.QuantityUnits = QuantityUnits + def get_AdditionalMeasures(self): return self.AdditionalMeasures + def set_AdditionalMeasures(self, AdditionalMeasures): self.AdditionalMeasures = AdditionalMeasures + def add_AdditionalMeasures(self, value): self.AdditionalMeasures.append(value) + def insert_AdditionalMeasures(self, index, value): self.AdditionalMeasures[index] = value + def get_UnitPrice(self): return self.UnitPrice + def set_UnitPrice(self, UnitPrice): self.UnitPrice = UnitPrice + def get_CustomsValue(self): return self.CustomsValue + def set_CustomsValue(self, CustomsValue): self.CustomsValue = CustomsValue + def get_ExciseConditions(self): return self.ExciseConditions + def set_ExciseConditions(self, ExciseConditions): self.ExciseConditions = ExciseConditions + def add_ExciseConditions(self, value): self.ExciseConditions.append(value) + def insert_ExciseConditions(self, index, value): self.ExciseConditions[index] = value + def get_ExportLicenseNumber(self): return self.ExportLicenseNumber + def set_ExportLicenseNumber(self, ExportLicenseNumber): self.ExportLicenseNumber = ExportLicenseNumber + def get_ExportLicenseExpirationDate(self): return self.ExportLicenseExpirationDate + def set_ExportLicenseExpirationDate(self, ExportLicenseExpirationDate): self.ExportLicenseExpirationDate = ExportLicenseExpirationDate + def get_CIMarksAndNumbers(self): return self.CIMarksAndNumbers + def set_CIMarksAndNumbers(self, CIMarksAndNumbers): self.CIMarksAndNumbers = CIMarksAndNumbers + def get_NaftaDetail(self): return self.NaftaDetail + def set_NaftaDetail(self, NaftaDetail): self.NaftaDetail = NaftaDetail + def export(self, outfile, level, namespace_='ns:', name_='Commodity', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Commodity') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Commodity'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Commodity', fromsubclass_=False): + if self.Name is not None: + showIndent(outfile, level) + outfile.write('<%sName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Name).encode(ExternalEncoding), input_name='Name'), namespace_)) + if self.NumberOfPieces is not None: + showIndent(outfile, level) + outfile.write('<%sNumberOfPieces>%s\n' % (namespace_, self.gds_format_integer(self.NumberOfPieces, input_name='NumberOfPieces'), namespace_)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('<%sDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Description).encode(ExternalEncoding), input_name='Description'), namespace_)) + if self.CountryOfManufacture is not None: + showIndent(outfile, level) + outfile.write('<%sCountryOfManufacture>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CountryOfManufacture).encode(ExternalEncoding), input_name='CountryOfManufacture'), namespace_)) + if self.HarmonizedCode is not None: + showIndent(outfile, level) + outfile.write('<%sHarmonizedCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HarmonizedCode).encode(ExternalEncoding), input_name='HarmonizedCode'), namespace_)) + if self.Weight: + self.Weight.export(outfile, level, namespace_, name_='Weight') + if self.Quantity is not None: + showIndent(outfile, level) + outfile.write('<%sQuantity>%s\n' % (namespace_, self.gds_format_integer(self.Quantity, input_name='Quantity'), namespace_)) + if self.QuantityUnits is not None: + showIndent(outfile, level) + outfile.write('<%sQuantityUnits>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.QuantityUnits).encode(ExternalEncoding), input_name='QuantityUnits'), namespace_)) + for AdditionalMeasures_ in self.AdditionalMeasures: + AdditionalMeasures_.export(outfile, level, namespace_, name_='AdditionalMeasures') + if self.UnitPrice: + self.UnitPrice.export(outfile, level, namespace_, name_='UnitPrice') + if self.CustomsValue: + self.CustomsValue.export(outfile, level, namespace_, name_='CustomsValue') + for ExciseConditions_ in self.ExciseConditions: + ExciseConditions_.export(outfile, level, namespace_, name_='ExciseConditions') + if self.ExportLicenseNumber is not None: + showIndent(outfile, level) + outfile.write('<%sExportLicenseNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ExportLicenseNumber).encode(ExternalEncoding), input_name='ExportLicenseNumber'), namespace_)) + if self.ExportLicenseExpirationDate is not None: + showIndent(outfile, level) + outfile.write('<%sExportLicenseExpirationDate>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ExportLicenseExpirationDate).encode(ExternalEncoding), input_name='ExportLicenseExpirationDate'), namespace_)) + if self.CIMarksAndNumbers is not None: + showIndent(outfile, level) + outfile.write('<%sCIMarksAndNumbers>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CIMarksAndNumbers).encode(ExternalEncoding), input_name='CIMarksAndNumbers'), namespace_)) + if self.NaftaDetail: + self.NaftaDetail.export(outfile, level, namespace_, name_='NaftaDetail') + def hasContent_(self): + if ( + self.Name is not None or + self.NumberOfPieces is not None or + self.Description is not None or + self.CountryOfManufacture is not None or + self.HarmonizedCode is not None or + self.Weight is not None or + self.Quantity is not None or + self.QuantityUnits is not None or + self.AdditionalMeasures or + self.UnitPrice is not None or + self.CustomsValue is not None or + self.ExciseConditions or + self.ExportLicenseNumber is not None or + self.ExportLicenseExpirationDate is not None or + self.CIMarksAndNumbers is not None or + self.NaftaDetail is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Commodity'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Name is not None: + showIndent(outfile, level) + outfile.write('Name=%s,\n' % quote_python(self.Name).encode(ExternalEncoding)) + if self.NumberOfPieces is not None: + showIndent(outfile, level) + outfile.write('NumberOfPieces=%d,\n' % self.NumberOfPieces) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('Description=%s,\n' % quote_python(self.Description).encode(ExternalEncoding)) + if self.CountryOfManufacture is not None: + showIndent(outfile, level) + outfile.write('CountryOfManufacture=%s,\n' % quote_python(self.CountryOfManufacture).encode(ExternalEncoding)) + if self.HarmonizedCode is not None: + showIndent(outfile, level) + outfile.write('HarmonizedCode=%s,\n' % quote_python(self.HarmonizedCode).encode(ExternalEncoding)) + if self.Weight is not None: + showIndent(outfile, level) + outfile.write('Weight=model_.Weight(\n') + self.Weight.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Quantity is not None: + showIndent(outfile, level) + outfile.write('Quantity=%d,\n' % self.Quantity) + if self.QuantityUnits is not None: + showIndent(outfile, level) + outfile.write('QuantityUnits=%s,\n' % quote_python(self.QuantityUnits).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('AdditionalMeasures=[\n') + level += 1 + for AdditionalMeasures_ in self.AdditionalMeasures: + showIndent(outfile, level) + outfile.write('model_.Measure(\n') + AdditionalMeasures_.exportLiteral(outfile, level, name_='Measure') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.UnitPrice is not None: + showIndent(outfile, level) + outfile.write('UnitPrice=model_.Money(\n') + self.UnitPrice.exportLiteral(outfile, level, name_='UnitPrice') + showIndent(outfile, level) + outfile.write('),\n') + if self.CustomsValue is not None: + showIndent(outfile, level) + outfile.write('CustomsValue=model_.Money(\n') + self.CustomsValue.exportLiteral(outfile, level, name_='CustomsValue') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('ExciseConditions=[\n') + level += 1 + for ExciseConditions_ in self.ExciseConditions: + showIndent(outfile, level) + outfile.write('model_.EdtExciseCondition(\n') + ExciseConditions_.exportLiteral(outfile, level, name_='EdtExciseCondition') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.ExportLicenseNumber is not None: + showIndent(outfile, level) + outfile.write('ExportLicenseNumber=%s,\n' % quote_python(self.ExportLicenseNumber).encode(ExternalEncoding)) + if self.ExportLicenseExpirationDate is not None: + showIndent(outfile, level) + outfile.write('ExportLicenseExpirationDate=%s,\n' % quote_python(self.ExportLicenseExpirationDate).encode(ExternalEncoding)) + if self.CIMarksAndNumbers is not None: + showIndent(outfile, level) + outfile.write('CIMarksAndNumbers=%s,\n' % quote_python(self.CIMarksAndNumbers).encode(ExternalEncoding)) + if self.NaftaDetail is not None: + showIndent(outfile, level) + outfile.write('NaftaDetail=model_.NaftaCommodityDetail(\n') + self.NaftaDetail.exportLiteral(outfile, level, name_='NaftaDetail') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Name': + Name_ = child_.text + Name_ = self.gds_validate_string(Name_, node, 'Name') + self.Name = Name_ + elif nodeName_ == 'NumberOfPieces': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'NumberOfPieces') + self.NumberOfPieces = ival_ + elif nodeName_ == 'Description': + Description_ = child_.text + Description_ = self.gds_validate_string(Description_, node, 'Description') + self.Description = Description_ + elif nodeName_ == 'CountryOfManufacture': + CountryOfManufacture_ = child_.text + CountryOfManufacture_ = self.gds_validate_string(CountryOfManufacture_, node, 'CountryOfManufacture') + self.CountryOfManufacture = CountryOfManufacture_ + elif nodeName_ == 'HarmonizedCode': + HarmonizedCode_ = child_.text + HarmonizedCode_ = self.gds_validate_string(HarmonizedCode_, node, 'HarmonizedCode') + self.HarmonizedCode = HarmonizedCode_ + elif nodeName_ == 'Weight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_Weight(obj_) + elif nodeName_ == 'Quantity': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'Quantity') + self.Quantity = ival_ + elif nodeName_ == 'QuantityUnits': + QuantityUnits_ = child_.text + QuantityUnits_ = self.gds_validate_string(QuantityUnits_, node, 'QuantityUnits') + self.QuantityUnits = QuantityUnits_ + elif nodeName_ == 'AdditionalMeasures': + obj_ = Measure.factory() + obj_.build(child_) + self.AdditionalMeasures.append(obj_) + elif nodeName_ == 'UnitPrice': + obj_ = Money.factory() + obj_.build(child_) + self.set_UnitPrice(obj_) + elif nodeName_ == 'CustomsValue': + obj_ = Money.factory() + obj_.build(child_) + self.set_CustomsValue(obj_) + elif nodeName_ == 'ExciseConditions': + obj_ = EdtExciseCondition.factory() + obj_.build(child_) + self.ExciseConditions.append(obj_) + elif nodeName_ == 'ExportLicenseNumber': + ExportLicenseNumber_ = child_.text + ExportLicenseNumber_ = self.gds_validate_string(ExportLicenseNumber_, node, 'ExportLicenseNumber') + self.ExportLicenseNumber = ExportLicenseNumber_ + elif nodeName_ == 'ExportLicenseExpirationDate': + ExportLicenseExpirationDate_ = child_.text + ExportLicenseExpirationDate_ = self.gds_validate_string(ExportLicenseExpirationDate_, node, 'ExportLicenseExpirationDate') + self.ExportLicenseExpirationDate = ExportLicenseExpirationDate_ + elif nodeName_ == 'CIMarksAndNumbers': + CIMarksAndNumbers_ = child_.text + CIMarksAndNumbers_ = self.gds_validate_string(CIMarksAndNumbers_, node, 'CIMarksAndNumbers') + self.CIMarksAndNumbers = CIMarksAndNumbers_ + elif nodeName_ == 'NaftaDetail': + obj_ = NaftaCommodityDetail.factory() + obj_.build(child_) + self.set_NaftaDetail(obj_) +# end class Commodity + + +class ConfigurableLabelReferenceEntry(GeneratedsSuper): + """Defines additional data to print in the Configurable portion of the + label, this allows you to print the same type information on the + label that can also be printed on the doc tab.""" + subclass = None + superclass = None + def __init__(self, ZoneNumber=None, Header=None, DataField=None, LiteralValue=None): + self.ZoneNumber = ZoneNumber + self.Header = Header + self.DataField = DataField + self.LiteralValue = LiteralValue + def factory(*args_, **kwargs_): + if ConfigurableLabelReferenceEntry.subclass: + return ConfigurableLabelReferenceEntry.subclass(*args_, **kwargs_) + else: + return ConfigurableLabelReferenceEntry(*args_, **kwargs_) + factory = staticmethod(factory) + def get_ZoneNumber(self): return self.ZoneNumber + def set_ZoneNumber(self, ZoneNumber): self.ZoneNumber = ZoneNumber + def get_Header(self): return self.Header + def set_Header(self, Header): self.Header = Header + def get_DataField(self): return self.DataField + def set_DataField(self, DataField): self.DataField = DataField + def get_LiteralValue(self): return self.LiteralValue + def set_LiteralValue(self, LiteralValue): self.LiteralValue = LiteralValue + def export(self, outfile, level, namespace_='ns:', name_='ConfigurableLabelReferenceEntry', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ConfigurableLabelReferenceEntry') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ConfigurableLabelReferenceEntry'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ConfigurableLabelReferenceEntry', fromsubclass_=False): + if self.ZoneNumber is not None: + showIndent(outfile, level) + outfile.write('<%sZoneNumber>%s\n' % (namespace_, self.gds_format_integer(self.ZoneNumber, input_name='ZoneNumber'), namespace_)) + if self.Header is not None: + showIndent(outfile, level) + outfile.write('<%sHeader>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Header).encode(ExternalEncoding), input_name='Header'), namespace_)) + if self.DataField is not None: + showIndent(outfile, level) + outfile.write('<%sDataField>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DataField).encode(ExternalEncoding), input_name='DataField'), namespace_)) + if self.LiteralValue is not None: + showIndent(outfile, level) + outfile.write('<%sLiteralValue>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LiteralValue).encode(ExternalEncoding), input_name='LiteralValue'), namespace_)) + def hasContent_(self): + if ( + self.ZoneNumber is not None or + self.Header is not None or + self.DataField is not None or + self.LiteralValue is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ConfigurableLabelReferenceEntry'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.ZoneNumber is not None: + showIndent(outfile, level) + outfile.write('ZoneNumber=%d,\n' % self.ZoneNumber) + if self.Header is not None: + showIndent(outfile, level) + outfile.write('Header=%s,\n' % quote_python(self.Header).encode(ExternalEncoding)) + if self.DataField is not None: + showIndent(outfile, level) + outfile.write('DataField=%s,\n' % quote_python(self.DataField).encode(ExternalEncoding)) + if self.LiteralValue is not None: + showIndent(outfile, level) + outfile.write('LiteralValue=%s,\n' % quote_python(self.LiteralValue).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'ZoneNumber': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ <= 0: + raise_parse_error(child_, 'requires positiveInteger') + ival_ = self.gds_validate_integer(ival_, node, 'ZoneNumber') + self.ZoneNumber = ival_ + elif nodeName_ == 'Header': + Header_ = child_.text + Header_ = self.gds_validate_string(Header_, node, 'Header') + self.Header = Header_ + elif nodeName_ == 'DataField': + DataField_ = child_.text + DataField_ = self.gds_validate_string(DataField_, node, 'DataField') + self.DataField = DataField_ + elif nodeName_ == 'LiteralValue': + LiteralValue_ = child_.text + LiteralValue_ = self.gds_validate_string(LiteralValue_, node, 'LiteralValue') + self.LiteralValue = LiteralValue_ +# end class ConfigurableLabelReferenceEntry + + +class Contact(GeneratedsSuper): + """The descriptive data for a point-of-contact person.""" + subclass = None + superclass = None + def __init__(self, ContactId=None, PersonName=None, Title=None, CompanyName=None, PhoneNumber=None, PhoneExtension=None, PagerNumber=None, FaxNumber=None, EMailAddress=None): + self.ContactId = ContactId + self.PersonName = PersonName + self.Title = Title + self.CompanyName = CompanyName + self.PhoneNumber = PhoneNumber + self.PhoneExtension = PhoneExtension + self.PagerNumber = PagerNumber + self.FaxNumber = FaxNumber + self.EMailAddress = EMailAddress + def factory(*args_, **kwargs_): + if Contact.subclass: + return Contact.subclass(*args_, **kwargs_) + else: + return Contact(*args_, **kwargs_) + factory = staticmethod(factory) + def get_ContactId(self): return self.ContactId + def set_ContactId(self, ContactId): self.ContactId = ContactId + def get_PersonName(self): return self.PersonName + def set_PersonName(self, PersonName): self.PersonName = PersonName + def get_Title(self): return self.Title + def set_Title(self, Title): self.Title = Title + def get_CompanyName(self): return self.CompanyName + def set_CompanyName(self, CompanyName): self.CompanyName = CompanyName + def get_PhoneNumber(self): return self.PhoneNumber + def set_PhoneNumber(self, PhoneNumber): self.PhoneNumber = PhoneNumber + def get_PhoneExtension(self): return self.PhoneExtension + def set_PhoneExtension(self, PhoneExtension): self.PhoneExtension = PhoneExtension + def get_PagerNumber(self): return self.PagerNumber + def set_PagerNumber(self, PagerNumber): self.PagerNumber = PagerNumber + def get_FaxNumber(self): return self.FaxNumber + def set_FaxNumber(self, FaxNumber): self.FaxNumber = FaxNumber + def get_EMailAddress(self): return self.EMailAddress + def set_EMailAddress(self, EMailAddress): self.EMailAddress = EMailAddress + def export(self, outfile, level, namespace_='ns:', name_='Contact', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Contact') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Contact'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Contact', fromsubclass_=False): + if self.ContactId is not None: + showIndent(outfile, level) + outfile.write('<%sContactId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ContactId).encode(ExternalEncoding), input_name='ContactId'), namespace_)) + if self.PersonName is not None: + showIndent(outfile, level) + outfile.write('<%sPersonName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PersonName).encode(ExternalEncoding), input_name='PersonName'), namespace_)) + if self.Title is not None: + showIndent(outfile, level) + outfile.write('<%sTitle>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Title).encode(ExternalEncoding), input_name='Title'), namespace_)) + if self.CompanyName is not None: + showIndent(outfile, level) + outfile.write('<%sCompanyName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CompanyName).encode(ExternalEncoding), input_name='CompanyName'), namespace_)) + if self.PhoneNumber is not None: + showIndent(outfile, level) + outfile.write('<%sPhoneNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PhoneNumber).encode(ExternalEncoding), input_name='PhoneNumber'), namespace_)) + if self.PhoneExtension is not None: + showIndent(outfile, level) + outfile.write('<%sPhoneExtension>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PhoneExtension).encode(ExternalEncoding), input_name='PhoneExtension'), namespace_)) + if self.PagerNumber is not None: + showIndent(outfile, level) + outfile.write('<%sPagerNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PagerNumber).encode(ExternalEncoding), input_name='PagerNumber'), namespace_)) + if self.FaxNumber is not None: + showIndent(outfile, level) + outfile.write('<%sFaxNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.FaxNumber).encode(ExternalEncoding), input_name='FaxNumber'), namespace_)) + if self.EMailAddress is not None: + showIndent(outfile, level) + outfile.write('<%sEMailAddress>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.EMailAddress).encode(ExternalEncoding), input_name='EMailAddress'), namespace_)) + def hasContent_(self): + if ( + self.ContactId is not None or + self.PersonName is not None or + self.Title is not None or + self.CompanyName is not None or + self.PhoneNumber is not None or + self.PhoneExtension is not None or + self.PagerNumber is not None or + self.FaxNumber is not None or + self.EMailAddress is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Contact'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.ContactId is not None: + showIndent(outfile, level) + outfile.write('ContactId=%s,\n' % quote_python(self.ContactId).encode(ExternalEncoding)) + if self.PersonName is not None: + showIndent(outfile, level) + outfile.write('PersonName=%s,\n' % quote_python(self.PersonName).encode(ExternalEncoding)) + if self.Title is not None: + showIndent(outfile, level) + outfile.write('Title=%s,\n' % quote_python(self.Title).encode(ExternalEncoding)) + if self.CompanyName is not None: + showIndent(outfile, level) + outfile.write('CompanyName=%s,\n' % quote_python(self.CompanyName).encode(ExternalEncoding)) + if self.PhoneNumber is not None: + showIndent(outfile, level) + outfile.write('PhoneNumber=%s,\n' % quote_python(self.PhoneNumber).encode(ExternalEncoding)) + if self.PhoneExtension is not None: + showIndent(outfile, level) + outfile.write('PhoneExtension=%s,\n' % quote_python(self.PhoneExtension).encode(ExternalEncoding)) + if self.PagerNumber is not None: + showIndent(outfile, level) + outfile.write('PagerNumber=%s,\n' % quote_python(self.PagerNumber).encode(ExternalEncoding)) + if self.FaxNumber is not None: + showIndent(outfile, level) + outfile.write('FaxNumber=%s,\n' % quote_python(self.FaxNumber).encode(ExternalEncoding)) + if self.EMailAddress is not None: + showIndent(outfile, level) + outfile.write('EMailAddress=%s,\n' % quote_python(self.EMailAddress).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'ContactId': + ContactId_ = child_.text + ContactId_ = self.gds_validate_string(ContactId_, node, 'ContactId') + self.ContactId = ContactId_ + elif nodeName_ == 'PersonName': + PersonName_ = child_.text + PersonName_ = self.gds_validate_string(PersonName_, node, 'PersonName') + self.PersonName = PersonName_ + elif nodeName_ == 'Title': + Title_ = child_.text + Title_ = self.gds_validate_string(Title_, node, 'Title') + self.Title = Title_ + elif nodeName_ == 'CompanyName': + CompanyName_ = child_.text + CompanyName_ = self.gds_validate_string(CompanyName_, node, 'CompanyName') + self.CompanyName = CompanyName_ + elif nodeName_ == 'PhoneNumber': + PhoneNumber_ = child_.text + PhoneNumber_ = self.gds_validate_string(PhoneNumber_, node, 'PhoneNumber') + self.PhoneNumber = PhoneNumber_ + elif nodeName_ == 'PhoneExtension': + PhoneExtension_ = child_.text + PhoneExtension_ = self.gds_validate_string(PhoneExtension_, node, 'PhoneExtension') + self.PhoneExtension = PhoneExtension_ + elif nodeName_ == 'PagerNumber': + PagerNumber_ = child_.text + PagerNumber_ = self.gds_validate_string(PagerNumber_, node, 'PagerNumber') + self.PagerNumber = PagerNumber_ + elif nodeName_ == 'FaxNumber': + FaxNumber_ = child_.text + FaxNumber_ = self.gds_validate_string(FaxNumber_, node, 'FaxNumber') + self.FaxNumber = FaxNumber_ + elif nodeName_ == 'EMailAddress': + EMailAddress_ = child_.text + EMailAddress_ = self.gds_validate_string(EMailAddress_, node, 'EMailAddress') + self.EMailAddress = EMailAddress_ +# end class Contact + + +class ContactAndAddress(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Contact=None, Address=None): + self.Contact = Contact + self.Address = Address + def factory(*args_, **kwargs_): + if ContactAndAddress.subclass: + return ContactAndAddress.subclass(*args_, **kwargs_) + else: + return ContactAndAddress(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Contact(self): return self.Contact + def set_Contact(self, Contact): self.Contact = Contact + def get_Address(self): return self.Address + def set_Address(self, Address): self.Address = Address + def export(self, outfile, level, namespace_='ns:', name_='ContactAndAddress', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ContactAndAddress') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ContactAndAddress'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ContactAndAddress', fromsubclass_=False): + if self.Contact: + self.Contact.export(outfile, level, namespace_, name_='Contact') + if self.Address: + self.Address.export(outfile, level, namespace_, name_='Address') + def hasContent_(self): + if ( + self.Contact is not None or + self.Address is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ContactAndAddress'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Contact is not None: + showIndent(outfile, level) + outfile.write('Contact=model_.Contact(\n') + self.Contact.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Address is not None: + showIndent(outfile, level) + outfile.write('Address=model_.Address(\n') + self.Address.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Contact': + obj_ = Contact.factory() + obj_.build(child_) + self.set_Contact(obj_) + elif nodeName_ == 'Address': + obj_ = Address.factory() + obj_.build(child_) + self.set_Address(obj_) +# end class ContactAndAddress + + +class ContentRecord(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, PartNumber=None, ItemNumber=None, ReceivedQuantity=None, Description=None): + self.PartNumber = PartNumber + self.ItemNumber = ItemNumber + self.ReceivedQuantity = ReceivedQuantity + self.Description = Description + def factory(*args_, **kwargs_): + if ContentRecord.subclass: + return ContentRecord.subclass(*args_, **kwargs_) + else: + return ContentRecord(*args_, **kwargs_) + factory = staticmethod(factory) + def get_PartNumber(self): return self.PartNumber + def set_PartNumber(self, PartNumber): self.PartNumber = PartNumber + def get_ItemNumber(self): return self.ItemNumber + def set_ItemNumber(self, ItemNumber): self.ItemNumber = ItemNumber + def get_ReceivedQuantity(self): return self.ReceivedQuantity + def set_ReceivedQuantity(self, ReceivedQuantity): self.ReceivedQuantity = ReceivedQuantity + def get_Description(self): return self.Description + def set_Description(self, Description): self.Description = Description + def export(self, outfile, level, namespace_='ns:', name_='ContentRecord', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ContentRecord') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ContentRecord'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ContentRecord', fromsubclass_=False): + if self.PartNumber is not None: + showIndent(outfile, level) + outfile.write('<%sPartNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PartNumber).encode(ExternalEncoding), input_name='PartNumber'), namespace_)) + if self.ItemNumber is not None: + showIndent(outfile, level) + outfile.write('<%sItemNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ItemNumber).encode(ExternalEncoding), input_name='ItemNumber'), namespace_)) + if self.ReceivedQuantity is not None: + showIndent(outfile, level) + outfile.write('<%sReceivedQuantity>%s\n' % (namespace_, self.gds_format_integer(self.ReceivedQuantity, input_name='ReceivedQuantity'), namespace_)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('<%sDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Description).encode(ExternalEncoding), input_name='Description'), namespace_)) + def hasContent_(self): + if ( + self.PartNumber is not None or + self.ItemNumber is not None or + self.ReceivedQuantity is not None or + self.Description is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ContentRecord'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.PartNumber is not None: + showIndent(outfile, level) + outfile.write('PartNumber=%s,\n' % quote_python(self.PartNumber).encode(ExternalEncoding)) + if self.ItemNumber is not None: + showIndent(outfile, level) + outfile.write('ItemNumber=%s,\n' % quote_python(self.ItemNumber).encode(ExternalEncoding)) + if self.ReceivedQuantity is not None: + showIndent(outfile, level) + outfile.write('ReceivedQuantity=%d,\n' % self.ReceivedQuantity) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('Description=%s,\n' % quote_python(self.Description).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'PartNumber': + PartNumber_ = child_.text + PartNumber_ = self.gds_validate_string(PartNumber_, node, 'PartNumber') + self.PartNumber = PartNumber_ + elif nodeName_ == 'ItemNumber': + ItemNumber_ = child_.text + ItemNumber_ = self.gds_validate_string(ItemNumber_, node, 'ItemNumber') + self.ItemNumber = ItemNumber_ + elif nodeName_ == 'ReceivedQuantity': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'ReceivedQuantity') + self.ReceivedQuantity = ival_ + elif nodeName_ == 'Description': + Description_ = child_.text + Description_ = self.gds_validate_string(Description_, node, 'Description') + self.Description = Description_ +# end class ContentRecord + + +class CurrencyExchangeRate(GeneratedsSuper): + """Specifies the currency exchange performed on financial amounts for + this rate.""" + subclass = None + superclass = None + def __init__(self, FromCurrency=None, IntoCurrency=None, Rate=None): + self.FromCurrency = FromCurrency + self.IntoCurrency = IntoCurrency + self.Rate = Rate + def factory(*args_, **kwargs_): + if CurrencyExchangeRate.subclass: + return CurrencyExchangeRate.subclass(*args_, **kwargs_) + else: + return CurrencyExchangeRate(*args_, **kwargs_) + factory = staticmethod(factory) + def get_FromCurrency(self): return self.FromCurrency + def set_FromCurrency(self, FromCurrency): self.FromCurrency = FromCurrency + def get_IntoCurrency(self): return self.IntoCurrency + def set_IntoCurrency(self, IntoCurrency): self.IntoCurrency = IntoCurrency + def get_Rate(self): return self.Rate + def set_Rate(self, Rate): self.Rate = Rate + def export(self, outfile, level, namespace_='ns:', name_='CurrencyExchangeRate', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CurrencyExchangeRate') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CurrencyExchangeRate'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CurrencyExchangeRate', fromsubclass_=False): + if self.FromCurrency is not None: + showIndent(outfile, level) + outfile.write('<%sFromCurrency>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.FromCurrency).encode(ExternalEncoding), input_name='FromCurrency'), namespace_)) + if self.IntoCurrency is not None: + showIndent(outfile, level) + outfile.write('<%sIntoCurrency>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.IntoCurrency).encode(ExternalEncoding), input_name='IntoCurrency'), namespace_)) + if self.Rate is not None: + showIndent(outfile, level) + outfile.write('<%sRate>%s\n' % (namespace_, self.gds_format_float(self.Rate, input_name='Rate'), namespace_)) + def hasContent_(self): + if ( + self.FromCurrency is not None or + self.IntoCurrency is not None or + self.Rate is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CurrencyExchangeRate'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.FromCurrency is not None: + showIndent(outfile, level) + outfile.write('FromCurrency=%s,\n' % quote_python(self.FromCurrency).encode(ExternalEncoding)) + if self.IntoCurrency is not None: + showIndent(outfile, level) + outfile.write('IntoCurrency=%s,\n' % quote_python(self.IntoCurrency).encode(ExternalEncoding)) + if self.Rate is not None: + showIndent(outfile, level) + outfile.write('Rate=%f,\n' % self.Rate) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'FromCurrency': + FromCurrency_ = child_.text + FromCurrency_ = self.gds_validate_string(FromCurrency_, node, 'FromCurrency') + self.FromCurrency = FromCurrency_ + elif nodeName_ == 'IntoCurrency': + IntoCurrency_ = child_.text + IntoCurrency_ = self.gds_validate_string(IntoCurrency_, node, 'IntoCurrency') + self.IntoCurrency = IntoCurrency_ + elif nodeName_ == 'Rate': + sval_ = child_.text + try: + fval_ = float(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires float or double: %s' % exp) + fval_ = self.gds_validate_float(fval_, node, 'Rate') + self.Rate = fval_ +# end class CurrencyExchangeRate + + +class CustomDeliveryWindowDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Type=None, RequestTime=None, RequestRange=None, RequestDate=None): + self.Type = Type + self.RequestTime = RequestTime + self.RequestRange = RequestRange + self.RequestDate = RequestDate + def factory(*args_, **kwargs_): + if CustomDeliveryWindowDetail.subclass: + return CustomDeliveryWindowDetail.subclass(*args_, **kwargs_) + else: + return CustomDeliveryWindowDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Type(self): return self.Type + def set_Type(self, Type): self.Type = Type + def validate_CustomDeliveryWindowType(self, value): + # Validate type CustomDeliveryWindowType, a restriction on xs:string. + pass + def get_RequestTime(self): return self.RequestTime + def set_RequestTime(self, RequestTime): self.RequestTime = RequestTime + def get_RequestRange(self): return self.RequestRange + def set_RequestRange(self, RequestRange): self.RequestRange = RequestRange + def get_RequestDate(self): return self.RequestDate + def set_RequestDate(self, RequestDate): self.RequestDate = RequestDate + def export(self, outfile, level, namespace_='ns:', name_='CustomDeliveryWindowDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CustomDeliveryWindowDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CustomDeliveryWindowDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CustomDeliveryWindowDetail', fromsubclass_=False): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('<%sType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Type).encode(ExternalEncoding), input_name='Type'), namespace_)) + if self.RequestTime: + self.RequestTime.export(outfile, level, namespace_, name_='RequestTime') + if self.RequestRange: + self.RequestRange.export(outfile, level, namespace_, name_='RequestRange') + if self.RequestDate is not None: + showIndent(outfile, level) + outfile.write('<%sRequestDate>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RequestDate).encode(ExternalEncoding), input_name='RequestDate'), namespace_)) + def hasContent_(self): + if ( + self.Type is not None or + self.RequestTime is not None or + self.RequestRange is not None or + self.RequestDate is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CustomDeliveryWindowDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('Type=%s,\n' % quote_python(self.Type).encode(ExternalEncoding)) + if self.RequestTime is not None: + showIndent(outfile, level) + outfile.write('RequestTime=model_.xs_time(\n') + self.RequestTime.exportLiteral(outfile, level, name_='RequestTime') + showIndent(outfile, level) + outfile.write('),\n') + if self.RequestRange is not None: + showIndent(outfile, level) + outfile.write('RequestRange=model_.DateRange(\n') + self.RequestRange.exportLiteral(outfile, level, name_='RequestRange') + showIndent(outfile, level) + outfile.write('),\n') + if self.RequestDate is not None: + showIndent(outfile, level) + outfile.write('RequestDate=%s,\n' % quote_python(self.RequestDate).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Type': + Type_ = child_.text + Type_ = self.gds_validate_string(Type_, node, 'Type') + self.Type = Type_ + self.validate_CustomDeliveryWindowType(self.Type) # validate type CustomDeliveryWindowType + elif nodeName_ == 'RequestTime': + obj_ = xs_time.factory() + obj_.build(child_) + self.set_RequestTime(obj_) + elif nodeName_ == 'RequestRange': + obj_ = DateRange.factory() + obj_.build(child_) + self.set_RequestRange(obj_) + elif nodeName_ == 'RequestDate': + RequestDate_ = child_.text + RequestDate_ = self.gds_validate_string(RequestDate_, node, 'RequestDate') + self.RequestDate = RequestDate_ +# end class CustomDeliveryWindowDetail + + +class CustomDocumentDetail(GeneratedsSuper): + """Data required to produce a custom-specified document, either at + shipment or package level.""" + subclass = None + superclass = None + def __init__(self, Format=None, LabelPrintingOrientation=None, LabelRotation=None, SpecificationId=None): + self.Format = Format + self.LabelPrintingOrientation = LabelPrintingOrientation + self.LabelRotation = LabelRotation + self.SpecificationId = SpecificationId + def factory(*args_, **kwargs_): + if CustomDocumentDetail.subclass: + return CustomDocumentDetail.subclass(*args_, **kwargs_) + else: + return CustomDocumentDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Format(self): return self.Format + def set_Format(self, Format): self.Format = Format + def get_LabelPrintingOrientation(self): return self.LabelPrintingOrientation + def set_LabelPrintingOrientation(self, LabelPrintingOrientation): self.LabelPrintingOrientation = LabelPrintingOrientation + def validate_LabelPrintingOrientationType(self, value): + # Validate type LabelPrintingOrientationType, a restriction on xs:string. + pass + def get_LabelRotation(self): return self.LabelRotation + def set_LabelRotation(self, LabelRotation): self.LabelRotation = LabelRotation + def validate_LabelRotationType(self, value): + # Validate type LabelRotationType, a restriction on xs:string. + pass + def get_SpecificationId(self): return self.SpecificationId + def set_SpecificationId(self, SpecificationId): self.SpecificationId = SpecificationId + def export(self, outfile, level, namespace_='ns:', name_='CustomDocumentDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CustomDocumentDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CustomDocumentDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CustomDocumentDetail', fromsubclass_=False): + if self.Format: + self.Format.export(outfile, level, namespace_, name_='Format') + if self.LabelPrintingOrientation is not None: + showIndent(outfile, level) + outfile.write('<%sLabelPrintingOrientation>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LabelPrintingOrientation).encode(ExternalEncoding), input_name='LabelPrintingOrientation'), namespace_)) + if self.LabelRotation is not None: + showIndent(outfile, level) + outfile.write('<%sLabelRotation>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LabelRotation).encode(ExternalEncoding), input_name='LabelRotation'), namespace_)) + if self.SpecificationId is not None: + showIndent(outfile, level) + outfile.write('<%sSpecificationId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.SpecificationId).encode(ExternalEncoding), input_name='SpecificationId'), namespace_)) + def hasContent_(self): + if ( + self.Format is not None or + self.LabelPrintingOrientation is not None or + self.LabelRotation is not None or + self.SpecificationId is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CustomDocumentDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Format is not None: + showIndent(outfile, level) + outfile.write('Format=model_.ShippingDocumentFormat(\n') + self.Format.exportLiteral(outfile, level, name_='Format') + showIndent(outfile, level) + outfile.write('),\n') + if self.LabelPrintingOrientation is not None: + showIndent(outfile, level) + outfile.write('LabelPrintingOrientation=%s,\n' % quote_python(self.LabelPrintingOrientation).encode(ExternalEncoding)) + if self.LabelRotation is not None: + showIndent(outfile, level) + outfile.write('LabelRotation=%s,\n' % quote_python(self.LabelRotation).encode(ExternalEncoding)) + if self.SpecificationId is not None: + showIndent(outfile, level) + outfile.write('SpecificationId=%s,\n' % quote_python(self.SpecificationId).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Format': + obj_ = ShippingDocumentFormat.factory() + obj_.build(child_) + self.set_Format(obj_) + elif nodeName_ == 'LabelPrintingOrientation': + LabelPrintingOrientation_ = child_.text + LabelPrintingOrientation_ = self.gds_validate_string(LabelPrintingOrientation_, node, 'LabelPrintingOrientation') + self.LabelPrintingOrientation = LabelPrintingOrientation_ + self.validate_LabelPrintingOrientationType(self.LabelPrintingOrientation) # validate type LabelPrintingOrientationType + elif nodeName_ == 'LabelRotation': + LabelRotation_ = child_.text + LabelRotation_ = self.gds_validate_string(LabelRotation_, node, 'LabelRotation') + self.LabelRotation = LabelRotation_ + self.validate_LabelRotationType(self.LabelRotation) # validate type LabelRotationType + elif nodeName_ == 'SpecificationId': + SpecificationId_ = child_.text + SpecificationId_ = self.gds_validate_string(SpecificationId_, node, 'SpecificationId') + self.SpecificationId = SpecificationId_ +# end class CustomDocumentDetail + + +class CustomLabelBarcodeEntry(GeneratedsSuper): + """Constructed string, based on format and zero or more data fields, + printed in specified barcode symbology.""" + subclass = None + superclass = None + def __init__(self, Position=None, Format=None, DataFields=None, BarHeight=None, ThinBarWidth=None, BarcodeSymbology=None): + self.Position = Position + self.Format = Format + if DataFields is None: + self.DataFields = [] + else: + self.DataFields = DataFields + self.BarHeight = BarHeight + self.ThinBarWidth = ThinBarWidth + self.BarcodeSymbology = BarcodeSymbology + def factory(*args_, **kwargs_): + if CustomLabelBarcodeEntry.subclass: + return CustomLabelBarcodeEntry.subclass(*args_, **kwargs_) + else: + return CustomLabelBarcodeEntry(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Position(self): return self.Position + def set_Position(self, Position): self.Position = Position + def get_Format(self): return self.Format + def set_Format(self, Format): self.Format = Format + def get_DataFields(self): return self.DataFields + def set_DataFields(self, DataFields): self.DataFields = DataFields + def add_DataFields(self, value): self.DataFields.append(value) + def insert_DataFields(self, index, value): self.DataFields[index] = value + def get_BarHeight(self): return self.BarHeight + def set_BarHeight(self, BarHeight): self.BarHeight = BarHeight + def get_ThinBarWidth(self): return self.ThinBarWidth + def set_ThinBarWidth(self, ThinBarWidth): self.ThinBarWidth = ThinBarWidth + def get_BarcodeSymbology(self): return self.BarcodeSymbology + def set_BarcodeSymbology(self, BarcodeSymbology): self.BarcodeSymbology = BarcodeSymbology + def validate_BarcodeSymbologyType(self, value): + # Validate type BarcodeSymbologyType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='CustomLabelBarcodeEntry', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CustomLabelBarcodeEntry') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CustomLabelBarcodeEntry'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CustomLabelBarcodeEntry', fromsubclass_=False): + if self.Position: + self.Position.export(outfile, level, namespace_, name_='Position') + if self.Format is not None: + showIndent(outfile, level) + outfile.write('<%sFormat>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Format).encode(ExternalEncoding), input_name='Format'), namespace_)) + for DataFields_ in self.DataFields: + showIndent(outfile, level) + outfile.write('<%sDataFields>%s\n' % (namespace_, self.gds_format_string(quote_xml(DataFields_).encode(ExternalEncoding), input_name='DataFields'), namespace_)) + if self.BarHeight is not None: + showIndent(outfile, level) + outfile.write('<%sBarHeight>%s\n' % (namespace_, self.gds_format_integer(self.BarHeight, input_name='BarHeight'), namespace_)) + if self.ThinBarWidth is not None: + showIndent(outfile, level) + outfile.write('<%sThinBarWidth>%s\n' % (namespace_, self.gds_format_integer(self.ThinBarWidth, input_name='ThinBarWidth'), namespace_)) + if self.BarcodeSymbology is not None: + showIndent(outfile, level) + outfile.write('<%sBarcodeSymbology>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.BarcodeSymbology).encode(ExternalEncoding), input_name='BarcodeSymbology'), namespace_)) + def hasContent_(self): + if ( + self.Position is not None or + self.Format is not None or + self.DataFields or + self.BarHeight is not None or + self.ThinBarWidth is not None or + self.BarcodeSymbology is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CustomLabelBarcodeEntry'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Position is not None: + showIndent(outfile, level) + outfile.write('Position=model_.CustomLabelPosition(\n') + self.Position.exportLiteral(outfile, level, name_='Position') + showIndent(outfile, level) + outfile.write('),\n') + if self.Format is not None: + showIndent(outfile, level) + outfile.write('Format=%s,\n' % quote_python(self.Format).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('DataFields=[\n') + level += 1 + for DataFields_ in self.DataFields: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(DataFields_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.BarHeight is not None: + showIndent(outfile, level) + outfile.write('BarHeight=%d,\n' % self.BarHeight) + if self.ThinBarWidth is not None: + showIndent(outfile, level) + outfile.write('ThinBarWidth=%d,\n' % self.ThinBarWidth) + if self.BarcodeSymbology is not None: + showIndent(outfile, level) + outfile.write('BarcodeSymbology=%s,\n' % quote_python(self.BarcodeSymbology).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Position': + obj_ = CustomLabelPosition.factory() + obj_.build(child_) + self.set_Position(obj_) + elif nodeName_ == 'Format': + Format_ = child_.text + Format_ = self.gds_validate_string(Format_, node, 'Format') + self.Format = Format_ + elif nodeName_ == 'DataFields': + DataFields_ = child_.text + DataFields_ = self.gds_validate_string(DataFields_, node, 'DataFields') + self.DataFields.append(DataFields_) + elif nodeName_ == 'BarHeight': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'BarHeight') + self.BarHeight = ival_ + elif nodeName_ == 'ThinBarWidth': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'ThinBarWidth') + self.ThinBarWidth = ival_ + elif nodeName_ == 'BarcodeSymbology': + BarcodeSymbology_ = child_.text + BarcodeSymbology_ = self.gds_validate_string(BarcodeSymbology_, node, 'BarcodeSymbology') + self.BarcodeSymbology = BarcodeSymbology_ + self.validate_BarcodeSymbologyType(self.BarcodeSymbology) # validate type BarcodeSymbologyType +# end class CustomLabelBarcodeEntry + + +class CustomLabelBoxEntry(GeneratedsSuper): + """Solid (filled) rectangular area on label.""" + subclass = None + superclass = None + def __init__(self, TopLeftCorner=None, BottomRightCorner=None): + self.TopLeftCorner = TopLeftCorner + self.BottomRightCorner = BottomRightCorner + def factory(*args_, **kwargs_): + if CustomLabelBoxEntry.subclass: + return CustomLabelBoxEntry.subclass(*args_, **kwargs_) + else: + return CustomLabelBoxEntry(*args_, **kwargs_) + factory = staticmethod(factory) + def get_TopLeftCorner(self): return self.TopLeftCorner + def set_TopLeftCorner(self, TopLeftCorner): self.TopLeftCorner = TopLeftCorner + def get_BottomRightCorner(self): return self.BottomRightCorner + def set_BottomRightCorner(self, BottomRightCorner): self.BottomRightCorner = BottomRightCorner + def export(self, outfile, level, namespace_='ns:', name_='CustomLabelBoxEntry', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CustomLabelBoxEntry') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CustomLabelBoxEntry'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CustomLabelBoxEntry', fromsubclass_=False): + if self.TopLeftCorner: + self.TopLeftCorner.export(outfile, level, namespace_, name_='TopLeftCorner', ) + if self.BottomRightCorner: + self.BottomRightCorner.export(outfile, level, namespace_, name_='BottomRightCorner', ) + def hasContent_(self): + if ( + self.TopLeftCorner is not None or + self.BottomRightCorner is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CustomLabelBoxEntry'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.TopLeftCorner is not None: + showIndent(outfile, level) + outfile.write('TopLeftCorner=model_.CustomLabelPosition(\n') + self.TopLeftCorner.exportLiteral(outfile, level, name_='TopLeftCorner') + showIndent(outfile, level) + outfile.write('),\n') + if self.BottomRightCorner is not None: + showIndent(outfile, level) + outfile.write('BottomRightCorner=model_.CustomLabelPosition(\n') + self.BottomRightCorner.exportLiteral(outfile, level, name_='BottomRightCorner') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'TopLeftCorner': + obj_ = CustomLabelPosition.factory() + obj_.build(child_) + self.set_TopLeftCorner(obj_) + elif nodeName_ == 'BottomRightCorner': + obj_ = CustomLabelPosition.factory() + obj_.build(child_) + self.set_BottomRightCorner(obj_) +# end class CustomLabelBoxEntry + + +class CustomLabelDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, CoordinateUnits=None, TextEntries=None, GraphicEntries=None, BoxEntries=None, BarcodeEntries=None): + self.CoordinateUnits = CoordinateUnits + if TextEntries is None: + self.TextEntries = [] + else: + self.TextEntries = TextEntries + if GraphicEntries is None: + self.GraphicEntries = [] + else: + self.GraphicEntries = GraphicEntries + if BoxEntries is None: + self.BoxEntries = [] + else: + self.BoxEntries = BoxEntries + if BarcodeEntries is None: + self.BarcodeEntries = [] + else: + self.BarcodeEntries = BarcodeEntries + def factory(*args_, **kwargs_): + if CustomLabelDetail.subclass: + return CustomLabelDetail.subclass(*args_, **kwargs_) + else: + return CustomLabelDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_CoordinateUnits(self): return self.CoordinateUnits + def set_CoordinateUnits(self, CoordinateUnits): self.CoordinateUnits = CoordinateUnits + def validate_CustomLabelCoordinateUnits(self, value): + # Validate type CustomLabelCoordinateUnits, a restriction on xs:string. + pass + def get_TextEntries(self): return self.TextEntries + def set_TextEntries(self, TextEntries): self.TextEntries = TextEntries + def add_TextEntries(self, value): self.TextEntries.append(value) + def insert_TextEntries(self, index, value): self.TextEntries[index] = value + def get_GraphicEntries(self): return self.GraphicEntries + def set_GraphicEntries(self, GraphicEntries): self.GraphicEntries = GraphicEntries + def add_GraphicEntries(self, value): self.GraphicEntries.append(value) + def insert_GraphicEntries(self, index, value): self.GraphicEntries[index] = value + def get_BoxEntries(self): return self.BoxEntries + def set_BoxEntries(self, BoxEntries): self.BoxEntries = BoxEntries + def add_BoxEntries(self, value): self.BoxEntries.append(value) + def insert_BoxEntries(self, index, value): self.BoxEntries[index] = value + def get_BarcodeEntries(self): return self.BarcodeEntries + def set_BarcodeEntries(self, BarcodeEntries): self.BarcodeEntries = BarcodeEntries + def add_BarcodeEntries(self, value): self.BarcodeEntries.append(value) + def insert_BarcodeEntries(self, index, value): self.BarcodeEntries[index] = value + def export(self, outfile, level, namespace_='ns:', name_='CustomLabelDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CustomLabelDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CustomLabelDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CustomLabelDetail', fromsubclass_=False): + if self.CoordinateUnits is not None: + showIndent(outfile, level) + outfile.write('<%sCoordinateUnits>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CoordinateUnits).encode(ExternalEncoding), input_name='CoordinateUnits'), namespace_)) + for TextEntries_ in self.TextEntries: + TextEntries_.export(outfile, level, namespace_, name_='TextEntries') + for GraphicEntries_ in self.GraphicEntries: + GraphicEntries_.export(outfile, level, namespace_, name_='GraphicEntries') + for BoxEntries_ in self.BoxEntries: + BoxEntries_.export(outfile, level, namespace_, name_='BoxEntries') + for BarcodeEntries_ in self.BarcodeEntries: + BarcodeEntries_.export(outfile, level, namespace_, name_='BarcodeEntries') + def hasContent_(self): + if ( + self.CoordinateUnits is not None or + self.TextEntries or + self.GraphicEntries or + self.BoxEntries or + self.BarcodeEntries + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CustomLabelDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.CoordinateUnits is not None: + showIndent(outfile, level) + outfile.write('CoordinateUnits=%s,\n' % quote_python(self.CoordinateUnits).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('TextEntries=[\n') + level += 1 + for TextEntries_ in self.TextEntries: + showIndent(outfile, level) + outfile.write('model_.CustomLabelTextEntry(\n') + TextEntries_.exportLiteral(outfile, level, name_='CustomLabelTextEntry') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('GraphicEntries=[\n') + level += 1 + for GraphicEntries_ in self.GraphicEntries: + showIndent(outfile, level) + outfile.write('model_.CustomLabelGraphicEntry(\n') + GraphicEntries_.exportLiteral(outfile, level, name_='CustomLabelGraphicEntry') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('BoxEntries=[\n') + level += 1 + for BoxEntries_ in self.BoxEntries: + showIndent(outfile, level) + outfile.write('model_.CustomLabelBoxEntry(\n') + BoxEntries_.exportLiteral(outfile, level, name_='CustomLabelBoxEntry') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('BarcodeEntries=[\n') + level += 1 + for BarcodeEntries_ in self.BarcodeEntries: + showIndent(outfile, level) + outfile.write('model_.CustomLabelBarcodeEntry(\n') + BarcodeEntries_.exportLiteral(outfile, level, name_='CustomLabelBarcodeEntry') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'CoordinateUnits': + CoordinateUnits_ = child_.text + CoordinateUnits_ = self.gds_validate_string(CoordinateUnits_, node, 'CoordinateUnits') + self.CoordinateUnits = CoordinateUnits_ + self.validate_CustomLabelCoordinateUnits(self.CoordinateUnits) # validate type CustomLabelCoordinateUnits + elif nodeName_ == 'TextEntries': + obj_ = CustomLabelTextEntry.factory() + obj_.build(child_) + self.TextEntries.append(obj_) + elif nodeName_ == 'GraphicEntries': + obj_ = CustomLabelGraphicEntry.factory() + obj_.build(child_) + self.GraphicEntries.append(obj_) + elif nodeName_ == 'BoxEntries': + obj_ = CustomLabelBoxEntry.factory() + obj_.build(child_) + self.BoxEntries.append(obj_) + elif nodeName_ == 'BarcodeEntries': + obj_ = CustomLabelBarcodeEntry.factory() + obj_.build(child_) + self.BarcodeEntries.append(obj_) +# end class CustomLabelDetail + + +class CustomLabelGraphicEntry(GeneratedsSuper): + """Image to be included from printer's memory, or from a local file for + offline clients.""" + subclass = None + superclass = None + def __init__(self, Position=None, PrinterGraphicId=None, FileGraphicFullName=None): + self.Position = Position + self.PrinterGraphicId = PrinterGraphicId + self.FileGraphicFullName = FileGraphicFullName + def factory(*args_, **kwargs_): + if CustomLabelGraphicEntry.subclass: + return CustomLabelGraphicEntry.subclass(*args_, **kwargs_) + else: + return CustomLabelGraphicEntry(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Position(self): return self.Position + def set_Position(self, Position): self.Position = Position + def get_PrinterGraphicId(self): return self.PrinterGraphicId + def set_PrinterGraphicId(self, PrinterGraphicId): self.PrinterGraphicId = PrinterGraphicId + def get_FileGraphicFullName(self): return self.FileGraphicFullName + def set_FileGraphicFullName(self, FileGraphicFullName): self.FileGraphicFullName = FileGraphicFullName + def export(self, outfile, level, namespace_='ns:', name_='CustomLabelGraphicEntry', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CustomLabelGraphicEntry') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CustomLabelGraphicEntry'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CustomLabelGraphicEntry', fromsubclass_=False): + if self.Position: + self.Position.export(outfile, level, namespace_, name_='Position') + if self.PrinterGraphicId is not None: + showIndent(outfile, level) + outfile.write('<%sPrinterGraphicId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PrinterGraphicId).encode(ExternalEncoding), input_name='PrinterGraphicId'), namespace_)) + if self.FileGraphicFullName is not None: + showIndent(outfile, level) + outfile.write('<%sFileGraphicFullName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.FileGraphicFullName).encode(ExternalEncoding), input_name='FileGraphicFullName'), namespace_)) + def hasContent_(self): + if ( + self.Position is not None or + self.PrinterGraphicId is not None or + self.FileGraphicFullName is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CustomLabelGraphicEntry'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Position is not None: + showIndent(outfile, level) + outfile.write('Position=model_.CustomLabelPosition(\n') + self.Position.exportLiteral(outfile, level, name_='Position') + showIndent(outfile, level) + outfile.write('),\n') + if self.PrinterGraphicId is not None: + showIndent(outfile, level) + outfile.write('PrinterGraphicId=%s,\n' % quote_python(self.PrinterGraphicId).encode(ExternalEncoding)) + if self.FileGraphicFullName is not None: + showIndent(outfile, level) + outfile.write('FileGraphicFullName=%s,\n' % quote_python(self.FileGraphicFullName).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Position': + obj_ = CustomLabelPosition.factory() + obj_.build(child_) + self.set_Position(obj_) + elif nodeName_ == 'PrinterGraphicId': + PrinterGraphicId_ = child_.text + PrinterGraphicId_ = self.gds_validate_string(PrinterGraphicId_, node, 'PrinterGraphicId') + self.PrinterGraphicId = PrinterGraphicId_ + elif nodeName_ == 'FileGraphicFullName': + FileGraphicFullName_ = child_.text + FileGraphicFullName_ = self.gds_validate_string(FileGraphicFullName_, node, 'FileGraphicFullName') + self.FileGraphicFullName = FileGraphicFullName_ +# end class CustomLabelGraphicEntry + + +class CustomLabelPosition(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, X=None, Y=None): + self.X = X + self.Y = Y + def factory(*args_, **kwargs_): + if CustomLabelPosition.subclass: + return CustomLabelPosition.subclass(*args_, **kwargs_) + else: + return CustomLabelPosition(*args_, **kwargs_) + factory = staticmethod(factory) + def get_X(self): return self.X + def set_X(self, X): self.X = X + def get_Y(self): return self.Y + def set_Y(self, Y): self.Y = Y + def export(self, outfile, level, namespace_='ns:', name_='CustomLabelPosition', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CustomLabelPosition') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CustomLabelPosition'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CustomLabelPosition', fromsubclass_=False): + if self.X is not None: + showIndent(outfile, level) + outfile.write('<%sX>%s\n' % (namespace_, self.gds_format_integer(self.X, input_name='X'), namespace_)) + if self.Y is not None: + showIndent(outfile, level) + outfile.write('<%sY>%s\n' % (namespace_, self.gds_format_integer(self.Y, input_name='Y'), namespace_)) + def hasContent_(self): + if ( + self.X is not None or + self.Y is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CustomLabelPosition'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.X is not None: + showIndent(outfile, level) + outfile.write('X=%d,\n' % self.X) + if self.Y is not None: + showIndent(outfile, level) + outfile.write('Y=%d,\n' % self.Y) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'X': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'X') + self.X = ival_ + elif nodeName_ == 'Y': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'Y') + self.Y = ival_ +# end class CustomLabelPosition + + +class CustomLabelTextEntry(GeneratedsSuper): + """Constructed string, based on format and zero or more data fields, + printed in specified printer font (for thermal labels) or + generic font/size (for plain paper labels).""" + subclass = None + superclass = None + def __init__(self, Position=None, Format=None, DataFields=None, ThermalFontId=None, FontName=None, FontSize=None): + self.Position = Position + self.Format = Format + if DataFields is None: + self.DataFields = [] + else: + self.DataFields = DataFields + self.ThermalFontId = ThermalFontId + self.FontName = FontName + self.FontSize = FontSize + def factory(*args_, **kwargs_): + if CustomLabelTextEntry.subclass: + return CustomLabelTextEntry.subclass(*args_, **kwargs_) + else: + return CustomLabelTextEntry(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Position(self): return self.Position + def set_Position(self, Position): self.Position = Position + def get_Format(self): return self.Format + def set_Format(self, Format): self.Format = Format + def get_DataFields(self): return self.DataFields + def set_DataFields(self, DataFields): self.DataFields = DataFields + def add_DataFields(self, value): self.DataFields.append(value) + def insert_DataFields(self, index, value): self.DataFields[index] = value + def get_ThermalFontId(self): return self.ThermalFontId + def set_ThermalFontId(self, ThermalFontId): self.ThermalFontId = ThermalFontId + def get_FontName(self): return self.FontName + def set_FontName(self, FontName): self.FontName = FontName + def get_FontSize(self): return self.FontSize + def set_FontSize(self, FontSize): self.FontSize = FontSize + def export(self, outfile, level, namespace_='ns:', name_='CustomLabelTextEntry', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CustomLabelTextEntry') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CustomLabelTextEntry'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CustomLabelTextEntry', fromsubclass_=False): + if self.Position: + self.Position.export(outfile, level, namespace_, name_='Position') + if self.Format is not None: + showIndent(outfile, level) + outfile.write('<%sFormat>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Format).encode(ExternalEncoding), input_name='Format'), namespace_)) + for DataFields_ in self.DataFields: + showIndent(outfile, level) + outfile.write('<%sDataFields>%s\n' % (namespace_, self.gds_format_string(quote_xml(DataFields_).encode(ExternalEncoding), input_name='DataFields'), namespace_)) + if self.ThermalFontId is not None: + showIndent(outfile, level) + outfile.write('<%sThermalFontId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ThermalFontId).encode(ExternalEncoding), input_name='ThermalFontId'), namespace_)) + if self.FontName is not None: + showIndent(outfile, level) + outfile.write('<%sFontName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.FontName).encode(ExternalEncoding), input_name='FontName'), namespace_)) + if self.FontSize is not None: + showIndent(outfile, level) + outfile.write('<%sFontSize>%s\n' % (namespace_, self.gds_format_integer(self.FontSize, input_name='FontSize'), namespace_)) + def hasContent_(self): + if ( + self.Position is not None or + self.Format is not None or + self.DataFields or + self.ThermalFontId is not None or + self.FontName is not None or + self.FontSize is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CustomLabelTextEntry'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Position is not None: + showIndent(outfile, level) + outfile.write('Position=model_.CustomLabelPosition(\n') + self.Position.exportLiteral(outfile, level, name_='Position') + showIndent(outfile, level) + outfile.write('),\n') + if self.Format is not None: + showIndent(outfile, level) + outfile.write('Format=%s,\n' % quote_python(self.Format).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('DataFields=[\n') + level += 1 + for DataFields_ in self.DataFields: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(DataFields_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.ThermalFontId is not None: + showIndent(outfile, level) + outfile.write('ThermalFontId=%s,\n' % quote_python(self.ThermalFontId).encode(ExternalEncoding)) + if self.FontName is not None: + showIndent(outfile, level) + outfile.write('FontName=%s,\n' % quote_python(self.FontName).encode(ExternalEncoding)) + if self.FontSize is not None: + showIndent(outfile, level) + outfile.write('FontSize=%d,\n' % self.FontSize) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Position': + obj_ = CustomLabelPosition.factory() + obj_.build(child_) + self.set_Position(obj_) + elif nodeName_ == 'Format': + Format_ = child_.text + Format_ = self.gds_validate_string(Format_, node, 'Format') + self.Format = Format_ + elif nodeName_ == 'DataFields': + DataFields_ = child_.text + DataFields_ = self.gds_validate_string(DataFields_, node, 'DataFields') + self.DataFields.append(DataFields_) + elif nodeName_ == 'ThermalFontId': + ThermalFontId_ = child_.text + ThermalFontId_ = self.gds_validate_string(ThermalFontId_, node, 'ThermalFontId') + self.ThermalFontId = ThermalFontId_ + elif nodeName_ == 'FontName': + FontName_ = child_.text + FontName_ = self.gds_validate_string(FontName_, node, 'FontName') + self.FontName = FontName_ + elif nodeName_ == 'FontSize': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ <= 0: + raise_parse_error(child_, 'requires positiveInteger') + ival_ = self.gds_validate_integer(ival_, node, 'FontSize') + self.FontSize = ival_ +# end class CustomLabelTextEntry + + +class CustomerImageUsage(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Type=None, Id=None): + self.Type = Type + self.Id = Id + def factory(*args_, **kwargs_): + if CustomerImageUsage.subclass: + return CustomerImageUsage.subclass(*args_, **kwargs_) + else: + return CustomerImageUsage(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Type(self): return self.Type + def set_Type(self, Type): self.Type = Type + def validate_CustomerImageUsageType(self, value): + # Validate type CustomerImageUsageType, a restriction on xs:string. + pass + def get_Id(self): return self.Id + def set_Id(self, Id): self.Id = Id + def validate_ImageId(self, value): + # Validate type ImageId, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='CustomerImageUsage', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CustomerImageUsage') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CustomerImageUsage'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CustomerImageUsage', fromsubclass_=False): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('<%sType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Type).encode(ExternalEncoding), input_name='Type'), namespace_)) + if self.Id is not None: + showIndent(outfile, level) + outfile.write('<%sId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Id).encode(ExternalEncoding), input_name='Id'), namespace_)) + def hasContent_(self): + if ( + self.Type is not None or + self.Id is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CustomerImageUsage'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('Type=%s,\n' % quote_python(self.Type).encode(ExternalEncoding)) + if self.Id is not None: + showIndent(outfile, level) + outfile.write('Id=%s,\n' % quote_python(self.Id).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Type': + Type_ = child_.text + Type_ = self.gds_validate_string(Type_, node, 'Type') + self.Type = Type_ + self.validate_CustomerImageUsageType(self.Type) # validate type CustomerImageUsageType + elif nodeName_ == 'Id': + Id_ = child_.text + Id_ = self.gds_validate_string(Id_, node, 'Id') + self.Id = Id_ + self.validate_ImageId(self.Id) # validate type ImageId +# end class CustomerImageUsage + + +class CustomerReference(GeneratedsSuper): + """Reference information to be associated with this package.""" + subclass = None + superclass = None + def __init__(self, CustomerReferenceType=None, Value=None): + self.CustomerReferenceType = CustomerReferenceType + self.Value = Value + def factory(*args_, **kwargs_): + if CustomerReference.subclass: + return CustomerReference.subclass(*args_, **kwargs_) + else: + return CustomerReference(*args_, **kwargs_) + factory = staticmethod(factory) + def get_CustomerReferenceType(self): return self.CustomerReferenceType + def set_CustomerReferenceType(self, CustomerReferenceType): self.CustomerReferenceType = CustomerReferenceType + def validate_CustomerReferenceType(self, value): + # Validate type CustomerReferenceType, a restriction on xs:string. + pass + def get_Value(self): return self.Value + def set_Value(self, Value): self.Value = Value + def export(self, outfile, level, namespace_='ns:', name_='CustomerReference', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CustomerReference') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CustomerReference'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CustomerReference', fromsubclass_=False): + if self.CustomerReferenceType is not None: + showIndent(outfile, level) + outfile.write('<%sCustomerReferenceType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CustomerReferenceType).encode(ExternalEncoding), input_name='CustomerReferenceType'), namespace_)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('<%sValue>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Value).encode(ExternalEncoding), input_name='Value'), namespace_)) + def hasContent_(self): + if ( + self.CustomerReferenceType is not None or + self.Value is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CustomerReference'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.CustomerReferenceType is not None: + showIndent(outfile, level) + outfile.write('CustomerReferenceType=%s,\n' % quote_python(self.CustomerReferenceType).encode(ExternalEncoding)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('Value=%s,\n' % quote_python(self.Value).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'CustomerReferenceType': + CustomerReferenceType_ = child_.text + CustomerReferenceType_ = self.gds_validate_string(CustomerReferenceType_, node, 'CustomerReferenceType') + self.CustomerReferenceType = CustomerReferenceType_ + self.validate_CustomerReferenceType(self.CustomerReferenceType) # validate type CustomerReferenceType + elif nodeName_ == 'Value': + Value_ = child_.text + Value_ = self.gds_validate_string(Value_, node, 'Value') + self.Value = Value_ +# end class CustomerReference + + +class CustomerSpecifiedLabelDetail(GeneratedsSuper): + """Allows customer-specified control of label content.""" + subclass = None + superclass = None + def __init__(self, DocTabContent=None, CustomContent=None, ConfigurableReferenceEntries=None, MaskedData=None, SecondaryBarcode=None, TermsAndConditionsLocalization=None, AdditionalLabels=None, AirWaybillSuppressionCount=None): + self.DocTabContent = DocTabContent + self.CustomContent = CustomContent + if ConfigurableReferenceEntries is None: + self.ConfigurableReferenceEntries = [] + else: + self.ConfigurableReferenceEntries = ConfigurableReferenceEntries + if MaskedData is None: + self.MaskedData = [] + else: + self.MaskedData = MaskedData + self.SecondaryBarcode = SecondaryBarcode + self.TermsAndConditionsLocalization = TermsAndConditionsLocalization + if AdditionalLabels is None: + self.AdditionalLabels = [] + else: + self.AdditionalLabels = AdditionalLabels + self.AirWaybillSuppressionCount = AirWaybillSuppressionCount + def factory(*args_, **kwargs_): + if CustomerSpecifiedLabelDetail.subclass: + return CustomerSpecifiedLabelDetail.subclass(*args_, **kwargs_) + else: + return CustomerSpecifiedLabelDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_DocTabContent(self): return self.DocTabContent + def set_DocTabContent(self, DocTabContent): self.DocTabContent = DocTabContent + def get_CustomContent(self): return self.CustomContent + def set_CustomContent(self, CustomContent): self.CustomContent = CustomContent + def get_ConfigurableReferenceEntries(self): return self.ConfigurableReferenceEntries + def set_ConfigurableReferenceEntries(self, ConfigurableReferenceEntries): self.ConfigurableReferenceEntries = ConfigurableReferenceEntries + def add_ConfigurableReferenceEntries(self, value): self.ConfigurableReferenceEntries.append(value) + def insert_ConfigurableReferenceEntries(self, index, value): self.ConfigurableReferenceEntries[index] = value + def get_MaskedData(self): return self.MaskedData + def set_MaskedData(self, MaskedData): self.MaskedData = MaskedData + def add_MaskedData(self, value): self.MaskedData.append(value) + def insert_MaskedData(self, index, value): self.MaskedData[index] = value + def validate_LabelMaskableDataType(self, value): + # Validate type LabelMaskableDataType, a restriction on xs:string. + pass + def get_SecondaryBarcode(self): return self.SecondaryBarcode + def set_SecondaryBarcode(self, SecondaryBarcode): self.SecondaryBarcode = SecondaryBarcode + def validate_SecondaryBarcodeType(self, value): + # Validate type SecondaryBarcodeType, a restriction on xs:string. + pass + def get_TermsAndConditionsLocalization(self): return self.TermsAndConditionsLocalization + def set_TermsAndConditionsLocalization(self, TermsAndConditionsLocalization): self.TermsAndConditionsLocalization = TermsAndConditionsLocalization + def get_AdditionalLabels(self): return self.AdditionalLabels + def set_AdditionalLabels(self, AdditionalLabels): self.AdditionalLabels = AdditionalLabels + def add_AdditionalLabels(self, value): self.AdditionalLabels.append(value) + def insert_AdditionalLabels(self, index, value): self.AdditionalLabels[index] = value + def get_AirWaybillSuppressionCount(self): return self.AirWaybillSuppressionCount + def set_AirWaybillSuppressionCount(self, AirWaybillSuppressionCount): self.AirWaybillSuppressionCount = AirWaybillSuppressionCount + def export(self, outfile, level, namespace_='ns:', name_='CustomerSpecifiedLabelDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CustomerSpecifiedLabelDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CustomerSpecifiedLabelDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CustomerSpecifiedLabelDetail', fromsubclass_=False): + if self.DocTabContent: + self.DocTabContent.export(outfile, level, namespace_, name_='DocTabContent') + if self.CustomContent: + self.CustomContent.export(outfile, level, namespace_, name_='CustomContent') + for ConfigurableReferenceEntries_ in self.ConfigurableReferenceEntries: + ConfigurableReferenceEntries_.export(outfile, level, namespace_, name_='ConfigurableReferenceEntries') + for MaskedData_ in self.MaskedData: + showIndent(outfile, level) + outfile.write('<%sMaskedData>%s\n' % (namespace_, self.gds_format_string(quote_xml(MaskedData_).encode(ExternalEncoding), input_name='MaskedData'), namespace_)) + if self.SecondaryBarcode is not None: + showIndent(outfile, level) + outfile.write('<%sSecondaryBarcode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.SecondaryBarcode).encode(ExternalEncoding), input_name='SecondaryBarcode'), namespace_)) + if self.TermsAndConditionsLocalization: + self.TermsAndConditionsLocalization.export(outfile, level, namespace_, name_='TermsAndConditionsLocalization') + for AdditionalLabels_ in self.AdditionalLabels: + AdditionalLabels_.export(outfile, level, namespace_, name_='AdditionalLabels') + if self.AirWaybillSuppressionCount is not None: + showIndent(outfile, level) + outfile.write('<%sAirWaybillSuppressionCount>%s\n' % (namespace_, self.gds_format_integer(self.AirWaybillSuppressionCount, input_name='AirWaybillSuppressionCount'), namespace_)) + def hasContent_(self): + if ( + self.DocTabContent is not None or + self.CustomContent is not None or + self.ConfigurableReferenceEntries or + self.MaskedData or + self.SecondaryBarcode is not None or + self.TermsAndConditionsLocalization is not None or + self.AdditionalLabels or + self.AirWaybillSuppressionCount is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CustomerSpecifiedLabelDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.DocTabContent is not None: + showIndent(outfile, level) + outfile.write('DocTabContent=model_.DocTabContent(\n') + self.DocTabContent.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.CustomContent is not None: + showIndent(outfile, level) + outfile.write('CustomContent=model_.CustomLabelDetail(\n') + self.CustomContent.exportLiteral(outfile, level, name_='CustomContent') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('ConfigurableReferenceEntries=[\n') + level += 1 + for ConfigurableReferenceEntries_ in self.ConfigurableReferenceEntries: + showIndent(outfile, level) + outfile.write('model_.ConfigurableLabelReferenceEntry(\n') + ConfigurableReferenceEntries_.exportLiteral(outfile, level, name_='ConfigurableLabelReferenceEntry') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('MaskedData=[\n') + level += 1 + for MaskedData_ in self.MaskedData: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(MaskedData_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.SecondaryBarcode is not None: + showIndent(outfile, level) + outfile.write('SecondaryBarcode=%s,\n' % quote_python(self.SecondaryBarcode).encode(ExternalEncoding)) + if self.TermsAndConditionsLocalization is not None: + showIndent(outfile, level) + outfile.write('TermsAndConditionsLocalization=model_.Localization(\n') + self.TermsAndConditionsLocalization.exportLiteral(outfile, level, name_='TermsAndConditionsLocalization') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('AdditionalLabels=[\n') + level += 1 + for AdditionalLabels_ in self.AdditionalLabels: + showIndent(outfile, level) + outfile.write('model_.AdditionalLabelsDetail(\n') + AdditionalLabels_.exportLiteral(outfile, level, name_='AdditionalLabelsDetail') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.AirWaybillSuppressionCount is not None: + showIndent(outfile, level) + outfile.write('AirWaybillSuppressionCount=%d,\n' % self.AirWaybillSuppressionCount) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'DocTabContent': + obj_ = DocTabContent.factory() + obj_.build(child_) + self.set_DocTabContent(obj_) + elif nodeName_ == 'CustomContent': + obj_ = CustomLabelDetail.factory() + obj_.build(child_) + self.set_CustomContent(obj_) + elif nodeName_ == 'ConfigurableReferenceEntries': + obj_ = ConfigurableLabelReferenceEntry.factory() + obj_.build(child_) + self.ConfigurableReferenceEntries.append(obj_) + elif nodeName_ == 'MaskedData': + MaskedData_ = child_.text + MaskedData_ = self.gds_validate_string(MaskedData_, node, 'MaskedData') + self.MaskedData.append(MaskedData_) + self.validate_LabelMaskableDataType(self.MaskedData) # validate type LabelMaskableDataType + elif nodeName_ == 'SecondaryBarcode': + SecondaryBarcode_ = child_.text + SecondaryBarcode_ = self.gds_validate_string(SecondaryBarcode_, node, 'SecondaryBarcode') + self.SecondaryBarcode = SecondaryBarcode_ + self.validate_SecondaryBarcodeType(self.SecondaryBarcode) # validate type SecondaryBarcodeType + elif nodeName_ == 'TermsAndConditionsLocalization': + obj_ = Localization.factory() + obj_.build(child_) + self.set_TermsAndConditionsLocalization(obj_) + elif nodeName_ == 'AdditionalLabels': + obj_ = AdditionalLabelsDetail.factory() + obj_.build(child_) + self.AdditionalLabels.append(obj_) + elif nodeName_ == 'AirWaybillSuppressionCount': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'AirWaybillSuppressionCount') + self.AirWaybillSuppressionCount = ival_ +# end class CustomerSpecifiedLabelDetail + + +class CustomsClearanceDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Broker=None, ClearanceBrokerage=None, ImporterOfRecord=None, RecipientCustomsId=None, DutiesPayment=None, DocumentContent=None, CustomsValue=None, FreightOnValue=None, InsuranceCharges=None, PartiesToTransactionAreRelated=None, CommercialInvoice=None, Commodities=None, ExportDetail=None, RegulatoryControls=None): + self.Broker = Broker + self.ClearanceBrokerage = ClearanceBrokerage + self.ImporterOfRecord = ImporterOfRecord + self.RecipientCustomsId = RecipientCustomsId + self.DutiesPayment = DutiesPayment + self.DocumentContent = DocumentContent + self.CustomsValue = CustomsValue + self.FreightOnValue = FreightOnValue + self.InsuranceCharges = InsuranceCharges + self.PartiesToTransactionAreRelated = PartiesToTransactionAreRelated + self.CommercialInvoice = CommercialInvoice + if Commodities is None: + self.Commodities = [] + else: + self.Commodities = Commodities + self.ExportDetail = ExportDetail + if RegulatoryControls is None: + self.RegulatoryControls = [] + else: + self.RegulatoryControls = RegulatoryControls + def factory(*args_, **kwargs_): + if CustomsClearanceDetail.subclass: + return CustomsClearanceDetail.subclass(*args_, **kwargs_) + else: + return CustomsClearanceDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Broker(self): return self.Broker + def set_Broker(self, Broker): self.Broker = Broker + def get_ClearanceBrokerage(self): return self.ClearanceBrokerage + def set_ClearanceBrokerage(self, ClearanceBrokerage): self.ClearanceBrokerage = ClearanceBrokerage + def validate_ClearanceBrokerageType(self, value): + # Validate type ClearanceBrokerageType, a restriction on xs:string. + pass + def get_ImporterOfRecord(self): return self.ImporterOfRecord + def set_ImporterOfRecord(self, ImporterOfRecord): self.ImporterOfRecord = ImporterOfRecord + def get_RecipientCustomsId(self): return self.RecipientCustomsId + def set_RecipientCustomsId(self, RecipientCustomsId): self.RecipientCustomsId = RecipientCustomsId + def get_DutiesPayment(self): return self.DutiesPayment + def set_DutiesPayment(self, DutiesPayment): self.DutiesPayment = DutiesPayment + def get_DocumentContent(self): return self.DocumentContent + def set_DocumentContent(self, DocumentContent): self.DocumentContent = DocumentContent + def validate_InternationalDocumentContentType(self, value): + # Validate type InternationalDocumentContentType, a restriction on xs:string. + pass + def get_CustomsValue(self): return self.CustomsValue + def set_CustomsValue(self, CustomsValue): self.CustomsValue = CustomsValue + def get_FreightOnValue(self): return self.FreightOnValue + def set_FreightOnValue(self, FreightOnValue): self.FreightOnValue = FreightOnValue + def validate_FreightOnValueType(self, value): + # Validate type FreightOnValueType, a restriction on xs:string. + pass + def get_InsuranceCharges(self): return self.InsuranceCharges + def set_InsuranceCharges(self, InsuranceCharges): self.InsuranceCharges = InsuranceCharges + def get_PartiesToTransactionAreRelated(self): return self.PartiesToTransactionAreRelated + def set_PartiesToTransactionAreRelated(self, PartiesToTransactionAreRelated): self.PartiesToTransactionAreRelated = PartiesToTransactionAreRelated + def get_CommercialInvoice(self): return self.CommercialInvoice + def set_CommercialInvoice(self, CommercialInvoice): self.CommercialInvoice = CommercialInvoice + def get_Commodities(self): return self.Commodities + def set_Commodities(self, Commodities): self.Commodities = Commodities + def add_Commodities(self, value): self.Commodities.append(value) + def insert_Commodities(self, index, value): self.Commodities[index] = value + def get_ExportDetail(self): return self.ExportDetail + def set_ExportDetail(self, ExportDetail): self.ExportDetail = ExportDetail + def get_RegulatoryControls(self): return self.RegulatoryControls + def set_RegulatoryControls(self, RegulatoryControls): self.RegulatoryControls = RegulatoryControls + def add_RegulatoryControls(self, value): self.RegulatoryControls.append(value) + def insert_RegulatoryControls(self, index, value): self.RegulatoryControls[index] = value + def validate_RegulatoryControlType(self, value): + # Validate type RegulatoryControlType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='CustomsClearanceDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CustomsClearanceDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CustomsClearanceDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CustomsClearanceDetail', fromsubclass_=False): + if self.Broker: + self.Broker.export(outfile, level, namespace_, name_='Broker') + if self.ClearanceBrokerage is not None: + showIndent(outfile, level) + outfile.write('<%sClearanceBrokerage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ClearanceBrokerage).encode(ExternalEncoding), input_name='ClearanceBrokerage'), namespace_)) + if self.ImporterOfRecord: + self.ImporterOfRecord.export(outfile, level, namespace_, name_='ImporterOfRecord') + if self.RecipientCustomsId: + self.RecipientCustomsId.export(outfile, level, namespace_, name_='RecipientCustomsId') + if self.DutiesPayment: + self.DutiesPayment.export(outfile, level, namespace_, name_='DutiesPayment') + if self.DocumentContent is not None: + showIndent(outfile, level) + outfile.write('<%sDocumentContent>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DocumentContent).encode(ExternalEncoding), input_name='DocumentContent'), namespace_)) + if self.CustomsValue: + self.CustomsValue.export(outfile, level, namespace_, name_='CustomsValue') + if self.FreightOnValue is not None: + showIndent(outfile, level) + outfile.write('<%sFreightOnValue>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.FreightOnValue).encode(ExternalEncoding), input_name='FreightOnValue'), namespace_)) + if self.InsuranceCharges: + self.InsuranceCharges.export(outfile, level, namespace_, name_='InsuranceCharges') + if self.PartiesToTransactionAreRelated is not None: + showIndent(outfile, level) + outfile.write('<%sPartiesToTransactionAreRelated>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.PartiesToTransactionAreRelated)), input_name='PartiesToTransactionAreRelated'), namespace_)) + if self.CommercialInvoice: + self.CommercialInvoice.export(outfile, level, namespace_, name_='CommercialInvoice') + for Commodities_ in self.Commodities: + Commodities_.export(outfile, level, namespace_, name_='Commodities') + if self.ExportDetail: + self.ExportDetail.export(outfile, level, namespace_, name_='ExportDetail') + for RegulatoryControls_ in self.RegulatoryControls: + showIndent(outfile, level) + outfile.write('<%sRegulatoryControls>%s\n' % (namespace_, self.gds_format_string(quote_xml(RegulatoryControls_).encode(ExternalEncoding), input_name='RegulatoryControls'), namespace_)) + def hasContent_(self): + if ( + self.Broker is not None or + self.ClearanceBrokerage is not None or + self.ImporterOfRecord is not None or + self.RecipientCustomsId is not None or + self.DutiesPayment is not None or + self.DocumentContent is not None or + self.CustomsValue is not None or + self.FreightOnValue is not None or + self.InsuranceCharges is not None or + self.PartiesToTransactionAreRelated is not None or + self.CommercialInvoice is not None or + self.Commodities or + self.ExportDetail is not None or + self.RegulatoryControls + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CustomsClearanceDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Broker is not None: + showIndent(outfile, level) + outfile.write('Broker=model_.Party(\n') + self.Broker.exportLiteral(outfile, level, name_='Broker') + showIndent(outfile, level) + outfile.write('),\n') + if self.ClearanceBrokerage is not None: + showIndent(outfile, level) + outfile.write('ClearanceBrokerage=%s,\n' % quote_python(self.ClearanceBrokerage).encode(ExternalEncoding)) + if self.ImporterOfRecord is not None: + showIndent(outfile, level) + outfile.write('ImporterOfRecord=model_.Party(\n') + self.ImporterOfRecord.exportLiteral(outfile, level, name_='ImporterOfRecord') + showIndent(outfile, level) + outfile.write('),\n') + if self.RecipientCustomsId is not None: + showIndent(outfile, level) + outfile.write('RecipientCustomsId=model_.RecipientCustomsId(\n') + self.RecipientCustomsId.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.DutiesPayment is not None: + showIndent(outfile, level) + outfile.write('DutiesPayment=model_.Payment(\n') + self.DutiesPayment.exportLiteral(outfile, level, name_='DutiesPayment') + showIndent(outfile, level) + outfile.write('),\n') + if self.DocumentContent is not None: + showIndent(outfile, level) + outfile.write('DocumentContent=%s,\n' % quote_python(self.DocumentContent).encode(ExternalEncoding)) + if self.CustomsValue is not None: + showIndent(outfile, level) + outfile.write('CustomsValue=model_.Money(\n') + self.CustomsValue.exportLiteral(outfile, level, name_='CustomsValue') + showIndent(outfile, level) + outfile.write('),\n') + if self.FreightOnValue is not None: + showIndent(outfile, level) + outfile.write('FreightOnValue=%s,\n' % quote_python(self.FreightOnValue).encode(ExternalEncoding)) + if self.InsuranceCharges is not None: + showIndent(outfile, level) + outfile.write('InsuranceCharges=model_.Money(\n') + self.InsuranceCharges.exportLiteral(outfile, level, name_='InsuranceCharges') + showIndent(outfile, level) + outfile.write('),\n') + if self.PartiesToTransactionAreRelated is not None: + showIndent(outfile, level) + outfile.write('PartiesToTransactionAreRelated=%s,\n' % self.PartiesToTransactionAreRelated) + if self.CommercialInvoice is not None: + showIndent(outfile, level) + outfile.write('CommercialInvoice=model_.CommercialInvoice(\n') + self.CommercialInvoice.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('Commodities=[\n') + level += 1 + for Commodities_ in self.Commodities: + showIndent(outfile, level) + outfile.write('model_.Commodity(\n') + Commodities_.exportLiteral(outfile, level, name_='Commodity') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.ExportDetail is not None: + showIndent(outfile, level) + outfile.write('ExportDetail=model_.ExportDetail(\n') + self.ExportDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('RegulatoryControls=[\n') + level += 1 + for RegulatoryControls_ in self.RegulatoryControls: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(RegulatoryControls_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Broker': + obj_ = Party.factory() + obj_.build(child_) + self.set_Broker(obj_) + elif nodeName_ == 'ClearanceBrokerage': + ClearanceBrokerage_ = child_.text + ClearanceBrokerage_ = self.gds_validate_string(ClearanceBrokerage_, node, 'ClearanceBrokerage') + self.ClearanceBrokerage = ClearanceBrokerage_ + self.validate_ClearanceBrokerageType(self.ClearanceBrokerage) # validate type ClearanceBrokerageType + elif nodeName_ == 'ImporterOfRecord': + obj_ = Party.factory() + obj_.build(child_) + self.set_ImporterOfRecord(obj_) + elif nodeName_ == 'RecipientCustomsId': + obj_ = RecipientCustomsId.factory() + obj_.build(child_) + self.set_RecipientCustomsId(obj_) + elif nodeName_ == 'DutiesPayment': + obj_ = Payment.factory() + obj_.build(child_) + self.set_DutiesPayment(obj_) + elif nodeName_ == 'DocumentContent': + DocumentContent_ = child_.text + DocumentContent_ = self.gds_validate_string(DocumentContent_, node, 'DocumentContent') + self.DocumentContent = DocumentContent_ + self.validate_InternationalDocumentContentType(self.DocumentContent) # validate type InternationalDocumentContentType + elif nodeName_ == 'CustomsValue': + obj_ = Money.factory() + obj_.build(child_) + self.set_CustomsValue(obj_) + elif nodeName_ == 'FreightOnValue': + FreightOnValue_ = child_.text + FreightOnValue_ = self.gds_validate_string(FreightOnValue_, node, 'FreightOnValue') + self.FreightOnValue = FreightOnValue_ + self.validate_FreightOnValueType(self.FreightOnValue) # validate type FreightOnValueType + elif nodeName_ == 'InsuranceCharges': + obj_ = Money.factory() + obj_.build(child_) + self.set_InsuranceCharges(obj_) + elif nodeName_ == 'PartiesToTransactionAreRelated': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'PartiesToTransactionAreRelated') + self.PartiesToTransactionAreRelated = ival_ + elif nodeName_ == 'CommercialInvoice': + obj_ = CommercialInvoice.factory() + obj_.build(child_) + self.set_CommercialInvoice(obj_) + elif nodeName_ == 'Commodities': + obj_ = Commodity.factory() + obj_.build(child_) + self.Commodities.append(obj_) + elif nodeName_ == 'ExportDetail': + obj_ = ExportDetail.factory() + obj_.build(child_) + self.set_ExportDetail(obj_) + elif nodeName_ == 'RegulatoryControls': + RegulatoryControls_ = child_.text + RegulatoryControls_ = self.gds_validate_string(RegulatoryControls_, node, 'RegulatoryControls') + self.RegulatoryControls.append(RegulatoryControls_) + self.validate_RegulatoryControlType(self.RegulatoryControls) # validate type RegulatoryControlType +# end class CustomsClearanceDetail + + +class DangerousGoodsDetail(GeneratedsSuper): + """The descriptive data required for a FedEx shipment containing + dangerous goods (hazardous materials).""" + subclass = None + superclass = None + def __init__(self, Accessibility=None, CargoAircraftOnly=None, Options=None, HazardousCommodities=None, Packaging=None, EmergencyContactNumber=None, Offeror=None): + self.Accessibility = Accessibility + self.CargoAircraftOnly = CargoAircraftOnly + if Options is None: + self.Options = [] + else: + self.Options = Options + if HazardousCommodities is None: + self.HazardousCommodities = [] + else: + self.HazardousCommodities = HazardousCommodities + self.Packaging = Packaging + self.EmergencyContactNumber = EmergencyContactNumber + self.Offeror = Offeror + def factory(*args_, **kwargs_): + if DangerousGoodsDetail.subclass: + return DangerousGoodsDetail.subclass(*args_, **kwargs_) + else: + return DangerousGoodsDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Accessibility(self): return self.Accessibility + def set_Accessibility(self, Accessibility): self.Accessibility = Accessibility + def validate_DangerousGoodsAccessibilityType(self, value): + # Validate type DangerousGoodsAccessibilityType, a restriction on xs:string. + pass + def get_CargoAircraftOnly(self): return self.CargoAircraftOnly + def set_CargoAircraftOnly(self, CargoAircraftOnly): self.CargoAircraftOnly = CargoAircraftOnly + def get_Options(self): return self.Options + def set_Options(self, Options): self.Options = Options + def add_Options(self, value): self.Options.append(value) + def insert_Options(self, index, value): self.Options[index] = value + def validate_HazardousCommodityOptionType(self, value): + # Validate type HazardousCommodityOptionType, a restriction on xs:string. + pass + def get_HazardousCommodities(self): return self.HazardousCommodities + def set_HazardousCommodities(self, HazardousCommodities): self.HazardousCommodities = HazardousCommodities + def add_HazardousCommodities(self, value): self.HazardousCommodities.append(value) + def insert_HazardousCommodities(self, index, value): self.HazardousCommodities[index] = value + def get_Packaging(self): return self.Packaging + def set_Packaging(self, Packaging): self.Packaging = Packaging + def get_EmergencyContactNumber(self): return self.EmergencyContactNumber + def set_EmergencyContactNumber(self, EmergencyContactNumber): self.EmergencyContactNumber = EmergencyContactNumber + def get_Offeror(self): return self.Offeror + def set_Offeror(self, Offeror): self.Offeror = Offeror + def export(self, outfile, level, namespace_='ns:', name_='DangerousGoodsDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='DangerousGoodsDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='DangerousGoodsDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='DangerousGoodsDetail', fromsubclass_=False): + if self.Accessibility is not None: + showIndent(outfile, level) + outfile.write('<%sAccessibility>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Accessibility).encode(ExternalEncoding), input_name='Accessibility'), namespace_)) + if self.CargoAircraftOnly is not None: + showIndent(outfile, level) + outfile.write('<%sCargoAircraftOnly>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.CargoAircraftOnly)), input_name='CargoAircraftOnly'), namespace_)) + for Options_ in self.Options: + showIndent(outfile, level) + outfile.write('<%sOptions>%s\n' % (namespace_, self.gds_format_string(quote_xml(Options_).encode(ExternalEncoding), input_name='Options'), namespace_)) + for HazardousCommodities_ in self.HazardousCommodities: + HazardousCommodities_.export(outfile, level, namespace_, name_='HazardousCommodities') + if self.Packaging: + self.Packaging.export(outfile, level, namespace_, name_='Packaging') + if self.EmergencyContactNumber is not None: + showIndent(outfile, level) + outfile.write('<%sEmergencyContactNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.EmergencyContactNumber).encode(ExternalEncoding), input_name='EmergencyContactNumber'), namespace_)) + if self.Offeror is not None: + showIndent(outfile, level) + outfile.write('<%sOfferor>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Offeror).encode(ExternalEncoding), input_name='Offeror'), namespace_)) + def hasContent_(self): + if ( + self.Accessibility is not None or + self.CargoAircraftOnly is not None or + self.Options or + self.HazardousCommodities or + self.Packaging is not None or + self.EmergencyContactNumber is not None or + self.Offeror is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='DangerousGoodsDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Accessibility is not None: + showIndent(outfile, level) + outfile.write('Accessibility=%s,\n' % quote_python(self.Accessibility).encode(ExternalEncoding)) + if self.CargoAircraftOnly is not None: + showIndent(outfile, level) + outfile.write('CargoAircraftOnly=%s,\n' % self.CargoAircraftOnly) + showIndent(outfile, level) + outfile.write('Options=[\n') + level += 1 + for Options_ in self.Options: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(Options_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('HazardousCommodities=[\n') + level += 1 + for HazardousCommodities_ in self.HazardousCommodities: + showIndent(outfile, level) + outfile.write('model_.HazardousCommodityContent(\n') + HazardousCommodities_.exportLiteral(outfile, level, name_='HazardousCommodityContent') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.Packaging is not None: + showIndent(outfile, level) + outfile.write('Packaging=model_.HazardousCommodityPackagingDetail(\n') + self.Packaging.exportLiteral(outfile, level, name_='Packaging') + showIndent(outfile, level) + outfile.write('),\n') + if self.EmergencyContactNumber is not None: + showIndent(outfile, level) + outfile.write('EmergencyContactNumber=%s,\n' % quote_python(self.EmergencyContactNumber).encode(ExternalEncoding)) + if self.Offeror is not None: + showIndent(outfile, level) + outfile.write('Offeror=%s,\n' % quote_python(self.Offeror).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Accessibility': + Accessibility_ = child_.text + Accessibility_ = self.gds_validate_string(Accessibility_, node, 'Accessibility') + self.Accessibility = Accessibility_ + self.validate_DangerousGoodsAccessibilityType(self.Accessibility) # validate type DangerousGoodsAccessibilityType + elif nodeName_ == 'CargoAircraftOnly': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'CargoAircraftOnly') + self.CargoAircraftOnly = ival_ + elif nodeName_ == 'Options': + Options_ = child_.text + Options_ = self.gds_validate_string(Options_, node, 'Options') + self.Options.append(Options_) + self.validate_HazardousCommodityOptionType(self.Options) # validate type HazardousCommodityOptionType + elif nodeName_ == 'HazardousCommodities': + obj_ = HazardousCommodityContent.factory() + obj_.build(child_) + self.HazardousCommodities.append(obj_) + elif nodeName_ == 'Packaging': + obj_ = HazardousCommodityPackagingDetail.factory() + obj_.build(child_) + self.set_Packaging(obj_) + elif nodeName_ == 'EmergencyContactNumber': + EmergencyContactNumber_ = child_.text + EmergencyContactNumber_ = self.gds_validate_string(EmergencyContactNumber_, node, 'EmergencyContactNumber') + self.EmergencyContactNumber = EmergencyContactNumber_ + elif nodeName_ == 'Offeror': + Offeror_ = child_.text + Offeror_ = self.gds_validate_string(Offeror_, node, 'Offeror') + self.Offeror = Offeror_ +# end class DangerousGoodsDetail + + +class DateRange(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Begins=None, Ends=None): + self.Begins = Begins + self.Ends = Ends + def factory(*args_, **kwargs_): + if DateRange.subclass: + return DateRange.subclass(*args_, **kwargs_) + else: + return DateRange(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Begins(self): return self.Begins + def set_Begins(self, Begins): self.Begins = Begins + def get_Ends(self): return self.Ends + def set_Ends(self, Ends): self.Ends = Ends + def export(self, outfile, level, namespace_='ns:', name_='DateRange', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='DateRange') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='DateRange'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='DateRange', fromsubclass_=False): + if self.Begins is not None: + showIndent(outfile, level) + outfile.write('<%sBegins>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Begins).encode(ExternalEncoding), input_name='Begins'), namespace_)) + if self.Ends is not None: + showIndent(outfile, level) + outfile.write('<%sEnds>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Ends).encode(ExternalEncoding), input_name='Ends'), namespace_)) + def hasContent_(self): + if ( + self.Begins is not None or + self.Ends is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='DateRange'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Begins is not None: + showIndent(outfile, level) + outfile.write('Begins=%s,\n' % quote_python(self.Begins).encode(ExternalEncoding)) + if self.Ends is not None: + showIndent(outfile, level) + outfile.write('Ends=%s,\n' % quote_python(self.Ends).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Begins': + Begins_ = child_.text + Begins_ = self.gds_validate_string(Begins_, node, 'Begins') + self.Begins = Begins_ + elif nodeName_ == 'Ends': + Ends_ = child_.text + Ends_ = self.gds_validate_string(Ends_, node, 'Ends') + self.Ends = Ends_ +# end class DateRange + + +class DelayDetail(GeneratedsSuper): + """Information about why a shipment delivery is delayed and at what + level( country/service etc.).""" + subclass = None + superclass = None + def __init__(self, Date=None, DayOfWeek=None, Level=None, Point=None, Type=None, Description=None): + self.Date = Date + self.DayOfWeek = DayOfWeek + self.Level = Level + self.Point = Point + self.Type = Type + self.Description = Description + def factory(*args_, **kwargs_): + if DelayDetail.subclass: + return DelayDetail.subclass(*args_, **kwargs_) + else: + return DelayDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Date(self): return self.Date + def set_Date(self, Date): self.Date = Date + def get_DayOfWeek(self): return self.DayOfWeek + def set_DayOfWeek(self, DayOfWeek): self.DayOfWeek = DayOfWeek + def validate_DayOfWeekType(self, value): + # Validate type DayOfWeekType, a restriction on xs:string. + pass + def get_Level(self): return self.Level + def set_Level(self, Level): self.Level = Level + def validate_DelayLevelType(self, value): + # Validate type DelayLevelType, a restriction on xs:string. + pass + def get_Point(self): return self.Point + def set_Point(self, Point): self.Point = Point + def validate_DelayPointType(self, value): + # Validate type DelayPointType, a restriction on xs:string. + pass + def get_Type(self): return self.Type + def set_Type(self, Type): self.Type = Type + def validate_CommitmentDelayType(self, value): + # Validate type CommitmentDelayType, a restriction on xs:string. + pass + def get_Description(self): return self.Description + def set_Description(self, Description): self.Description = Description + def export(self, outfile, level, namespace_='ns:', name_='DelayDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='DelayDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='DelayDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='DelayDetail', fromsubclass_=False): + if self.Date is not None: + showIndent(outfile, level) + outfile.write('<%sDate>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Date).encode(ExternalEncoding), input_name='Date'), namespace_)) + if self.DayOfWeek is not None: + showIndent(outfile, level) + outfile.write('<%sDayOfWeek>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DayOfWeek).encode(ExternalEncoding), input_name='DayOfWeek'), namespace_)) + if self.Level is not None: + showIndent(outfile, level) + outfile.write('<%sLevel>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Level).encode(ExternalEncoding), input_name='Level'), namespace_)) + if self.Point is not None: + showIndent(outfile, level) + outfile.write('<%sPoint>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Point).encode(ExternalEncoding), input_name='Point'), namespace_)) + if self.Type is not None: + showIndent(outfile, level) + outfile.write('<%sType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Type).encode(ExternalEncoding), input_name='Type'), namespace_)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('<%sDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Description).encode(ExternalEncoding), input_name='Description'), namespace_)) + def hasContent_(self): + if ( + self.Date is not None or + self.DayOfWeek is not None or + self.Level is not None or + self.Point is not None or + self.Type is not None or + self.Description is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='DelayDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Date is not None: + showIndent(outfile, level) + outfile.write('Date=%s,\n' % quote_python(self.Date).encode(ExternalEncoding)) + if self.DayOfWeek is not None: + showIndent(outfile, level) + outfile.write('DayOfWeek=%s,\n' % quote_python(self.DayOfWeek).encode(ExternalEncoding)) + if self.Level is not None: + showIndent(outfile, level) + outfile.write('Level=%s,\n' % quote_python(self.Level).encode(ExternalEncoding)) + if self.Point is not None: + showIndent(outfile, level) + outfile.write('Point=%s,\n' % quote_python(self.Point).encode(ExternalEncoding)) + if self.Type is not None: + showIndent(outfile, level) + outfile.write('Type=%s,\n' % quote_python(self.Type).encode(ExternalEncoding)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('Description=%s,\n' % quote_python(self.Description).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Date': + Date_ = child_.text + Date_ = self.gds_validate_string(Date_, node, 'Date') + self.Date = Date_ + elif nodeName_ == 'DayOfWeek': + DayOfWeek_ = child_.text + DayOfWeek_ = self.gds_validate_string(DayOfWeek_, node, 'DayOfWeek') + self.DayOfWeek = DayOfWeek_ + self.validate_DayOfWeekType(self.DayOfWeek) # validate type DayOfWeekType + elif nodeName_ == 'Level': + Level_ = child_.text + Level_ = self.gds_validate_string(Level_, node, 'Level') + self.Level = Level_ + self.validate_DelayLevelType(self.Level) # validate type DelayLevelType + elif nodeName_ == 'Point': + Point_ = child_.text + Point_ = self.gds_validate_string(Point_, node, 'Point') + self.Point = Point_ + self.validate_DelayPointType(self.Point) # validate type DelayPointType + elif nodeName_ == 'Type': + Type_ = child_.text + Type_ = self.gds_validate_string(Type_, node, 'Type') + self.Type = Type_ + self.validate_CommitmentDelayType(self.Type) # validate type CommitmentDelayType + elif nodeName_ == 'Description': + Description_ = child_.text + Description_ = self.gds_validate_string(Description_, node, 'Description') + self.Description = Description_ +# end class DelayDetail + + +class DestinationControlDetail(GeneratedsSuper): + """Data required to complete the Destionation Control Statement for US + exports.""" + subclass = None + superclass = None + def __init__(self, StatementTypes=None, DestinationCountries=None, EndUser=None): + if StatementTypes is None: + self.StatementTypes = [] + else: + self.StatementTypes = StatementTypes + self.DestinationCountries = DestinationCountries + self.EndUser = EndUser + def factory(*args_, **kwargs_): + if DestinationControlDetail.subclass: + return DestinationControlDetail.subclass(*args_, **kwargs_) + else: + return DestinationControlDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_StatementTypes(self): return self.StatementTypes + def set_StatementTypes(self, StatementTypes): self.StatementTypes = StatementTypes + def add_StatementTypes(self, value): self.StatementTypes.append(value) + def insert_StatementTypes(self, index, value): self.StatementTypes[index] = value + def validate_DestinationControlStatementType(self, value): + # Validate type DestinationControlStatementType, a restriction on xs:string. + pass + def get_DestinationCountries(self): return self.DestinationCountries + def set_DestinationCountries(self, DestinationCountries): self.DestinationCountries = DestinationCountries + def get_EndUser(self): return self.EndUser + def set_EndUser(self, EndUser): self.EndUser = EndUser + def export(self, outfile, level, namespace_='ns:', name_='DestinationControlDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='DestinationControlDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='DestinationControlDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='DestinationControlDetail', fromsubclass_=False): + for StatementTypes_ in self.StatementTypes: + showIndent(outfile, level) + outfile.write('<%sStatementTypes>%s\n' % (namespace_, self.gds_format_string(quote_xml(StatementTypes_).encode(ExternalEncoding), input_name='StatementTypes'), namespace_)) + if self.DestinationCountries is not None: + showIndent(outfile, level) + outfile.write('<%sDestinationCountries>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DestinationCountries).encode(ExternalEncoding), input_name='DestinationCountries'), namespace_)) + if self.EndUser is not None: + showIndent(outfile, level) + outfile.write('<%sEndUser>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.EndUser).encode(ExternalEncoding), input_name='EndUser'), namespace_)) + def hasContent_(self): + if ( + self.StatementTypes or + self.DestinationCountries is not None or + self.EndUser is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='DestinationControlDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('StatementTypes=[\n') + level += 1 + for StatementTypes_ in self.StatementTypes: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(StatementTypes_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.DestinationCountries is not None: + showIndent(outfile, level) + outfile.write('DestinationCountries=%s,\n' % quote_python(self.DestinationCountries).encode(ExternalEncoding)) + if self.EndUser is not None: + showIndent(outfile, level) + outfile.write('EndUser=%s,\n' % quote_python(self.EndUser).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'StatementTypes': + StatementTypes_ = child_.text + StatementTypes_ = self.gds_validate_string(StatementTypes_, node, 'StatementTypes') + self.StatementTypes.append(StatementTypes_) + self.validate_DestinationControlStatementType(self.StatementTypes) # validate type DestinationControlStatementType + elif nodeName_ == 'DestinationCountries': + DestinationCountries_ = child_.text + DestinationCountries_ = self.gds_validate_string(DestinationCountries_, node, 'DestinationCountries') + self.DestinationCountries = DestinationCountries_ + elif nodeName_ == 'EndUser': + EndUser_ = child_.text + EndUser_ = self.gds_validate_string(EndUser_, node, 'EndUser') + self.EndUser = EndUser_ +# end class DestinationControlDetail + + +class Dimensions(GeneratedsSuper): + """The dimensions of this package and the unit type used for the + measurements.""" + subclass = None + superclass = None + def __init__(self, Length=None, Width=None, Height=None, Units=None): + self.Length = Length + self.Width = Width + self.Height = Height + self.Units = Units + def factory(*args_, **kwargs_): + if Dimensions.subclass: + return Dimensions.subclass(*args_, **kwargs_) + else: + return Dimensions(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Length(self): return self.Length + def set_Length(self, Length): self.Length = Length + def get_Width(self): return self.Width + def set_Width(self, Width): self.Width = Width + def get_Height(self): return self.Height + def set_Height(self, Height): self.Height = Height + def get_Units(self): return self.Units + def set_Units(self, Units): self.Units = Units + def validate_LinearUnits(self, value): + # Validate type LinearUnits, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='Dimensions', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Dimensions') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Dimensions'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Dimensions', fromsubclass_=False): + if self.Length is not None: + showIndent(outfile, level) + outfile.write('<%sLength>%s\n' % (namespace_, self.gds_format_integer(self.Length, input_name='Length'), namespace_)) + if self.Width is not None: + showIndent(outfile, level) + outfile.write('<%sWidth>%s\n' % (namespace_, self.gds_format_integer(self.Width, input_name='Width'), namespace_)) + if self.Height is not None: + showIndent(outfile, level) + outfile.write('<%sHeight>%s\n' % (namespace_, self.gds_format_integer(self.Height, input_name='Height'), namespace_)) + if self.Units is not None: + showIndent(outfile, level) + outfile.write('<%sUnits>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Units).encode(ExternalEncoding), input_name='Units'), namespace_)) + def hasContent_(self): + if ( + self.Length is not None or + self.Width is not None or + self.Height is not None or + self.Units is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Dimensions'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Length is not None: + showIndent(outfile, level) + outfile.write('Length=%d,\n' % self.Length) + if self.Width is not None: + showIndent(outfile, level) + outfile.write('Width=%d,\n' % self.Width) + if self.Height is not None: + showIndent(outfile, level) + outfile.write('Height=%d,\n' % self.Height) + if self.Units is not None: + showIndent(outfile, level) + outfile.write('Units=%s,\n' % quote_python(self.Units).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Length': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'Length') + self.Length = ival_ + elif nodeName_ == 'Width': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'Width') + self.Width = ival_ + elif nodeName_ == 'Height': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'Height') + self.Height = ival_ + elif nodeName_ == 'Units': + Units_ = child_.text + Units_ = self.gds_validate_string(Units_, node, 'Units') + self.Units = Units_ + self.validate_LinearUnits(self.Units) # validate type LinearUnits +# end class Dimensions + + +class Distance(GeneratedsSuper): + """Driving or other transportation distances, distinct from dimension + measurements.""" + subclass = None + superclass = None + def __init__(self, Value=None, Units=None): + self.Value = Value + self.Units = Units + def factory(*args_, **kwargs_): + if Distance.subclass: + return Distance.subclass(*args_, **kwargs_) + else: + return Distance(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Value(self): return self.Value + def set_Value(self, Value): self.Value = Value + def get_Units(self): return self.Units + def set_Units(self, Units): self.Units = Units + def validate_DistanceUnits(self, value): + # Validate type DistanceUnits, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='Distance', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Distance') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Distance'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Distance', fromsubclass_=False): + if self.Value is not None: + showIndent(outfile, level) + outfile.write('<%sValue>%s\n' % (namespace_, self.gds_format_float(self.Value, input_name='Value'), namespace_)) + if self.Units is not None: + showIndent(outfile, level) + outfile.write('<%sUnits>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Units).encode(ExternalEncoding), input_name='Units'), namespace_)) + def hasContent_(self): + if ( + self.Value is not None or + self.Units is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Distance'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Value is not None: + showIndent(outfile, level) + outfile.write('Value=%f,\n' % self.Value) + if self.Units is not None: + showIndent(outfile, level) + outfile.write('Units=%s,\n' % quote_python(self.Units).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Value': + sval_ = child_.text + try: + fval_ = float(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires float or double: %s' % exp) + fval_ = self.gds_validate_float(fval_, node, 'Value') + self.Value = fval_ + elif nodeName_ == 'Units': + Units_ = child_.text + Units_ = self.gds_validate_string(Units_, node, 'Units') + self.Units = Units_ + self.validate_DistanceUnits(self.Units) # validate type DistanceUnits +# end class Distance + + +class DocTabContent(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, DocTabContentType=None, Zone001=None, Barcoded=None): + self.DocTabContentType = DocTabContentType + self.Zone001 = Zone001 + self.Barcoded = Barcoded + def factory(*args_, **kwargs_): + if DocTabContent.subclass: + return DocTabContent.subclass(*args_, **kwargs_) + else: + return DocTabContent(*args_, **kwargs_) + factory = staticmethod(factory) + def get_DocTabContentType(self): return self.DocTabContentType + def set_DocTabContentType(self, DocTabContentType): self.DocTabContentType = DocTabContentType + def validate_DocTabContentType(self, value): + # Validate type DocTabContentType, a restriction on xs:string. + pass + def get_Zone001(self): return self.Zone001 + def set_Zone001(self, Zone001): self.Zone001 = Zone001 + def get_Barcoded(self): return self.Barcoded + def set_Barcoded(self, Barcoded): self.Barcoded = Barcoded + def export(self, outfile, level, namespace_='ns:', name_='DocTabContent', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='DocTabContent') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='DocTabContent'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='DocTabContent', fromsubclass_=False): + if self.DocTabContentType is not None: + showIndent(outfile, level) + outfile.write('<%sDocTabContentType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DocTabContentType).encode(ExternalEncoding), input_name='DocTabContentType'), namespace_)) + if self.Zone001: + self.Zone001.export(outfile, level, namespace_, name_='Zone001') + if self.Barcoded: + self.Barcoded.export(outfile, level, namespace_, name_='Barcoded') + def hasContent_(self): + if ( + self.DocTabContentType is not None or + self.Zone001 is not None or + self.Barcoded is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='DocTabContent'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.DocTabContentType is not None: + showIndent(outfile, level) + outfile.write('DocTabContentType=%s,\n' % quote_python(self.DocTabContentType).encode(ExternalEncoding)) + if self.Zone001 is not None: + showIndent(outfile, level) + outfile.write('Zone001=model_.DocTabContentZone001(\n') + self.Zone001.exportLiteral(outfile, level, name_='Zone001') + showIndent(outfile, level) + outfile.write('),\n') + if self.Barcoded is not None: + showIndent(outfile, level) + outfile.write('Barcoded=model_.DocTabContentBarcoded(\n') + self.Barcoded.exportLiteral(outfile, level, name_='Barcoded') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'DocTabContentType': + DocTabContentType_ = child_.text + DocTabContentType_ = self.gds_validate_string(DocTabContentType_, node, 'DocTabContentType') + self.DocTabContentType = DocTabContentType_ + self.validate_DocTabContentType(self.DocTabContentType) # validate type DocTabContentType + elif nodeName_ == 'Zone001': + obj_ = DocTabContentZone001.factory() + obj_.build(child_) + self.set_Zone001(obj_) + elif nodeName_ == 'Barcoded': + obj_ = DocTabContentBarcoded.factory() + obj_.build(child_) + self.set_Barcoded(obj_) +# end class DocTabContent + + +class DocTabContentBarcoded(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Symbology=None, Specification=None): + self.Symbology = Symbology + self.Specification = Specification + def factory(*args_, **kwargs_): + if DocTabContentBarcoded.subclass: + return DocTabContentBarcoded.subclass(*args_, **kwargs_) + else: + return DocTabContentBarcoded(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Symbology(self): return self.Symbology + def set_Symbology(self, Symbology): self.Symbology = Symbology + def validate_BarcodeSymbologyType(self, value): + # Validate type BarcodeSymbologyType, a restriction on xs:string. + pass + def get_Specification(self): return self.Specification + def set_Specification(self, Specification): self.Specification = Specification + def export(self, outfile, level, namespace_='ns:', name_='DocTabContentBarcoded', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='DocTabContentBarcoded') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='DocTabContentBarcoded'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='DocTabContentBarcoded', fromsubclass_=False): + if self.Symbology is not None: + showIndent(outfile, level) + outfile.write('<%sSymbology>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Symbology).encode(ExternalEncoding), input_name='Symbology'), namespace_)) + if self.Specification: + self.Specification.export(outfile, level, namespace_, name_='Specification') + def hasContent_(self): + if ( + self.Symbology is not None or + self.Specification is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='DocTabContentBarcoded'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Symbology is not None: + showIndent(outfile, level) + outfile.write('Symbology=%s,\n' % quote_python(self.Symbology).encode(ExternalEncoding)) + if self.Specification is not None: + showIndent(outfile, level) + outfile.write('Specification=model_.DocTabZoneSpecification(\n') + self.Specification.exportLiteral(outfile, level, name_='Specification') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Symbology': + Symbology_ = child_.text + Symbology_ = self.gds_validate_string(Symbology_, node, 'Symbology') + self.Symbology = Symbology_ + self.validate_BarcodeSymbologyType(self.Symbology) # validate type BarcodeSymbologyType + elif nodeName_ == 'Specification': + obj_ = DocTabZoneSpecification.factory() + obj_.build(child_) + self.set_Specification(obj_) +# end class DocTabContentBarcoded + + +class DocTabContentZone001(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, DocTabZoneSpecifications=None): + if DocTabZoneSpecifications is None: + self.DocTabZoneSpecifications = [] + else: + self.DocTabZoneSpecifications = DocTabZoneSpecifications + def factory(*args_, **kwargs_): + if DocTabContentZone001.subclass: + return DocTabContentZone001.subclass(*args_, **kwargs_) + else: + return DocTabContentZone001(*args_, **kwargs_) + factory = staticmethod(factory) + def get_DocTabZoneSpecifications(self): return self.DocTabZoneSpecifications + def set_DocTabZoneSpecifications(self, DocTabZoneSpecifications): self.DocTabZoneSpecifications = DocTabZoneSpecifications + def add_DocTabZoneSpecifications(self, value): self.DocTabZoneSpecifications.append(value) + def insert_DocTabZoneSpecifications(self, index, value): self.DocTabZoneSpecifications[index] = value + def export(self, outfile, level, namespace_='ns:', name_='DocTabContentZone001', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='DocTabContentZone001') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='DocTabContentZone001'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='DocTabContentZone001', fromsubclass_=False): + for DocTabZoneSpecifications_ in self.DocTabZoneSpecifications: + DocTabZoneSpecifications_.export(outfile, level, namespace_, name_='DocTabZoneSpecifications') + def hasContent_(self): + if ( + self.DocTabZoneSpecifications + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='DocTabContentZone001'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('DocTabZoneSpecifications=[\n') + level += 1 + for DocTabZoneSpecifications_ in self.DocTabZoneSpecifications: + showIndent(outfile, level) + outfile.write('model_.DocTabZoneSpecification(\n') + DocTabZoneSpecifications_.exportLiteral(outfile, level, name_='DocTabZoneSpecification') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'DocTabZoneSpecifications': + obj_ = DocTabZoneSpecification.factory() + obj_.build(child_) + self.DocTabZoneSpecifications.append(obj_) +# end class DocTabContentZone001 + + +class DocTabZoneSpecification(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, ZoneNumber=None, Header=None, DataField=None, LiteralValue=None, Justification=None): + self.ZoneNumber = ZoneNumber + self.Header = Header + self.DataField = DataField + self.LiteralValue = LiteralValue + self.Justification = Justification + def factory(*args_, **kwargs_): + if DocTabZoneSpecification.subclass: + return DocTabZoneSpecification.subclass(*args_, **kwargs_) + else: + return DocTabZoneSpecification(*args_, **kwargs_) + factory = staticmethod(factory) + def get_ZoneNumber(self): return self.ZoneNumber + def set_ZoneNumber(self, ZoneNumber): self.ZoneNumber = ZoneNumber + def get_Header(self): return self.Header + def set_Header(self, Header): self.Header = Header + def get_DataField(self): return self.DataField + def set_DataField(self, DataField): self.DataField = DataField + def get_LiteralValue(self): return self.LiteralValue + def set_LiteralValue(self, LiteralValue): self.LiteralValue = LiteralValue + def get_Justification(self): return self.Justification + def set_Justification(self, Justification): self.Justification = Justification + def validate_DocTabZoneJustificationType(self, value): + # Validate type DocTabZoneJustificationType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='DocTabZoneSpecification', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='DocTabZoneSpecification') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='DocTabZoneSpecification'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='DocTabZoneSpecification', fromsubclass_=False): + if self.ZoneNumber is not None: + showIndent(outfile, level) + outfile.write('<%sZoneNumber>%s\n' % (namespace_, self.gds_format_integer(self.ZoneNumber, input_name='ZoneNumber'), namespace_)) + if self.Header is not None: + showIndent(outfile, level) + outfile.write('<%sHeader>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Header).encode(ExternalEncoding), input_name='Header'), namespace_)) + if self.DataField is not None: + showIndent(outfile, level) + outfile.write('<%sDataField>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DataField).encode(ExternalEncoding), input_name='DataField'), namespace_)) + if self.LiteralValue is not None: + showIndent(outfile, level) + outfile.write('<%sLiteralValue>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LiteralValue).encode(ExternalEncoding), input_name='LiteralValue'), namespace_)) + if self.Justification is not None: + showIndent(outfile, level) + outfile.write('<%sJustification>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Justification).encode(ExternalEncoding), input_name='Justification'), namespace_)) + def hasContent_(self): + if ( + self.ZoneNumber is not None or + self.Header is not None or + self.DataField is not None or + self.LiteralValue is not None or + self.Justification is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='DocTabZoneSpecification'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.ZoneNumber is not None: + showIndent(outfile, level) + outfile.write('ZoneNumber=%d,\n' % self.ZoneNumber) + if self.Header is not None: + showIndent(outfile, level) + outfile.write('Header=%s,\n' % quote_python(self.Header).encode(ExternalEncoding)) + if self.DataField is not None: + showIndent(outfile, level) + outfile.write('DataField=%s,\n' % quote_python(self.DataField).encode(ExternalEncoding)) + if self.LiteralValue is not None: + showIndent(outfile, level) + outfile.write('LiteralValue=%s,\n' % quote_python(self.LiteralValue).encode(ExternalEncoding)) + if self.Justification is not None: + showIndent(outfile, level) + outfile.write('Justification=%s,\n' % quote_python(self.Justification).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'ZoneNumber': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ <= 0: + raise_parse_error(child_, 'requires positiveInteger') + ival_ = self.gds_validate_integer(ival_, node, 'ZoneNumber') + self.ZoneNumber = ival_ + elif nodeName_ == 'Header': + Header_ = child_.text + Header_ = self.gds_validate_string(Header_, node, 'Header') + self.Header = Header_ + elif nodeName_ == 'DataField': + DataField_ = child_.text + DataField_ = self.gds_validate_string(DataField_, node, 'DataField') + self.DataField = DataField_ + elif nodeName_ == 'LiteralValue': + LiteralValue_ = child_.text + LiteralValue_ = self.gds_validate_string(LiteralValue_, node, 'LiteralValue') + self.LiteralValue = LiteralValue_ + elif nodeName_ == 'Justification': + Justification_ = child_.text + Justification_ = self.gds_validate_string(Justification_, node, 'Justification') + self.Justification = Justification_ + self.validate_DocTabZoneJustificationType(self.Justification) # validate type DocTabZoneJustificationType +# end class DocTabZoneSpecification + + +class EMailLabelDetail(GeneratedsSuper): + """Specific information about the delivery of the email and options for + the shipment.""" + subclass = None + superclass = None + def __init__(self, NotificationEMailAddress=None, NotificationMessage=None): + self.NotificationEMailAddress = NotificationEMailAddress + self.NotificationMessage = NotificationMessage + def factory(*args_, **kwargs_): + if EMailLabelDetail.subclass: + return EMailLabelDetail.subclass(*args_, **kwargs_) + else: + return EMailLabelDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_NotificationEMailAddress(self): return self.NotificationEMailAddress + def set_NotificationEMailAddress(self, NotificationEMailAddress): self.NotificationEMailAddress = NotificationEMailAddress + def get_NotificationMessage(self): return self.NotificationMessage + def set_NotificationMessage(self, NotificationMessage): self.NotificationMessage = NotificationMessage + def export(self, outfile, level, namespace_='ns:', name_='EMailLabelDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='EMailLabelDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='EMailLabelDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='EMailLabelDetail', fromsubclass_=False): + if self.NotificationEMailAddress is not None: + showIndent(outfile, level) + outfile.write('<%sNotificationEMailAddress>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.NotificationEMailAddress).encode(ExternalEncoding), input_name='NotificationEMailAddress'), namespace_)) + if self.NotificationMessage is not None: + showIndent(outfile, level) + outfile.write('<%sNotificationMessage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.NotificationMessage).encode(ExternalEncoding), input_name='NotificationMessage'), namespace_)) + def hasContent_(self): + if ( + self.NotificationEMailAddress is not None or + self.NotificationMessage is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='EMailLabelDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.NotificationEMailAddress is not None: + showIndent(outfile, level) + outfile.write('NotificationEMailAddress=%s,\n' % quote_python(self.NotificationEMailAddress).encode(ExternalEncoding)) + if self.NotificationMessage is not None: + showIndent(outfile, level) + outfile.write('NotificationMessage=%s,\n' % quote_python(self.NotificationMessage).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'NotificationEMailAddress': + NotificationEMailAddress_ = child_.text + NotificationEMailAddress_ = self.gds_validate_string(NotificationEMailAddress_, node, 'NotificationEMailAddress') + self.NotificationEMailAddress = NotificationEMailAddress_ + elif nodeName_ == 'NotificationMessage': + NotificationMessage_ = child_.text + NotificationMessage_ = self.gds_validate_string(NotificationMessage_, node, 'NotificationMessage') + self.NotificationMessage = NotificationMessage_ +# end class EMailLabelDetail + + +class EMailNotificationDetail(GeneratedsSuper): + """Information describing email notifications that will be sent in + relation to events that occur during package movement""" + subclass = None + superclass = None + def __init__(self, PersonalMessage=None, Recipients=None): + self.PersonalMessage = PersonalMessage + if Recipients is None: + self.Recipients = [] + else: + self.Recipients = Recipients + def factory(*args_, **kwargs_): + if EMailNotificationDetail.subclass: + return EMailNotificationDetail.subclass(*args_, **kwargs_) + else: + return EMailNotificationDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_PersonalMessage(self): return self.PersonalMessage + def set_PersonalMessage(self, PersonalMessage): self.PersonalMessage = PersonalMessage + def get_Recipients(self): return self.Recipients + def set_Recipients(self, Recipients): self.Recipients = Recipients + def add_Recipients(self, value): self.Recipients.append(value) + def insert_Recipients(self, index, value): self.Recipients[index] = value + def export(self, outfile, level, namespace_='ns:', name_='EMailNotificationDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='EMailNotificationDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='EMailNotificationDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='EMailNotificationDetail', fromsubclass_=False): + if self.PersonalMessage is not None: + showIndent(outfile, level) + outfile.write('<%sPersonalMessage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PersonalMessage).encode(ExternalEncoding), input_name='PersonalMessage'), namespace_)) + for Recipients_ in self.Recipients: + Recipients_.export(outfile, level, namespace_, name_='Recipients') + def hasContent_(self): + if ( + self.PersonalMessage is not None or + self.Recipients + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='EMailNotificationDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.PersonalMessage is not None: + showIndent(outfile, level) + outfile.write('PersonalMessage=%s,\n' % quote_python(self.PersonalMessage).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Recipients=[\n') + level += 1 + for Recipients_ in self.Recipients: + showIndent(outfile, level) + outfile.write('model_.EMailNotificationRecipient(\n') + Recipients_.exportLiteral(outfile, level, name_='EMailNotificationRecipient') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'PersonalMessage': + PersonalMessage_ = child_.text + PersonalMessage_ = self.gds_validate_string(PersonalMessage_, node, 'PersonalMessage') + self.PersonalMessage = PersonalMessage_ + elif nodeName_ == 'Recipients': + obj_ = EMailNotificationRecipient.factory() + obj_.build(child_) + self.Recipients.append(obj_) +# end class EMailNotificationDetail + + +class EMailNotificationRecipient(GeneratedsSuper): + """The descriptive data for a FedEx email notification recipient.""" + subclass = None + superclass = None + def __init__(self, EMailNotificationRecipientType=None, EMailAddress=None, NotificationEventsRequested=None, Format=None, Localization=None): + self.EMailNotificationRecipientType = EMailNotificationRecipientType + self.EMailAddress = EMailAddress + if NotificationEventsRequested is None: + self.NotificationEventsRequested = [] + else: + self.NotificationEventsRequested = NotificationEventsRequested + self.Format = Format + self.Localization = Localization + def factory(*args_, **kwargs_): + if EMailNotificationRecipient.subclass: + return EMailNotificationRecipient.subclass(*args_, **kwargs_) + else: + return EMailNotificationRecipient(*args_, **kwargs_) + factory = staticmethod(factory) + def get_EMailNotificationRecipientType(self): return self.EMailNotificationRecipientType + def set_EMailNotificationRecipientType(self, EMailNotificationRecipientType): self.EMailNotificationRecipientType = EMailNotificationRecipientType + def validate_EMailNotificationRecipientType(self, value): + # Validate type EMailNotificationRecipientType, a restriction on xs:string. + pass + def get_EMailAddress(self): return self.EMailAddress + def set_EMailAddress(self, EMailAddress): self.EMailAddress = EMailAddress + def get_NotificationEventsRequested(self): return self.NotificationEventsRequested + def set_NotificationEventsRequested(self, NotificationEventsRequested): self.NotificationEventsRequested = NotificationEventsRequested + def add_NotificationEventsRequested(self, value): self.NotificationEventsRequested.append(value) + def insert_NotificationEventsRequested(self, index, value): self.NotificationEventsRequested[index] = value + def validate_EMailNotificationEventType(self, value): + # Validate type EMailNotificationEventType, a restriction on xs:string. + pass + def get_Format(self): return self.Format + def set_Format(self, Format): self.Format = Format + def validate_EMailNotificationFormatType(self, value): + # Validate type EMailNotificationFormatType, a restriction on xs:string. + pass + def get_Localization(self): return self.Localization + def set_Localization(self, Localization): self.Localization = Localization + def export(self, outfile, level, namespace_='ns:', name_='EMailNotificationRecipient', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='EMailNotificationRecipient') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='EMailNotificationRecipient'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='EMailNotificationRecipient', fromsubclass_=False): + if self.EMailNotificationRecipientType is not None: + showIndent(outfile, level) + outfile.write('<%sEMailNotificationRecipientType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.EMailNotificationRecipientType).encode(ExternalEncoding), input_name='EMailNotificationRecipientType'), namespace_)) + if self.EMailAddress is not None: + showIndent(outfile, level) + outfile.write('<%sEMailAddress>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.EMailAddress).encode(ExternalEncoding), input_name='EMailAddress'), namespace_)) + for NotificationEventsRequested_ in self.NotificationEventsRequested: + showIndent(outfile, level) + outfile.write('<%sNotificationEventsRequested>%s\n' % (namespace_, self.gds_format_string(quote_xml(NotificationEventsRequested_).encode(ExternalEncoding), input_name='NotificationEventsRequested'), namespace_)) + if self.Format is not None: + showIndent(outfile, level) + outfile.write('<%sFormat>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Format).encode(ExternalEncoding), input_name='Format'), namespace_)) + if self.Localization: + self.Localization.export(outfile, level, namespace_, name_='Localization') + def hasContent_(self): + if ( + self.EMailNotificationRecipientType is not None or + self.EMailAddress is not None or + self.NotificationEventsRequested or + self.Format is not None or + self.Localization is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='EMailNotificationRecipient'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.EMailNotificationRecipientType is not None: + showIndent(outfile, level) + outfile.write('EMailNotificationRecipientType=%s,\n' % quote_python(self.EMailNotificationRecipientType).encode(ExternalEncoding)) + if self.EMailAddress is not None: + showIndent(outfile, level) + outfile.write('EMailAddress=%s,\n' % quote_python(self.EMailAddress).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('NotificationEventsRequested=[\n') + level += 1 + for NotificationEventsRequested_ in self.NotificationEventsRequested: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(NotificationEventsRequested_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.Format is not None: + showIndent(outfile, level) + outfile.write('Format=%s,\n' % quote_python(self.Format).encode(ExternalEncoding)) + if self.Localization is not None: + showIndent(outfile, level) + outfile.write('Localization=model_.Localization(\n') + self.Localization.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'EMailNotificationRecipientType': + EMailNotificationRecipientType_ = child_.text + EMailNotificationRecipientType_ = self.gds_validate_string(EMailNotificationRecipientType_, node, 'EMailNotificationRecipientType') + self.EMailNotificationRecipientType = EMailNotificationRecipientType_ + self.validate_EMailNotificationRecipientType(self.EMailNotificationRecipientType) # validate type EMailNotificationRecipientType + elif nodeName_ == 'EMailAddress': + EMailAddress_ = child_.text + EMailAddress_ = self.gds_validate_string(EMailAddress_, node, 'EMailAddress') + self.EMailAddress = EMailAddress_ + elif nodeName_ == 'NotificationEventsRequested': + NotificationEventsRequested_ = child_.text + NotificationEventsRequested_ = self.gds_validate_string(NotificationEventsRequested_, node, 'NotificationEventsRequested') + self.NotificationEventsRequested.append(NotificationEventsRequested_) + self.validate_EMailNotificationEventType(self.NotificationEventsRequested) # validate type EMailNotificationEventType + elif nodeName_ == 'Format': + Format_ = child_.text + Format_ = self.gds_validate_string(Format_, node, 'Format') + self.Format = Format_ + self.validate_EMailNotificationFormatType(self.Format) # validate type EMailNotificationFormatType + elif nodeName_ == 'Localization': + obj_ = Localization.factory() + obj_.build(child_) + self.set_Localization(obj_) +# end class EMailNotificationRecipient + + +class EdtCommodityTax(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, HarmonizedCode=None, Taxes=None): + self.HarmonizedCode = HarmonizedCode + if Taxes is None: + self.Taxes = [] + else: + self.Taxes = Taxes + def factory(*args_, **kwargs_): + if EdtCommodityTax.subclass: + return EdtCommodityTax.subclass(*args_, **kwargs_) + else: + return EdtCommodityTax(*args_, **kwargs_) + factory = staticmethod(factory) + def get_HarmonizedCode(self): return self.HarmonizedCode + def set_HarmonizedCode(self, HarmonizedCode): self.HarmonizedCode = HarmonizedCode + def get_Taxes(self): return self.Taxes + def set_Taxes(self, Taxes): self.Taxes = Taxes + def add_Taxes(self, value): self.Taxes.append(value) + def insert_Taxes(self, index, value): self.Taxes[index] = value + def export(self, outfile, level, namespace_='ns:', name_='EdtCommodityTax', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='EdtCommodityTax') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='EdtCommodityTax'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='EdtCommodityTax', fromsubclass_=False): + if self.HarmonizedCode is not None: + showIndent(outfile, level) + outfile.write('<%sHarmonizedCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HarmonizedCode).encode(ExternalEncoding), input_name='HarmonizedCode'), namespace_)) + for Taxes_ in self.Taxes: + Taxes_.export(outfile, level, namespace_, name_='Taxes') + def hasContent_(self): + if ( + self.HarmonizedCode is not None or + self.Taxes + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='EdtCommodityTax'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.HarmonizedCode is not None: + showIndent(outfile, level) + outfile.write('HarmonizedCode=%s,\n' % quote_python(self.HarmonizedCode).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Taxes=[\n') + level += 1 + for Taxes_ in self.Taxes: + showIndent(outfile, level) + outfile.write('model_.EdtTaxDetail(\n') + Taxes_.exportLiteral(outfile, level, name_='EdtTaxDetail') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'HarmonizedCode': + HarmonizedCode_ = child_.text + HarmonizedCode_ = self.gds_validate_string(HarmonizedCode_, node, 'HarmonizedCode') + self.HarmonizedCode = HarmonizedCode_ + elif nodeName_ == 'Taxes': + obj_ = EdtTaxDetail.factory() + obj_.build(child_) + self.Taxes.append(obj_) +# end class EdtCommodityTax + + +class EdtExciseCondition(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Category=None, Value=None): + self.Category = Category + self.Value = Value + def factory(*args_, **kwargs_): + if EdtExciseCondition.subclass: + return EdtExciseCondition.subclass(*args_, **kwargs_) + else: + return EdtExciseCondition(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Category(self): return self.Category + def set_Category(self, Category): self.Category = Category + def get_Value(self): return self.Value + def set_Value(self, Value): self.Value = Value + def export(self, outfile, level, namespace_='ns:', name_='EdtExciseCondition', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='EdtExciseCondition') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='EdtExciseCondition'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='EdtExciseCondition', fromsubclass_=False): + if self.Category is not None: + showIndent(outfile, level) + outfile.write('<%sCategory>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Category).encode(ExternalEncoding), input_name='Category'), namespace_)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('<%sValue>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Value).encode(ExternalEncoding), input_name='Value'), namespace_)) + def hasContent_(self): + if ( + self.Category is not None or + self.Value is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='EdtExciseCondition'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Category is not None: + showIndent(outfile, level) + outfile.write('Category=%s,\n' % quote_python(self.Category).encode(ExternalEncoding)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('Value=%s,\n' % quote_python(self.Value).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Category': + Category_ = child_.text + Category_ = self.gds_validate_string(Category_, node, 'Category') + self.Category = Category_ + elif nodeName_ == 'Value': + Value_ = child_.text + Value_ = self.gds_validate_string(Value_, node, 'Value') + self.Value = Value_ +# end class EdtExciseCondition + + +class EdtTaxDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, TaxType=None, EffectiveDate=None, Name=None, TaxableValue=None, Description=None, Formula=None, Amount=None): + self.TaxType = TaxType + self.EffectiveDate = EffectiveDate + self.Name = Name + self.TaxableValue = TaxableValue + self.Description = Description + self.Formula = Formula + self.Amount = Amount + def factory(*args_, **kwargs_): + if EdtTaxDetail.subclass: + return EdtTaxDetail.subclass(*args_, **kwargs_) + else: + return EdtTaxDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_TaxType(self): return self.TaxType + def set_TaxType(self, TaxType): self.TaxType = TaxType + def validate_EdtTaxType(self, value): + # Validate type EdtTaxType, a restriction on xs:string. + pass + def get_EffectiveDate(self): return self.EffectiveDate + def set_EffectiveDate(self, EffectiveDate): self.EffectiveDate = EffectiveDate + def get_Name(self): return self.Name + def set_Name(self, Name): self.Name = Name + def get_TaxableValue(self): return self.TaxableValue + def set_TaxableValue(self, TaxableValue): self.TaxableValue = TaxableValue + def get_Description(self): return self.Description + def set_Description(self, Description): self.Description = Description + def get_Formula(self): return self.Formula + def set_Formula(self, Formula): self.Formula = Formula + def get_Amount(self): return self.Amount + def set_Amount(self, Amount): self.Amount = Amount + def export(self, outfile, level, namespace_='ns:', name_='EdtTaxDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='EdtTaxDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='EdtTaxDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='EdtTaxDetail', fromsubclass_=False): + if self.TaxType is not None: + showIndent(outfile, level) + outfile.write('<%sTaxType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.TaxType).encode(ExternalEncoding), input_name='TaxType'), namespace_)) + if self.EffectiveDate is not None: + showIndent(outfile, level) + outfile.write('<%sEffectiveDate>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.EffectiveDate).encode(ExternalEncoding), input_name='EffectiveDate'), namespace_)) + if self.Name is not None: + showIndent(outfile, level) + outfile.write('<%sName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Name).encode(ExternalEncoding), input_name='Name'), namespace_)) + if self.TaxableValue: + self.TaxableValue.export(outfile, level, namespace_, name_='TaxableValue') + if self.Description is not None: + showIndent(outfile, level) + outfile.write('<%sDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Description).encode(ExternalEncoding), input_name='Description'), namespace_)) + if self.Formula is not None: + showIndent(outfile, level) + outfile.write('<%sFormula>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Formula).encode(ExternalEncoding), input_name='Formula'), namespace_)) + if self.Amount: + self.Amount.export(outfile, level, namespace_, name_='Amount') + def hasContent_(self): + if ( + self.TaxType is not None or + self.EffectiveDate is not None or + self.Name is not None or + self.TaxableValue is not None or + self.Description is not None or + self.Formula is not None or + self.Amount is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='EdtTaxDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.TaxType is not None: + showIndent(outfile, level) + outfile.write('TaxType=%s,\n' % quote_python(self.TaxType).encode(ExternalEncoding)) + if self.EffectiveDate is not None: + showIndent(outfile, level) + outfile.write('EffectiveDate=%s,\n' % quote_python(self.EffectiveDate).encode(ExternalEncoding)) + if self.Name is not None: + showIndent(outfile, level) + outfile.write('Name=%s,\n' % quote_python(self.Name).encode(ExternalEncoding)) + if self.TaxableValue is not None: + showIndent(outfile, level) + outfile.write('TaxableValue=model_.Money(\n') + self.TaxableValue.exportLiteral(outfile, level, name_='TaxableValue') + showIndent(outfile, level) + outfile.write('),\n') + if self.Description is not None: + showIndent(outfile, level) + outfile.write('Description=%s,\n' % quote_python(self.Description).encode(ExternalEncoding)) + if self.Formula is not None: + showIndent(outfile, level) + outfile.write('Formula=%s,\n' % quote_python(self.Formula).encode(ExternalEncoding)) + if self.Amount is not None: + showIndent(outfile, level) + outfile.write('Amount=model_.Money(\n') + self.Amount.exportLiteral(outfile, level, name_='Amount') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'TaxType': + TaxType_ = child_.text + TaxType_ = self.gds_validate_string(TaxType_, node, 'TaxType') + self.TaxType = TaxType_ + self.validate_EdtTaxType(self.TaxType) # validate type EdtTaxType + elif nodeName_ == 'EffectiveDate': + EffectiveDate_ = child_.text + EffectiveDate_ = self.gds_validate_string(EffectiveDate_, node, 'EffectiveDate') + self.EffectiveDate = EffectiveDate_ + elif nodeName_ == 'Name': + Name_ = child_.text + Name_ = self.gds_validate_string(Name_, node, 'Name') + self.Name = Name_ + elif nodeName_ == 'TaxableValue': + obj_ = Money.factory() + obj_.build(child_) + self.set_TaxableValue(obj_) + elif nodeName_ == 'Description': + Description_ = child_.text + Description_ = self.gds_validate_string(Description_, node, 'Description') + self.Description = Description_ + elif nodeName_ == 'Formula': + Formula_ = child_.text + Formula_ = self.gds_validate_string(Formula_, node, 'Formula') + self.Formula = Formula_ + elif nodeName_ == 'Amount': + obj_ = Money.factory() + obj_.build(child_) + self.set_Amount(obj_) +# end class EdtTaxDetail + + +class EtdDetail(GeneratedsSuper): + """Electronic Trade document references used with the ETD special + service.""" + subclass = None + superclass = None + def __init__(self, RequestedDocumentCopies=None, Documents=None, DocumentReferences=None): + if RequestedDocumentCopies is None: + self.RequestedDocumentCopies = [] + else: + self.RequestedDocumentCopies = RequestedDocumentCopies + if Documents is None: + self.Documents = [] + else: + self.Documents = Documents + if DocumentReferences is None: + self.DocumentReferences = [] + else: + self.DocumentReferences = DocumentReferences + def factory(*args_, **kwargs_): + if EtdDetail.subclass: + return EtdDetail.subclass(*args_, **kwargs_) + else: + return EtdDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_RequestedDocumentCopies(self): return self.RequestedDocumentCopies + def set_RequestedDocumentCopies(self, RequestedDocumentCopies): self.RequestedDocumentCopies = RequestedDocumentCopies + def add_RequestedDocumentCopies(self, value): self.RequestedDocumentCopies.append(value) + def insert_RequestedDocumentCopies(self, index, value): self.RequestedDocumentCopies[index] = value + def validate_RequestedShippingDocumentType(self, value): + # Validate type RequestedShippingDocumentType, a restriction on xs:string. + pass + def get_Documents(self): return self.Documents + def set_Documents(self, Documents): self.Documents = Documents + def add_Documents(self, value): self.Documents.append(value) + def insert_Documents(self, index, value): self.Documents[index] = value + def get_DocumentReferences(self): return self.DocumentReferences + def set_DocumentReferences(self, DocumentReferences): self.DocumentReferences = DocumentReferences + def add_DocumentReferences(self, value): self.DocumentReferences.append(value) + def insert_DocumentReferences(self, index, value): self.DocumentReferences[index] = value + def export(self, outfile, level, namespace_='ns:', name_='EtdDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='EtdDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='EtdDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='EtdDetail', fromsubclass_=False): + for RequestedDocumentCopies_ in self.RequestedDocumentCopies: + showIndent(outfile, level) + outfile.write('<%sRequestedDocumentCopies>%s\n' % (namespace_, self.gds_format_string(quote_xml(RequestedDocumentCopies_).encode(ExternalEncoding), input_name='RequestedDocumentCopies'), namespace_)) + for Documents_ in self.Documents: + Documents_.export(outfile, level, namespace_, name_='Documents') + for DocumentReferences_ in self.DocumentReferences: + DocumentReferences_.export(outfile, level, namespace_, name_='DocumentReferences') + def hasContent_(self): + if ( + self.RequestedDocumentCopies or + self.Documents or + self.DocumentReferences + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='EtdDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('RequestedDocumentCopies=[\n') + level += 1 + for RequestedDocumentCopies_ in self.RequestedDocumentCopies: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(RequestedDocumentCopies_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('Documents=[\n') + level += 1 + for Documents_ in self.Documents: + showIndent(outfile, level) + outfile.write('model_.UploadDocumentDetail(\n') + Documents_.exportLiteral(outfile, level, name_='UploadDocumentDetail') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('DocumentReferences=[\n') + level += 1 + for DocumentReferences_ in self.DocumentReferences: + showIndent(outfile, level) + outfile.write('model_.UploadDocumentReferenceDetail(\n') + DocumentReferences_.exportLiteral(outfile, level, name_='UploadDocumentReferenceDetail') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'RequestedDocumentCopies': + RequestedDocumentCopies_ = child_.text + RequestedDocumentCopies_ = self.gds_validate_string(RequestedDocumentCopies_, node, 'RequestedDocumentCopies') + self.RequestedDocumentCopies.append(RequestedDocumentCopies_) + self.validate_RequestedShippingDocumentType(self.RequestedDocumentCopies) # validate type RequestedShippingDocumentType + elif nodeName_ == 'Documents': + obj_ = UploadDocumentDetail.factory() + obj_.build(child_) + self.Documents.append(obj_) + elif nodeName_ == 'DocumentReferences': + obj_ = UploadDocumentReferenceDetail.factory() + obj_.build(child_) + self.DocumentReferences.append(obj_) +# end class EtdDetail + + +class ExportDetail(GeneratedsSuper): + """Country specific details of an International shipment.""" + subclass = None + superclass = None + def __init__(self, B13AFilingOption=None, ExportComplianceStatement=None, PermitNumber=None, DestinationControlDetail=None): + self.B13AFilingOption = B13AFilingOption + self.ExportComplianceStatement = ExportComplianceStatement + self.PermitNumber = PermitNumber + self.DestinationControlDetail = DestinationControlDetail + def factory(*args_, **kwargs_): + if ExportDetail.subclass: + return ExportDetail.subclass(*args_, **kwargs_) + else: + return ExportDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_B13AFilingOption(self): return self.B13AFilingOption + def set_B13AFilingOption(self, B13AFilingOption): self.B13AFilingOption = B13AFilingOption + def validate_B13AFilingOptionType(self, value): + # Validate type B13AFilingOptionType, a restriction on xs:string. + pass + def get_ExportComplianceStatement(self): return self.ExportComplianceStatement + def set_ExportComplianceStatement(self, ExportComplianceStatement): self.ExportComplianceStatement = ExportComplianceStatement + def get_PermitNumber(self): return self.PermitNumber + def set_PermitNumber(self, PermitNumber): self.PermitNumber = PermitNumber + def get_DestinationControlDetail(self): return self.DestinationControlDetail + def set_DestinationControlDetail(self, DestinationControlDetail): self.DestinationControlDetail = DestinationControlDetail + def export(self, outfile, level, namespace_='ns:', name_='ExportDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ExportDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ExportDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ExportDetail', fromsubclass_=False): + if self.B13AFilingOption is not None: + showIndent(outfile, level) + outfile.write('<%sB13AFilingOption>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.B13AFilingOption).encode(ExternalEncoding), input_name='B13AFilingOption'), namespace_)) + if self.ExportComplianceStatement is not None: + showIndent(outfile, level) + outfile.write('<%sExportComplianceStatement>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ExportComplianceStatement).encode(ExternalEncoding), input_name='ExportComplianceStatement'), namespace_)) + if self.PermitNumber is not None: + showIndent(outfile, level) + outfile.write('<%sPermitNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PermitNumber).encode(ExternalEncoding), input_name='PermitNumber'), namespace_)) + if self.DestinationControlDetail: + self.DestinationControlDetail.export(outfile, level, namespace_, name_='DestinationControlDetail') + def hasContent_(self): + if ( + self.B13AFilingOption is not None or + self.ExportComplianceStatement is not None or + self.PermitNumber is not None or + self.DestinationControlDetail is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ExportDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.B13AFilingOption is not None: + showIndent(outfile, level) + outfile.write('B13AFilingOption=%s,\n' % quote_python(self.B13AFilingOption).encode(ExternalEncoding)) + if self.ExportComplianceStatement is not None: + showIndent(outfile, level) + outfile.write('ExportComplianceStatement=%s,\n' % quote_python(self.ExportComplianceStatement).encode(ExternalEncoding)) + if self.PermitNumber is not None: + showIndent(outfile, level) + outfile.write('PermitNumber=%s,\n' % quote_python(self.PermitNumber).encode(ExternalEncoding)) + if self.DestinationControlDetail is not None: + showIndent(outfile, level) + outfile.write('DestinationControlDetail=model_.DestinationControlDetail(\n') + self.DestinationControlDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'B13AFilingOption': + B13AFilingOption_ = child_.text + B13AFilingOption_ = self.gds_validate_string(B13AFilingOption_, node, 'B13AFilingOption') + self.B13AFilingOption = B13AFilingOption_ + self.validate_B13AFilingOptionType(self.B13AFilingOption) # validate type B13AFilingOptionType + elif nodeName_ == 'ExportComplianceStatement': + ExportComplianceStatement_ = child_.text + ExportComplianceStatement_ = self.gds_validate_string(ExportComplianceStatement_, node, 'ExportComplianceStatement') + self.ExportComplianceStatement = ExportComplianceStatement_ + elif nodeName_ == 'PermitNumber': + PermitNumber_ = child_.text + PermitNumber_ = self.gds_validate_string(PermitNumber_, node, 'PermitNumber') + self.PermitNumber = PermitNumber_ + elif nodeName_ == 'DestinationControlDetail': + obj_ = DestinationControlDetail.factory() + obj_.build(child_) + self.set_DestinationControlDetail(obj_) +# end class ExportDetail + + +class ExpressFreightDetail(GeneratedsSuper): + """Details specific to an Express freight shipment.""" + subclass = None + superclass = None + def __init__(self, PackingListEnclosed=None, ShippersLoadAndCount=None, BookingConfirmationNumber=None, ReferenceLabelRequested=None, BeforeDeliveryContact=None, UndeliverableContact=None): + self.PackingListEnclosed = PackingListEnclosed + self.ShippersLoadAndCount = ShippersLoadAndCount + self.BookingConfirmationNumber = BookingConfirmationNumber + self.ReferenceLabelRequested = ReferenceLabelRequested + self.BeforeDeliveryContact = BeforeDeliveryContact + self.UndeliverableContact = UndeliverableContact + def factory(*args_, **kwargs_): + if ExpressFreightDetail.subclass: + return ExpressFreightDetail.subclass(*args_, **kwargs_) + else: + return ExpressFreightDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_PackingListEnclosed(self): return self.PackingListEnclosed + def set_PackingListEnclosed(self, PackingListEnclosed): self.PackingListEnclosed = PackingListEnclosed + def get_ShippersLoadAndCount(self): return self.ShippersLoadAndCount + def set_ShippersLoadAndCount(self, ShippersLoadAndCount): self.ShippersLoadAndCount = ShippersLoadAndCount + def get_BookingConfirmationNumber(self): return self.BookingConfirmationNumber + def set_BookingConfirmationNumber(self, BookingConfirmationNumber): self.BookingConfirmationNumber = BookingConfirmationNumber + def get_ReferenceLabelRequested(self): return self.ReferenceLabelRequested + def set_ReferenceLabelRequested(self, ReferenceLabelRequested): self.ReferenceLabelRequested = ReferenceLabelRequested + def get_BeforeDeliveryContact(self): return self.BeforeDeliveryContact + def set_BeforeDeliveryContact(self, BeforeDeliveryContact): self.BeforeDeliveryContact = BeforeDeliveryContact + def get_UndeliverableContact(self): return self.UndeliverableContact + def set_UndeliverableContact(self, UndeliverableContact): self.UndeliverableContact = UndeliverableContact + def export(self, outfile, level, namespace_='ns:', name_='ExpressFreightDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ExpressFreightDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ExpressFreightDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ExpressFreightDetail', fromsubclass_=False): + if self.PackingListEnclosed is not None: + showIndent(outfile, level) + outfile.write('<%sPackingListEnclosed>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.PackingListEnclosed)), input_name='PackingListEnclosed'), namespace_)) + if self.ShippersLoadAndCount is not None: + showIndent(outfile, level) + outfile.write('<%sShippersLoadAndCount>%s\n' % (namespace_, self.gds_format_integer(self.ShippersLoadAndCount, input_name='ShippersLoadAndCount'), namespace_)) + if self.BookingConfirmationNumber is not None: + showIndent(outfile, level) + outfile.write('<%sBookingConfirmationNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.BookingConfirmationNumber).encode(ExternalEncoding), input_name='BookingConfirmationNumber'), namespace_)) + if self.ReferenceLabelRequested is not None: + showIndent(outfile, level) + outfile.write('<%sReferenceLabelRequested>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.ReferenceLabelRequested)), input_name='ReferenceLabelRequested'), namespace_)) + if self.BeforeDeliveryContact: + self.BeforeDeliveryContact.export(outfile, level, namespace_, name_='BeforeDeliveryContact') + if self.UndeliverableContact: + self.UndeliverableContact.export(outfile, level, namespace_, name_='UndeliverableContact') + def hasContent_(self): + if ( + self.PackingListEnclosed is not None or + self.ShippersLoadAndCount is not None or + self.BookingConfirmationNumber is not None or + self.ReferenceLabelRequested is not None or + self.BeforeDeliveryContact is not None or + self.UndeliverableContact is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ExpressFreightDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.PackingListEnclosed is not None: + showIndent(outfile, level) + outfile.write('PackingListEnclosed=%s,\n' % self.PackingListEnclosed) + if self.ShippersLoadAndCount is not None: + showIndent(outfile, level) + outfile.write('ShippersLoadAndCount=%d,\n' % self.ShippersLoadAndCount) + if self.BookingConfirmationNumber is not None: + showIndent(outfile, level) + outfile.write('BookingConfirmationNumber=%s,\n' % quote_python(self.BookingConfirmationNumber).encode(ExternalEncoding)) + if self.ReferenceLabelRequested is not None: + showIndent(outfile, level) + outfile.write('ReferenceLabelRequested=%s,\n' % self.ReferenceLabelRequested) + if self.BeforeDeliveryContact is not None: + showIndent(outfile, level) + outfile.write('BeforeDeliveryContact=model_.ExpressFreightDetailContact(\n') + self.BeforeDeliveryContact.exportLiteral(outfile, level, name_='BeforeDeliveryContact') + showIndent(outfile, level) + outfile.write('),\n') + if self.UndeliverableContact is not None: + showIndent(outfile, level) + outfile.write('UndeliverableContact=model_.ExpressFreightDetailContact(\n') + self.UndeliverableContact.exportLiteral(outfile, level, name_='UndeliverableContact') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'PackingListEnclosed': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'PackingListEnclosed') + self.PackingListEnclosed = ival_ + elif nodeName_ == 'ShippersLoadAndCount': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ <= 0: + raise_parse_error(child_, 'requires positiveInteger') + ival_ = self.gds_validate_integer(ival_, node, 'ShippersLoadAndCount') + self.ShippersLoadAndCount = ival_ + elif nodeName_ == 'BookingConfirmationNumber': + BookingConfirmationNumber_ = child_.text + BookingConfirmationNumber_ = self.gds_validate_string(BookingConfirmationNumber_, node, 'BookingConfirmationNumber') + self.BookingConfirmationNumber = BookingConfirmationNumber_ + elif nodeName_ == 'ReferenceLabelRequested': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'ReferenceLabelRequested') + self.ReferenceLabelRequested = ival_ + elif nodeName_ == 'BeforeDeliveryContact': + obj_ = ExpressFreightDetailContact.factory() + obj_.build(child_) + self.set_BeforeDeliveryContact(obj_) + elif nodeName_ == 'UndeliverableContact': + obj_ = ExpressFreightDetailContact.factory() + obj_.build(child_) + self.set_UndeliverableContact(obj_) +# end class ExpressFreightDetail + + +class ExpressFreightDetailContact(GeneratedsSuper): + """Currently not supported. Delivery contact information for an Express + freight shipment.""" + subclass = None + superclass = None + def __init__(self, Name=None, Phone=None): + self.Name = Name + self.Phone = Phone + def factory(*args_, **kwargs_): + if ExpressFreightDetailContact.subclass: + return ExpressFreightDetailContact.subclass(*args_, **kwargs_) + else: + return ExpressFreightDetailContact(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Name(self): return self.Name + def set_Name(self, Name): self.Name = Name + def get_Phone(self): return self.Phone + def set_Phone(self, Phone): self.Phone = Phone + def export(self, outfile, level, namespace_='ns:', name_='ExpressFreightDetailContact', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ExpressFreightDetailContact') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ExpressFreightDetailContact'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ExpressFreightDetailContact', fromsubclass_=False): + if self.Name is not None: + showIndent(outfile, level) + outfile.write('<%sName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Name).encode(ExternalEncoding), input_name='Name'), namespace_)) + if self.Phone is not None: + showIndent(outfile, level) + outfile.write('<%sPhone>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Phone).encode(ExternalEncoding), input_name='Phone'), namespace_)) + def hasContent_(self): + if ( + self.Name is not None or + self.Phone is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ExpressFreightDetailContact'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Name is not None: + showIndent(outfile, level) + outfile.write('Name=%s,\n' % quote_python(self.Name).encode(ExternalEncoding)) + if self.Phone is not None: + showIndent(outfile, level) + outfile.write('Phone=%s,\n' % quote_python(self.Phone).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Name': + Name_ = child_.text + Name_ = self.gds_validate_string(Name_, node, 'Name') + self.Name = Name_ + elif nodeName_ == 'Phone': + Phone_ = child_.text + Phone_ = self.gds_validate_string(Phone_, node, 'Phone') + self.Phone = Phone_ +# end class ExpressFreightDetailContact + + +class FlatbedTrailerDetail(GeneratedsSuper): + """Specifies the optional features/characteristics requested for a + Freight shipment utilizing a flatbed trailer.""" + subclass = None + superclass = None + def __init__(self, Options=None): + if Options is None: + self.Options = [] + else: + self.Options = Options + def factory(*args_, **kwargs_): + if FlatbedTrailerDetail.subclass: + return FlatbedTrailerDetail.subclass(*args_, **kwargs_) + else: + return FlatbedTrailerDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Options(self): return self.Options + def set_Options(self, Options): self.Options = Options + def add_Options(self, value): self.Options.append(value) + def insert_Options(self, index, value): self.Options[index] = value + def validate_FlatbedTrailerOption(self, value): + # Validate type FlatbedTrailerOption, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='FlatbedTrailerDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='FlatbedTrailerDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='FlatbedTrailerDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='FlatbedTrailerDetail', fromsubclass_=False): + for Options_ in self.Options: + showIndent(outfile, level) + outfile.write('<%sOptions>%s\n' % (namespace_, self.gds_format_string(quote_xml(Options_).encode(ExternalEncoding), input_name='Options'), namespace_)) + def hasContent_(self): + if ( + self.Options + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='FlatbedTrailerDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('Options=[\n') + level += 1 + for Options_ in self.Options: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(Options_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Options': + Options_ = child_.text + Options_ = self.gds_validate_string(Options_, node, 'Options') + self.Options.append(Options_) + self.validate_FlatbedTrailerOption(self.Options) # validate type FlatbedTrailerOption +# end class FlatbedTrailerDetail + + +class FreightBaseCharge(GeneratedsSuper): + """Individual charge which contributes to the total base charge for the + shipment.""" + subclass = None + superclass = None + def __init__(self, FreightClass=None, RatedAsClass=None, NmfcCode=None, Description=None, Weight=None, ChargeRate=None, ChargeBasis=None, ExtendedAmount=None): + self.FreightClass = FreightClass + self.RatedAsClass = RatedAsClass + self.NmfcCode = NmfcCode + self.Description = Description + self.Weight = Weight + self.ChargeRate = ChargeRate + self.ChargeBasis = ChargeBasis + self.ExtendedAmount = ExtendedAmount + def factory(*args_, **kwargs_): + if FreightBaseCharge.subclass: + return FreightBaseCharge.subclass(*args_, **kwargs_) + else: + return FreightBaseCharge(*args_, **kwargs_) + factory = staticmethod(factory) + def get_FreightClass(self): return self.FreightClass + def set_FreightClass(self, FreightClass): self.FreightClass = FreightClass + def validate_FreightClassType(self, value): + # Validate type FreightClassType, a restriction on xs:string. + pass + def get_RatedAsClass(self): return self.RatedAsClass + def set_RatedAsClass(self, RatedAsClass): self.RatedAsClass = RatedAsClass + def get_NmfcCode(self): return self.NmfcCode + def set_NmfcCode(self, NmfcCode): self.NmfcCode = NmfcCode + def get_Description(self): return self.Description + def set_Description(self, Description): self.Description = Description + def get_Weight(self): return self.Weight + def set_Weight(self, Weight): self.Weight = Weight + def get_ChargeRate(self): return self.ChargeRate + def set_ChargeRate(self, ChargeRate): self.ChargeRate = ChargeRate + def get_ChargeBasis(self): return self.ChargeBasis + def set_ChargeBasis(self, ChargeBasis): self.ChargeBasis = ChargeBasis + def validate_FreightChargeBasisType(self, value): + # Validate type FreightChargeBasisType, a restriction on xs:string. + pass + def get_ExtendedAmount(self): return self.ExtendedAmount + def set_ExtendedAmount(self, ExtendedAmount): self.ExtendedAmount = ExtendedAmount + def export(self, outfile, level, namespace_='ns:', name_='FreightBaseCharge', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='FreightBaseCharge') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='FreightBaseCharge'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='FreightBaseCharge', fromsubclass_=False): + if self.FreightClass is not None: + showIndent(outfile, level) + outfile.write('<%sFreightClass>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.FreightClass).encode(ExternalEncoding), input_name='FreightClass'), namespace_)) + if self.RatedAsClass is not None: + showIndent(outfile, level) + outfile.write('<%sRatedAsClass>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RatedAsClass).encode(ExternalEncoding), input_name='RatedAsClass'), namespace_)) + if self.NmfcCode is not None: + showIndent(outfile, level) + outfile.write('<%sNmfcCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.NmfcCode).encode(ExternalEncoding), input_name='NmfcCode'), namespace_)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('<%sDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Description).encode(ExternalEncoding), input_name='Description'), namespace_)) + if self.Weight: + self.Weight.export(outfile, level, namespace_, name_='Weight') + if self.ChargeRate: + self.ChargeRate.export(outfile, level, namespace_, name_='ChargeRate') + if self.ChargeBasis is not None: + showIndent(outfile, level) + outfile.write('<%sChargeBasis>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ChargeBasis).encode(ExternalEncoding), input_name='ChargeBasis'), namespace_)) + if self.ExtendedAmount: + self.ExtendedAmount.export(outfile, level, namespace_, name_='ExtendedAmount') + def hasContent_(self): + if ( + self.FreightClass is not None or + self.RatedAsClass is not None or + self.NmfcCode is not None or + self.Description is not None or + self.Weight is not None or + self.ChargeRate is not None or + self.ChargeBasis is not None or + self.ExtendedAmount is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='FreightBaseCharge'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.FreightClass is not None: + showIndent(outfile, level) + outfile.write('FreightClass=%s,\n' % quote_python(self.FreightClass).encode(ExternalEncoding)) + if self.RatedAsClass is not None: + showIndent(outfile, level) + outfile.write('RatedAsClass=%s,\n' % quote_python(self.RatedAsClass).encode(ExternalEncoding)) + if self.NmfcCode is not None: + showIndent(outfile, level) + outfile.write('NmfcCode=%s,\n' % quote_python(self.NmfcCode).encode(ExternalEncoding)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('Description=%s,\n' % quote_python(self.Description).encode(ExternalEncoding)) + if self.Weight is not None: + showIndent(outfile, level) + outfile.write('Weight=model_.Weight(\n') + self.Weight.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ChargeRate is not None: + showIndent(outfile, level) + outfile.write('ChargeRate=model_.Money(\n') + self.ChargeRate.exportLiteral(outfile, level, name_='ChargeRate') + showIndent(outfile, level) + outfile.write('),\n') + if self.ChargeBasis is not None: + showIndent(outfile, level) + outfile.write('ChargeBasis=%s,\n' % quote_python(self.ChargeBasis).encode(ExternalEncoding)) + if self.ExtendedAmount is not None: + showIndent(outfile, level) + outfile.write('ExtendedAmount=model_.Money(\n') + self.ExtendedAmount.exportLiteral(outfile, level, name_='ExtendedAmount') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'FreightClass': + FreightClass_ = child_.text + FreightClass_ = self.gds_validate_string(FreightClass_, node, 'FreightClass') + self.FreightClass = FreightClass_ + self.validate_FreightClassType(self.FreightClass) # validate type FreightClassType + elif nodeName_ == 'RatedAsClass': + RatedAsClass_ = child_.text + RatedAsClass_ = self.gds_validate_string(RatedAsClass_, node, 'RatedAsClass') + self.RatedAsClass = RatedAsClass_ + self.validate_FreightClassType(self.RatedAsClass) # validate type FreightClassType + elif nodeName_ == 'NmfcCode': + NmfcCode_ = child_.text + NmfcCode_ = self.gds_validate_string(NmfcCode_, node, 'NmfcCode') + self.NmfcCode = NmfcCode_ + elif nodeName_ == 'Description': + Description_ = child_.text + Description_ = self.gds_validate_string(Description_, node, 'Description') + self.Description = Description_ + elif nodeName_ == 'Weight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_Weight(obj_) + elif nodeName_ == 'ChargeRate': + obj_ = Money.factory() + obj_.build(child_) + self.set_ChargeRate(obj_) + elif nodeName_ == 'ChargeBasis': + ChargeBasis_ = child_.text + ChargeBasis_ = self.gds_validate_string(ChargeBasis_, node, 'ChargeBasis') + self.ChargeBasis = ChargeBasis_ + self.validate_FreightChargeBasisType(self.ChargeBasis) # validate type FreightChargeBasisType + elif nodeName_ == 'ExtendedAmount': + obj_ = Money.factory() + obj_.build(child_) + self.set_ExtendedAmount(obj_) +# end class FreightBaseCharge + + +class FreightCommitDetail(GeneratedsSuper): + """Information about the Freight Service Centers associated with this + shipment.""" + subclass = None + superclass = None + def __init__(self, OriginDetail=None, DestinationDetail=None, TotalDistance=None): + self.OriginDetail = OriginDetail + self.DestinationDetail = DestinationDetail + self.TotalDistance = TotalDistance + def factory(*args_, **kwargs_): + if FreightCommitDetail.subclass: + return FreightCommitDetail.subclass(*args_, **kwargs_) + else: + return FreightCommitDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_OriginDetail(self): return self.OriginDetail + def set_OriginDetail(self, OriginDetail): self.OriginDetail = OriginDetail + def get_DestinationDetail(self): return self.DestinationDetail + def set_DestinationDetail(self, DestinationDetail): self.DestinationDetail = DestinationDetail + def get_TotalDistance(self): return self.TotalDistance + def set_TotalDistance(self, TotalDistance): self.TotalDistance = TotalDistance + def export(self, outfile, level, namespace_='ns:', name_='FreightCommitDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='FreightCommitDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='FreightCommitDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='FreightCommitDetail', fromsubclass_=False): + if self.OriginDetail: + self.OriginDetail.export(outfile, level, namespace_, name_='OriginDetail') + if self.DestinationDetail: + self.DestinationDetail.export(outfile, level, namespace_, name_='DestinationDetail') + if self.TotalDistance: + self.TotalDistance.export(outfile, level, namespace_, name_='TotalDistance') + def hasContent_(self): + if ( + self.OriginDetail is not None or + self.DestinationDetail is not None or + self.TotalDistance is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='FreightCommitDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.OriginDetail is not None: + showIndent(outfile, level) + outfile.write('OriginDetail=model_.FreightServiceCenterDetail(\n') + self.OriginDetail.exportLiteral(outfile, level, name_='OriginDetail') + showIndent(outfile, level) + outfile.write('),\n') + if self.DestinationDetail is not None: + showIndent(outfile, level) + outfile.write('DestinationDetail=model_.FreightServiceCenterDetail(\n') + self.DestinationDetail.exportLiteral(outfile, level, name_='DestinationDetail') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalDistance is not None: + showIndent(outfile, level) + outfile.write('TotalDistance=model_.Distance(\n') + self.TotalDistance.exportLiteral(outfile, level, name_='TotalDistance') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'OriginDetail': + obj_ = FreightServiceCenterDetail.factory() + obj_.build(child_) + self.set_OriginDetail(obj_) + elif nodeName_ == 'DestinationDetail': + obj_ = FreightServiceCenterDetail.factory() + obj_.build(child_) + self.set_DestinationDetail(obj_) + elif nodeName_ == 'TotalDistance': + obj_ = Distance.factory() + obj_.build(child_) + self.set_TotalDistance(obj_) +# end class FreightCommitDetail + + +class FreightGuaranteeDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Type=None, Date=None): + self.Type = Type + self.Date = Date + def factory(*args_, **kwargs_): + if FreightGuaranteeDetail.subclass: + return FreightGuaranteeDetail.subclass(*args_, **kwargs_) + else: + return FreightGuaranteeDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Type(self): return self.Type + def set_Type(self, Type): self.Type = Type + def validate_FreightGuaranteeType(self, value): + # Validate type FreightGuaranteeType, a restriction on xs:string. + pass + def get_Date(self): return self.Date + def set_Date(self, Date): self.Date = Date + def export(self, outfile, level, namespace_='ns:', name_='FreightGuaranteeDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='FreightGuaranteeDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='FreightGuaranteeDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='FreightGuaranteeDetail', fromsubclass_=False): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('<%sType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Type).encode(ExternalEncoding), input_name='Type'), namespace_)) + if self.Date is not None: + showIndent(outfile, level) + outfile.write('<%sDate>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Date).encode(ExternalEncoding), input_name='Date'), namespace_)) + def hasContent_(self): + if ( + self.Type is not None or + self.Date is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='FreightGuaranteeDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('Type=%s,\n' % quote_python(self.Type).encode(ExternalEncoding)) + if self.Date is not None: + showIndent(outfile, level) + outfile.write('Date=%s,\n' % quote_python(self.Date).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Type': + Type_ = child_.text + Type_ = self.gds_validate_string(Type_, node, 'Type') + self.Type = Type_ + self.validate_FreightGuaranteeType(self.Type) # validate type FreightGuaranteeType + elif nodeName_ == 'Date': + Date_ = child_.text + Date_ = self.gds_validate_string(Date_, node, 'Date') + self.Date = Date_ +# end class FreightGuaranteeDetail + + +class FreightRateDetail(GeneratedsSuper): + """Rate data specific to FedEx Freight or FedEx National Freight + services.""" + subclass = None + superclass = None + def __init__(self, QuoteNumber=None, BaseChargeCalculation=None, BaseCharges=None, Notations=None): + self.QuoteNumber = QuoteNumber + self.BaseChargeCalculation = BaseChargeCalculation + if BaseCharges is None: + self.BaseCharges = [] + else: + self.BaseCharges = BaseCharges + if Notations is None: + self.Notations = [] + else: + self.Notations = Notations + def factory(*args_, **kwargs_): + if FreightRateDetail.subclass: + return FreightRateDetail.subclass(*args_, **kwargs_) + else: + return FreightRateDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_QuoteNumber(self): return self.QuoteNumber + def set_QuoteNumber(self, QuoteNumber): self.QuoteNumber = QuoteNumber + def get_BaseChargeCalculation(self): return self.BaseChargeCalculation + def set_BaseChargeCalculation(self, BaseChargeCalculation): self.BaseChargeCalculation = BaseChargeCalculation + def validate_FreightBaseChargeCalculationType(self, value): + # Validate type FreightBaseChargeCalculationType, a restriction on xs:string. + pass + def get_BaseCharges(self): return self.BaseCharges + def set_BaseCharges(self, BaseCharges): self.BaseCharges = BaseCharges + def add_BaseCharges(self, value): self.BaseCharges.append(value) + def insert_BaseCharges(self, index, value): self.BaseCharges[index] = value + def get_Notations(self): return self.Notations + def set_Notations(self, Notations): self.Notations = Notations + def add_Notations(self, value): self.Notations.append(value) + def insert_Notations(self, index, value): self.Notations[index] = value + def export(self, outfile, level, namespace_='ns:', name_='FreightRateDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='FreightRateDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='FreightRateDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='FreightRateDetail', fromsubclass_=False): + if self.QuoteNumber is not None: + showIndent(outfile, level) + outfile.write('<%sQuoteNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.QuoteNumber).encode(ExternalEncoding), input_name='QuoteNumber'), namespace_)) + if self.BaseChargeCalculation is not None: + showIndent(outfile, level) + outfile.write('<%sBaseChargeCalculation>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.BaseChargeCalculation).encode(ExternalEncoding), input_name='BaseChargeCalculation'), namespace_)) + for BaseCharges_ in self.BaseCharges: + BaseCharges_.export(outfile, level, namespace_, name_='BaseCharges') + for Notations_ in self.Notations: + Notations_.export(outfile, level, namespace_, name_='Notations') + def hasContent_(self): + if ( + self.QuoteNumber is not None or + self.BaseChargeCalculation is not None or + self.BaseCharges or + self.Notations + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='FreightRateDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.QuoteNumber is not None: + showIndent(outfile, level) + outfile.write('QuoteNumber=%s,\n' % quote_python(self.QuoteNumber).encode(ExternalEncoding)) + if self.BaseChargeCalculation is not None: + showIndent(outfile, level) + outfile.write('BaseChargeCalculation=%s,\n' % quote_python(self.BaseChargeCalculation).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('BaseCharges=[\n') + level += 1 + for BaseCharges_ in self.BaseCharges: + showIndent(outfile, level) + outfile.write('model_.FreightBaseCharge(\n') + BaseCharges_.exportLiteral(outfile, level, name_='FreightBaseCharge') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('Notations=[\n') + level += 1 + for Notations_ in self.Notations: + showIndent(outfile, level) + outfile.write('model_.FreightRateNotation(\n') + Notations_.exportLiteral(outfile, level, name_='FreightRateNotation') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'QuoteNumber': + QuoteNumber_ = child_.text + QuoteNumber_ = self.gds_validate_string(QuoteNumber_, node, 'QuoteNumber') + self.QuoteNumber = QuoteNumber_ + elif nodeName_ == 'BaseChargeCalculation': + BaseChargeCalculation_ = child_.text + BaseChargeCalculation_ = self.gds_validate_string(BaseChargeCalculation_, node, 'BaseChargeCalculation') + self.BaseChargeCalculation = BaseChargeCalculation_ + self.validate_FreightBaseChargeCalculationType(self.BaseChargeCalculation) # validate type FreightBaseChargeCalculationType + elif nodeName_ == 'BaseCharges': + obj_ = FreightBaseCharge.factory() + obj_.build(child_) + self.BaseCharges.append(obj_) + elif nodeName_ == 'Notations': + obj_ = FreightRateNotation.factory() + obj_.build(child_) + self.Notations.append(obj_) +# end class FreightRateDetail + + +class FreightRateNotation(GeneratedsSuper): + """Additional non-monetary data returned with Freight rates.""" + subclass = None + superclass = None + def __init__(self, Code=None, Description=None): + self.Code = Code + self.Description = Description + def factory(*args_, **kwargs_): + if FreightRateNotation.subclass: + return FreightRateNotation.subclass(*args_, **kwargs_) + else: + return FreightRateNotation(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Code(self): return self.Code + def set_Code(self, Code): self.Code = Code + def get_Description(self): return self.Description + def set_Description(self, Description): self.Description = Description + def export(self, outfile, level, namespace_='ns:', name_='FreightRateNotation', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='FreightRateNotation') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='FreightRateNotation'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='FreightRateNotation', fromsubclass_=False): + if self.Code is not None: + showIndent(outfile, level) + outfile.write('<%sCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Code).encode(ExternalEncoding), input_name='Code'), namespace_)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('<%sDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Description).encode(ExternalEncoding), input_name='Description'), namespace_)) + def hasContent_(self): + if ( + self.Code is not None or + self.Description is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='FreightRateNotation'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Code is not None: + showIndent(outfile, level) + outfile.write('Code=%s,\n' % quote_python(self.Code).encode(ExternalEncoding)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('Description=%s,\n' % quote_python(self.Description).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Code': + Code_ = child_.text + Code_ = self.gds_validate_string(Code_, node, 'Code') + self.Code = Code_ + elif nodeName_ == 'Description': + Description_ = child_.text + Description_ = self.gds_validate_string(Description_, node, 'Description') + self.Description = Description_ +# end class FreightRateNotation + + +class FreightServiceCenterDetail(GeneratedsSuper): + """This class describes the relationship between a customer-specified + address and the FedEx Freight / FedEx National Freight Service + Center that supports that address.""" + subclass = None + superclass = None + def __init__(self, InterlineCarrierCode=None, InterlineCarrierName=None, AdditionalDays=None, LocalService=None, LocalDistance=None, LocalDuration=None, LocalServiceScheduling=None, LimitedServiceDays=None, GatewayLocationId=None, Location=None, ContactAndAddress=None): + self.InterlineCarrierCode = InterlineCarrierCode + self.InterlineCarrierName = InterlineCarrierName + self.AdditionalDays = AdditionalDays + self.LocalService = LocalService + self.LocalDistance = LocalDistance + self.LocalDuration = LocalDuration + self.LocalServiceScheduling = LocalServiceScheduling + if LimitedServiceDays is None: + self.LimitedServiceDays = [] + else: + self.LimitedServiceDays = LimitedServiceDays + self.GatewayLocationId = GatewayLocationId + self.Location = Location + self.ContactAndAddress = ContactAndAddress + def factory(*args_, **kwargs_): + if FreightServiceCenterDetail.subclass: + return FreightServiceCenterDetail.subclass(*args_, **kwargs_) + else: + return FreightServiceCenterDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_InterlineCarrierCode(self): return self.InterlineCarrierCode + def set_InterlineCarrierCode(self, InterlineCarrierCode): self.InterlineCarrierCode = InterlineCarrierCode + def get_InterlineCarrierName(self): return self.InterlineCarrierName + def set_InterlineCarrierName(self, InterlineCarrierName): self.InterlineCarrierName = InterlineCarrierName + def get_AdditionalDays(self): return self.AdditionalDays + def set_AdditionalDays(self, AdditionalDays): self.AdditionalDays = AdditionalDays + def get_LocalService(self): return self.LocalService + def set_LocalService(self, LocalService): self.LocalService = LocalService + def validate_ServiceType(self, value): + # Validate type ServiceType, a restriction on xs:string. + pass + def get_LocalDistance(self): return self.LocalDistance + def set_LocalDistance(self, LocalDistance): self.LocalDistance = LocalDistance + def get_LocalDuration(self): return self.LocalDuration + def set_LocalDuration(self, LocalDuration): self.LocalDuration = LocalDuration + def get_LocalServiceScheduling(self): return self.LocalServiceScheduling + def set_LocalServiceScheduling(self, LocalServiceScheduling): self.LocalServiceScheduling = LocalServiceScheduling + def validate_FreightServiceSchedulingType(self, value): + # Validate type FreightServiceSchedulingType, a restriction on xs:string. + pass + def get_LimitedServiceDays(self): return self.LimitedServiceDays + def set_LimitedServiceDays(self, LimitedServiceDays): self.LimitedServiceDays = LimitedServiceDays + def add_LimitedServiceDays(self, value): self.LimitedServiceDays.append(value) + def insert_LimitedServiceDays(self, index, value): self.LimitedServiceDays[index] = value + def validate_DayOfWeekType(self, value): + # Validate type DayOfWeekType, a restriction on xs:string. + pass + def get_GatewayLocationId(self): return self.GatewayLocationId + def set_GatewayLocationId(self, GatewayLocationId): self.GatewayLocationId = GatewayLocationId + def get_Location(self): return self.Location + def set_Location(self, Location): self.Location = Location + def get_ContactAndAddress(self): return self.ContactAndAddress + def set_ContactAndAddress(self, ContactAndAddress): self.ContactAndAddress = ContactAndAddress + def export(self, outfile, level, namespace_='ns:', name_='FreightServiceCenterDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='FreightServiceCenterDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='FreightServiceCenterDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='FreightServiceCenterDetail', fromsubclass_=False): + if self.InterlineCarrierCode is not None: + showIndent(outfile, level) + outfile.write('<%sInterlineCarrierCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.InterlineCarrierCode).encode(ExternalEncoding), input_name='InterlineCarrierCode'), namespace_)) + if self.InterlineCarrierName is not None: + showIndent(outfile, level) + outfile.write('<%sInterlineCarrierName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.InterlineCarrierName).encode(ExternalEncoding), input_name='InterlineCarrierName'), namespace_)) + if self.AdditionalDays is not None: + showIndent(outfile, level) + outfile.write('<%sAdditionalDays>%s\n' % (namespace_, self.gds_format_integer(self.AdditionalDays, input_name='AdditionalDays'), namespace_)) + if self.LocalService is not None: + showIndent(outfile, level) + outfile.write('<%sLocalService>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LocalService).encode(ExternalEncoding), input_name='LocalService'), namespace_)) + if self.LocalDistance: + self.LocalDistance.export(outfile, level, namespace_, name_='LocalDistance') + if self.LocalDuration is not None: + showIndent(outfile, level) + outfile.write('<%sLocalDuration>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LocalDuration).encode(ExternalEncoding), input_name='LocalDuration'), namespace_)) + if self.LocalServiceScheduling is not None: + showIndent(outfile, level) + outfile.write('<%sLocalServiceScheduling>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LocalServiceScheduling).encode(ExternalEncoding), input_name='LocalServiceScheduling'), namespace_)) + for LimitedServiceDays_ in self.LimitedServiceDays: + showIndent(outfile, level) + outfile.write('<%sLimitedServiceDays>%s\n' % (namespace_, self.gds_format_string(quote_xml(LimitedServiceDays_).encode(ExternalEncoding), input_name='LimitedServiceDays'), namespace_)) + if self.GatewayLocationId is not None: + showIndent(outfile, level) + outfile.write('<%sGatewayLocationId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.GatewayLocationId).encode(ExternalEncoding), input_name='GatewayLocationId'), namespace_)) + if self.Location is not None: + showIndent(outfile, level) + outfile.write('<%sLocation>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Location).encode(ExternalEncoding), input_name='Location'), namespace_)) + if self.ContactAndAddress: + self.ContactAndAddress.export(outfile, level, namespace_, name_='ContactAndAddress') + def hasContent_(self): + if ( + self.InterlineCarrierCode is not None or + self.InterlineCarrierName is not None or + self.AdditionalDays is not None or + self.LocalService is not None or + self.LocalDistance is not None or + self.LocalDuration is not None or + self.LocalServiceScheduling is not None or + self.LimitedServiceDays or + self.GatewayLocationId is not None or + self.Location is not None or + self.ContactAndAddress is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='FreightServiceCenterDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.InterlineCarrierCode is not None: + showIndent(outfile, level) + outfile.write('InterlineCarrierCode=%s,\n' % quote_python(self.InterlineCarrierCode).encode(ExternalEncoding)) + if self.InterlineCarrierName is not None: + showIndent(outfile, level) + outfile.write('InterlineCarrierName=%s,\n' % quote_python(self.InterlineCarrierName).encode(ExternalEncoding)) + if self.AdditionalDays is not None: + showIndent(outfile, level) + outfile.write('AdditionalDays=%d,\n' % self.AdditionalDays) + if self.LocalService is not None: + showIndent(outfile, level) + outfile.write('LocalService=%s,\n' % quote_python(self.LocalService).encode(ExternalEncoding)) + if self.LocalDistance is not None: + showIndent(outfile, level) + outfile.write('LocalDistance=model_.Distance(\n') + self.LocalDistance.exportLiteral(outfile, level, name_='LocalDistance') + showIndent(outfile, level) + outfile.write('),\n') + if self.LocalDuration is not None: + showIndent(outfile, level) + outfile.write('LocalDuration=%s,\n' % quote_python(self.LocalDuration).encode(ExternalEncoding)) + if self.LocalServiceScheduling is not None: + showIndent(outfile, level) + outfile.write('LocalServiceScheduling=%s,\n' % quote_python(self.LocalServiceScheduling).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('LimitedServiceDays=[\n') + level += 1 + for LimitedServiceDays_ in self.LimitedServiceDays: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(LimitedServiceDays_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.GatewayLocationId is not None: + showIndent(outfile, level) + outfile.write('GatewayLocationId=%s,\n' % quote_python(self.GatewayLocationId).encode(ExternalEncoding)) + if self.Location is not None: + showIndent(outfile, level) + outfile.write('Location=%s,\n' % quote_python(self.Location).encode(ExternalEncoding)) + if self.ContactAndAddress is not None: + showIndent(outfile, level) + outfile.write('ContactAndAddress=model_.ContactAndAddress(\n') + self.ContactAndAddress.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'InterlineCarrierCode': + InterlineCarrierCode_ = child_.text + InterlineCarrierCode_ = self.gds_validate_string(InterlineCarrierCode_, node, 'InterlineCarrierCode') + self.InterlineCarrierCode = InterlineCarrierCode_ + elif nodeName_ == 'InterlineCarrierName': + InterlineCarrierName_ = child_.text + InterlineCarrierName_ = self.gds_validate_string(InterlineCarrierName_, node, 'InterlineCarrierName') + self.InterlineCarrierName = InterlineCarrierName_ + elif nodeName_ == 'AdditionalDays': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'AdditionalDays') + self.AdditionalDays = ival_ + elif nodeName_ == 'LocalService': + LocalService_ = child_.text + LocalService_ = self.gds_validate_string(LocalService_, node, 'LocalService') + self.LocalService = LocalService_ + self.validate_ServiceType(self.LocalService) # validate type ServiceType + elif nodeName_ == 'LocalDistance': + obj_ = Distance.factory() + obj_.build(child_) + self.set_LocalDistance(obj_) + elif nodeName_ == 'LocalDuration': + LocalDuration_ = child_.text + LocalDuration_ = self.gds_validate_string(LocalDuration_, node, 'LocalDuration') + self.LocalDuration = LocalDuration_ + elif nodeName_ == 'LocalServiceScheduling': + LocalServiceScheduling_ = child_.text + LocalServiceScheduling_ = self.gds_validate_string(LocalServiceScheduling_, node, 'LocalServiceScheduling') + self.LocalServiceScheduling = LocalServiceScheduling_ + self.validate_FreightServiceSchedulingType(self.LocalServiceScheduling) # validate type FreightServiceSchedulingType + elif nodeName_ == 'LimitedServiceDays': + LimitedServiceDays_ = child_.text + LimitedServiceDays_ = self.gds_validate_string(LimitedServiceDays_, node, 'LimitedServiceDays') + self.LimitedServiceDays.append(LimitedServiceDays_) + self.validate_DayOfWeekType(self.LimitedServiceDays) # validate type DayOfWeekType + elif nodeName_ == 'GatewayLocationId': + GatewayLocationId_ = child_.text + GatewayLocationId_ = self.gds_validate_string(GatewayLocationId_, node, 'GatewayLocationId') + self.GatewayLocationId = GatewayLocationId_ + elif nodeName_ == 'Location': + Location_ = child_.text + Location_ = self.gds_validate_string(Location_, node, 'Location') + self.Location = Location_ + elif nodeName_ == 'ContactAndAddress': + obj_ = ContactAndAddress.factory() + obj_.build(child_) + self.set_ContactAndAddress(obj_) +# end class FreightServiceCenterDetail + + +class FreightShipmentDetail(GeneratedsSuper): + """Data applicable to shipments using FEDEX_FREIGHT and + FEDEX_NATIONAL_FREIGHT services.""" + subclass = None + superclass = None + def __init__(self, FedExFreightAccountNumber=None, FedExFreightBillingContactAndAddress=None, FedExNationalFreightAccountNumber=None, FedExNationalFreightBillingContactAndAddress=None, Role=None, PaymentType=None, DeclaredValuePerUnit=None, DeclaredValueUnits=None, LiabilityCoverageDetail=None, Coupons=None, TotalHandlingUnits=None, ClientDiscountPercent=None, PalletWeight=None, ShipmentDimensions=None, Comment=None, SpecialServicePayments=None, LineItems=None): + self.FedExFreightAccountNumber = FedExFreightAccountNumber + self.FedExFreightBillingContactAndAddress = FedExFreightBillingContactAndAddress + self.FedExNationalFreightAccountNumber = FedExNationalFreightAccountNumber + self.FedExNationalFreightBillingContactAndAddress = FedExNationalFreightBillingContactAndAddress + self.Role = Role + self.PaymentType = PaymentType + self.DeclaredValuePerUnit = DeclaredValuePerUnit + self.DeclaredValueUnits = DeclaredValueUnits + self.LiabilityCoverageDetail = LiabilityCoverageDetail + if Coupons is None: + self.Coupons = [] + else: + self.Coupons = Coupons + self.TotalHandlingUnits = TotalHandlingUnits + self.ClientDiscountPercent = ClientDiscountPercent + self.PalletWeight = PalletWeight + self.ShipmentDimensions = ShipmentDimensions + self.Comment = Comment + if SpecialServicePayments is None: + self.SpecialServicePayments = [] + else: + self.SpecialServicePayments = SpecialServicePayments + if LineItems is None: + self.LineItems = [] + else: + self.LineItems = LineItems + def factory(*args_, **kwargs_): + if FreightShipmentDetail.subclass: + return FreightShipmentDetail.subclass(*args_, **kwargs_) + else: + return FreightShipmentDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_FedExFreightAccountNumber(self): return self.FedExFreightAccountNumber + def set_FedExFreightAccountNumber(self, FedExFreightAccountNumber): self.FedExFreightAccountNumber = FedExFreightAccountNumber + def get_FedExFreightBillingContactAndAddress(self): return self.FedExFreightBillingContactAndAddress + def set_FedExFreightBillingContactAndAddress(self, FedExFreightBillingContactAndAddress): self.FedExFreightBillingContactAndAddress = FedExFreightBillingContactAndAddress + def get_FedExNationalFreightAccountNumber(self): return self.FedExNationalFreightAccountNumber + def set_FedExNationalFreightAccountNumber(self, FedExNationalFreightAccountNumber): self.FedExNationalFreightAccountNumber = FedExNationalFreightAccountNumber + def get_FedExNationalFreightBillingContactAndAddress(self): return self.FedExNationalFreightBillingContactAndAddress + def set_FedExNationalFreightBillingContactAndAddress(self, FedExNationalFreightBillingContactAndAddress): self.FedExNationalFreightBillingContactAndAddress = FedExNationalFreightBillingContactAndAddress + def get_Role(self): return self.Role + def set_Role(self, Role): self.Role = Role + def validate_FreightShipmentRoleType(self, value): + # Validate type FreightShipmentRoleType, a restriction on xs:string. + pass + def get_PaymentType(self): return self.PaymentType + def set_PaymentType(self, PaymentType): self.PaymentType = PaymentType + def validate_FreightAccountPaymentType(self, value): + # Validate type FreightAccountPaymentType, a restriction on xs:string. + pass + def get_DeclaredValuePerUnit(self): return self.DeclaredValuePerUnit + def set_DeclaredValuePerUnit(self, DeclaredValuePerUnit): self.DeclaredValuePerUnit = DeclaredValuePerUnit + def get_DeclaredValueUnits(self): return self.DeclaredValueUnits + def set_DeclaredValueUnits(self, DeclaredValueUnits): self.DeclaredValueUnits = DeclaredValueUnits + def get_LiabilityCoverageDetail(self): return self.LiabilityCoverageDetail + def set_LiabilityCoverageDetail(self, LiabilityCoverageDetail): self.LiabilityCoverageDetail = LiabilityCoverageDetail + def get_Coupons(self): return self.Coupons + def set_Coupons(self, Coupons): self.Coupons = Coupons + def add_Coupons(self, value): self.Coupons.append(value) + def insert_Coupons(self, index, value): self.Coupons[index] = value + def get_TotalHandlingUnits(self): return self.TotalHandlingUnits + def set_TotalHandlingUnits(self, TotalHandlingUnits): self.TotalHandlingUnits = TotalHandlingUnits + def get_ClientDiscountPercent(self): return self.ClientDiscountPercent + def set_ClientDiscountPercent(self, ClientDiscountPercent): self.ClientDiscountPercent = ClientDiscountPercent + def get_PalletWeight(self): return self.PalletWeight + def set_PalletWeight(self, PalletWeight): self.PalletWeight = PalletWeight + def get_ShipmentDimensions(self): return self.ShipmentDimensions + def set_ShipmentDimensions(self, ShipmentDimensions): self.ShipmentDimensions = ShipmentDimensions + def get_Comment(self): return self.Comment + def set_Comment(self, Comment): self.Comment = Comment + def get_SpecialServicePayments(self): return self.SpecialServicePayments + def set_SpecialServicePayments(self, SpecialServicePayments): self.SpecialServicePayments = SpecialServicePayments + def add_SpecialServicePayments(self, value): self.SpecialServicePayments.append(value) + def insert_SpecialServicePayments(self, index, value): self.SpecialServicePayments[index] = value + def get_LineItems(self): return self.LineItems + def set_LineItems(self, LineItems): self.LineItems = LineItems + def add_LineItems(self, value): self.LineItems.append(value) + def insert_LineItems(self, index, value): self.LineItems[index] = value + def export(self, outfile, level, namespace_='ns:', name_='FreightShipmentDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='FreightShipmentDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='FreightShipmentDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='FreightShipmentDetail', fromsubclass_=False): + if self.FedExFreightAccountNumber is not None: + showIndent(outfile, level) + outfile.write('<%sFedExFreightAccountNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.FedExFreightAccountNumber).encode(ExternalEncoding), input_name='FedExFreightAccountNumber'), namespace_)) + if self.FedExFreightBillingContactAndAddress: + self.FedExFreightBillingContactAndAddress.export(outfile, level, namespace_, name_='FedExFreightBillingContactAndAddress') + if self.FedExNationalFreightAccountNumber is not None: + showIndent(outfile, level) + outfile.write('<%sFedExNationalFreightAccountNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.FedExNationalFreightAccountNumber).encode(ExternalEncoding), input_name='FedExNationalFreightAccountNumber'), namespace_)) + if self.FedExNationalFreightBillingContactAndAddress: + self.FedExNationalFreightBillingContactAndAddress.export(outfile, level, namespace_, name_='FedExNationalFreightBillingContactAndAddress') + if self.Role is not None: + showIndent(outfile, level) + outfile.write('<%sRole>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Role).encode(ExternalEncoding), input_name='Role'), namespace_)) + if self.PaymentType is not None: + showIndent(outfile, level) + outfile.write('<%sPaymentType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PaymentType).encode(ExternalEncoding), input_name='PaymentType'), namespace_)) + if self.DeclaredValuePerUnit: + self.DeclaredValuePerUnit.export(outfile, level, namespace_, name_='DeclaredValuePerUnit') + if self.DeclaredValueUnits is not None: + showIndent(outfile, level) + outfile.write('<%sDeclaredValueUnits>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DeclaredValueUnits).encode(ExternalEncoding), input_name='DeclaredValueUnits'), namespace_)) + if self.LiabilityCoverageDetail: + self.LiabilityCoverageDetail.export(outfile, level, namespace_, name_='LiabilityCoverageDetail') + for Coupons_ in self.Coupons: + showIndent(outfile, level) + outfile.write('<%sCoupons>%s\n' % (namespace_, self.gds_format_string(quote_xml(Coupons_).encode(ExternalEncoding), input_name='Coupons'), namespace_)) + if self.TotalHandlingUnits is not None: + showIndent(outfile, level) + outfile.write('<%sTotalHandlingUnits>%s\n' % (namespace_, self.gds_format_integer(self.TotalHandlingUnits, input_name='TotalHandlingUnits'), namespace_)) + if self.ClientDiscountPercent is not None: + showIndent(outfile, level) + outfile.write('<%sClientDiscountPercent>%s\n' % (namespace_, self.gds_format_float(self.ClientDiscountPercent, input_name='ClientDiscountPercent'), namespace_)) + if self.PalletWeight: + self.PalletWeight.export(outfile, level, namespace_, name_='PalletWeight') + if self.ShipmentDimensions: + self.ShipmentDimensions.export(outfile, level, namespace_, name_='ShipmentDimensions') + if self.Comment is not None: + showIndent(outfile, level) + outfile.write('<%sComment>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Comment).encode(ExternalEncoding), input_name='Comment'), namespace_)) + for SpecialServicePayments_ in self.SpecialServicePayments: + SpecialServicePayments_.export(outfile, level, namespace_, name_='SpecialServicePayments') + for LineItems_ in self.LineItems: + LineItems_.export(outfile, level, namespace_, name_='LineItems') + def hasContent_(self): + if ( + self.FedExFreightAccountNumber is not None or + self.FedExFreightBillingContactAndAddress is not None or + self.FedExNationalFreightAccountNumber is not None or + self.FedExNationalFreightBillingContactAndAddress is not None or + self.Role is not None or + self.PaymentType is not None or + self.DeclaredValuePerUnit is not None or + self.DeclaredValueUnits is not None or + self.LiabilityCoverageDetail is not None or + self.Coupons or + self.TotalHandlingUnits is not None or + self.ClientDiscountPercent is not None or + self.PalletWeight is not None or + self.ShipmentDimensions is not None or + self.Comment is not None or + self.SpecialServicePayments or + self.LineItems + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='FreightShipmentDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.FedExFreightAccountNumber is not None: + showIndent(outfile, level) + outfile.write('FedExFreightAccountNumber=%s,\n' % quote_python(self.FedExFreightAccountNumber).encode(ExternalEncoding)) + if self.FedExFreightBillingContactAndAddress is not None: + showIndent(outfile, level) + outfile.write('FedExFreightBillingContactAndAddress=model_.ContactAndAddress(\n') + self.FedExFreightBillingContactAndAddress.exportLiteral(outfile, level, name_='FedExFreightBillingContactAndAddress') + showIndent(outfile, level) + outfile.write('),\n') + if self.FedExNationalFreightAccountNumber is not None: + showIndent(outfile, level) + outfile.write('FedExNationalFreightAccountNumber=%s,\n' % quote_python(self.FedExNationalFreightAccountNumber).encode(ExternalEncoding)) + if self.FedExNationalFreightBillingContactAndAddress is not None: + showIndent(outfile, level) + outfile.write('FedExNationalFreightBillingContactAndAddress=model_.ContactAndAddress(\n') + self.FedExNationalFreightBillingContactAndAddress.exportLiteral(outfile, level, name_='FedExNationalFreightBillingContactAndAddress') + showIndent(outfile, level) + outfile.write('),\n') + if self.Role is not None: + showIndent(outfile, level) + outfile.write('Role=%s,\n' % quote_python(self.Role).encode(ExternalEncoding)) + if self.PaymentType is not None: + showIndent(outfile, level) + outfile.write('PaymentType=%s,\n' % quote_python(self.PaymentType).encode(ExternalEncoding)) + if self.DeclaredValuePerUnit is not None: + showIndent(outfile, level) + outfile.write('DeclaredValuePerUnit=model_.Money(\n') + self.DeclaredValuePerUnit.exportLiteral(outfile, level, name_='DeclaredValuePerUnit') + showIndent(outfile, level) + outfile.write('),\n') + if self.DeclaredValueUnits is not None: + showIndent(outfile, level) + outfile.write('DeclaredValueUnits=%s,\n' % quote_python(self.DeclaredValueUnits).encode(ExternalEncoding)) + if self.LiabilityCoverageDetail is not None: + showIndent(outfile, level) + outfile.write('LiabilityCoverageDetail=model_.LiabilityCoverageDetail(\n') + self.LiabilityCoverageDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('Coupons=[\n') + level += 1 + for Coupons_ in self.Coupons: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(Coupons_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.TotalHandlingUnits is not None: + showIndent(outfile, level) + outfile.write('TotalHandlingUnits=%d,\n' % self.TotalHandlingUnits) + if self.ClientDiscountPercent is not None: + showIndent(outfile, level) + outfile.write('ClientDiscountPercent=%f,\n' % self.ClientDiscountPercent) + if self.PalletWeight is not None: + showIndent(outfile, level) + outfile.write('PalletWeight=model_.Weight(\n') + self.PalletWeight.exportLiteral(outfile, level, name_='PalletWeight') + showIndent(outfile, level) + outfile.write('),\n') + if self.ShipmentDimensions is not None: + showIndent(outfile, level) + outfile.write('ShipmentDimensions=model_.Dimensions(\n') + self.ShipmentDimensions.exportLiteral(outfile, level, name_='ShipmentDimensions') + showIndent(outfile, level) + outfile.write('),\n') + if self.Comment is not None: + showIndent(outfile, level) + outfile.write('Comment=%s,\n' % quote_python(self.Comment).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('SpecialServicePayments=[\n') + level += 1 + for SpecialServicePayments_ in self.SpecialServicePayments: + showIndent(outfile, level) + outfile.write('model_.FreightSpecialServicePayment(\n') + SpecialServicePayments_.exportLiteral(outfile, level, name_='FreightSpecialServicePayment') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('LineItems=[\n') + level += 1 + for LineItems_ in self.LineItems: + showIndent(outfile, level) + outfile.write('model_.FreightShipmentLineItem(\n') + LineItems_.exportLiteral(outfile, level, name_='FreightShipmentLineItem') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'FedExFreightAccountNumber': + FedExFreightAccountNumber_ = child_.text + FedExFreightAccountNumber_ = self.gds_validate_string(FedExFreightAccountNumber_, node, 'FedExFreightAccountNumber') + self.FedExFreightAccountNumber = FedExFreightAccountNumber_ + elif nodeName_ == 'FedExFreightBillingContactAndAddress': + obj_ = ContactAndAddress.factory() + obj_.build(child_) + self.set_FedExFreightBillingContactAndAddress(obj_) + elif nodeName_ == 'FedExNationalFreightAccountNumber': + FedExNationalFreightAccountNumber_ = child_.text + FedExNationalFreightAccountNumber_ = self.gds_validate_string(FedExNationalFreightAccountNumber_, node, 'FedExNationalFreightAccountNumber') + self.FedExNationalFreightAccountNumber = FedExNationalFreightAccountNumber_ + elif nodeName_ == 'FedExNationalFreightBillingContactAndAddress': + obj_ = ContactAndAddress.factory() + obj_.build(child_) + self.set_FedExNationalFreightBillingContactAndAddress(obj_) + elif nodeName_ == 'Role': + Role_ = child_.text + Role_ = self.gds_validate_string(Role_, node, 'Role') + self.Role = Role_ + self.validate_FreightShipmentRoleType(self.Role) # validate type FreightShipmentRoleType + elif nodeName_ == 'PaymentType': + PaymentType_ = child_.text + PaymentType_ = self.gds_validate_string(PaymentType_, node, 'PaymentType') + self.PaymentType = PaymentType_ + self.validate_FreightAccountPaymentType(self.PaymentType) # validate type FreightAccountPaymentType + elif nodeName_ == 'DeclaredValuePerUnit': + obj_ = Money.factory() + obj_.build(child_) + self.set_DeclaredValuePerUnit(obj_) + elif nodeName_ == 'DeclaredValueUnits': + DeclaredValueUnits_ = child_.text + DeclaredValueUnits_ = self.gds_validate_string(DeclaredValueUnits_, node, 'DeclaredValueUnits') + self.DeclaredValueUnits = DeclaredValueUnits_ + elif nodeName_ == 'LiabilityCoverageDetail': + obj_ = LiabilityCoverageDetail.factory() + obj_.build(child_) + self.set_LiabilityCoverageDetail(obj_) + elif nodeName_ == 'Coupons': + Coupons_ = child_.text + Coupons_ = self.gds_validate_string(Coupons_, node, 'Coupons') + self.Coupons.append(Coupons_) + elif nodeName_ == 'TotalHandlingUnits': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'TotalHandlingUnits') + self.TotalHandlingUnits = ival_ + elif nodeName_ == 'ClientDiscountPercent': + sval_ = child_.text + try: + fval_ = float(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires float or double: %s' % exp) + fval_ = self.gds_validate_float(fval_, node, 'ClientDiscountPercent') + self.ClientDiscountPercent = fval_ + elif nodeName_ == 'PalletWeight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_PalletWeight(obj_) + elif nodeName_ == 'ShipmentDimensions': + obj_ = Dimensions.factory() + obj_.build(child_) + self.set_ShipmentDimensions(obj_) + elif nodeName_ == 'Comment': + Comment_ = child_.text + Comment_ = self.gds_validate_string(Comment_, node, 'Comment') + self.Comment = Comment_ + elif nodeName_ == 'SpecialServicePayments': + obj_ = FreightSpecialServicePayment.factory() + obj_.build(child_) + self.SpecialServicePayments.append(obj_) + elif nodeName_ == 'LineItems': + obj_ = FreightShipmentLineItem.factory() + obj_.build(child_) + self.LineItems.append(obj_) +# end class FreightShipmentDetail + + +class FreightShipmentLineItem(GeneratedsSuper): + """Description of an individual commodity or class of content in a + shipment.""" + subclass = None + superclass = None + def __init__(self, FreightClass=None, Packaging=None, Description=None, Weight=None, Dimensions=None, Volume=None): + self.FreightClass = FreightClass + self.Packaging = Packaging + self.Description = Description + self.Weight = Weight + self.Dimensions = Dimensions + self.Volume = Volume + def factory(*args_, **kwargs_): + if FreightShipmentLineItem.subclass: + return FreightShipmentLineItem.subclass(*args_, **kwargs_) + else: + return FreightShipmentLineItem(*args_, **kwargs_) + factory = staticmethod(factory) + def get_FreightClass(self): return self.FreightClass + def set_FreightClass(self, FreightClass): self.FreightClass = FreightClass + def validate_FreightClassType(self, value): + # Validate type FreightClassType, a restriction on xs:string. + pass + def get_Packaging(self): return self.Packaging + def set_Packaging(self, Packaging): self.Packaging = Packaging + def validate_PhysicalPackagingType(self, value): + # Validate type PhysicalPackagingType, a restriction on xs:string. + pass + def get_Description(self): return self.Description + def set_Description(self, Description): self.Description = Description + def get_Weight(self): return self.Weight + def set_Weight(self, Weight): self.Weight = Weight + def get_Dimensions(self): return self.Dimensions + def set_Dimensions(self, Dimensions): self.Dimensions = Dimensions + def get_Volume(self): return self.Volume + def set_Volume(self, Volume): self.Volume = Volume + def export(self, outfile, level, namespace_='ns:', name_='FreightShipmentLineItem', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='FreightShipmentLineItem') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='FreightShipmentLineItem'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='FreightShipmentLineItem', fromsubclass_=False): + if self.FreightClass is not None: + showIndent(outfile, level) + outfile.write('<%sFreightClass>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.FreightClass).encode(ExternalEncoding), input_name='FreightClass'), namespace_)) + if self.Packaging is not None: + showIndent(outfile, level) + outfile.write('<%sPackaging>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Packaging).encode(ExternalEncoding), input_name='Packaging'), namespace_)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('<%sDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Description).encode(ExternalEncoding), input_name='Description'), namespace_)) + if self.Weight: + self.Weight.export(outfile, level, namespace_, name_='Weight') + if self.Dimensions: + self.Dimensions.export(outfile, level, namespace_, name_='Dimensions') + if self.Volume: + self.Volume.export(outfile, level, namespace_, name_='Volume') + def hasContent_(self): + if ( + self.FreightClass is not None or + self.Packaging is not None or + self.Description is not None or + self.Weight is not None or + self.Dimensions is not None or + self.Volume is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='FreightShipmentLineItem'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.FreightClass is not None: + showIndent(outfile, level) + outfile.write('FreightClass=%s,\n' % quote_python(self.FreightClass).encode(ExternalEncoding)) + if self.Packaging is not None: + showIndent(outfile, level) + outfile.write('Packaging=%s,\n' % quote_python(self.Packaging).encode(ExternalEncoding)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('Description=%s,\n' % quote_python(self.Description).encode(ExternalEncoding)) + if self.Weight is not None: + showIndent(outfile, level) + outfile.write('Weight=model_.Weight(\n') + self.Weight.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Dimensions is not None: + showIndent(outfile, level) + outfile.write('Dimensions=model_.Dimensions(\n') + self.Dimensions.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Volume is not None: + showIndent(outfile, level) + outfile.write('Volume=model_.Volume(\n') + self.Volume.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'FreightClass': + FreightClass_ = child_.text + FreightClass_ = self.gds_validate_string(FreightClass_, node, 'FreightClass') + self.FreightClass = FreightClass_ + self.validate_FreightClassType(self.FreightClass) # validate type FreightClassType + elif nodeName_ == 'Packaging': + Packaging_ = child_.text + Packaging_ = self.gds_validate_string(Packaging_, node, 'Packaging') + self.Packaging = Packaging_ + self.validate_PhysicalPackagingType(self.Packaging) # validate type PhysicalPackagingType + elif nodeName_ == 'Description': + Description_ = child_.text + Description_ = self.gds_validate_string(Description_, node, 'Description') + self.Description = Description_ + elif nodeName_ == 'Weight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_Weight(obj_) + elif nodeName_ == 'Dimensions': + obj_ = Dimensions.factory() + obj_.build(child_) + self.set_Dimensions(obj_) + elif nodeName_ == 'Volume': + obj_ = Volume.factory() + obj_.build(child_) + self.set_Volume(obj_) +# end class FreightShipmentLineItem + + +class FreightSpecialServicePayment(GeneratedsSuper): + """Specifies which party will be responsible for payment of any + surcharges for Freight special services for which split billing + is allowed.""" + subclass = None + superclass = None + def __init__(self, SpecialService=None, PaymentType=None): + self.SpecialService = SpecialService + self.PaymentType = PaymentType + def factory(*args_, **kwargs_): + if FreightSpecialServicePayment.subclass: + return FreightSpecialServicePayment.subclass(*args_, **kwargs_) + else: + return FreightSpecialServicePayment(*args_, **kwargs_) + factory = staticmethod(factory) + def get_SpecialService(self): return self.SpecialService + def set_SpecialService(self, SpecialService): self.SpecialService = SpecialService + def validate_ShipmentSpecialServiceType(self, value): + # Validate type ShipmentSpecialServiceType, a restriction on xs:string. + pass + def get_PaymentType(self): return self.PaymentType + def set_PaymentType(self, PaymentType): self.PaymentType = PaymentType + def validate_FreightAccountPaymentType(self, value): + # Validate type FreightAccountPaymentType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='FreightSpecialServicePayment', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='FreightSpecialServicePayment') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='FreightSpecialServicePayment'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='FreightSpecialServicePayment', fromsubclass_=False): + if self.SpecialService is not None: + showIndent(outfile, level) + outfile.write('<%sSpecialService>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.SpecialService).encode(ExternalEncoding), input_name='SpecialService'), namespace_)) + if self.PaymentType is not None: + showIndent(outfile, level) + outfile.write('<%sPaymentType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PaymentType).encode(ExternalEncoding), input_name='PaymentType'), namespace_)) + def hasContent_(self): + if ( + self.SpecialService is not None or + self.PaymentType is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='FreightSpecialServicePayment'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.SpecialService is not None: + showIndent(outfile, level) + outfile.write('SpecialService=%s,\n' % quote_python(self.SpecialService).encode(ExternalEncoding)) + if self.PaymentType is not None: + showIndent(outfile, level) + outfile.write('PaymentType=%s,\n' % quote_python(self.PaymentType).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'SpecialService': + SpecialService_ = child_.text + SpecialService_ = self.gds_validate_string(SpecialService_, node, 'SpecialService') + self.SpecialService = SpecialService_ + self.validate_ShipmentSpecialServiceType(self.SpecialService) # validate type ShipmentSpecialServiceType + elif nodeName_ == 'PaymentType': + PaymentType_ = child_.text + PaymentType_ = self.gds_validate_string(PaymentType_, node, 'PaymentType') + self.PaymentType = PaymentType_ + self.validate_FreightAccountPaymentType(self.PaymentType) # validate type FreightAccountPaymentType +# end class FreightSpecialServicePayment + + +class GeneralAgencyAgreementDetail(GeneratedsSuper): + """Data required to produce a General Agency Agreement document. + Remaining content (business data) to be defined once + requirements have been completed.""" + subclass = None + superclass = None + def __init__(self, Format=None): + self.Format = Format + def factory(*args_, **kwargs_): + if GeneralAgencyAgreementDetail.subclass: + return GeneralAgencyAgreementDetail.subclass(*args_, **kwargs_) + else: + return GeneralAgencyAgreementDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Format(self): return self.Format + def set_Format(self, Format): self.Format = Format + def export(self, outfile, level, namespace_='ns:', name_='GeneralAgencyAgreementDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='GeneralAgencyAgreementDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='GeneralAgencyAgreementDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='GeneralAgencyAgreementDetail', fromsubclass_=False): + if self.Format: + self.Format.export(outfile, level, namespace_, name_='Format') + def hasContent_(self): + if ( + self.Format is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='GeneralAgencyAgreementDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Format is not None: + showIndent(outfile, level) + outfile.write('Format=model_.ShippingDocumentFormat(\n') + self.Format.exportLiteral(outfile, level, name_='Format') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Format': + obj_ = ShippingDocumentFormat.factory() + obj_.build(child_) + self.set_Format(obj_) +# end class GeneralAgencyAgreementDetail + + +class HazardousCommodityContent(GeneratedsSuper): + """Documents the kind and quantity of an individual hazardous commodity + in a package.""" + subclass = None + superclass = None + def __init__(self, Description=None, Quantity=None, Options=None): + self.Description = Description + self.Quantity = Quantity + self.Options = Options + def factory(*args_, **kwargs_): + if HazardousCommodityContent.subclass: + return HazardousCommodityContent.subclass(*args_, **kwargs_) + else: + return HazardousCommodityContent(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Description(self): return self.Description + def set_Description(self, Description): self.Description = Description + def get_Quantity(self): return self.Quantity + def set_Quantity(self, Quantity): self.Quantity = Quantity + def get_Options(self): return self.Options + def set_Options(self, Options): self.Options = Options + def export(self, outfile, level, namespace_='ns:', name_='HazardousCommodityContent', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='HazardousCommodityContent') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='HazardousCommodityContent'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='HazardousCommodityContent', fromsubclass_=False): + if self.Description: + self.Description.export(outfile, level, namespace_, name_='Description') + if self.Quantity: + self.Quantity.export(outfile, level, namespace_, name_='Quantity') + if self.Options: + self.Options.export(outfile, level, namespace_, name_='Options') + def hasContent_(self): + if ( + self.Description is not None or + self.Quantity is not None or + self.Options is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='HazardousCommodityContent'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Description is not None: + showIndent(outfile, level) + outfile.write('Description=model_.HazardousCommodityDescription(\n') + self.Description.exportLiteral(outfile, level, name_='Description') + showIndent(outfile, level) + outfile.write('),\n') + if self.Quantity is not None: + showIndent(outfile, level) + outfile.write('Quantity=model_.HazardousCommodityQuantityDetail(\n') + self.Quantity.exportLiteral(outfile, level, name_='Quantity') + showIndent(outfile, level) + outfile.write('),\n') + if self.Options is not None: + showIndent(outfile, level) + outfile.write('Options=model_.HazardousCommodityOptionDetail(\n') + self.Options.exportLiteral(outfile, level, name_='Options') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Description': + obj_ = HazardousCommodityDescription.factory() + obj_.build(child_) + self.set_Description(obj_) + elif nodeName_ == 'Quantity': + obj_ = HazardousCommodityQuantityDetail.factory() + obj_.build(child_) + self.set_Quantity(obj_) + elif nodeName_ == 'Options': + obj_ = HazardousCommodityOptionDetail.factory() + obj_.build(child_) + self.set_Options(obj_) +# end class HazardousCommodityContent + + +class HazardousCommodityDescription(GeneratedsSuper): + """Identifies and describes an individual hazardous commodity. For + 201001 load, this is based on data from the FedEx Ground + Hazardous Materials Shipping Guide.""" + subclass = None + superclass = None + def __init__(self, Id=None, PackingGroup=None, ProperShippingName=None, TechnicalName=None, HazardClass=None, SubsidiaryClasses=None, LabelText=None): + self.Id = Id + self.PackingGroup = PackingGroup + self.ProperShippingName = ProperShippingName + self.TechnicalName = TechnicalName + self.HazardClass = HazardClass + if SubsidiaryClasses is None: + self.SubsidiaryClasses = [] + else: + self.SubsidiaryClasses = SubsidiaryClasses + self.LabelText = LabelText + def factory(*args_, **kwargs_): + if HazardousCommodityDescription.subclass: + return HazardousCommodityDescription.subclass(*args_, **kwargs_) + else: + return HazardousCommodityDescription(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Id(self): return self.Id + def set_Id(self, Id): self.Id = Id + def get_PackingGroup(self): return self.PackingGroup + def set_PackingGroup(self, PackingGroup): self.PackingGroup = PackingGroup + def validate_HazardousCommodityPackingGroupType(self, value): + # Validate type HazardousCommodityPackingGroupType, a restriction on xs:string. + pass + def get_ProperShippingName(self): return self.ProperShippingName + def set_ProperShippingName(self, ProperShippingName): self.ProperShippingName = ProperShippingName + def get_TechnicalName(self): return self.TechnicalName + def set_TechnicalName(self, TechnicalName): self.TechnicalName = TechnicalName + def get_HazardClass(self): return self.HazardClass + def set_HazardClass(self, HazardClass): self.HazardClass = HazardClass + def get_SubsidiaryClasses(self): return self.SubsidiaryClasses + def set_SubsidiaryClasses(self, SubsidiaryClasses): self.SubsidiaryClasses = SubsidiaryClasses + def add_SubsidiaryClasses(self, value): self.SubsidiaryClasses.append(value) + def insert_SubsidiaryClasses(self, index, value): self.SubsidiaryClasses[index] = value + def get_LabelText(self): return self.LabelText + def set_LabelText(self, LabelText): self.LabelText = LabelText + def export(self, outfile, level, namespace_='ns:', name_='HazardousCommodityDescription', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='HazardousCommodityDescription') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='HazardousCommodityDescription'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='HazardousCommodityDescription', fromsubclass_=False): + if self.Id is not None: + showIndent(outfile, level) + outfile.write('<%sId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Id).encode(ExternalEncoding), input_name='Id'), namespace_)) + if self.PackingGroup is not None: + showIndent(outfile, level) + outfile.write('<%sPackingGroup>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PackingGroup).encode(ExternalEncoding), input_name='PackingGroup'), namespace_)) + if self.ProperShippingName is not None: + showIndent(outfile, level) + outfile.write('<%sProperShippingName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ProperShippingName).encode(ExternalEncoding), input_name='ProperShippingName'), namespace_)) + if self.TechnicalName is not None: + showIndent(outfile, level) + outfile.write('<%sTechnicalName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.TechnicalName).encode(ExternalEncoding), input_name='TechnicalName'), namespace_)) + if self.HazardClass is not None: + showIndent(outfile, level) + outfile.write('<%sHazardClass>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HazardClass).encode(ExternalEncoding), input_name='HazardClass'), namespace_)) + for SubsidiaryClasses_ in self.SubsidiaryClasses: + showIndent(outfile, level) + outfile.write('<%sSubsidiaryClasses>%s\n' % (namespace_, self.gds_format_string(quote_xml(SubsidiaryClasses_).encode(ExternalEncoding), input_name='SubsidiaryClasses'), namespace_)) + if self.LabelText is not None: + showIndent(outfile, level) + outfile.write('<%sLabelText>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LabelText).encode(ExternalEncoding), input_name='LabelText'), namespace_)) + def hasContent_(self): + if ( + self.Id is not None or + self.PackingGroup is not None or + self.ProperShippingName is not None or + self.TechnicalName is not None or + self.HazardClass is not None or + self.SubsidiaryClasses or + self.LabelText is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='HazardousCommodityDescription'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Id is not None: + showIndent(outfile, level) + outfile.write('Id=%s,\n' % quote_python(self.Id).encode(ExternalEncoding)) + if self.PackingGroup is not None: + showIndent(outfile, level) + outfile.write('PackingGroup=%s,\n' % quote_python(self.PackingGroup).encode(ExternalEncoding)) + if self.ProperShippingName is not None: + showIndent(outfile, level) + outfile.write('ProperShippingName=%s,\n' % quote_python(self.ProperShippingName).encode(ExternalEncoding)) + if self.TechnicalName is not None: + showIndent(outfile, level) + outfile.write('TechnicalName=%s,\n' % quote_python(self.TechnicalName).encode(ExternalEncoding)) + if self.HazardClass is not None: + showIndent(outfile, level) + outfile.write('HazardClass=%s,\n' % quote_python(self.HazardClass).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('SubsidiaryClasses=[\n') + level += 1 + for SubsidiaryClasses_ in self.SubsidiaryClasses: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(SubsidiaryClasses_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.LabelText is not None: + showIndent(outfile, level) + outfile.write('LabelText=%s,\n' % quote_python(self.LabelText).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Id': + Id_ = child_.text + Id_ = self.gds_validate_string(Id_, node, 'Id') + self.Id = Id_ + elif nodeName_ == 'PackingGroup': + PackingGroup_ = child_.text + PackingGroup_ = self.gds_validate_string(PackingGroup_, node, 'PackingGroup') + self.PackingGroup = PackingGroup_ + self.validate_HazardousCommodityPackingGroupType(self.PackingGroup) # validate type HazardousCommodityPackingGroupType + elif nodeName_ == 'ProperShippingName': + ProperShippingName_ = child_.text + ProperShippingName_ = self.gds_validate_string(ProperShippingName_, node, 'ProperShippingName') + self.ProperShippingName = ProperShippingName_ + elif nodeName_ == 'TechnicalName': + TechnicalName_ = child_.text + TechnicalName_ = self.gds_validate_string(TechnicalName_, node, 'TechnicalName') + self.TechnicalName = TechnicalName_ + elif nodeName_ == 'HazardClass': + HazardClass_ = child_.text + HazardClass_ = self.gds_validate_string(HazardClass_, node, 'HazardClass') + self.HazardClass = HazardClass_ + elif nodeName_ == 'SubsidiaryClasses': + SubsidiaryClasses_ = child_.text + SubsidiaryClasses_ = self.gds_validate_string(SubsidiaryClasses_, node, 'SubsidiaryClasses') + self.SubsidiaryClasses.append(SubsidiaryClasses_) + elif nodeName_ == 'LabelText': + LabelText_ = child_.text + LabelText_ = self.gds_validate_string(LabelText_, node, 'LabelText') + self.LabelText = LabelText_ +# end class HazardousCommodityDescription + + +class HazardousCommodityOptionDetail(GeneratedsSuper): + """Customer-provided specifications for handling individual + commodities.""" + subclass = None + superclass = None + def __init__(self, LabelTextOption=None, CustomerSuppliedLabelText=None): + self.LabelTextOption = LabelTextOption + self.CustomerSuppliedLabelText = CustomerSuppliedLabelText + def factory(*args_, **kwargs_): + if HazardousCommodityOptionDetail.subclass: + return HazardousCommodityOptionDetail.subclass(*args_, **kwargs_) + else: + return HazardousCommodityOptionDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_LabelTextOption(self): return self.LabelTextOption + def set_LabelTextOption(self, LabelTextOption): self.LabelTextOption = LabelTextOption + def validate_HazardousCommodityLabelTextOptionType(self, value): + # Validate type HazardousCommodityLabelTextOptionType, a restriction on xs:string. + pass + def get_CustomerSuppliedLabelText(self): return self.CustomerSuppliedLabelText + def set_CustomerSuppliedLabelText(self, CustomerSuppliedLabelText): self.CustomerSuppliedLabelText = CustomerSuppliedLabelText + def export(self, outfile, level, namespace_='ns:', name_='HazardousCommodityOptionDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='HazardousCommodityOptionDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='HazardousCommodityOptionDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='HazardousCommodityOptionDetail', fromsubclass_=False): + if self.LabelTextOption is not None: + showIndent(outfile, level) + outfile.write('<%sLabelTextOption>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LabelTextOption).encode(ExternalEncoding), input_name='LabelTextOption'), namespace_)) + if self.CustomerSuppliedLabelText is not None: + showIndent(outfile, level) + outfile.write('<%sCustomerSuppliedLabelText>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CustomerSuppliedLabelText).encode(ExternalEncoding), input_name='CustomerSuppliedLabelText'), namespace_)) + def hasContent_(self): + if ( + self.LabelTextOption is not None or + self.CustomerSuppliedLabelText is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='HazardousCommodityOptionDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.LabelTextOption is not None: + showIndent(outfile, level) + outfile.write('LabelTextOption=%s,\n' % quote_python(self.LabelTextOption).encode(ExternalEncoding)) + if self.CustomerSuppliedLabelText is not None: + showIndent(outfile, level) + outfile.write('CustomerSuppliedLabelText=%s,\n' % quote_python(self.CustomerSuppliedLabelText).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'LabelTextOption': + LabelTextOption_ = child_.text + LabelTextOption_ = self.gds_validate_string(LabelTextOption_, node, 'LabelTextOption') + self.LabelTextOption = LabelTextOption_ + self.validate_HazardousCommodityLabelTextOptionType(self.LabelTextOption) # validate type HazardousCommodityLabelTextOptionType + elif nodeName_ == 'CustomerSuppliedLabelText': + CustomerSuppliedLabelText_ = child_.text + CustomerSuppliedLabelText_ = self.gds_validate_string(CustomerSuppliedLabelText_, node, 'CustomerSuppliedLabelText') + self.CustomerSuppliedLabelText = CustomerSuppliedLabelText_ +# end class HazardousCommodityOptionDetail + + +class HazardousCommodityPackagingDetail(GeneratedsSuper): + """Identifies number and type of packaging units for hazardous + commodities.""" + subclass = None + superclass = None + def __init__(self, Count=None, Units=None): + self.Count = Count + self.Units = Units + def factory(*args_, **kwargs_): + if HazardousCommodityPackagingDetail.subclass: + return HazardousCommodityPackagingDetail.subclass(*args_, **kwargs_) + else: + return HazardousCommodityPackagingDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Count(self): return self.Count + def set_Count(self, Count): self.Count = Count + def get_Units(self): return self.Units + def set_Units(self, Units): self.Units = Units + def export(self, outfile, level, namespace_='ns:', name_='HazardousCommodityPackagingDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='HazardousCommodityPackagingDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='HazardousCommodityPackagingDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='HazardousCommodityPackagingDetail', fromsubclass_=False): + if self.Count is not None: + showIndent(outfile, level) + outfile.write('<%sCount>%s\n' % (namespace_, self.gds_format_integer(self.Count, input_name='Count'), namespace_)) + if self.Units is not None: + showIndent(outfile, level) + outfile.write('<%sUnits>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Units).encode(ExternalEncoding), input_name='Units'), namespace_)) + def hasContent_(self): + if ( + self.Count is not None or + self.Units is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='HazardousCommodityPackagingDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Count is not None: + showIndent(outfile, level) + outfile.write('Count=%d,\n' % self.Count) + if self.Units is not None: + showIndent(outfile, level) + outfile.write('Units=%s,\n' % quote_python(self.Units).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Count': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'Count') + self.Count = ival_ + elif nodeName_ == 'Units': + Units_ = child_.text + Units_ = self.gds_validate_string(Units_, node, 'Units') + self.Units = Units_ +# end class HazardousCommodityPackagingDetail + + +class HazardousCommodityQuantityDetail(GeneratedsSuper): + """Identifies amount and units for quantity of hazardous commodities.""" + subclass = None + superclass = None + def __init__(self, Amount=None, Units=None): + self.Amount = Amount + self.Units = Units + def factory(*args_, **kwargs_): + if HazardousCommodityQuantityDetail.subclass: + return HazardousCommodityQuantityDetail.subclass(*args_, **kwargs_) + else: + return HazardousCommodityQuantityDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Amount(self): return self.Amount + def set_Amount(self, Amount): self.Amount = Amount + def get_Units(self): return self.Units + def set_Units(self, Units): self.Units = Units + def export(self, outfile, level, namespace_='ns:', name_='HazardousCommodityQuantityDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='HazardousCommodityQuantityDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='HazardousCommodityQuantityDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='HazardousCommodityQuantityDetail', fromsubclass_=False): + if self.Amount is not None: + showIndent(outfile, level) + outfile.write('<%sAmount>%s\n' % (namespace_, self.gds_format_float(self.Amount, input_name='Amount'), namespace_)) + if self.Units is not None: + showIndent(outfile, level) + outfile.write('<%sUnits>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Units).encode(ExternalEncoding), input_name='Units'), namespace_)) + def hasContent_(self): + if ( + self.Amount is not None or + self.Units is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='HazardousCommodityQuantityDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Amount is not None: + showIndent(outfile, level) + outfile.write('Amount=%f,\n' % self.Amount) + if self.Units is not None: + showIndent(outfile, level) + outfile.write('Units=%s,\n' % quote_python(self.Units).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Amount': + sval_ = child_.text + try: + fval_ = float(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires float or double: %s' % exp) + fval_ = self.gds_validate_float(fval_, node, 'Amount') + self.Amount = fval_ + elif nodeName_ == 'Units': + Units_ = child_.text + Units_ = self.gds_validate_string(Units_, node, 'Units') + self.Units = Units_ +# end class HazardousCommodityQuantityDetail + + +class HoldAtLocationDetail(GeneratedsSuper): + """Descriptive data required for a FedEx shipment that is to be held at + the destination FedEx location for pickup by the recipient.""" + subclass = None + superclass = None + def __init__(self, PhoneNumber=None, LocationContactAndAddress=None, LocationType=None, LocationId=None, LocationNumber=None): + self.PhoneNumber = PhoneNumber + self.LocationContactAndAddress = LocationContactAndAddress + self.LocationType = LocationType + self.LocationId = LocationId + self.LocationNumber = LocationNumber + def factory(*args_, **kwargs_): + if HoldAtLocationDetail.subclass: + return HoldAtLocationDetail.subclass(*args_, **kwargs_) + else: + return HoldAtLocationDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_PhoneNumber(self): return self.PhoneNumber + def set_PhoneNumber(self, PhoneNumber): self.PhoneNumber = PhoneNumber + def get_LocationContactAndAddress(self): return self.LocationContactAndAddress + def set_LocationContactAndAddress(self, LocationContactAndAddress): self.LocationContactAndAddress = LocationContactAndAddress + def get_LocationType(self): return self.LocationType + def set_LocationType(self, LocationType): self.LocationType = LocationType + def validate_FedExLocationType(self, value): + # Validate type FedExLocationType, a restriction on xs:string. + pass + def get_LocationId(self): return self.LocationId + def set_LocationId(self, LocationId): self.LocationId = LocationId + def get_LocationNumber(self): return self.LocationNumber + def set_LocationNumber(self, LocationNumber): self.LocationNumber = LocationNumber + def export(self, outfile, level, namespace_='ns:', name_='HoldAtLocationDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='HoldAtLocationDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='HoldAtLocationDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='HoldAtLocationDetail', fromsubclass_=False): + if self.PhoneNumber is not None: + showIndent(outfile, level) + outfile.write('<%sPhoneNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PhoneNumber).encode(ExternalEncoding), input_name='PhoneNumber'), namespace_)) + if self.LocationContactAndAddress: + self.LocationContactAndAddress.export(outfile, level, namespace_, name_='LocationContactAndAddress') + if self.LocationType is not None: + showIndent(outfile, level) + outfile.write('<%sLocationType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LocationType).encode(ExternalEncoding), input_name='LocationType'), namespace_)) + if self.LocationId is not None: + showIndent(outfile, level) + outfile.write('<%sLocationId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LocationId).encode(ExternalEncoding), input_name='LocationId'), namespace_)) + if self.LocationNumber is not None: + showIndent(outfile, level) + outfile.write('<%sLocationNumber>%s\n' % (namespace_, self.gds_format_integer(self.LocationNumber, input_name='LocationNumber'), namespace_)) + def hasContent_(self): + if ( + self.PhoneNumber is not None or + self.LocationContactAndAddress is not None or + self.LocationType is not None or + self.LocationId is not None or + self.LocationNumber is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='HoldAtLocationDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.PhoneNumber is not None: + showIndent(outfile, level) + outfile.write('PhoneNumber=%s,\n' % quote_python(self.PhoneNumber).encode(ExternalEncoding)) + if self.LocationContactAndAddress is not None: + showIndent(outfile, level) + outfile.write('LocationContactAndAddress=model_.ContactAndAddress(\n') + self.LocationContactAndAddress.exportLiteral(outfile, level, name_='LocationContactAndAddress') + showIndent(outfile, level) + outfile.write('),\n') + if self.LocationType is not None: + showIndent(outfile, level) + outfile.write('LocationType=%s,\n' % quote_python(self.LocationType).encode(ExternalEncoding)) + if self.LocationId is not None: + showIndent(outfile, level) + outfile.write('LocationId=%s,\n' % quote_python(self.LocationId).encode(ExternalEncoding)) + if self.LocationNumber is not None: + showIndent(outfile, level) + outfile.write('LocationNumber=%d,\n' % self.LocationNumber) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'PhoneNumber': + PhoneNumber_ = child_.text + PhoneNumber_ = self.gds_validate_string(PhoneNumber_, node, 'PhoneNumber') + self.PhoneNumber = PhoneNumber_ + elif nodeName_ == 'LocationContactAndAddress': + obj_ = ContactAndAddress.factory() + obj_.build(child_) + self.set_LocationContactAndAddress(obj_) + elif nodeName_ == 'LocationType': + LocationType_ = child_.text + LocationType_ = self.gds_validate_string(LocationType_, node, 'LocationType') + self.LocationType = LocationType_ + self.validate_FedExLocationType(self.LocationType) # validate type FedExLocationType + elif nodeName_ == 'LocationId': + LocationId_ = child_.text + LocationId_ = self.gds_validate_string(LocationId_, node, 'LocationId') + self.LocationId = LocationId_ + elif nodeName_ == 'LocationNumber': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'LocationNumber') + self.LocationNumber = ival_ +# end class HoldAtLocationDetail + + +class HomeDeliveryPremiumDetail(GeneratedsSuper): + """The descriptive data required by FedEx for home delivery services.""" + subclass = None + superclass = None + def __init__(self, HomeDeliveryPremiumType=None, Date=None, PhoneNumber=None): + self.HomeDeliveryPremiumType = HomeDeliveryPremiumType + self.Date = Date + self.PhoneNumber = PhoneNumber + def factory(*args_, **kwargs_): + if HomeDeliveryPremiumDetail.subclass: + return HomeDeliveryPremiumDetail.subclass(*args_, **kwargs_) + else: + return HomeDeliveryPremiumDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_HomeDeliveryPremiumType(self): return self.HomeDeliveryPremiumType + def set_HomeDeliveryPremiumType(self, HomeDeliveryPremiumType): self.HomeDeliveryPremiumType = HomeDeliveryPremiumType + def validate_HomeDeliveryPremiumType(self, value): + # Validate type HomeDeliveryPremiumType, a restriction on xs:string. + pass + def get_Date(self): return self.Date + def set_Date(self, Date): self.Date = Date + def get_PhoneNumber(self): return self.PhoneNumber + def set_PhoneNumber(self, PhoneNumber): self.PhoneNumber = PhoneNumber + def export(self, outfile, level, namespace_='ns:', name_='HomeDeliveryPremiumDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='HomeDeliveryPremiumDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='HomeDeliveryPremiumDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='HomeDeliveryPremiumDetail', fromsubclass_=False): + if self.HomeDeliveryPremiumType is not None: + showIndent(outfile, level) + outfile.write('<%sHomeDeliveryPremiumType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HomeDeliveryPremiumType).encode(ExternalEncoding), input_name='HomeDeliveryPremiumType'), namespace_)) + if self.Date is not None: + showIndent(outfile, level) + outfile.write('<%sDate>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Date).encode(ExternalEncoding), input_name='Date'), namespace_)) + if self.PhoneNumber is not None: + showIndent(outfile, level) + outfile.write('<%sPhoneNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PhoneNumber).encode(ExternalEncoding), input_name='PhoneNumber'), namespace_)) + def hasContent_(self): + if ( + self.HomeDeliveryPremiumType is not None or + self.Date is not None or + self.PhoneNumber is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='HomeDeliveryPremiumDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.HomeDeliveryPremiumType is not None: + showIndent(outfile, level) + outfile.write('HomeDeliveryPremiumType=%s,\n' % quote_python(self.HomeDeliveryPremiumType).encode(ExternalEncoding)) + if self.Date is not None: + showIndent(outfile, level) + outfile.write('Date=%s,\n' % quote_python(self.Date).encode(ExternalEncoding)) + if self.PhoneNumber is not None: + showIndent(outfile, level) + outfile.write('PhoneNumber=%s,\n' % quote_python(self.PhoneNumber).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'HomeDeliveryPremiumType': + HomeDeliveryPremiumType_ = child_.text + HomeDeliveryPremiumType_ = self.gds_validate_string(HomeDeliveryPremiumType_, node, 'HomeDeliveryPremiumType') + self.HomeDeliveryPremiumType = HomeDeliveryPremiumType_ + self.validate_HomeDeliveryPremiumType(self.HomeDeliveryPremiumType) # validate type HomeDeliveryPremiumType + elif nodeName_ == 'Date': + Date_ = child_.text + Date_ = self.gds_validate_string(Date_, node, 'Date') + self.Date = Date_ + elif nodeName_ == 'PhoneNumber': + PhoneNumber_ = child_.text + PhoneNumber_ = self.gds_validate_string(PhoneNumber_, node, 'PhoneNumber') + self.PhoneNumber = PhoneNumber_ +# end class HomeDeliveryPremiumDetail + + +class LabelSpecification(GeneratedsSuper): + """Description of shipping label to be returned in the reply""" + subclass = None + superclass = None + def __init__(self, LabelFormatType=None, ImageType=None, LabelStockType=None, LabelPrintingOrientation=None, LabelRotation=None, PrintedLabelOrigin=None, CustomerSpecifiedDetail=None): + self.LabelFormatType = LabelFormatType + self.ImageType = ImageType + self.LabelStockType = LabelStockType + self.LabelPrintingOrientation = LabelPrintingOrientation + self.LabelRotation = LabelRotation + self.PrintedLabelOrigin = PrintedLabelOrigin + self.CustomerSpecifiedDetail = CustomerSpecifiedDetail + def factory(*args_, **kwargs_): + if LabelSpecification.subclass: + return LabelSpecification.subclass(*args_, **kwargs_) + else: + return LabelSpecification(*args_, **kwargs_) + factory = staticmethod(factory) + def get_LabelFormatType(self): return self.LabelFormatType + def set_LabelFormatType(self, LabelFormatType): self.LabelFormatType = LabelFormatType + def validate_LabelFormatType(self, value): + # Validate type LabelFormatType, a restriction on xs:string. + pass + def get_ImageType(self): return self.ImageType + def set_ImageType(self, ImageType): self.ImageType = ImageType + def validate_ShippingDocumentImageType(self, value): + # Validate type ShippingDocumentImageType, a restriction on xs:string. + pass + def get_LabelStockType(self): return self.LabelStockType + def set_LabelStockType(self, LabelStockType): self.LabelStockType = LabelStockType + def validate_LabelStockType(self, value): + # Validate type LabelStockType, a restriction on xs:string. + pass + def get_LabelPrintingOrientation(self): return self.LabelPrintingOrientation + def set_LabelPrintingOrientation(self, LabelPrintingOrientation): self.LabelPrintingOrientation = LabelPrintingOrientation + def validate_LabelPrintingOrientationType(self, value): + # Validate type LabelPrintingOrientationType, a restriction on xs:string. + pass + def get_LabelRotation(self): return self.LabelRotation + def set_LabelRotation(self, LabelRotation): self.LabelRotation = LabelRotation + def validate_LabelRotationType(self, value): + # Validate type LabelRotationType, a restriction on xs:string. + pass + def get_PrintedLabelOrigin(self): return self.PrintedLabelOrigin + def set_PrintedLabelOrigin(self, PrintedLabelOrigin): self.PrintedLabelOrigin = PrintedLabelOrigin + def get_CustomerSpecifiedDetail(self): return self.CustomerSpecifiedDetail + def set_CustomerSpecifiedDetail(self, CustomerSpecifiedDetail): self.CustomerSpecifiedDetail = CustomerSpecifiedDetail + def export(self, outfile, level, namespace_='ns:', name_='LabelSpecification', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='LabelSpecification') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='LabelSpecification'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='LabelSpecification', fromsubclass_=False): + if self.LabelFormatType is not None: + showIndent(outfile, level) + outfile.write('<%sLabelFormatType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LabelFormatType).encode(ExternalEncoding), input_name='LabelFormatType'), namespace_)) + if self.ImageType is not None: + showIndent(outfile, level) + outfile.write('<%sImageType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ImageType).encode(ExternalEncoding), input_name='ImageType'), namespace_)) + if self.LabelStockType is not None: + showIndent(outfile, level) + outfile.write('<%sLabelStockType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LabelStockType).encode(ExternalEncoding), input_name='LabelStockType'), namespace_)) + if self.LabelPrintingOrientation is not None: + showIndent(outfile, level) + outfile.write('<%sLabelPrintingOrientation>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LabelPrintingOrientation).encode(ExternalEncoding), input_name='LabelPrintingOrientation'), namespace_)) + if self.LabelRotation is not None: + showIndent(outfile, level) + outfile.write('<%sLabelRotation>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LabelRotation).encode(ExternalEncoding), input_name='LabelRotation'), namespace_)) + if self.PrintedLabelOrigin: + self.PrintedLabelOrigin.export(outfile, level, namespace_, name_='PrintedLabelOrigin') + if self.CustomerSpecifiedDetail: + self.CustomerSpecifiedDetail.export(outfile, level, namespace_, name_='CustomerSpecifiedDetail') + def hasContent_(self): + if ( + self.LabelFormatType is not None or + self.ImageType is not None or + self.LabelStockType is not None or + self.LabelPrintingOrientation is not None or + self.LabelRotation is not None or + self.PrintedLabelOrigin is not None or + self.CustomerSpecifiedDetail is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='LabelSpecification'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.LabelFormatType is not None: + showIndent(outfile, level) + outfile.write('LabelFormatType=%s,\n' % quote_python(self.LabelFormatType).encode(ExternalEncoding)) + if self.ImageType is not None: + showIndent(outfile, level) + outfile.write('ImageType=%s,\n' % quote_python(self.ImageType).encode(ExternalEncoding)) + if self.LabelStockType is not None: + showIndent(outfile, level) + outfile.write('LabelStockType=%s,\n' % quote_python(self.LabelStockType).encode(ExternalEncoding)) + if self.LabelPrintingOrientation is not None: + showIndent(outfile, level) + outfile.write('LabelPrintingOrientation=%s,\n' % quote_python(self.LabelPrintingOrientation).encode(ExternalEncoding)) + if self.LabelRotation is not None: + showIndent(outfile, level) + outfile.write('LabelRotation=%s,\n' % quote_python(self.LabelRotation).encode(ExternalEncoding)) + if self.PrintedLabelOrigin is not None: + showIndent(outfile, level) + outfile.write('PrintedLabelOrigin=model_.ContactAndAddress(\n') + self.PrintedLabelOrigin.exportLiteral(outfile, level, name_='PrintedLabelOrigin') + showIndent(outfile, level) + outfile.write('),\n') + if self.CustomerSpecifiedDetail is not None: + showIndent(outfile, level) + outfile.write('CustomerSpecifiedDetail=model_.CustomerSpecifiedLabelDetail(\n') + self.CustomerSpecifiedDetail.exportLiteral(outfile, level, name_='CustomerSpecifiedDetail') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'LabelFormatType': + LabelFormatType_ = child_.text + LabelFormatType_ = self.gds_validate_string(LabelFormatType_, node, 'LabelFormatType') + self.LabelFormatType = LabelFormatType_ + self.validate_LabelFormatType(self.LabelFormatType) # validate type LabelFormatType + elif nodeName_ == 'ImageType': + ImageType_ = child_.text + ImageType_ = self.gds_validate_string(ImageType_, node, 'ImageType') + self.ImageType = ImageType_ + self.validate_ShippingDocumentImageType(self.ImageType) # validate type ShippingDocumentImageType + elif nodeName_ == 'LabelStockType': + LabelStockType_ = child_.text + LabelStockType_ = self.gds_validate_string(LabelStockType_, node, 'LabelStockType') + self.LabelStockType = LabelStockType_ + self.validate_LabelStockType(self.LabelStockType) # validate type LabelStockType + elif nodeName_ == 'LabelPrintingOrientation': + LabelPrintingOrientation_ = child_.text + LabelPrintingOrientation_ = self.gds_validate_string(LabelPrintingOrientation_, node, 'LabelPrintingOrientation') + self.LabelPrintingOrientation = LabelPrintingOrientation_ + self.validate_LabelPrintingOrientationType(self.LabelPrintingOrientation) # validate type LabelPrintingOrientationType + elif nodeName_ == 'LabelRotation': + LabelRotation_ = child_.text + LabelRotation_ = self.gds_validate_string(LabelRotation_, node, 'LabelRotation') + self.LabelRotation = LabelRotation_ + self.validate_LabelRotationType(self.LabelRotation) # validate type LabelRotationType + elif nodeName_ == 'PrintedLabelOrigin': + obj_ = ContactAndAddress.factory() + obj_.build(child_) + self.set_PrintedLabelOrigin(obj_) + elif nodeName_ == 'CustomerSpecifiedDetail': + obj_ = CustomerSpecifiedLabelDetail.factory() + obj_.build(child_) + self.set_CustomerSpecifiedDetail(obj_) +# end class LabelSpecification + + +class LiabilityCoverageDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, CoverageType=None, CoverageAmount=None): + self.CoverageType = CoverageType + self.CoverageAmount = CoverageAmount + def factory(*args_, **kwargs_): + if LiabilityCoverageDetail.subclass: + return LiabilityCoverageDetail.subclass(*args_, **kwargs_) + else: + return LiabilityCoverageDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_CoverageType(self): return self.CoverageType + def set_CoverageType(self, CoverageType): self.CoverageType = CoverageType + def validate_LiabilityCoverageType(self, value): + # Validate type LiabilityCoverageType, a restriction on xs:string. + pass + def get_CoverageAmount(self): return self.CoverageAmount + def set_CoverageAmount(self, CoverageAmount): self.CoverageAmount = CoverageAmount + def export(self, outfile, level, namespace_='ns:', name_='LiabilityCoverageDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='LiabilityCoverageDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='LiabilityCoverageDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='LiabilityCoverageDetail', fromsubclass_=False): + if self.CoverageType is not None: + showIndent(outfile, level) + outfile.write('<%sCoverageType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CoverageType).encode(ExternalEncoding), input_name='CoverageType'), namespace_)) + if self.CoverageAmount: + self.CoverageAmount.export(outfile, level, namespace_, name_='CoverageAmount') + def hasContent_(self): + if ( + self.CoverageType is not None or + self.CoverageAmount is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='LiabilityCoverageDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.CoverageType is not None: + showIndent(outfile, level) + outfile.write('CoverageType=%s,\n' % quote_python(self.CoverageType).encode(ExternalEncoding)) + if self.CoverageAmount is not None: + showIndent(outfile, level) + outfile.write('CoverageAmount=model_.Money(\n') + self.CoverageAmount.exportLiteral(outfile, level, name_='CoverageAmount') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'CoverageType': + CoverageType_ = child_.text + CoverageType_ = self.gds_validate_string(CoverageType_, node, 'CoverageType') + self.CoverageType = CoverageType_ + self.validate_LiabilityCoverageType(self.CoverageType) # validate type LiabilityCoverageType + elif nodeName_ == 'CoverageAmount': + obj_ = Money.factory() + obj_.build(child_) + self.set_CoverageAmount(obj_) +# end class LiabilityCoverageDetail + + +class LinearMeasure(GeneratedsSuper): + """Represents a one-dimensional measurement in small units (e.g. + suitable for measuring a package or document), contrasted with + Distance, which represents a large one-dimensional measurement + (e.g. distance between cities).""" + subclass = None + superclass = None + def __init__(self, Value=None, Units=None): + self.Value = Value + self.Units = Units + def factory(*args_, **kwargs_): + if LinearMeasure.subclass: + return LinearMeasure.subclass(*args_, **kwargs_) + else: + return LinearMeasure(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Value(self): return self.Value + def set_Value(self, Value): self.Value = Value + def get_Units(self): return self.Units + def set_Units(self, Units): self.Units = Units + def validate_LinearUnits(self, value): + # Validate type LinearUnits, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='LinearMeasure', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='LinearMeasure') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='LinearMeasure'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='LinearMeasure', fromsubclass_=False): + if self.Value is not None: + showIndent(outfile, level) + outfile.write('<%sValue>%s\n' % (namespace_, self.gds_format_float(self.Value, input_name='Value'), namespace_)) + if self.Units is not None: + showIndent(outfile, level) + outfile.write('<%sUnits>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Units).encode(ExternalEncoding), input_name='Units'), namespace_)) + def hasContent_(self): + if ( + self.Value is not None or + self.Units is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='LinearMeasure'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Value is not None: + showIndent(outfile, level) + outfile.write('Value=%f,\n' % self.Value) + if self.Units is not None: + showIndent(outfile, level) + outfile.write('Units=%s,\n' % quote_python(self.Units).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Value': + sval_ = child_.text + try: + fval_ = float(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires float or double: %s' % exp) + fval_ = self.gds_validate_float(fval_, node, 'Value') + self.Value = fval_ + elif nodeName_ == 'Units': + Units_ = child_.text + Units_ = self.gds_validate_string(Units_, node, 'Units') + self.Units = Units_ + self.validate_LinearUnits(self.Units) # validate type LinearUnits +# end class LinearMeasure + + +class Localization(GeneratedsSuper): + """Identifies the representation of human-readable text.""" + subclass = None + superclass = None + def __init__(self, LanguageCode=None, LocaleCode=None): + self.LanguageCode = LanguageCode + self.LocaleCode = LocaleCode + def factory(*args_, **kwargs_): + if Localization.subclass: + return Localization.subclass(*args_, **kwargs_) + else: + return Localization(*args_, **kwargs_) + factory = staticmethod(factory) + def get_LanguageCode(self): return self.LanguageCode + def set_LanguageCode(self, LanguageCode): self.LanguageCode = LanguageCode + def get_LocaleCode(self): return self.LocaleCode + def set_LocaleCode(self, LocaleCode): self.LocaleCode = LocaleCode + def export(self, outfile, level, namespace_='ns:', name_='Localization', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Localization') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Localization'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Localization', fromsubclass_=False): + if self.LanguageCode is not None: + showIndent(outfile, level) + outfile.write('<%sLanguageCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LanguageCode).encode(ExternalEncoding), input_name='LanguageCode'), namespace_)) + if self.LocaleCode is not None: + showIndent(outfile, level) + outfile.write('<%sLocaleCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LocaleCode).encode(ExternalEncoding), input_name='LocaleCode'), namespace_)) + def hasContent_(self): + if ( + self.LanguageCode is not None or + self.LocaleCode is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Localization'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.LanguageCode is not None: + showIndent(outfile, level) + outfile.write('LanguageCode=%s,\n' % quote_python(self.LanguageCode).encode(ExternalEncoding)) + if self.LocaleCode is not None: + showIndent(outfile, level) + outfile.write('LocaleCode=%s,\n' % quote_python(self.LocaleCode).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'LanguageCode': + LanguageCode_ = child_.text + LanguageCode_ = self.gds_validate_string(LanguageCode_, node, 'LanguageCode') + self.LanguageCode = LanguageCode_ + elif nodeName_ == 'LocaleCode': + LocaleCode_ = child_.text + LocaleCode_ = self.gds_validate_string(LocaleCode_, node, 'LocaleCode') + self.LocaleCode = LocaleCode_ +# end class Localization + + +class Measure(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Quantity=None, Units=None): + self.Quantity = Quantity + self.Units = Units + def factory(*args_, **kwargs_): + if Measure.subclass: + return Measure.subclass(*args_, **kwargs_) + else: + return Measure(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Quantity(self): return self.Quantity + def set_Quantity(self, Quantity): self.Quantity = Quantity + def get_Units(self): return self.Units + def set_Units(self, Units): self.Units = Units + def export(self, outfile, level, namespace_='ns:', name_='Measure', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Measure') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Measure'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Measure', fromsubclass_=False): + if self.Quantity is not None: + showIndent(outfile, level) + outfile.write('<%sQuantity>%s\n' % (namespace_, self.gds_format_float(self.Quantity, input_name='Quantity'), namespace_)) + if self.Units is not None: + showIndent(outfile, level) + outfile.write('<%sUnits>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Units).encode(ExternalEncoding), input_name='Units'), namespace_)) + def hasContent_(self): + if ( + self.Quantity is not None or + self.Units is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Measure'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Quantity is not None: + showIndent(outfile, level) + outfile.write('Quantity=%f,\n' % self.Quantity) + if self.Units is not None: + showIndent(outfile, level) + outfile.write('Units=%s,\n' % quote_python(self.Units).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Quantity': + sval_ = child_.text + try: + fval_ = float(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires float or double: %s' % exp) + fval_ = self.gds_validate_float(fval_, node, 'Quantity') + self.Quantity = fval_ + elif nodeName_ == 'Units': + Units_ = child_.text + Units_ = self.gds_validate_string(Units_, node, 'Units') + self.Units = Units_ +# end class Measure + + +class Money(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Currency=None, Amount=None): + self.Currency = Currency + self.Amount = Amount + def factory(*args_, **kwargs_): + if Money.subclass: + return Money.subclass(*args_, **kwargs_) + else: + return Money(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Currency(self): return self.Currency + def set_Currency(self, Currency): self.Currency = Currency + def get_Amount(self): return self.Amount + def set_Amount(self, Amount): self.Amount = Amount + def export(self, outfile, level, namespace_='ns:', name_='Money', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Money') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Money'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Money', fromsubclass_=False): + if self.Currency is not None: + showIndent(outfile, level) + outfile.write('<%sCurrency>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Currency).encode(ExternalEncoding), input_name='Currency'), namespace_)) + if self.Amount is not None: + showIndent(outfile, level) + outfile.write('<%sAmount>%s\n' % (namespace_, self.gds_format_float(self.Amount, input_name='Amount'), namespace_)) + def hasContent_(self): + if ( + self.Currency is not None or + self.Amount is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Money'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Currency is not None: + showIndent(outfile, level) + outfile.write('Currency=%s,\n' % quote_python(self.Currency).encode(ExternalEncoding)) + if self.Amount is not None: + showIndent(outfile, level) + outfile.write('Amount=%f,\n' % self.Amount) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Currency': + Currency_ = child_.text + Currency_ = self.gds_validate_string(Currency_, node, 'Currency') + self.Currency = Currency_ + elif nodeName_ == 'Amount': + sval_ = child_.text + try: + fval_ = float(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires float or double: %s' % exp) + fval_ = self.gds_validate_float(fval_, node, 'Amount') + self.Amount = fval_ +# end class Money + + +class NaftaCertificateOfOriginDetail(GeneratedsSuper): + """Data required to produce a Certificate of Origin document. Remaining + content (business data) to be defined once requirements have + been completed.""" + subclass = None + superclass = None + def __init__(self, Format=None, BlanketPeriod=None, ImporterSpecification=None, SignatureContact=None, ProducerSpecification=None, Producers=None, CustomerImageUsages=None): + self.Format = Format + self.BlanketPeriod = BlanketPeriod + self.ImporterSpecification = ImporterSpecification + self.SignatureContact = SignatureContact + self.ProducerSpecification = ProducerSpecification + if Producers is None: + self.Producers = [] + else: + self.Producers = Producers + if CustomerImageUsages is None: + self.CustomerImageUsages = [] + else: + self.CustomerImageUsages = CustomerImageUsages + def factory(*args_, **kwargs_): + if NaftaCertificateOfOriginDetail.subclass: + return NaftaCertificateOfOriginDetail.subclass(*args_, **kwargs_) + else: + return NaftaCertificateOfOriginDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Format(self): return self.Format + def set_Format(self, Format): self.Format = Format + def get_BlanketPeriod(self): return self.BlanketPeriod + def set_BlanketPeriod(self, BlanketPeriod): self.BlanketPeriod = BlanketPeriod + def get_ImporterSpecification(self): return self.ImporterSpecification + def set_ImporterSpecification(self, ImporterSpecification): self.ImporterSpecification = ImporterSpecification + def validate_NaftaImporterSpecificationType(self, value): + # Validate type NaftaImporterSpecificationType, a restriction on xs:string. + pass + def get_SignatureContact(self): return self.SignatureContact + def set_SignatureContact(self, SignatureContact): self.SignatureContact = SignatureContact + def get_ProducerSpecification(self): return self.ProducerSpecification + def set_ProducerSpecification(self, ProducerSpecification): self.ProducerSpecification = ProducerSpecification + def validate_NaftaProducerSpecificationType(self, value): + # Validate type NaftaProducerSpecificationType, a restriction on xs:string. + pass + def get_Producers(self): return self.Producers + def set_Producers(self, Producers): self.Producers = Producers + def add_Producers(self, value): self.Producers.append(value) + def insert_Producers(self, index, value): self.Producers[index] = value + def get_CustomerImageUsages(self): return self.CustomerImageUsages + def set_CustomerImageUsages(self, CustomerImageUsages): self.CustomerImageUsages = CustomerImageUsages + def add_CustomerImageUsages(self, value): self.CustomerImageUsages.append(value) + def insert_CustomerImageUsages(self, index, value): self.CustomerImageUsages[index] = value + def export(self, outfile, level, namespace_='ns:', name_='NaftaCertificateOfOriginDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='NaftaCertificateOfOriginDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='NaftaCertificateOfOriginDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='NaftaCertificateOfOriginDetail', fromsubclass_=False): + if self.Format: + self.Format.export(outfile, level, namespace_, name_='Format') + if self.BlanketPeriod: + self.BlanketPeriod.export(outfile, level, namespace_, name_='BlanketPeriod') + if self.ImporterSpecification is not None: + showIndent(outfile, level) + outfile.write('<%sImporterSpecification>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ImporterSpecification).encode(ExternalEncoding), input_name='ImporterSpecification'), namespace_)) + if self.SignatureContact: + self.SignatureContact.export(outfile, level, namespace_, name_='SignatureContact') + if self.ProducerSpecification is not None: + showIndent(outfile, level) + outfile.write('<%sProducerSpecification>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ProducerSpecification).encode(ExternalEncoding), input_name='ProducerSpecification'), namespace_)) + for Producers_ in self.Producers: + Producers_.export(outfile, level, namespace_, name_='Producers') + for CustomerImageUsages_ in self.CustomerImageUsages: + CustomerImageUsages_.export(outfile, level, namespace_, name_='CustomerImageUsages') + def hasContent_(self): + if ( + self.Format is not None or + self.BlanketPeriod is not None or + self.ImporterSpecification is not None or + self.SignatureContact is not None or + self.ProducerSpecification is not None or + self.Producers or + self.CustomerImageUsages + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='NaftaCertificateOfOriginDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Format is not None: + showIndent(outfile, level) + outfile.write('Format=model_.ShippingDocumentFormat(\n') + self.Format.exportLiteral(outfile, level, name_='Format') + showIndent(outfile, level) + outfile.write('),\n') + if self.BlanketPeriod is not None: + showIndent(outfile, level) + outfile.write('BlanketPeriod=model_.DateRange(\n') + self.BlanketPeriod.exportLiteral(outfile, level, name_='BlanketPeriod') + showIndent(outfile, level) + outfile.write('),\n') + if self.ImporterSpecification is not None: + showIndent(outfile, level) + outfile.write('ImporterSpecification=%s,\n' % quote_python(self.ImporterSpecification).encode(ExternalEncoding)) + if self.SignatureContact is not None: + showIndent(outfile, level) + outfile.write('SignatureContact=model_.Contact(\n') + self.SignatureContact.exportLiteral(outfile, level, name_='SignatureContact') + showIndent(outfile, level) + outfile.write('),\n') + if self.ProducerSpecification is not None: + showIndent(outfile, level) + outfile.write('ProducerSpecification=%s,\n' % quote_python(self.ProducerSpecification).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Producers=[\n') + level += 1 + for Producers_ in self.Producers: + showIndent(outfile, level) + outfile.write('model_.NaftaProducer(\n') + Producers_.exportLiteral(outfile, level, name_='NaftaProducer') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('CustomerImageUsages=[\n') + level += 1 + for CustomerImageUsages_ in self.CustomerImageUsages: + showIndent(outfile, level) + outfile.write('model_.CustomerImageUsage(\n') + CustomerImageUsages_.exportLiteral(outfile, level, name_='CustomerImageUsage') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Format': + obj_ = ShippingDocumentFormat.factory() + obj_.build(child_) + self.set_Format(obj_) + elif nodeName_ == 'BlanketPeriod': + obj_ = DateRange.factory() + obj_.build(child_) + self.set_BlanketPeriod(obj_) + elif nodeName_ == 'ImporterSpecification': + ImporterSpecification_ = child_.text + ImporterSpecification_ = self.gds_validate_string(ImporterSpecification_, node, 'ImporterSpecification') + self.ImporterSpecification = ImporterSpecification_ + self.validate_NaftaImporterSpecificationType(self.ImporterSpecification) # validate type NaftaImporterSpecificationType + elif nodeName_ == 'SignatureContact': + obj_ = Contact.factory() + obj_.build(child_) + self.set_SignatureContact(obj_) + elif nodeName_ == 'ProducerSpecification': + ProducerSpecification_ = child_.text + ProducerSpecification_ = self.gds_validate_string(ProducerSpecification_, node, 'ProducerSpecification') + self.ProducerSpecification = ProducerSpecification_ + self.validate_NaftaProducerSpecificationType(self.ProducerSpecification) # validate type NaftaProducerSpecificationType + elif nodeName_ == 'Producers': + obj_ = NaftaProducer.factory() + obj_.build(child_) + self.Producers.append(obj_) + elif nodeName_ == 'CustomerImageUsages': + obj_ = CustomerImageUsage.factory() + obj_.build(child_) + self.CustomerImageUsages.append(obj_) +# end class NaftaCertificateOfOriginDetail + + +class NaftaCommodityDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, PreferenceCriterion=None, ProducerDetermination=None, ProducerId=None, NetCostMethod=None, NetCostDateRange=None): + self.PreferenceCriterion = PreferenceCriterion + self.ProducerDetermination = ProducerDetermination + self.ProducerId = ProducerId + self.NetCostMethod = NetCostMethod + self.NetCostDateRange = NetCostDateRange + def factory(*args_, **kwargs_): + if NaftaCommodityDetail.subclass: + return NaftaCommodityDetail.subclass(*args_, **kwargs_) + else: + return NaftaCommodityDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_PreferenceCriterion(self): return self.PreferenceCriterion + def set_PreferenceCriterion(self, PreferenceCriterion): self.PreferenceCriterion = PreferenceCriterion + def validate_NaftaPreferenceCriterionCode(self, value): + # Validate type NaftaPreferenceCriterionCode, a restriction on xs:string. + pass + def get_ProducerDetermination(self): return self.ProducerDetermination + def set_ProducerDetermination(self, ProducerDetermination): self.ProducerDetermination = ProducerDetermination + def validate_NaftaProducerDeterminationCode(self, value): + # Validate type NaftaProducerDeterminationCode, a restriction on xs:string. + pass + def get_ProducerId(self): return self.ProducerId + def set_ProducerId(self, ProducerId): self.ProducerId = ProducerId + def get_NetCostMethod(self): return self.NetCostMethod + def set_NetCostMethod(self, NetCostMethod): self.NetCostMethod = NetCostMethod + def validate_NaftaNetCostMethodCode(self, value): + # Validate type NaftaNetCostMethodCode, a restriction on xs:string. + pass + def get_NetCostDateRange(self): return self.NetCostDateRange + def set_NetCostDateRange(self, NetCostDateRange): self.NetCostDateRange = NetCostDateRange + def export(self, outfile, level, namespace_='ns:', name_='NaftaCommodityDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='NaftaCommodityDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='NaftaCommodityDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='NaftaCommodityDetail', fromsubclass_=False): + if self.PreferenceCriterion is not None: + showIndent(outfile, level) + outfile.write('<%sPreferenceCriterion>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PreferenceCriterion).encode(ExternalEncoding), input_name='PreferenceCriterion'), namespace_)) + if self.ProducerDetermination is not None: + showIndent(outfile, level) + outfile.write('<%sProducerDetermination>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ProducerDetermination).encode(ExternalEncoding), input_name='ProducerDetermination'), namespace_)) + if self.ProducerId is not None: + showIndent(outfile, level) + outfile.write('<%sProducerId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ProducerId).encode(ExternalEncoding), input_name='ProducerId'), namespace_)) + if self.NetCostMethod is not None: + showIndent(outfile, level) + outfile.write('<%sNetCostMethod>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.NetCostMethod).encode(ExternalEncoding), input_name='NetCostMethod'), namespace_)) + if self.NetCostDateRange: + self.NetCostDateRange.export(outfile, level, namespace_, name_='NetCostDateRange') + def hasContent_(self): + if ( + self.PreferenceCriterion is not None or + self.ProducerDetermination is not None or + self.ProducerId is not None or + self.NetCostMethod is not None or + self.NetCostDateRange is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='NaftaCommodityDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.PreferenceCriterion is not None: + showIndent(outfile, level) + outfile.write('PreferenceCriterion=%s,\n' % quote_python(self.PreferenceCriterion).encode(ExternalEncoding)) + if self.ProducerDetermination is not None: + showIndent(outfile, level) + outfile.write('ProducerDetermination=%s,\n' % quote_python(self.ProducerDetermination).encode(ExternalEncoding)) + if self.ProducerId is not None: + showIndent(outfile, level) + outfile.write('ProducerId=%s,\n' % quote_python(self.ProducerId).encode(ExternalEncoding)) + if self.NetCostMethod is not None: + showIndent(outfile, level) + outfile.write('NetCostMethod=%s,\n' % quote_python(self.NetCostMethod).encode(ExternalEncoding)) + if self.NetCostDateRange is not None: + showIndent(outfile, level) + outfile.write('NetCostDateRange=model_.DateRange(\n') + self.NetCostDateRange.exportLiteral(outfile, level, name_='NetCostDateRange') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'PreferenceCriterion': + PreferenceCriterion_ = child_.text + PreferenceCriterion_ = self.gds_validate_string(PreferenceCriterion_, node, 'PreferenceCriterion') + self.PreferenceCriterion = PreferenceCriterion_ + self.validate_NaftaPreferenceCriterionCode(self.PreferenceCriterion) # validate type NaftaPreferenceCriterionCode + elif nodeName_ == 'ProducerDetermination': + ProducerDetermination_ = child_.text + ProducerDetermination_ = self.gds_validate_string(ProducerDetermination_, node, 'ProducerDetermination') + self.ProducerDetermination = ProducerDetermination_ + self.validate_NaftaProducerDeterminationCode(self.ProducerDetermination) # validate type NaftaProducerDeterminationCode + elif nodeName_ == 'ProducerId': + ProducerId_ = child_.text + ProducerId_ = self.gds_validate_string(ProducerId_, node, 'ProducerId') + self.ProducerId = ProducerId_ + elif nodeName_ == 'NetCostMethod': + NetCostMethod_ = child_.text + NetCostMethod_ = self.gds_validate_string(NetCostMethod_, node, 'NetCostMethod') + self.NetCostMethod = NetCostMethod_ + self.validate_NaftaNetCostMethodCode(self.NetCostMethod) # validate type NaftaNetCostMethodCode + elif nodeName_ == 'NetCostDateRange': + obj_ = DateRange.factory() + obj_.build(child_) + self.set_NetCostDateRange(obj_) +# end class NaftaCommodityDetail + + +class NaftaProducer(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Id=None, Producer=None): + self.Id = Id + self.Producer = Producer + def factory(*args_, **kwargs_): + if NaftaProducer.subclass: + return NaftaProducer.subclass(*args_, **kwargs_) + else: + return NaftaProducer(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Id(self): return self.Id + def set_Id(self, Id): self.Id = Id + def get_Producer(self): return self.Producer + def set_Producer(self, Producer): self.Producer = Producer + def export(self, outfile, level, namespace_='ns:', name_='NaftaProducer', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='NaftaProducer') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='NaftaProducer'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='NaftaProducer', fromsubclass_=False): + if self.Id is not None: + showIndent(outfile, level) + outfile.write('<%sId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Id).encode(ExternalEncoding), input_name='Id'), namespace_)) + if self.Producer: + self.Producer.export(outfile, level, namespace_, name_='Producer') + def hasContent_(self): + if ( + self.Id is not None or + self.Producer is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='NaftaProducer'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Id is not None: + showIndent(outfile, level) + outfile.write('Id=%s,\n' % quote_python(self.Id).encode(ExternalEncoding)) + if self.Producer is not None: + showIndent(outfile, level) + outfile.write('Producer=model_.Party(\n') + self.Producer.exportLiteral(outfile, level, name_='Producer') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Id': + Id_ = child_.text + Id_ = self.gds_validate_string(Id_, node, 'Id') + self.Id = Id_ + elif nodeName_ == 'Producer': + obj_ = Party.factory() + obj_.build(child_) + self.set_Producer(obj_) +# end class NaftaProducer + + +class Notification(GeneratedsSuper): + """The descriptive data regarding the result of the submitted + transaction.""" + subclass = None + superclass = None + def __init__(self, Severity=None, Source=None, Code=None, Message=None, LocalizedMessage=None, MessageParameters=None): + self.Severity = Severity + self.Source = Source + self.Code = Code + self.Message = Message + self.LocalizedMessage = LocalizedMessage + if MessageParameters is None: + self.MessageParameters = [] + else: + self.MessageParameters = MessageParameters + def factory(*args_, **kwargs_): + if Notification.subclass: + return Notification.subclass(*args_, **kwargs_) + else: + return Notification(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Severity(self): return self.Severity + def set_Severity(self, Severity): self.Severity = Severity + def validate_NotificationSeverityType(self, value): + # Validate type NotificationSeverityType, a restriction on xs:string. + pass + def get_Source(self): return self.Source + def set_Source(self, Source): self.Source = Source + def get_Code(self): return self.Code + def set_Code(self, Code): self.Code = Code + def get_Message(self): return self.Message + def set_Message(self, Message): self.Message = Message + def get_LocalizedMessage(self): return self.LocalizedMessage + def set_LocalizedMessage(self, LocalizedMessage): self.LocalizedMessage = LocalizedMessage + def get_MessageParameters(self): return self.MessageParameters + def set_MessageParameters(self, MessageParameters): self.MessageParameters = MessageParameters + def add_MessageParameters(self, value): self.MessageParameters.append(value) + def insert_MessageParameters(self, index, value): self.MessageParameters[index] = value + def export(self, outfile, level, namespace_='ns:', name_='Notification', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Notification') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Notification'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Notification', fromsubclass_=False): + if self.Severity is not None: + showIndent(outfile, level) + outfile.write('<%sSeverity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Severity).encode(ExternalEncoding), input_name='Severity'), namespace_)) + if self.Source is not None: + showIndent(outfile, level) + outfile.write('<%sSource>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Source).encode(ExternalEncoding), input_name='Source'), namespace_)) + if self.Code is not None: + showIndent(outfile, level) + outfile.write('<%sCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Code).encode(ExternalEncoding), input_name='Code'), namespace_)) + if self.Message is not None: + showIndent(outfile, level) + outfile.write('<%sMessage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Message).encode(ExternalEncoding), input_name='Message'), namespace_)) + if self.LocalizedMessage is not None: + showIndent(outfile, level) + outfile.write('<%sLocalizedMessage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LocalizedMessage).encode(ExternalEncoding), input_name='LocalizedMessage'), namespace_)) + for MessageParameters_ in self.MessageParameters: + MessageParameters_.export(outfile, level, namespace_, name_='MessageParameters') + def hasContent_(self): + if ( + self.Severity is not None or + self.Source is not None or + self.Code is not None or + self.Message is not None or + self.LocalizedMessage is not None or + self.MessageParameters + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Notification'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Severity is not None: + showIndent(outfile, level) + outfile.write('Severity=%s,\n' % quote_python(self.Severity).encode(ExternalEncoding)) + if self.Source is not None: + showIndent(outfile, level) + outfile.write('Source=%s,\n' % quote_python(self.Source).encode(ExternalEncoding)) + if self.Code is not None: + showIndent(outfile, level) + outfile.write('Code=%s,\n' % quote_python(self.Code).encode(ExternalEncoding)) + if self.Message is not None: + showIndent(outfile, level) + outfile.write('Message=%s,\n' % quote_python(self.Message).encode(ExternalEncoding)) + if self.LocalizedMessage is not None: + showIndent(outfile, level) + outfile.write('LocalizedMessage=%s,\n' % quote_python(self.LocalizedMessage).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('MessageParameters=[\n') + level += 1 + for MessageParameters_ in self.MessageParameters: + showIndent(outfile, level) + outfile.write('model_.NotificationParameter(\n') + MessageParameters_.exportLiteral(outfile, level, name_='NotificationParameter') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Severity': + Severity_ = child_.text + Severity_ = self.gds_validate_string(Severity_, node, 'Severity') + self.Severity = Severity_ + self.validate_NotificationSeverityType(self.Severity) # validate type NotificationSeverityType + elif nodeName_ == 'Source': + Source_ = child_.text + Source_ = self.gds_validate_string(Source_, node, 'Source') + self.Source = Source_ + elif nodeName_ == 'Code': + Code_ = child_.text + Code_ = self.gds_validate_string(Code_, node, 'Code') + self.Code = Code_ + elif nodeName_ == 'Message': + Message_ = child_.text + Message_ = self.gds_validate_string(Message_, node, 'Message') + self.Message = Message_ + elif nodeName_ == 'LocalizedMessage': + LocalizedMessage_ = child_.text + LocalizedMessage_ = self.gds_validate_string(LocalizedMessage_, node, 'LocalizedMessage') + self.LocalizedMessage = LocalizedMessage_ + elif nodeName_ == 'MessageParameters': + obj_ = NotificationParameter.factory() + obj_.build(child_) + self.MessageParameters.append(obj_) +# end class Notification + + +class NotificationParameter(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Id=None, Value=None): + self.Id = Id + self.Value = Value + def factory(*args_, **kwargs_): + if NotificationParameter.subclass: + return NotificationParameter.subclass(*args_, **kwargs_) + else: + return NotificationParameter(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Id(self): return self.Id + def set_Id(self, Id): self.Id = Id + def get_Value(self): return self.Value + def set_Value(self, Value): self.Value = Value + def export(self, outfile, level, namespace_='ns:', name_='NotificationParameter', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='NotificationParameter') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='NotificationParameter'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='NotificationParameter', fromsubclass_=False): + if self.Id is not None: + showIndent(outfile, level) + outfile.write('<%sId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Id).encode(ExternalEncoding), input_name='Id'), namespace_)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('<%sValue>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Value).encode(ExternalEncoding), input_name='Value'), namespace_)) + def hasContent_(self): + if ( + self.Id is not None or + self.Value is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='NotificationParameter'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Id is not None: + showIndent(outfile, level) + outfile.write('Id=%s,\n' % quote_python(self.Id).encode(ExternalEncoding)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('Value=%s,\n' % quote_python(self.Value).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Id': + Id_ = child_.text + Id_ = self.gds_validate_string(Id_, node, 'Id') + self.Id = Id_ + elif nodeName_ == 'Value': + Value_ = child_.text + Value_ = self.gds_validate_string(Value_, node, 'Value') + self.Value = Value_ +# end class NotificationParameter + + +class Op900Detail(GeneratedsSuper): + """The instructions indicating how to print the OP-900 form for + hazardous materials packages.""" + subclass = None + superclass = None + def __init__(self, Format=None, Reference=None, CustomerImageUsages=None, SignatureName=None): + self.Format = Format + self.Reference = Reference + if CustomerImageUsages is None: + self.CustomerImageUsages = [] + else: + self.CustomerImageUsages = CustomerImageUsages + self.SignatureName = SignatureName + def factory(*args_, **kwargs_): + if Op900Detail.subclass: + return Op900Detail.subclass(*args_, **kwargs_) + else: + return Op900Detail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Format(self): return self.Format + def set_Format(self, Format): self.Format = Format + def get_Reference(self): return self.Reference + def set_Reference(self, Reference): self.Reference = Reference + def validate_CustomerReferenceType(self, value): + # Validate type CustomerReferenceType, a restriction on xs:string. + pass + def get_CustomerImageUsages(self): return self.CustomerImageUsages + def set_CustomerImageUsages(self, CustomerImageUsages): self.CustomerImageUsages = CustomerImageUsages + def add_CustomerImageUsages(self, value): self.CustomerImageUsages.append(value) + def insert_CustomerImageUsages(self, index, value): self.CustomerImageUsages[index] = value + def get_SignatureName(self): return self.SignatureName + def set_SignatureName(self, SignatureName): self.SignatureName = SignatureName + def export(self, outfile, level, namespace_='ns:', name_='Op900Detail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Op900Detail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Op900Detail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Op900Detail', fromsubclass_=False): + if self.Format: + self.Format.export(outfile, level, namespace_, name_='Format') + if self.Reference is not None: + showIndent(outfile, level) + outfile.write('<%sReference>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Reference).encode(ExternalEncoding), input_name='Reference'), namespace_)) + for CustomerImageUsages_ in self.CustomerImageUsages: + CustomerImageUsages_.export(outfile, level, namespace_, name_='CustomerImageUsages') + if self.SignatureName is not None: + showIndent(outfile, level) + outfile.write('<%sSignatureName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.SignatureName).encode(ExternalEncoding), input_name='SignatureName'), namespace_)) + def hasContent_(self): + if ( + self.Format is not None or + self.Reference is not None or + self.CustomerImageUsages or + self.SignatureName is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Op900Detail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Format is not None: + showIndent(outfile, level) + outfile.write('Format=model_.ShippingDocumentFormat(\n') + self.Format.exportLiteral(outfile, level, name_='Format') + showIndent(outfile, level) + outfile.write('),\n') + if self.Reference is not None: + showIndent(outfile, level) + outfile.write('Reference=%s,\n' % quote_python(self.Reference).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('CustomerImageUsages=[\n') + level += 1 + for CustomerImageUsages_ in self.CustomerImageUsages: + showIndent(outfile, level) + outfile.write('model_.CustomerImageUsage(\n') + CustomerImageUsages_.exportLiteral(outfile, level, name_='CustomerImageUsage') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.SignatureName is not None: + showIndent(outfile, level) + outfile.write('SignatureName=%s,\n' % quote_python(self.SignatureName).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Format': + obj_ = ShippingDocumentFormat.factory() + obj_.build(child_) + self.set_Format(obj_) + elif nodeName_ == 'Reference': + Reference_ = child_.text + Reference_ = self.gds_validate_string(Reference_, node, 'Reference') + self.Reference = Reference_ + self.validate_CustomerReferenceType(self.Reference) # validate type CustomerReferenceType + elif nodeName_ == 'CustomerImageUsages': + obj_ = CustomerImageUsage.factory() + obj_.build(child_) + self.CustomerImageUsages.append(obj_) + elif nodeName_ == 'SignatureName': + SignatureName_ = child_.text + SignatureName_ = self.gds_validate_string(SignatureName_, node, 'SignatureName') + self.SignatureName = SignatureName_ +# end class Op900Detail + + +class PackageRateDetail(GeneratedsSuper): + """Data for a package's rates, as calculated per a specific rate type.""" + subclass = None + superclass = None + def __init__(self, RateType=None, RatedWeightMethod=None, MinimumChargeType=None, BillingWeight=None, DimWeight=None, OversizeWeight=None, BaseCharge=None, TotalFreightDiscounts=None, NetFreight=None, TotalSurcharges=None, NetFedExCharge=None, TotalTaxes=None, NetCharge=None, TotalRebates=None, FreightDiscounts=None, Rebates=None, Surcharges=None, Taxes=None, VariableHandlingCharges=None): + self.RateType = RateType + self.RatedWeightMethod = RatedWeightMethod + self.MinimumChargeType = MinimumChargeType + self.BillingWeight = BillingWeight + self.DimWeight = DimWeight + self.OversizeWeight = OversizeWeight + self.BaseCharge = BaseCharge + self.TotalFreightDiscounts = TotalFreightDiscounts + self.NetFreight = NetFreight + self.TotalSurcharges = TotalSurcharges + self.NetFedExCharge = NetFedExCharge + self.TotalTaxes = TotalTaxes + self.NetCharge = NetCharge + self.TotalRebates = TotalRebates + if FreightDiscounts is None: + self.FreightDiscounts = [] + else: + self.FreightDiscounts = FreightDiscounts + if Rebates is None: + self.Rebates = [] + else: + self.Rebates = Rebates + if Surcharges is None: + self.Surcharges = [] + else: + self.Surcharges = Surcharges + if Taxes is None: + self.Taxes = [] + else: + self.Taxes = Taxes + self.VariableHandlingCharges = VariableHandlingCharges + def factory(*args_, **kwargs_): + if PackageRateDetail.subclass: + return PackageRateDetail.subclass(*args_, **kwargs_) + else: + return PackageRateDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_RateType(self): return self.RateType + def set_RateType(self, RateType): self.RateType = RateType + def validate_ReturnedRateType(self, value): + # Validate type ReturnedRateType, a restriction on xs:string. + pass + def get_RatedWeightMethod(self): return self.RatedWeightMethod + def set_RatedWeightMethod(self, RatedWeightMethod): self.RatedWeightMethod = RatedWeightMethod + def validate_RatedWeightMethod(self, value): + # Validate type RatedWeightMethod, a restriction on xs:string. + pass + def get_MinimumChargeType(self): return self.MinimumChargeType + def set_MinimumChargeType(self, MinimumChargeType): self.MinimumChargeType = MinimumChargeType + def validate_MinimumChargeType(self, value): + # Validate type MinimumChargeType, a restriction on xs:string. + pass + def get_BillingWeight(self): return self.BillingWeight + def set_BillingWeight(self, BillingWeight): self.BillingWeight = BillingWeight + def get_DimWeight(self): return self.DimWeight + def set_DimWeight(self, DimWeight): self.DimWeight = DimWeight + def get_OversizeWeight(self): return self.OversizeWeight + def set_OversizeWeight(self, OversizeWeight): self.OversizeWeight = OversizeWeight + def get_BaseCharge(self): return self.BaseCharge + def set_BaseCharge(self, BaseCharge): self.BaseCharge = BaseCharge + def get_TotalFreightDiscounts(self): return self.TotalFreightDiscounts + def set_TotalFreightDiscounts(self, TotalFreightDiscounts): self.TotalFreightDiscounts = TotalFreightDiscounts + def get_NetFreight(self): return self.NetFreight + def set_NetFreight(self, NetFreight): self.NetFreight = NetFreight + def get_TotalSurcharges(self): return self.TotalSurcharges + def set_TotalSurcharges(self, TotalSurcharges): self.TotalSurcharges = TotalSurcharges + def get_NetFedExCharge(self): return self.NetFedExCharge + def set_NetFedExCharge(self, NetFedExCharge): self.NetFedExCharge = NetFedExCharge + def get_TotalTaxes(self): return self.TotalTaxes + def set_TotalTaxes(self, TotalTaxes): self.TotalTaxes = TotalTaxes + def get_NetCharge(self): return self.NetCharge + def set_NetCharge(self, NetCharge): self.NetCharge = NetCharge + def get_TotalRebates(self): return self.TotalRebates + def set_TotalRebates(self, TotalRebates): self.TotalRebates = TotalRebates + def get_FreightDiscounts(self): return self.FreightDiscounts + def set_FreightDiscounts(self, FreightDiscounts): self.FreightDiscounts = FreightDiscounts + def add_FreightDiscounts(self, value): self.FreightDiscounts.append(value) + def insert_FreightDiscounts(self, index, value): self.FreightDiscounts[index] = value + def get_Rebates(self): return self.Rebates + def set_Rebates(self, Rebates): self.Rebates = Rebates + def add_Rebates(self, value): self.Rebates.append(value) + def insert_Rebates(self, index, value): self.Rebates[index] = value + def get_Surcharges(self): return self.Surcharges + def set_Surcharges(self, Surcharges): self.Surcharges = Surcharges + def add_Surcharges(self, value): self.Surcharges.append(value) + def insert_Surcharges(self, index, value): self.Surcharges[index] = value + def get_Taxes(self): return self.Taxes + def set_Taxes(self, Taxes): self.Taxes = Taxes + def add_Taxes(self, value): self.Taxes.append(value) + def insert_Taxes(self, index, value): self.Taxes[index] = value + def get_VariableHandlingCharges(self): return self.VariableHandlingCharges + def set_VariableHandlingCharges(self, VariableHandlingCharges): self.VariableHandlingCharges = VariableHandlingCharges + def export(self, outfile, level, namespace_='ns:', name_='PackageRateDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='PackageRateDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='PackageRateDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='PackageRateDetail', fromsubclass_=False): + if self.RateType is not None: + showIndent(outfile, level) + outfile.write('<%sRateType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RateType).encode(ExternalEncoding), input_name='RateType'), namespace_)) + if self.RatedWeightMethod is not None: + showIndent(outfile, level) + outfile.write('<%sRatedWeightMethod>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RatedWeightMethod).encode(ExternalEncoding), input_name='RatedWeightMethod'), namespace_)) + if self.MinimumChargeType is not None: + showIndent(outfile, level) + outfile.write('<%sMinimumChargeType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.MinimumChargeType).encode(ExternalEncoding), input_name='MinimumChargeType'), namespace_)) + if self.BillingWeight: + self.BillingWeight.export(outfile, level, namespace_, name_='BillingWeight') + if self.DimWeight: + self.DimWeight.export(outfile, level, namespace_, name_='DimWeight') + if self.OversizeWeight: + self.OversizeWeight.export(outfile, level, namespace_, name_='OversizeWeight') + if self.BaseCharge: + self.BaseCharge.export(outfile, level, namespace_, name_='BaseCharge') + if self.TotalFreightDiscounts: + self.TotalFreightDiscounts.export(outfile, level, namespace_, name_='TotalFreightDiscounts') + if self.NetFreight: + self.NetFreight.export(outfile, level, namespace_, name_='NetFreight') + if self.TotalSurcharges: + self.TotalSurcharges.export(outfile, level, namespace_, name_='TotalSurcharges') + if self.NetFedExCharge: + self.NetFedExCharge.export(outfile, level, namespace_, name_='NetFedExCharge') + if self.TotalTaxes: + self.TotalTaxes.export(outfile, level, namespace_, name_='TotalTaxes') + if self.NetCharge: + self.NetCharge.export(outfile, level, namespace_, name_='NetCharge') + if self.TotalRebates: + self.TotalRebates.export(outfile, level, namespace_, name_='TotalRebates') + for FreightDiscounts_ in self.FreightDiscounts: + FreightDiscounts_.export(outfile, level, namespace_, name_='FreightDiscounts') + for Rebates_ in self.Rebates: + Rebates_.export(outfile, level, namespace_, name_='Rebates') + for Surcharges_ in self.Surcharges: + Surcharges_.export(outfile, level, namespace_, name_='Surcharges') + for Taxes_ in self.Taxes: + Taxes_.export(outfile, level, namespace_, name_='Taxes') + if self.VariableHandlingCharges: + self.VariableHandlingCharges.export(outfile, level, namespace_, name_='VariableHandlingCharges') + def hasContent_(self): + if ( + self.RateType is not None or + self.RatedWeightMethod is not None or + self.MinimumChargeType is not None or + self.BillingWeight is not None or + self.DimWeight is not None or + self.OversizeWeight is not None or + self.BaseCharge is not None or + self.TotalFreightDiscounts is not None or + self.NetFreight is not None or + self.TotalSurcharges is not None or + self.NetFedExCharge is not None or + self.TotalTaxes is not None or + self.NetCharge is not None or + self.TotalRebates is not None or + self.FreightDiscounts or + self.Rebates or + self.Surcharges or + self.Taxes or + self.VariableHandlingCharges is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='PackageRateDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.RateType is not None: + showIndent(outfile, level) + outfile.write('RateType=%s,\n' % quote_python(self.RateType).encode(ExternalEncoding)) + if self.RatedWeightMethod is not None: + showIndent(outfile, level) + outfile.write('RatedWeightMethod=%s,\n' % quote_python(self.RatedWeightMethod).encode(ExternalEncoding)) + if self.MinimumChargeType is not None: + showIndent(outfile, level) + outfile.write('MinimumChargeType=%s,\n' % quote_python(self.MinimumChargeType).encode(ExternalEncoding)) + if self.BillingWeight is not None: + showIndent(outfile, level) + outfile.write('BillingWeight=model_.Weight(\n') + self.BillingWeight.exportLiteral(outfile, level, name_='BillingWeight') + showIndent(outfile, level) + outfile.write('),\n') + if self.DimWeight is not None: + showIndent(outfile, level) + outfile.write('DimWeight=model_.Weight(\n') + self.DimWeight.exportLiteral(outfile, level, name_='DimWeight') + showIndent(outfile, level) + outfile.write('),\n') + if self.OversizeWeight is not None: + showIndent(outfile, level) + outfile.write('OversizeWeight=model_.Weight(\n') + self.OversizeWeight.exportLiteral(outfile, level, name_='OversizeWeight') + showIndent(outfile, level) + outfile.write('),\n') + if self.BaseCharge is not None: + showIndent(outfile, level) + outfile.write('BaseCharge=model_.Money(\n') + self.BaseCharge.exportLiteral(outfile, level, name_='BaseCharge') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalFreightDiscounts is not None: + showIndent(outfile, level) + outfile.write('TotalFreightDiscounts=model_.Money(\n') + self.TotalFreightDiscounts.exportLiteral(outfile, level, name_='TotalFreightDiscounts') + showIndent(outfile, level) + outfile.write('),\n') + if self.NetFreight is not None: + showIndent(outfile, level) + outfile.write('NetFreight=model_.Money(\n') + self.NetFreight.exportLiteral(outfile, level, name_='NetFreight') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalSurcharges is not None: + showIndent(outfile, level) + outfile.write('TotalSurcharges=model_.Money(\n') + self.TotalSurcharges.exportLiteral(outfile, level, name_='TotalSurcharges') + showIndent(outfile, level) + outfile.write('),\n') + if self.NetFedExCharge is not None: + showIndent(outfile, level) + outfile.write('NetFedExCharge=model_.Money(\n') + self.NetFedExCharge.exportLiteral(outfile, level, name_='NetFedExCharge') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalTaxes is not None: + showIndent(outfile, level) + outfile.write('TotalTaxes=model_.Money(\n') + self.TotalTaxes.exportLiteral(outfile, level, name_='TotalTaxes') + showIndent(outfile, level) + outfile.write('),\n') + if self.NetCharge is not None: + showIndent(outfile, level) + outfile.write('NetCharge=model_.Money(\n') + self.NetCharge.exportLiteral(outfile, level, name_='NetCharge') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalRebates is not None: + showIndent(outfile, level) + outfile.write('TotalRebates=model_.Money(\n') + self.TotalRebates.exportLiteral(outfile, level, name_='TotalRebates') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('FreightDiscounts=[\n') + level += 1 + for FreightDiscounts_ in self.FreightDiscounts: + showIndent(outfile, level) + outfile.write('model_.RateDiscount(\n') + FreightDiscounts_.exportLiteral(outfile, level, name_='RateDiscount') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('Rebates=[\n') + level += 1 + for Rebates_ in self.Rebates: + showIndent(outfile, level) + outfile.write('model_.Rebate(\n') + Rebates_.exportLiteral(outfile, level, name_='Rebate') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('Surcharges=[\n') + level += 1 + for Surcharges_ in self.Surcharges: + showIndent(outfile, level) + outfile.write('model_.Surcharge(\n') + Surcharges_.exportLiteral(outfile, level, name_='Surcharge') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('Taxes=[\n') + level += 1 + for Taxes_ in self.Taxes: + showIndent(outfile, level) + outfile.write('model_.Tax(\n') + Taxes_.exportLiteral(outfile, level, name_='Tax') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.VariableHandlingCharges is not None: + showIndent(outfile, level) + outfile.write('VariableHandlingCharges=model_.VariableHandlingCharges(\n') + self.VariableHandlingCharges.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'RateType': + RateType_ = child_.text + RateType_ = self.gds_validate_string(RateType_, node, 'RateType') + self.RateType = RateType_ + self.validate_ReturnedRateType(self.RateType) # validate type ReturnedRateType + elif nodeName_ == 'RatedWeightMethod': + RatedWeightMethod_ = child_.text + RatedWeightMethod_ = self.gds_validate_string(RatedWeightMethod_, node, 'RatedWeightMethod') + self.RatedWeightMethod = RatedWeightMethod_ + self.validate_RatedWeightMethod(self.RatedWeightMethod) # validate type RatedWeightMethod + elif nodeName_ == 'MinimumChargeType': + MinimumChargeType_ = child_.text + MinimumChargeType_ = self.gds_validate_string(MinimumChargeType_, node, 'MinimumChargeType') + self.MinimumChargeType = MinimumChargeType_ + self.validate_MinimumChargeType(self.MinimumChargeType) # validate type MinimumChargeType + elif nodeName_ == 'BillingWeight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_BillingWeight(obj_) + elif nodeName_ == 'DimWeight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_DimWeight(obj_) + elif nodeName_ == 'OversizeWeight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_OversizeWeight(obj_) + elif nodeName_ == 'BaseCharge': + obj_ = Money.factory() + obj_.build(child_) + self.set_BaseCharge(obj_) + elif nodeName_ == 'TotalFreightDiscounts': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalFreightDiscounts(obj_) + elif nodeName_ == 'NetFreight': + obj_ = Money.factory() + obj_.build(child_) + self.set_NetFreight(obj_) + elif nodeName_ == 'TotalSurcharges': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalSurcharges(obj_) + elif nodeName_ == 'NetFedExCharge': + obj_ = Money.factory() + obj_.build(child_) + self.set_NetFedExCharge(obj_) + elif nodeName_ == 'TotalTaxes': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalTaxes(obj_) + elif nodeName_ == 'NetCharge': + obj_ = Money.factory() + obj_.build(child_) + self.set_NetCharge(obj_) + elif nodeName_ == 'TotalRebates': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalRebates(obj_) + elif nodeName_ == 'FreightDiscounts': + obj_ = RateDiscount.factory() + obj_.build(child_) + self.FreightDiscounts.append(obj_) + elif nodeName_ == 'Rebates': + obj_ = Rebate.factory() + obj_.build(child_) + self.Rebates.append(obj_) + elif nodeName_ == 'Surcharges': + obj_ = Surcharge.factory() + obj_.build(child_) + self.Surcharges.append(obj_) + elif nodeName_ == 'Taxes': + obj_ = Tax.factory() + obj_.build(child_) + self.Taxes.append(obj_) + elif nodeName_ == 'VariableHandlingCharges': + obj_ = VariableHandlingCharges.factory() + obj_.build(child_) + self.set_VariableHandlingCharges(obj_) +# end class PackageRateDetail + + +class PackageSpecialServicesRequested(GeneratedsSuper): + """These special services are available at the package level for some + or all service types. If the shipper is requesting a special + service which requires additional data, the package special + service type must be present in the specialServiceTypes + collection, and the supporting detail must be provided in the + appropriate sub-object below.""" + subclass = None + superclass = None + def __init__(self, SpecialServiceTypes=None, CodDetail=None, DangerousGoodsDetail=None, DryIceWeight=None, SignatureOptionDetail=None, PriorityAlertDetail=None): + if SpecialServiceTypes is None: + self.SpecialServiceTypes = [] + else: + self.SpecialServiceTypes = SpecialServiceTypes + self.CodDetail = CodDetail + self.DangerousGoodsDetail = DangerousGoodsDetail + self.DryIceWeight = DryIceWeight + self.SignatureOptionDetail = SignatureOptionDetail + self.PriorityAlertDetail = PriorityAlertDetail + def factory(*args_, **kwargs_): + if PackageSpecialServicesRequested.subclass: + return PackageSpecialServicesRequested.subclass(*args_, **kwargs_) + else: + return PackageSpecialServicesRequested(*args_, **kwargs_) + factory = staticmethod(factory) + def get_SpecialServiceTypes(self): return self.SpecialServiceTypes + def set_SpecialServiceTypes(self, SpecialServiceTypes): self.SpecialServiceTypes = SpecialServiceTypes + def add_SpecialServiceTypes(self, value): self.SpecialServiceTypes.append(value) + def insert_SpecialServiceTypes(self, index, value): self.SpecialServiceTypes[index] = value + def validate_PackageSpecialServiceType(self, value): + # Validate type PackageSpecialServiceType, a restriction on xs:string. + pass + def get_CodDetail(self): return self.CodDetail + def set_CodDetail(self, CodDetail): self.CodDetail = CodDetail + def get_DangerousGoodsDetail(self): return self.DangerousGoodsDetail + def set_DangerousGoodsDetail(self, DangerousGoodsDetail): self.DangerousGoodsDetail = DangerousGoodsDetail + def get_DryIceWeight(self): return self.DryIceWeight + def set_DryIceWeight(self, DryIceWeight): self.DryIceWeight = DryIceWeight + def get_SignatureOptionDetail(self): return self.SignatureOptionDetail + def set_SignatureOptionDetail(self, SignatureOptionDetail): self.SignatureOptionDetail = SignatureOptionDetail + def get_PriorityAlertDetail(self): return self.PriorityAlertDetail + def set_PriorityAlertDetail(self, PriorityAlertDetail): self.PriorityAlertDetail = PriorityAlertDetail + def export(self, outfile, level, namespace_='ns:', name_='PackageSpecialServicesRequested', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='PackageSpecialServicesRequested') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='PackageSpecialServicesRequested'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='PackageSpecialServicesRequested', fromsubclass_=False): + for SpecialServiceTypes_ in self.SpecialServiceTypes: + showIndent(outfile, level) + outfile.write('<%sSpecialServiceTypes>%s\n' % (namespace_, self.gds_format_string(quote_xml(SpecialServiceTypes_).encode(ExternalEncoding), input_name='SpecialServiceTypes'), namespace_)) + if self.CodDetail: + self.CodDetail.export(outfile, level, namespace_, name_='CodDetail') + if self.DangerousGoodsDetail: + self.DangerousGoodsDetail.export(outfile, level, namespace_, name_='DangerousGoodsDetail') + if self.DryIceWeight: + self.DryIceWeight.export(outfile, level, namespace_, name_='DryIceWeight') + if self.SignatureOptionDetail: + self.SignatureOptionDetail.export(outfile, level, namespace_, name_='SignatureOptionDetail') + if self.PriorityAlertDetail: + self.PriorityAlertDetail.export(outfile, level, namespace_, name_='PriorityAlertDetail') + def hasContent_(self): + if ( + self.SpecialServiceTypes or + self.CodDetail is not None or + self.DangerousGoodsDetail is not None or + self.DryIceWeight is not None or + self.SignatureOptionDetail is not None or + self.PriorityAlertDetail is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='PackageSpecialServicesRequested'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('SpecialServiceTypes=[\n') + level += 1 + for SpecialServiceTypes_ in self.SpecialServiceTypes: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(SpecialServiceTypes_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.CodDetail is not None: + showIndent(outfile, level) + outfile.write('CodDetail=model_.CodDetail(\n') + self.CodDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.DangerousGoodsDetail is not None: + showIndent(outfile, level) + outfile.write('DangerousGoodsDetail=model_.DangerousGoodsDetail(\n') + self.DangerousGoodsDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.DryIceWeight is not None: + showIndent(outfile, level) + outfile.write('DryIceWeight=model_.Weight(\n') + self.DryIceWeight.exportLiteral(outfile, level, name_='DryIceWeight') + showIndent(outfile, level) + outfile.write('),\n') + if self.SignatureOptionDetail is not None: + showIndent(outfile, level) + outfile.write('SignatureOptionDetail=model_.SignatureOptionDetail(\n') + self.SignatureOptionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.PriorityAlertDetail is not None: + showIndent(outfile, level) + outfile.write('PriorityAlertDetail=model_.PriorityAlertDetail(\n') + self.PriorityAlertDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'SpecialServiceTypes': + SpecialServiceTypes_ = child_.text + SpecialServiceTypes_ = self.gds_validate_string(SpecialServiceTypes_, node, 'SpecialServiceTypes') + self.SpecialServiceTypes.append(SpecialServiceTypes_) + self.validate_PackageSpecialServiceType(self.SpecialServiceTypes) # validate type PackageSpecialServiceType + elif nodeName_ == 'CodDetail': + obj_ = CodDetail.factory() + obj_.build(child_) + self.set_CodDetail(obj_) + elif nodeName_ == 'DangerousGoodsDetail': + obj_ = DangerousGoodsDetail.factory() + obj_.build(child_) + self.set_DangerousGoodsDetail(obj_) + elif nodeName_ == 'DryIceWeight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_DryIceWeight(obj_) + elif nodeName_ == 'SignatureOptionDetail': + obj_ = SignatureOptionDetail.factory() + obj_.build(child_) + self.set_SignatureOptionDetail(obj_) + elif nodeName_ == 'PriorityAlertDetail': + obj_ = PriorityAlertDetail.factory() + obj_.build(child_) + self.set_PriorityAlertDetail(obj_) +# end class PackageSpecialServicesRequested + + +class Party(GeneratedsSuper): + """The descriptive data for a person or company entitiy doing business + with FedEx.""" + subclass = None + superclass = None + def __init__(self, AccountNumber=None, Tins=None, Contact=None, Address=None): + self.AccountNumber = AccountNumber + if Tins is None: + self.Tins = [] + else: + self.Tins = Tins + self.Contact = Contact + self.Address = Address + def factory(*args_, **kwargs_): + if Party.subclass: + return Party.subclass(*args_, **kwargs_) + else: + return Party(*args_, **kwargs_) + factory = staticmethod(factory) + def get_AccountNumber(self): return self.AccountNumber + def set_AccountNumber(self, AccountNumber): self.AccountNumber = AccountNumber + def get_Tins(self): return self.Tins + def set_Tins(self, Tins): self.Tins = Tins + def add_Tins(self, value): self.Tins.append(value) + def insert_Tins(self, index, value): self.Tins[index] = value + def get_Contact(self): return self.Contact + def set_Contact(self, Contact): self.Contact = Contact + def get_Address(self): return self.Address + def set_Address(self, Address): self.Address = Address + def export(self, outfile, level, namespace_='ns:', name_='Party', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Party') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Party'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Party', fromsubclass_=False): + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('<%sAccountNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AccountNumber).encode(ExternalEncoding), input_name='AccountNumber'), namespace_)) + for Tins_ in self.Tins: + Tins_.export(outfile, level, namespace_, name_='Tins') + if self.Contact: + self.Contact.export(outfile, level, namespace_, name_='Contact') + if self.Address: + self.Address.export(outfile, level, namespace_, name_='Address') + def hasContent_(self): + if ( + self.AccountNumber is not None or + self.Tins or + self.Contact is not None or + self.Address is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Party'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('AccountNumber=%s,\n' % quote_python(self.AccountNumber).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Tins=[\n') + level += 1 + for Tins_ in self.Tins: + showIndent(outfile, level) + outfile.write('model_.TaxpayerIdentification(\n') + Tins_.exportLiteral(outfile, level, name_='TaxpayerIdentification') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.Contact is not None: + showIndent(outfile, level) + outfile.write('Contact=model_.Contact(\n') + self.Contact.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Address is not None: + showIndent(outfile, level) + outfile.write('Address=model_.Address(\n') + self.Address.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'AccountNumber': + AccountNumber_ = child_.text + AccountNumber_ = self.gds_validate_string(AccountNumber_, node, 'AccountNumber') + self.AccountNumber = AccountNumber_ + elif nodeName_ == 'Tins': + obj_ = TaxpayerIdentification.factory() + obj_.build(child_) + self.Tins.append(obj_) + elif nodeName_ == 'Contact': + obj_ = Contact.factory() + obj_.build(child_) + self.set_Contact(obj_) + elif nodeName_ == 'Address': + obj_ = Address.factory() + obj_.build(child_) + self.set_Address(obj_) +# end class Party + + +class Payment(GeneratedsSuper): + """The descriptive data for the monetary compensation given to FedEx + for services rendered to the customer.""" + subclass = None + superclass = None + def __init__(self, PaymentType=None, Payor=None): + self.PaymentType = PaymentType + self.Payor = Payor + def factory(*args_, **kwargs_): + if Payment.subclass: + return Payment.subclass(*args_, **kwargs_) + else: + return Payment(*args_, **kwargs_) + factory = staticmethod(factory) + def get_PaymentType(self): return self.PaymentType + def set_PaymentType(self, PaymentType): self.PaymentType = PaymentType + def validate_PaymentType(self, value): + # Validate type PaymentType, a restriction on xs:string. + pass + def get_Payor(self): return self.Payor + def set_Payor(self, Payor): self.Payor = Payor + def export(self, outfile, level, namespace_='ns:', name_='Payment', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Payment') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Payment'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Payment', fromsubclass_=False): + if self.PaymentType is not None: + showIndent(outfile, level) + outfile.write('<%sPaymentType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PaymentType).encode(ExternalEncoding), input_name='PaymentType'), namespace_)) + if self.Payor: + self.Payor.export(outfile, level, namespace_, name_='Payor') + def hasContent_(self): + if ( + self.PaymentType is not None or + self.Payor is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Payment'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.PaymentType is not None: + showIndent(outfile, level) + outfile.write('PaymentType=%s,\n' % quote_python(self.PaymentType).encode(ExternalEncoding)) + if self.Payor is not None: + showIndent(outfile, level) + outfile.write('Payor=model_.Payor(\n') + self.Payor.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'PaymentType': + PaymentType_ = child_.text + PaymentType_ = self.gds_validate_string(PaymentType_, node, 'PaymentType') + self.PaymentType = PaymentType_ + self.validate_PaymentType(self.PaymentType) # validate type PaymentType + elif nodeName_ == 'Payor': + obj_ = Payor.factory() + obj_.build(child_) + self.set_Payor(obj_) +# end class Payment + + +class Payor(GeneratedsSuper): + """Descriptive data identifying the party responsible for payment for a + service.""" + subclass = None + superclass = None + def __init__(self, AccountNumber=None, CountryCode=None): + self.AccountNumber = AccountNumber + self.CountryCode = CountryCode + def factory(*args_, **kwargs_): + if Payor.subclass: + return Payor.subclass(*args_, **kwargs_) + else: + return Payor(*args_, **kwargs_) + factory = staticmethod(factory) + def get_AccountNumber(self): return self.AccountNumber + def set_AccountNumber(self, AccountNumber): self.AccountNumber = AccountNumber + def get_CountryCode(self): return self.CountryCode + def set_CountryCode(self, CountryCode): self.CountryCode = CountryCode + def export(self, outfile, level, namespace_='ns:', name_='Payor', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Payor') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Payor'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Payor', fromsubclass_=False): + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('<%sAccountNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AccountNumber).encode(ExternalEncoding), input_name='AccountNumber'), namespace_)) + if self.CountryCode is not None: + showIndent(outfile, level) + outfile.write('<%sCountryCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CountryCode).encode(ExternalEncoding), input_name='CountryCode'), namespace_)) + def hasContent_(self): + if ( + self.AccountNumber is not None or + self.CountryCode is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Payor'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('AccountNumber=%s,\n' % quote_python(self.AccountNumber).encode(ExternalEncoding)) + if self.CountryCode is not None: + showIndent(outfile, level) + outfile.write('CountryCode=%s,\n' % quote_python(self.CountryCode).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'AccountNumber': + AccountNumber_ = child_.text + AccountNumber_ = self.gds_validate_string(AccountNumber_, node, 'AccountNumber') + self.AccountNumber = AccountNumber_ + elif nodeName_ == 'CountryCode': + CountryCode_ = child_.text + CountryCode_ = self.gds_validate_string(CountryCode_, node, 'CountryCode') + self.CountryCode = CountryCode_ +# end class Payor + + +class PendingShipmentDetail(GeneratedsSuper): + """This information describes the kind of pending shipment being + requested.""" + subclass = None + superclass = None + def __init__(self, Type=None, ExpirationDate=None, EmailLabelDetail=None): + self.Type = Type + self.ExpirationDate = ExpirationDate + self.EmailLabelDetail = EmailLabelDetail + def factory(*args_, **kwargs_): + if PendingShipmentDetail.subclass: + return PendingShipmentDetail.subclass(*args_, **kwargs_) + else: + return PendingShipmentDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Type(self): return self.Type + def set_Type(self, Type): self.Type = Type + def validate_PendingShipmentType(self, value): + # Validate type PendingShipmentType, a restriction on xs:string. + pass + def get_ExpirationDate(self): return self.ExpirationDate + def set_ExpirationDate(self, ExpirationDate): self.ExpirationDate = ExpirationDate + def get_EmailLabelDetail(self): return self.EmailLabelDetail + def set_EmailLabelDetail(self, EmailLabelDetail): self.EmailLabelDetail = EmailLabelDetail + def export(self, outfile, level, namespace_='ns:', name_='PendingShipmentDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='PendingShipmentDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='PendingShipmentDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='PendingShipmentDetail', fromsubclass_=False): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('<%sType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Type).encode(ExternalEncoding), input_name='Type'), namespace_)) + if self.ExpirationDate is not None: + showIndent(outfile, level) + outfile.write('<%sExpirationDate>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ExpirationDate).encode(ExternalEncoding), input_name='ExpirationDate'), namespace_)) + if self.EmailLabelDetail: + self.EmailLabelDetail.export(outfile, level, namespace_, name_='EmailLabelDetail') + def hasContent_(self): + if ( + self.Type is not None or + self.ExpirationDate is not None or + self.EmailLabelDetail is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='PendingShipmentDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('Type=%s,\n' % quote_python(self.Type).encode(ExternalEncoding)) + if self.ExpirationDate is not None: + showIndent(outfile, level) + outfile.write('ExpirationDate=%s,\n' % quote_python(self.ExpirationDate).encode(ExternalEncoding)) + if self.EmailLabelDetail is not None: + showIndent(outfile, level) + outfile.write('EmailLabelDetail=model_.EMailLabelDetail(\n') + self.EmailLabelDetail.exportLiteral(outfile, level, name_='EmailLabelDetail') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Type': + Type_ = child_.text + Type_ = self.gds_validate_string(Type_, node, 'Type') + self.Type = Type_ + self.validate_PendingShipmentType(self.Type) # validate type PendingShipmentType + elif nodeName_ == 'ExpirationDate': + ExpirationDate_ = child_.text + ExpirationDate_ = self.gds_validate_string(ExpirationDate_, node, 'ExpirationDate') + self.ExpirationDate = ExpirationDate_ + elif nodeName_ == 'EmailLabelDetail': + obj_ = EMailLabelDetail.factory() + obj_.build(child_) + self.set_EmailLabelDetail(obj_) +# end class PendingShipmentDetail + + +class PickupDetail(GeneratedsSuper): + """This class describes the pickup characteristics of a shipment (e.g. + for use in a tag request).""" + subclass = None + superclass = None + def __init__(self, ReadyDateTime=None, LatestPickupDateTime=None, CourierInstructions=None, RequestType=None, RequestSource=None): + self.ReadyDateTime = ReadyDateTime + self.LatestPickupDateTime = LatestPickupDateTime + self.CourierInstructions = CourierInstructions + self.RequestType = RequestType + self.RequestSource = RequestSource + def factory(*args_, **kwargs_): + if PickupDetail.subclass: + return PickupDetail.subclass(*args_, **kwargs_) + else: + return PickupDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_ReadyDateTime(self): return self.ReadyDateTime + def set_ReadyDateTime(self, ReadyDateTime): self.ReadyDateTime = ReadyDateTime + def get_LatestPickupDateTime(self): return self.LatestPickupDateTime + def set_LatestPickupDateTime(self, LatestPickupDateTime): self.LatestPickupDateTime = LatestPickupDateTime + def get_CourierInstructions(self): return self.CourierInstructions + def set_CourierInstructions(self, CourierInstructions): self.CourierInstructions = CourierInstructions + def get_RequestType(self): return self.RequestType + def set_RequestType(self, RequestType): self.RequestType = RequestType + def validate_PickupRequestType(self, value): + # Validate type PickupRequestType, a restriction on xs:string. + pass + def get_RequestSource(self): return self.RequestSource + def set_RequestSource(self, RequestSource): self.RequestSource = RequestSource + def validate_PickupRequestSourceType(self, value): + # Validate type PickupRequestSourceType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='PickupDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='PickupDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='PickupDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='PickupDetail', fromsubclass_=False): + if self.ReadyDateTime is not None: + showIndent(outfile, level) + outfile.write('<%sReadyDateTime>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ReadyDateTime).encode(ExternalEncoding), input_name='ReadyDateTime'), namespace_)) + if self.LatestPickupDateTime is not None: + showIndent(outfile, level) + outfile.write('<%sLatestPickupDateTime>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LatestPickupDateTime).encode(ExternalEncoding), input_name='LatestPickupDateTime'), namespace_)) + if self.CourierInstructions is not None: + showIndent(outfile, level) + outfile.write('<%sCourierInstructions>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CourierInstructions).encode(ExternalEncoding), input_name='CourierInstructions'), namespace_)) + if self.RequestType is not None: + showIndent(outfile, level) + outfile.write('<%sRequestType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RequestType).encode(ExternalEncoding), input_name='RequestType'), namespace_)) + if self.RequestSource is not None: + showIndent(outfile, level) + outfile.write('<%sRequestSource>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RequestSource).encode(ExternalEncoding), input_name='RequestSource'), namespace_)) + def hasContent_(self): + if ( + self.ReadyDateTime is not None or + self.LatestPickupDateTime is not None or + self.CourierInstructions is not None or + self.RequestType is not None or + self.RequestSource is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='PickupDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.ReadyDateTime is not None: + showIndent(outfile, level) + outfile.write('ReadyDateTime=%s,\n' % quote_python(self.ReadyDateTime).encode(ExternalEncoding)) + if self.LatestPickupDateTime is not None: + showIndent(outfile, level) + outfile.write('LatestPickupDateTime=%s,\n' % quote_python(self.LatestPickupDateTime).encode(ExternalEncoding)) + if self.CourierInstructions is not None: + showIndent(outfile, level) + outfile.write('CourierInstructions=%s,\n' % quote_python(self.CourierInstructions).encode(ExternalEncoding)) + if self.RequestType is not None: + showIndent(outfile, level) + outfile.write('RequestType=%s,\n' % quote_python(self.RequestType).encode(ExternalEncoding)) + if self.RequestSource is not None: + showIndent(outfile, level) + outfile.write('RequestSource=%s,\n' % quote_python(self.RequestSource).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'ReadyDateTime': + ReadyDateTime_ = child_.text + ReadyDateTime_ = self.gds_validate_string(ReadyDateTime_, node, 'ReadyDateTime') + self.ReadyDateTime = ReadyDateTime_ + elif nodeName_ == 'LatestPickupDateTime': + LatestPickupDateTime_ = child_.text + LatestPickupDateTime_ = self.gds_validate_string(LatestPickupDateTime_, node, 'LatestPickupDateTime') + self.LatestPickupDateTime = LatestPickupDateTime_ + elif nodeName_ == 'CourierInstructions': + CourierInstructions_ = child_.text + CourierInstructions_ = self.gds_validate_string(CourierInstructions_, node, 'CourierInstructions') + self.CourierInstructions = CourierInstructions_ + elif nodeName_ == 'RequestType': + RequestType_ = child_.text + RequestType_ = self.gds_validate_string(RequestType_, node, 'RequestType') + self.RequestType = RequestType_ + self.validate_PickupRequestType(self.RequestType) # validate type PickupRequestType + elif nodeName_ == 'RequestSource': + RequestSource_ = child_.text + RequestSource_ = self.gds_validate_string(RequestSource_, node, 'RequestSource') + self.RequestSource = RequestSource_ + self.validate_PickupRequestSourceType(self.RequestSource) # validate type PickupRequestSourceType +# end class PickupDetail + + +class PriorityAlertDetail(GeneratedsSuper): + """Currently not supported.""" + subclass = None + superclass = None + def __init__(self, Content=None): + if Content is None: + self.Content = [] + else: + self.Content = Content + def factory(*args_, **kwargs_): + if PriorityAlertDetail.subclass: + return PriorityAlertDetail.subclass(*args_, **kwargs_) + else: + return PriorityAlertDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Content(self): return self.Content + def set_Content(self, Content): self.Content = Content + def add_Content(self, value): self.Content.append(value) + def insert_Content(self, index, value): self.Content[index] = value + def export(self, outfile, level, namespace_='ns:', name_='PriorityAlertDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='PriorityAlertDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='PriorityAlertDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='PriorityAlertDetail', fromsubclass_=False): + for Content_ in self.Content: + showIndent(outfile, level) + outfile.write('<%sContent>%s\n' % (namespace_, self.gds_format_string(quote_xml(Content_).encode(ExternalEncoding), input_name='Content'), namespace_)) + def hasContent_(self): + if ( + self.Content + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='PriorityAlertDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('Content=[\n') + level += 1 + for Content_ in self.Content: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(Content_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Content': + Content_ = child_.text + Content_ = self.gds_validate_string(Content_, node, 'Content') + self.Content.append(Content_) +# end class PriorityAlertDetail + + +class RateDiscount(GeneratedsSuper): + """Identifies a discount applied to the shipment.""" + subclass = None + superclass = None + def __init__(self, RateDiscountType=None, Description=None, Amount=None, Percent=None): + self.RateDiscountType = RateDiscountType + self.Description = Description + self.Amount = Amount + self.Percent = Percent + def factory(*args_, **kwargs_): + if RateDiscount.subclass: + return RateDiscount.subclass(*args_, **kwargs_) + else: + return RateDiscount(*args_, **kwargs_) + factory = staticmethod(factory) + def get_RateDiscountType(self): return self.RateDiscountType + def set_RateDiscountType(self, RateDiscountType): self.RateDiscountType = RateDiscountType + def validate_RateDiscountType(self, value): + # Validate type RateDiscountType, a restriction on xs:string. + pass + def get_Description(self): return self.Description + def set_Description(self, Description): self.Description = Description + def get_Amount(self): return self.Amount + def set_Amount(self, Amount): self.Amount = Amount + def get_Percent(self): return self.Percent + def set_Percent(self, Percent): self.Percent = Percent + def export(self, outfile, level, namespace_='ns:', name_='RateDiscount', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='RateDiscount') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='RateDiscount'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='RateDiscount', fromsubclass_=False): + if self.RateDiscountType is not None: + showIndent(outfile, level) + outfile.write('<%sRateDiscountType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RateDiscountType).encode(ExternalEncoding), input_name='RateDiscountType'), namespace_)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('<%sDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Description).encode(ExternalEncoding), input_name='Description'), namespace_)) + if self.Amount: + self.Amount.export(outfile, level, namespace_, name_='Amount') + if self.Percent is not None: + showIndent(outfile, level) + outfile.write('<%sPercent>%s\n' % (namespace_, self.gds_format_float(self.Percent, input_name='Percent'), namespace_)) + def hasContent_(self): + if ( + self.RateDiscountType is not None or + self.Description is not None or + self.Amount is not None or + self.Percent is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='RateDiscount'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.RateDiscountType is not None: + showIndent(outfile, level) + outfile.write('RateDiscountType=%s,\n' % quote_python(self.RateDiscountType).encode(ExternalEncoding)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('Description=%s,\n' % quote_python(self.Description).encode(ExternalEncoding)) + if self.Amount is not None: + showIndent(outfile, level) + outfile.write('Amount=model_.Money(\n') + self.Amount.exportLiteral(outfile, level, name_='Amount') + showIndent(outfile, level) + outfile.write('),\n') + if self.Percent is not None: + showIndent(outfile, level) + outfile.write('Percent=%f,\n' % self.Percent) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'RateDiscountType': + RateDiscountType_ = child_.text + RateDiscountType_ = self.gds_validate_string(RateDiscountType_, node, 'RateDiscountType') + self.RateDiscountType = RateDiscountType_ + self.validate_RateDiscountType(self.RateDiscountType) # validate type RateDiscountType + elif nodeName_ == 'Description': + Description_ = child_.text + Description_ = self.gds_validate_string(Description_, node, 'Description') + self.Description = Description_ + elif nodeName_ == 'Amount': + obj_ = Money.factory() + obj_.build(child_) + self.set_Amount(obj_) + elif nodeName_ == 'Percent': + sval_ = child_.text + try: + fval_ = float(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires float or double: %s' % exp) + fval_ = self.gds_validate_float(fval_, node, 'Percent') + self.Percent = fval_ +# end class RateDiscount + + +class RateReply(GeneratedsSuper): + """The response to a RateRequest. The Notifications indicate whether + the request was successful or not.""" + subclass = None + superclass = None + def __init__(self, HighestSeverity=None, Notifications=None, TransactionDetail=None, Version=None, RateReplyDetails=None): + self.HighestSeverity = HighestSeverity + if Notifications is None: + self.Notifications = [] + else: + self.Notifications = Notifications + self.TransactionDetail = TransactionDetail + self.Version = Version + if RateReplyDetails is None: + self.RateReplyDetails = [] + else: + self.RateReplyDetails = RateReplyDetails + def factory(*args_, **kwargs_): + if RateReply.subclass: + return RateReply.subclass(*args_, **kwargs_) + else: + return RateReply(*args_, **kwargs_) + factory = staticmethod(factory) + def get_HighestSeverity(self): return self.HighestSeverity + def set_HighestSeverity(self, HighestSeverity): self.HighestSeverity = HighestSeverity + def validate_NotificationSeverityType(self, value): + # Validate type NotificationSeverityType, a restriction on xs:string. + pass + def get_Notifications(self): return self.Notifications + def set_Notifications(self, Notifications): self.Notifications = Notifications + def add_Notifications(self, value): self.Notifications.append(value) + def insert_Notifications(self, index, value): self.Notifications[index] = value + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_RateReplyDetails(self): return self.RateReplyDetails + def set_RateReplyDetails(self, RateReplyDetails): self.RateReplyDetails = RateReplyDetails + def add_RateReplyDetails(self, value): self.RateReplyDetails.append(value) + def insert_RateReplyDetails(self, index, value): self.RateReplyDetails[index] = value + def export(self, outfile, level, namespace_='ns:', name_='RateReply', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='RateReply') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='RateReply'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='RateReply', fromsubclass_=False): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('<%sHighestSeverity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HighestSeverity).encode(ExternalEncoding), input_name='HighestSeverity'), namespace_)) + for Notifications_ in self.Notifications: + Notifications_.export(outfile, level, namespace_, name_='Notifications') + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + for RateReplyDetails_ in self.RateReplyDetails: + RateReplyDetails_.export(outfile, level, namespace_, name_='RateReplyDetails') + def hasContent_(self): + if ( + self.HighestSeverity is not None or + self.Notifications or + self.TransactionDetail is not None or + self.Version is not None or + self.RateReplyDetails + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='RateReply'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('HighestSeverity=%s,\n' % quote_python(self.HighestSeverity).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Notifications=[\n') + level += 1 + for Notifications_ in self.Notifications: + showIndent(outfile, level) + outfile.write('model_.Notification(\n') + Notifications_.exportLiteral(outfile, level, name_='Notification') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('RateReplyDetails=[\n') + level += 1 + for RateReplyDetails_ in self.RateReplyDetails: + showIndent(outfile, level) + outfile.write('model_.RateReplyDetail(\n') + RateReplyDetails_.exportLiteral(outfile, level, name_='RateReplyDetail') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'HighestSeverity': + HighestSeverity_ = child_.text + HighestSeverity_ = self.gds_validate_string(HighestSeverity_, node, 'HighestSeverity') + self.HighestSeverity = HighestSeverity_ + self.validate_NotificationSeverityType(self.HighestSeverity) # validate type NotificationSeverityType + elif nodeName_ == 'Notifications': + obj_ = Notification.factory() + obj_.build(child_) + self.Notifications.append(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'RateReplyDetails': + obj_ = RateReplyDetail.factory() + obj_.build(child_) + self.RateReplyDetails.append(obj_) +# end class RateReply + + +class RateReplyDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, ServiceType=None, PackagingType=None, AppliedOptions=None, AppliedSubOptions=None, DeliveryStation=None, DeliveryDayOfWeek=None, DeliveryTimestamp=None, CommitDetails=None, DestinationAirportId=None, IneligibleForMoneyBackGuarantee=None, OriginServiceArea=None, DestinationServiceArea=None, TransitTime=None, MaximumTransitTime=None, SignatureOption=None, ActualRateType=None, RatedShipmentDetails=None): + self.ServiceType = ServiceType + self.PackagingType = PackagingType + if AppliedOptions is None: + self.AppliedOptions = [] + else: + self.AppliedOptions = AppliedOptions + self.AppliedSubOptions = AppliedSubOptions + self.DeliveryStation = DeliveryStation + self.DeliveryDayOfWeek = DeliveryDayOfWeek + self.DeliveryTimestamp = DeliveryTimestamp + if CommitDetails is None: + self.CommitDetails = [] + else: + self.CommitDetails = CommitDetails + self.DestinationAirportId = DestinationAirportId + self.IneligibleForMoneyBackGuarantee = IneligibleForMoneyBackGuarantee + self.OriginServiceArea = OriginServiceArea + self.DestinationServiceArea = DestinationServiceArea + self.TransitTime = TransitTime + self.MaximumTransitTime = MaximumTransitTime + self.SignatureOption = SignatureOption + self.ActualRateType = ActualRateType + if RatedShipmentDetails is None: + self.RatedShipmentDetails = [] + else: + self.RatedShipmentDetails = RatedShipmentDetails + def factory(*args_, **kwargs_): + if RateReplyDetail.subclass: + return RateReplyDetail.subclass(*args_, **kwargs_) + else: + return RateReplyDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_ServiceType(self): return self.ServiceType + def set_ServiceType(self, ServiceType): self.ServiceType = ServiceType + def validate_ServiceType(self, value): + # Validate type ServiceType, a restriction on xs:string. + pass + def get_PackagingType(self): return self.PackagingType + def set_PackagingType(self, PackagingType): self.PackagingType = PackagingType + def validate_PackagingType(self, value): + # Validate type PackagingType, a restriction on xs:string. + pass + def get_AppliedOptions(self): return self.AppliedOptions + def set_AppliedOptions(self, AppliedOptions): self.AppliedOptions = AppliedOptions + def add_AppliedOptions(self, value): self.AppliedOptions.append(value) + def insert_AppliedOptions(self, index, value): self.AppliedOptions[index] = value + def validate_ServiceOptionType(self, value): + # Validate type ServiceOptionType, a restriction on xs:string. + pass + def get_AppliedSubOptions(self): return self.AppliedSubOptions + def set_AppliedSubOptions(self, AppliedSubOptions): self.AppliedSubOptions = AppliedSubOptions + def get_DeliveryStation(self): return self.DeliveryStation + def set_DeliveryStation(self, DeliveryStation): self.DeliveryStation = DeliveryStation + def get_DeliveryDayOfWeek(self): return self.DeliveryDayOfWeek + def set_DeliveryDayOfWeek(self, DeliveryDayOfWeek): self.DeliveryDayOfWeek = DeliveryDayOfWeek + def validate_DayOfWeekType(self, value): + # Validate type DayOfWeekType, a restriction on xs:string. + pass + def get_DeliveryTimestamp(self): return self.DeliveryTimestamp + def set_DeliveryTimestamp(self, DeliveryTimestamp): self.DeliveryTimestamp = DeliveryTimestamp + def get_CommitDetails(self): return self.CommitDetails + def set_CommitDetails(self, CommitDetails): self.CommitDetails = CommitDetails + def add_CommitDetails(self, value): self.CommitDetails.append(value) + def insert_CommitDetails(self, index, value): self.CommitDetails[index] = value + def get_DestinationAirportId(self): return self.DestinationAirportId + def set_DestinationAirportId(self, DestinationAirportId): self.DestinationAirportId = DestinationAirportId + def get_IneligibleForMoneyBackGuarantee(self): return self.IneligibleForMoneyBackGuarantee + def set_IneligibleForMoneyBackGuarantee(self, IneligibleForMoneyBackGuarantee): self.IneligibleForMoneyBackGuarantee = IneligibleForMoneyBackGuarantee + def get_OriginServiceArea(self): return self.OriginServiceArea + def set_OriginServiceArea(self, OriginServiceArea): self.OriginServiceArea = OriginServiceArea + def get_DestinationServiceArea(self): return self.DestinationServiceArea + def set_DestinationServiceArea(self, DestinationServiceArea): self.DestinationServiceArea = DestinationServiceArea + def get_TransitTime(self): return self.TransitTime + def set_TransitTime(self, TransitTime): self.TransitTime = TransitTime + def validate_TransitTimeType(self, value): + # Validate type TransitTimeType, a restriction on xs:string. + pass + def get_MaximumTransitTime(self): return self.MaximumTransitTime + def set_MaximumTransitTime(self, MaximumTransitTime): self.MaximumTransitTime = MaximumTransitTime + def get_SignatureOption(self): return self.SignatureOption + def set_SignatureOption(self, SignatureOption): self.SignatureOption = SignatureOption + def validate_SignatureOptionType(self, value): + # Validate type SignatureOptionType, a restriction on xs:string. + pass + def get_ActualRateType(self): return self.ActualRateType + def set_ActualRateType(self, ActualRateType): self.ActualRateType = ActualRateType + def validate_ReturnedRateType(self, value): + # Validate type ReturnedRateType, a restriction on xs:string. + pass + def get_RatedShipmentDetails(self): return self.RatedShipmentDetails + def set_RatedShipmentDetails(self, RatedShipmentDetails): self.RatedShipmentDetails = RatedShipmentDetails + def add_RatedShipmentDetails(self, value): self.RatedShipmentDetails.append(value) + def insert_RatedShipmentDetails(self, index, value): self.RatedShipmentDetails[index] = value + def export(self, outfile, level, namespace_='ns:', name_='RateReplyDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='RateReplyDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='RateReplyDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='RateReplyDetail', fromsubclass_=False): + if self.ServiceType is not None: + showIndent(outfile, level) + outfile.write('<%sServiceType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ServiceType).encode(ExternalEncoding), input_name='ServiceType'), namespace_)) + if self.PackagingType is not None: + showIndent(outfile, level) + outfile.write('<%sPackagingType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PackagingType).encode(ExternalEncoding), input_name='PackagingType'), namespace_)) + for AppliedOptions_ in self.AppliedOptions: + showIndent(outfile, level) + outfile.write('<%sAppliedOptions>%s\n' % (namespace_, self.gds_format_string(quote_xml(AppliedOptions_).encode(ExternalEncoding), input_name='AppliedOptions'), namespace_)) + if self.AppliedSubOptions: + self.AppliedSubOptions.export(outfile, level, namespace_, name_='AppliedSubOptions') + if self.DeliveryStation is not None: + showIndent(outfile, level) + outfile.write('<%sDeliveryStation>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DeliveryStation).encode(ExternalEncoding), input_name='DeliveryStation'), namespace_)) + if self.DeliveryDayOfWeek is not None: + showIndent(outfile, level) + outfile.write('<%sDeliveryDayOfWeek>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DeliveryDayOfWeek).encode(ExternalEncoding), input_name='DeliveryDayOfWeek'), namespace_)) + if self.DeliveryTimestamp is not None: + showIndent(outfile, level) + outfile.write('<%sDeliveryTimestamp>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DeliveryTimestamp).encode(ExternalEncoding), input_name='DeliveryTimestamp'), namespace_)) + for CommitDetails_ in self.CommitDetails: + CommitDetails_.export(outfile, level, namespace_, name_='CommitDetails') + if self.DestinationAirportId is not None: + showIndent(outfile, level) + outfile.write('<%sDestinationAirportId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DestinationAirportId).encode(ExternalEncoding), input_name='DestinationAirportId'), namespace_)) + if self.IneligibleForMoneyBackGuarantee is not None: + showIndent(outfile, level) + outfile.write('<%sIneligibleForMoneyBackGuarantee>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.IneligibleForMoneyBackGuarantee)), input_name='IneligibleForMoneyBackGuarantee'), namespace_)) + if self.OriginServiceArea is not None: + showIndent(outfile, level) + outfile.write('<%sOriginServiceArea>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.OriginServiceArea).encode(ExternalEncoding), input_name='OriginServiceArea'), namespace_)) + if self.DestinationServiceArea is not None: + showIndent(outfile, level) + outfile.write('<%sDestinationServiceArea>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DestinationServiceArea).encode(ExternalEncoding), input_name='DestinationServiceArea'), namespace_)) + if self.TransitTime is not None: + showIndent(outfile, level) + outfile.write('<%sTransitTime>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.TransitTime).encode(ExternalEncoding), input_name='TransitTime'), namespace_)) + if self.MaximumTransitTime is not None: + showIndent(outfile, level) + outfile.write('<%sMaximumTransitTime>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.MaximumTransitTime).encode(ExternalEncoding), input_name='MaximumTransitTime'), namespace_)) + if self.SignatureOption is not None: + showIndent(outfile, level) + outfile.write('<%sSignatureOption>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.SignatureOption).encode(ExternalEncoding), input_name='SignatureOption'), namespace_)) + if self.ActualRateType is not None: + showIndent(outfile, level) + outfile.write('<%sActualRateType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ActualRateType).encode(ExternalEncoding), input_name='ActualRateType'), namespace_)) + for RatedShipmentDetails_ in self.RatedShipmentDetails: + RatedShipmentDetails_.export(outfile, level, namespace_, name_='RatedShipmentDetails') + def hasContent_(self): + if ( + self.ServiceType is not None or + self.PackagingType is not None or + self.AppliedOptions or + self.AppliedSubOptions is not None or + self.DeliveryStation is not None or + self.DeliveryDayOfWeek is not None or + self.DeliveryTimestamp is not None or + self.CommitDetails or + self.DestinationAirportId is not None or + self.IneligibleForMoneyBackGuarantee is not None or + self.OriginServiceArea is not None or + self.DestinationServiceArea is not None or + self.TransitTime is not None or + self.MaximumTransitTime is not None or + self.SignatureOption is not None or + self.ActualRateType is not None or + self.RatedShipmentDetails + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='RateReplyDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.ServiceType is not None: + showIndent(outfile, level) + outfile.write('ServiceType=%s,\n' % quote_python(self.ServiceType).encode(ExternalEncoding)) + if self.PackagingType is not None: + showIndent(outfile, level) + outfile.write('PackagingType=%s,\n' % quote_python(self.PackagingType).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('AppliedOptions=[\n') + level += 1 + for AppliedOptions_ in self.AppliedOptions: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(AppliedOptions_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.AppliedSubOptions is not None: + showIndent(outfile, level) + outfile.write('AppliedSubOptions=model_.ServiceSubOptionDetail(\n') + self.AppliedSubOptions.exportLiteral(outfile, level, name_='AppliedSubOptions') + showIndent(outfile, level) + outfile.write('),\n') + if self.DeliveryStation is not None: + showIndent(outfile, level) + outfile.write('DeliveryStation=%s,\n' % quote_python(self.DeliveryStation).encode(ExternalEncoding)) + if self.DeliveryDayOfWeek is not None: + showIndent(outfile, level) + outfile.write('DeliveryDayOfWeek=%s,\n' % quote_python(self.DeliveryDayOfWeek).encode(ExternalEncoding)) + if self.DeliveryTimestamp is not None: + showIndent(outfile, level) + outfile.write('DeliveryTimestamp=%s,\n' % quote_python(self.DeliveryTimestamp).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('CommitDetails=[\n') + level += 1 + for CommitDetails_ in self.CommitDetails: + showIndent(outfile, level) + outfile.write('model_.CommitDetail(\n') + CommitDetails_.exportLiteral(outfile, level, name_='CommitDetail') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.DestinationAirportId is not None: + showIndent(outfile, level) + outfile.write('DestinationAirportId=%s,\n' % quote_python(self.DestinationAirportId).encode(ExternalEncoding)) + if self.IneligibleForMoneyBackGuarantee is not None: + showIndent(outfile, level) + outfile.write('IneligibleForMoneyBackGuarantee=%s,\n' % self.IneligibleForMoneyBackGuarantee) + if self.OriginServiceArea is not None: + showIndent(outfile, level) + outfile.write('OriginServiceArea=%s,\n' % quote_python(self.OriginServiceArea).encode(ExternalEncoding)) + if self.DestinationServiceArea is not None: + showIndent(outfile, level) + outfile.write('DestinationServiceArea=%s,\n' % quote_python(self.DestinationServiceArea).encode(ExternalEncoding)) + if self.TransitTime is not None: + showIndent(outfile, level) + outfile.write('TransitTime=%s,\n' % quote_python(self.TransitTime).encode(ExternalEncoding)) + if self.MaximumTransitTime is not None: + showIndent(outfile, level) + outfile.write('MaximumTransitTime=%s,\n' % quote_python(self.MaximumTransitTime).encode(ExternalEncoding)) + if self.SignatureOption is not None: + showIndent(outfile, level) + outfile.write('SignatureOption=%s,\n' % quote_python(self.SignatureOption).encode(ExternalEncoding)) + if self.ActualRateType is not None: + showIndent(outfile, level) + outfile.write('ActualRateType=%s,\n' % quote_python(self.ActualRateType).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('RatedShipmentDetails=[\n') + level += 1 + for RatedShipmentDetails_ in self.RatedShipmentDetails: + showIndent(outfile, level) + outfile.write('model_.RatedShipmentDetail(\n') + RatedShipmentDetails_.exportLiteral(outfile, level, name_='RatedShipmentDetail') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'ServiceType': + ServiceType_ = child_.text + ServiceType_ = self.gds_validate_string(ServiceType_, node, 'ServiceType') + self.ServiceType = ServiceType_ + self.validate_ServiceType(self.ServiceType) # validate type ServiceType + elif nodeName_ == 'PackagingType': + PackagingType_ = child_.text + PackagingType_ = self.gds_validate_string(PackagingType_, node, 'PackagingType') + self.PackagingType = PackagingType_ + self.validate_PackagingType(self.PackagingType) # validate type PackagingType + elif nodeName_ == 'AppliedOptions': + AppliedOptions_ = child_.text + AppliedOptions_ = self.gds_validate_string(AppliedOptions_, node, 'AppliedOptions') + self.AppliedOptions.append(AppliedOptions_) + self.validate_ServiceOptionType(self.AppliedOptions) # validate type ServiceOptionType + elif nodeName_ == 'AppliedSubOptions': + obj_ = ServiceSubOptionDetail.factory() + obj_.build(child_) + self.set_AppliedSubOptions(obj_) + elif nodeName_ == 'DeliveryStation': + DeliveryStation_ = child_.text + DeliveryStation_ = self.gds_validate_string(DeliveryStation_, node, 'DeliveryStation') + self.DeliveryStation = DeliveryStation_ + elif nodeName_ == 'DeliveryDayOfWeek': + DeliveryDayOfWeek_ = child_.text + DeliveryDayOfWeek_ = self.gds_validate_string(DeliveryDayOfWeek_, node, 'DeliveryDayOfWeek') + self.DeliveryDayOfWeek = DeliveryDayOfWeek_ + self.validate_DayOfWeekType(self.DeliveryDayOfWeek) # validate type DayOfWeekType + elif nodeName_ == 'DeliveryTimestamp': + DeliveryTimestamp_ = child_.text + DeliveryTimestamp_ = self.gds_validate_string(DeliveryTimestamp_, node, 'DeliveryTimestamp') + self.DeliveryTimestamp = DeliveryTimestamp_ + elif nodeName_ == 'CommitDetails': + obj_ = CommitDetail.factory() + obj_.build(child_) + self.CommitDetails.append(obj_) + elif nodeName_ == 'DestinationAirportId': + DestinationAirportId_ = child_.text + DestinationAirportId_ = self.gds_validate_string(DestinationAirportId_, node, 'DestinationAirportId') + self.DestinationAirportId = DestinationAirportId_ + elif nodeName_ == 'IneligibleForMoneyBackGuarantee': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'IneligibleForMoneyBackGuarantee') + self.IneligibleForMoneyBackGuarantee = ival_ + elif nodeName_ == 'OriginServiceArea': + OriginServiceArea_ = child_.text + OriginServiceArea_ = self.gds_validate_string(OriginServiceArea_, node, 'OriginServiceArea') + self.OriginServiceArea = OriginServiceArea_ + elif nodeName_ == 'DestinationServiceArea': + DestinationServiceArea_ = child_.text + DestinationServiceArea_ = self.gds_validate_string(DestinationServiceArea_, node, 'DestinationServiceArea') + self.DestinationServiceArea = DestinationServiceArea_ + elif nodeName_ == 'TransitTime': + TransitTime_ = child_.text + TransitTime_ = self.gds_validate_string(TransitTime_, node, 'TransitTime') + self.TransitTime = TransitTime_ + self.validate_TransitTimeType(self.TransitTime) # validate type TransitTimeType + elif nodeName_ == 'MaximumTransitTime': + MaximumTransitTime_ = child_.text + MaximumTransitTime_ = self.gds_validate_string(MaximumTransitTime_, node, 'MaximumTransitTime') + self.MaximumTransitTime = MaximumTransitTime_ + self.validate_TransitTimeType(self.MaximumTransitTime) # validate type TransitTimeType + elif nodeName_ == 'SignatureOption': + SignatureOption_ = child_.text + SignatureOption_ = self.gds_validate_string(SignatureOption_, node, 'SignatureOption') + self.SignatureOption = SignatureOption_ + self.validate_SignatureOptionType(self.SignatureOption) # validate type SignatureOptionType + elif nodeName_ == 'ActualRateType': + ActualRateType_ = child_.text + ActualRateType_ = self.gds_validate_string(ActualRateType_, node, 'ActualRateType') + self.ActualRateType = ActualRateType_ + self.validate_ReturnedRateType(self.ActualRateType) # validate type ReturnedRateType + elif nodeName_ == 'RatedShipmentDetails': + obj_ = RatedShipmentDetail.factory() + obj_.build(child_) + self.RatedShipmentDetails.append(obj_) +# end class RateReplyDetail + + +class RateRequest(GeneratedsSuper): + """Descriptive data sent to FedEx by a customer in order to rate a + package/shipment.""" + subclass = None + superclass = None + def __init__(self, WebAuthenticationDetail=None, ClientDetail=None, TransactionDetail=None, Version=None, ReturnTransitAndCommit=None, CarrierCodes=None, VariableOptions=None, RequestedShipment=None): + self.WebAuthenticationDetail = WebAuthenticationDetail + self.ClientDetail = ClientDetail + self.TransactionDetail = TransactionDetail + self.Version = Version + self.ReturnTransitAndCommit = ReturnTransitAndCommit + if CarrierCodes is None: + self.CarrierCodes = [] + else: + self.CarrierCodes = CarrierCodes + if VariableOptions is None: + self.VariableOptions = [] + else: + self.VariableOptions = VariableOptions + self.RequestedShipment = RequestedShipment + def factory(*args_, **kwargs_): + if RateRequest.subclass: + return RateRequest.subclass(*args_, **kwargs_) + else: + return RateRequest(*args_, **kwargs_) + factory = staticmethod(factory) + def get_WebAuthenticationDetail(self): return self.WebAuthenticationDetail + def set_WebAuthenticationDetail(self, WebAuthenticationDetail): self.WebAuthenticationDetail = WebAuthenticationDetail + def get_ClientDetail(self): return self.ClientDetail + def set_ClientDetail(self, ClientDetail): self.ClientDetail = ClientDetail + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_ReturnTransitAndCommit(self): return self.ReturnTransitAndCommit + def set_ReturnTransitAndCommit(self, ReturnTransitAndCommit): self.ReturnTransitAndCommit = ReturnTransitAndCommit + def get_CarrierCodes(self): return self.CarrierCodes + def set_CarrierCodes(self, CarrierCodes): self.CarrierCodes = CarrierCodes + def add_CarrierCodes(self, value): self.CarrierCodes.append(value) + def insert_CarrierCodes(self, index, value): self.CarrierCodes[index] = value + def validate_CarrierCodeType(self, value): + # Validate type CarrierCodeType, a restriction on xs:string. + pass + def get_VariableOptions(self): return self.VariableOptions + def set_VariableOptions(self, VariableOptions): self.VariableOptions = VariableOptions + def add_VariableOptions(self, value): self.VariableOptions.append(value) + def insert_VariableOptions(self, index, value): self.VariableOptions[index] = value + def validate_ServiceOptionType(self, value): + # Validate type ServiceOptionType, a restriction on xs:string. + pass + def get_RequestedShipment(self): return self.RequestedShipment + def set_RequestedShipment(self, RequestedShipment): self.RequestedShipment = RequestedShipment + def export(self, outfile, level, namespace_='ns:', name_='RateRequest', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='RateRequest') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='RateRequest'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='RateRequest', fromsubclass_=False): + if self.WebAuthenticationDetail: + self.WebAuthenticationDetail.export(outfile, level, namespace_, name_='WebAuthenticationDetail', ) + if self.ClientDetail: + self.ClientDetail.export(outfile, level, namespace_, name_='ClientDetail', ) + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.ReturnTransitAndCommit is not None: + showIndent(outfile, level) + outfile.write('<%sReturnTransitAndCommit>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.ReturnTransitAndCommit)), input_name='ReturnTransitAndCommit'), namespace_)) + for CarrierCodes_ in self.CarrierCodes: + showIndent(outfile, level) + outfile.write('<%sCarrierCodes>%s\n' % (namespace_, self.gds_format_string(quote_xml(CarrierCodes_).encode(ExternalEncoding), input_name='CarrierCodes'), namespace_)) + for VariableOptions_ in self.VariableOptions: + showIndent(outfile, level) + outfile.write('<%sVariableOptions>%s\n' % (namespace_, self.gds_format_string(quote_xml(VariableOptions_).encode(ExternalEncoding), input_name='VariableOptions'), namespace_)) + if self.RequestedShipment: + self.RequestedShipment.export(outfile, level, namespace_, name_='RequestedShipment', ) + def hasContent_(self): + if ( + self.WebAuthenticationDetail is not None or + self.ClientDetail is not None or + self.TransactionDetail is not None or + self.Version is not None or + self.ReturnTransitAndCommit is not None or + self.CarrierCodes or + self.VariableOptions or + self.RequestedShipment is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='RateRequest'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.WebAuthenticationDetail is not None: + showIndent(outfile, level) + outfile.write('WebAuthenticationDetail=model_.WebAuthenticationDetail(\n') + self.WebAuthenticationDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ClientDetail is not None: + showIndent(outfile, level) + outfile.write('ClientDetail=model_.ClientDetail(\n') + self.ClientDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.ReturnTransitAndCommit is not None: + showIndent(outfile, level) + outfile.write('ReturnTransitAndCommit=%s,\n' % self.ReturnTransitAndCommit) + showIndent(outfile, level) + outfile.write('CarrierCodes=[\n') + level += 1 + for CarrierCodes_ in self.CarrierCodes: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(CarrierCodes_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('VariableOptions=[\n') + level += 1 + for VariableOptions_ in self.VariableOptions: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(VariableOptions_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.RequestedShipment is not None: + showIndent(outfile, level) + outfile.write('RequestedShipment=model_.RequestedShipment(\n') + self.RequestedShipment.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'WebAuthenticationDetail': + obj_ = WebAuthenticationDetail.factory() + obj_.build(child_) + self.set_WebAuthenticationDetail(obj_) + elif nodeName_ == 'ClientDetail': + obj_ = ClientDetail.factory() + obj_.build(child_) + self.set_ClientDetail(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'ReturnTransitAndCommit': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'ReturnTransitAndCommit') + self.ReturnTransitAndCommit = ival_ + elif nodeName_ == 'CarrierCodes': + CarrierCodes_ = child_.text + CarrierCodes_ = self.gds_validate_string(CarrierCodes_, node, 'CarrierCodes') + self.CarrierCodes.append(CarrierCodes_) + self.validate_CarrierCodeType(self.CarrierCodes) # validate type CarrierCodeType + elif nodeName_ == 'VariableOptions': + VariableOptions_ = child_.text + VariableOptions_ = self.gds_validate_string(VariableOptions_, node, 'VariableOptions') + self.VariableOptions.append(VariableOptions_) + self.validate_ServiceOptionType(self.VariableOptions) # validate type ServiceOptionType + elif nodeName_ == 'RequestedShipment': + obj_ = RequestedShipment.factory() + obj_.build(child_) + self.set_RequestedShipment(obj_) +# end class RateRequest + + +class RatedPackageDetail(GeneratedsSuper): + """If requesting rates using the PackageDetails element (one package at + a time) in the request, the rates for each package will be + returned in this element. Currently total piece total weight + rates are also retuned in this element.""" + subclass = None + superclass = None + def __init__(self, TrackingIds=None, GroupNumber=None, EffectiveNetDiscount=None, AdjustedCodCollectionAmount=None, OversizeClass=None, PackageRateDetail=None): + if TrackingIds is None: + self.TrackingIds = [] + else: + self.TrackingIds = TrackingIds + self.GroupNumber = GroupNumber + self.EffectiveNetDiscount = EffectiveNetDiscount + self.AdjustedCodCollectionAmount = AdjustedCodCollectionAmount + self.OversizeClass = OversizeClass + self.PackageRateDetail = PackageRateDetail + def factory(*args_, **kwargs_): + if RatedPackageDetail.subclass: + return RatedPackageDetail.subclass(*args_, **kwargs_) + else: + return RatedPackageDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_TrackingIds(self): return self.TrackingIds + def set_TrackingIds(self, TrackingIds): self.TrackingIds = TrackingIds + def add_TrackingIds(self, value): self.TrackingIds.append(value) + def insert_TrackingIds(self, index, value): self.TrackingIds[index] = value + def get_GroupNumber(self): return self.GroupNumber + def set_GroupNumber(self, GroupNumber): self.GroupNumber = GroupNumber + def get_EffectiveNetDiscount(self): return self.EffectiveNetDiscount + def set_EffectiveNetDiscount(self, EffectiveNetDiscount): self.EffectiveNetDiscount = EffectiveNetDiscount + def get_AdjustedCodCollectionAmount(self): return self.AdjustedCodCollectionAmount + def set_AdjustedCodCollectionAmount(self, AdjustedCodCollectionAmount): self.AdjustedCodCollectionAmount = AdjustedCodCollectionAmount + def get_OversizeClass(self): return self.OversizeClass + def set_OversizeClass(self, OversizeClass): self.OversizeClass = OversizeClass + def validate_OversizeClassType(self, value): + # Validate type OversizeClassType, a restriction on xs:string. + pass + def get_PackageRateDetail(self): return self.PackageRateDetail + def set_PackageRateDetail(self, PackageRateDetail): self.PackageRateDetail = PackageRateDetail + def export(self, outfile, level, namespace_='ns:', name_='RatedPackageDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='RatedPackageDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='RatedPackageDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='RatedPackageDetail', fromsubclass_=False): + for TrackingIds_ in self.TrackingIds: + TrackingIds_.export(outfile, level, namespace_, name_='TrackingIds') + if self.GroupNumber is not None: + showIndent(outfile, level) + outfile.write('<%sGroupNumber>%s\n' % (namespace_, self.gds_format_integer(self.GroupNumber, input_name='GroupNumber'), namespace_)) + if self.EffectiveNetDiscount: + self.EffectiveNetDiscount.export(outfile, level, namespace_, name_='EffectiveNetDiscount') + if self.AdjustedCodCollectionAmount: + self.AdjustedCodCollectionAmount.export(outfile, level, namespace_, name_='AdjustedCodCollectionAmount') + if self.OversizeClass is not None: + showIndent(outfile, level) + outfile.write('<%sOversizeClass>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.OversizeClass).encode(ExternalEncoding), input_name='OversizeClass'), namespace_)) + if self.PackageRateDetail: + self.PackageRateDetail.export(outfile, level, namespace_, name_='PackageRateDetail') + def hasContent_(self): + if ( + self.TrackingIds or + self.GroupNumber is not None or + self.EffectiveNetDiscount is not None or + self.AdjustedCodCollectionAmount is not None or + self.OversizeClass is not None or + self.PackageRateDetail is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='RatedPackageDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('TrackingIds=[\n') + level += 1 + for TrackingIds_ in self.TrackingIds: + showIndent(outfile, level) + outfile.write('model_.TrackingId(\n') + TrackingIds_.exportLiteral(outfile, level, name_='TrackingId') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.GroupNumber is not None: + showIndent(outfile, level) + outfile.write('GroupNumber=%d,\n' % self.GroupNumber) + if self.EffectiveNetDiscount is not None: + showIndent(outfile, level) + outfile.write('EffectiveNetDiscount=model_.Money(\n') + self.EffectiveNetDiscount.exportLiteral(outfile, level, name_='EffectiveNetDiscount') + showIndent(outfile, level) + outfile.write('),\n') + if self.AdjustedCodCollectionAmount is not None: + showIndent(outfile, level) + outfile.write('AdjustedCodCollectionAmount=model_.Money(\n') + self.AdjustedCodCollectionAmount.exportLiteral(outfile, level, name_='AdjustedCodCollectionAmount') + showIndent(outfile, level) + outfile.write('),\n') + if self.OversizeClass is not None: + showIndent(outfile, level) + outfile.write('OversizeClass=%s,\n' % quote_python(self.OversizeClass).encode(ExternalEncoding)) + if self.PackageRateDetail is not None: + showIndent(outfile, level) + outfile.write('PackageRateDetail=model_.PackageRateDetail(\n') + self.PackageRateDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'TrackingIds': + obj_ = TrackingId.factory() + obj_.build(child_) + self.TrackingIds.append(obj_) + elif nodeName_ == 'GroupNumber': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'GroupNumber') + self.GroupNumber = ival_ + elif nodeName_ == 'EffectiveNetDiscount': + obj_ = Money.factory() + obj_.build(child_) + self.set_EffectiveNetDiscount(obj_) + elif nodeName_ == 'AdjustedCodCollectionAmount': + obj_ = Money.factory() + obj_.build(child_) + self.set_AdjustedCodCollectionAmount(obj_) + elif nodeName_ == 'OversizeClass': + OversizeClass_ = child_.text + OversizeClass_ = self.gds_validate_string(OversizeClass_, node, 'OversizeClass') + self.OversizeClass = OversizeClass_ + self.validate_OversizeClassType(self.OversizeClass) # validate type OversizeClassType + elif nodeName_ == 'PackageRateDetail': + obj_ = PackageRateDetail.factory() + obj_.build(child_) + self.set_PackageRateDetail(obj_) +# end class RatedPackageDetail + + +class RatedShipmentDetail(GeneratedsSuper): + """This class groups the shipment and package rating data for a + specific rate type for use in a rating reply, which groups + result data by rate type.""" + subclass = None + superclass = None + def __init__(self, EffectiveNetDiscount=None, AdjustedCodCollectionAmount=None, ShipmentRateDetail=None, RatedPackages=None): + self.EffectiveNetDiscount = EffectiveNetDiscount + self.AdjustedCodCollectionAmount = AdjustedCodCollectionAmount + self.ShipmentRateDetail = ShipmentRateDetail + if RatedPackages is None: + self.RatedPackages = [] + else: + self.RatedPackages = RatedPackages + def factory(*args_, **kwargs_): + if RatedShipmentDetail.subclass: + return RatedShipmentDetail.subclass(*args_, **kwargs_) + else: + return RatedShipmentDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_EffectiveNetDiscount(self): return self.EffectiveNetDiscount + def set_EffectiveNetDiscount(self, EffectiveNetDiscount): self.EffectiveNetDiscount = EffectiveNetDiscount + def get_AdjustedCodCollectionAmount(self): return self.AdjustedCodCollectionAmount + def set_AdjustedCodCollectionAmount(self, AdjustedCodCollectionAmount): self.AdjustedCodCollectionAmount = AdjustedCodCollectionAmount + def get_ShipmentRateDetail(self): return self.ShipmentRateDetail + def set_ShipmentRateDetail(self, ShipmentRateDetail): self.ShipmentRateDetail = ShipmentRateDetail + def get_RatedPackages(self): return self.RatedPackages + def set_RatedPackages(self, RatedPackages): self.RatedPackages = RatedPackages + def add_RatedPackages(self, value): self.RatedPackages.append(value) + def insert_RatedPackages(self, index, value): self.RatedPackages[index] = value + def export(self, outfile, level, namespace_='ns:', name_='RatedShipmentDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='RatedShipmentDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='RatedShipmentDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='RatedShipmentDetail', fromsubclass_=False): + if self.EffectiveNetDiscount: + self.EffectiveNetDiscount.export(outfile, level, namespace_, name_='EffectiveNetDiscount') + if self.AdjustedCodCollectionAmount: + self.AdjustedCodCollectionAmount.export(outfile, level, namespace_, name_='AdjustedCodCollectionAmount') + if self.ShipmentRateDetail: + self.ShipmentRateDetail.export(outfile, level, namespace_, name_='ShipmentRateDetail') + for RatedPackages_ in self.RatedPackages: + RatedPackages_.export(outfile, level, namespace_, name_='RatedPackages') + def hasContent_(self): + if ( + self.EffectiveNetDiscount is not None or + self.AdjustedCodCollectionAmount is not None or + self.ShipmentRateDetail is not None or + self.RatedPackages + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='RatedShipmentDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.EffectiveNetDiscount is not None: + showIndent(outfile, level) + outfile.write('EffectiveNetDiscount=model_.Money(\n') + self.EffectiveNetDiscount.exportLiteral(outfile, level, name_='EffectiveNetDiscount') + showIndent(outfile, level) + outfile.write('),\n') + if self.AdjustedCodCollectionAmount is not None: + showIndent(outfile, level) + outfile.write('AdjustedCodCollectionAmount=model_.Money(\n') + self.AdjustedCodCollectionAmount.exportLiteral(outfile, level, name_='AdjustedCodCollectionAmount') + showIndent(outfile, level) + outfile.write('),\n') + if self.ShipmentRateDetail is not None: + showIndent(outfile, level) + outfile.write('ShipmentRateDetail=model_.ShipmentRateDetail(\n') + self.ShipmentRateDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('RatedPackages=[\n') + level += 1 + for RatedPackages_ in self.RatedPackages: + showIndent(outfile, level) + outfile.write('model_.RatedPackageDetail(\n') + RatedPackages_.exportLiteral(outfile, level, name_='RatedPackageDetail') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'EffectiveNetDiscount': + obj_ = Money.factory() + obj_.build(child_) + self.set_EffectiveNetDiscount(obj_) + elif nodeName_ == 'AdjustedCodCollectionAmount': + obj_ = Money.factory() + obj_.build(child_) + self.set_AdjustedCodCollectionAmount(obj_) + elif nodeName_ == 'ShipmentRateDetail': + obj_ = ShipmentRateDetail.factory() + obj_.build(child_) + self.set_ShipmentRateDetail(obj_) + elif nodeName_ == 'RatedPackages': + obj_ = RatedPackageDetail.factory() + obj_.build(child_) + self.RatedPackages.append(obj_) +# end class RatedShipmentDetail + + +class Rebate(GeneratedsSuper): + """Identifies a discount applied to the shipment.""" + subclass = None + superclass = None + def __init__(self, RebateType=None, Description=None, Amount=None, Percent=None): + self.RebateType = RebateType + self.Description = Description + self.Amount = Amount + self.Percent = Percent + def factory(*args_, **kwargs_): + if Rebate.subclass: + return Rebate.subclass(*args_, **kwargs_) + else: + return Rebate(*args_, **kwargs_) + factory = staticmethod(factory) + def get_RebateType(self): return self.RebateType + def set_RebateType(self, RebateType): self.RebateType = RebateType + def validate_RebateType(self, value): + # Validate type RebateType, a restriction on xs:string. + pass + def get_Description(self): return self.Description + def set_Description(self, Description): self.Description = Description + def get_Amount(self): return self.Amount + def set_Amount(self, Amount): self.Amount = Amount + def get_Percent(self): return self.Percent + def set_Percent(self, Percent): self.Percent = Percent + def export(self, outfile, level, namespace_='ns:', name_='Rebate', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Rebate') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Rebate'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Rebate', fromsubclass_=False): + if self.RebateType is not None: + showIndent(outfile, level) + outfile.write('<%sRebateType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RebateType).encode(ExternalEncoding), input_name='RebateType'), namespace_)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('<%sDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Description).encode(ExternalEncoding), input_name='Description'), namespace_)) + if self.Amount: + self.Amount.export(outfile, level, namespace_, name_='Amount') + if self.Percent is not None: + showIndent(outfile, level) + outfile.write('<%sPercent>%s\n' % (namespace_, self.gds_format_float(self.Percent, input_name='Percent'), namespace_)) + def hasContent_(self): + if ( + self.RebateType is not None or + self.Description is not None or + self.Amount is not None or + self.Percent is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Rebate'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.RebateType is not None: + showIndent(outfile, level) + outfile.write('RebateType=%s,\n' % quote_python(self.RebateType).encode(ExternalEncoding)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('Description=%s,\n' % quote_python(self.Description).encode(ExternalEncoding)) + if self.Amount is not None: + showIndent(outfile, level) + outfile.write('Amount=model_.Money(\n') + self.Amount.exportLiteral(outfile, level, name_='Amount') + showIndent(outfile, level) + outfile.write('),\n') + if self.Percent is not None: + showIndent(outfile, level) + outfile.write('Percent=%f,\n' % self.Percent) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'RebateType': + RebateType_ = child_.text + RebateType_ = self.gds_validate_string(RebateType_, node, 'RebateType') + self.RebateType = RebateType_ + self.validate_RebateType(self.RebateType) # validate type RebateType + elif nodeName_ == 'Description': + Description_ = child_.text + Description_ = self.gds_validate_string(Description_, node, 'Description') + self.Description = Description_ + elif nodeName_ == 'Amount': + obj_ = Money.factory() + obj_.build(child_) + self.set_Amount(obj_) + elif nodeName_ == 'Percent': + sval_ = child_.text + try: + fval_ = float(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires float or double: %s' % exp) + fval_ = self.gds_validate_float(fval_, node, 'Percent') + self.Percent = fval_ +# end class Rebate + + +class RecipientCustomsId(GeneratedsSuper): + """Specifies how the recipient is identified for customs purposes; the + requirements on this information vary with destination country.""" + subclass = None + superclass = None + def __init__(self, Type=None, Value=None): + self.Type = Type + self.Value = Value + def factory(*args_, **kwargs_): + if RecipientCustomsId.subclass: + return RecipientCustomsId.subclass(*args_, **kwargs_) + else: + return RecipientCustomsId(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Type(self): return self.Type + def set_Type(self, Type): self.Type = Type + def validate_RecipientCustomsIdType(self, value): + # Validate type RecipientCustomsIdType, a restriction on xs:string. + pass + def get_Value(self): return self.Value + def set_Value(self, Value): self.Value = Value + def export(self, outfile, level, namespace_='ns:', name_='RecipientCustomsId', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='RecipientCustomsId') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='RecipientCustomsId'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='RecipientCustomsId', fromsubclass_=False): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('<%sType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Type).encode(ExternalEncoding), input_name='Type'), namespace_)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('<%sValue>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Value).encode(ExternalEncoding), input_name='Value'), namespace_)) + def hasContent_(self): + if ( + self.Type is not None or + self.Value is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='RecipientCustomsId'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('Type=%s,\n' % quote_python(self.Type).encode(ExternalEncoding)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('Value=%s,\n' % quote_python(self.Value).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Type': + Type_ = child_.text + Type_ = self.gds_validate_string(Type_, node, 'Type') + self.Type = Type_ + self.validate_RecipientCustomsIdType(self.Type) # validate type RecipientCustomsIdType + elif nodeName_ == 'Value': + Value_ = child_.text + Value_ = self.gds_validate_string(Value_, node, 'Value') + self.Value = Value_ +# end class RecipientCustomsId + + +class RequestedPackageLineItem(GeneratedsSuper): + """This class rationalizes RequestedPackage and RequestedPackageSummary + from previous interfaces. The way in which it is uses within a + RequestedShipment depends on the RequestedPackageDetailType + value specified for that shipment.""" + subclass = None + superclass = None + def __init__(self, SequenceNumber=None, GroupNumber=None, GroupPackageCount=None, VariableHandlingChargeDetail=None, InsuredValue=None, Weight=None, Dimensions=None, PhysicalPackaging=None, ItemDescription=None, CustomerReferences=None, SpecialServicesRequested=None, ContentRecords=None): + self.SequenceNumber = SequenceNumber + self.GroupNumber = GroupNumber + self.GroupPackageCount = GroupPackageCount + self.VariableHandlingChargeDetail = VariableHandlingChargeDetail + self.InsuredValue = InsuredValue + self.Weight = Weight + self.Dimensions = Dimensions + self.PhysicalPackaging = PhysicalPackaging + self.ItemDescription = ItemDescription + if CustomerReferences is None: + self.CustomerReferences = [] + else: + self.CustomerReferences = CustomerReferences + self.SpecialServicesRequested = SpecialServicesRequested + if ContentRecords is None: + self.ContentRecords = [] + else: + self.ContentRecords = ContentRecords + def factory(*args_, **kwargs_): + if RequestedPackageLineItem.subclass: + return RequestedPackageLineItem.subclass(*args_, **kwargs_) + else: + return RequestedPackageLineItem(*args_, **kwargs_) + factory = staticmethod(factory) + def get_SequenceNumber(self): return self.SequenceNumber + def set_SequenceNumber(self, SequenceNumber): self.SequenceNumber = SequenceNumber + def get_GroupNumber(self): return self.GroupNumber + def set_GroupNumber(self, GroupNumber): self.GroupNumber = GroupNumber + def get_GroupPackageCount(self): return self.GroupPackageCount + def set_GroupPackageCount(self, GroupPackageCount): self.GroupPackageCount = GroupPackageCount + def get_VariableHandlingChargeDetail(self): return self.VariableHandlingChargeDetail + def set_VariableHandlingChargeDetail(self, VariableHandlingChargeDetail): self.VariableHandlingChargeDetail = VariableHandlingChargeDetail + def get_InsuredValue(self): return self.InsuredValue + def set_InsuredValue(self, InsuredValue): self.InsuredValue = InsuredValue + def get_Weight(self): return self.Weight + def set_Weight(self, Weight): self.Weight = Weight + def get_Dimensions(self): return self.Dimensions + def set_Dimensions(self, Dimensions): self.Dimensions = Dimensions + def get_PhysicalPackaging(self): return self.PhysicalPackaging + def set_PhysicalPackaging(self, PhysicalPackaging): self.PhysicalPackaging = PhysicalPackaging + def validate_PhysicalPackagingType(self, value): + # Validate type PhysicalPackagingType, a restriction on xs:string. + pass + def get_ItemDescription(self): return self.ItemDescription + def set_ItemDescription(self, ItemDescription): self.ItemDescription = ItemDescription + def get_CustomerReferences(self): return self.CustomerReferences + def set_CustomerReferences(self, CustomerReferences): self.CustomerReferences = CustomerReferences + def add_CustomerReferences(self, value): self.CustomerReferences.append(value) + def insert_CustomerReferences(self, index, value): self.CustomerReferences[index] = value + def get_SpecialServicesRequested(self): return self.SpecialServicesRequested + def set_SpecialServicesRequested(self, SpecialServicesRequested): self.SpecialServicesRequested = SpecialServicesRequested + def get_ContentRecords(self): return self.ContentRecords + def set_ContentRecords(self, ContentRecords): self.ContentRecords = ContentRecords + def add_ContentRecords(self, value): self.ContentRecords.append(value) + def insert_ContentRecords(self, index, value): self.ContentRecords[index] = value + def export(self, outfile, level, namespace_='ns:', name_='RequestedPackageLineItem', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='RequestedPackageLineItem') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='RequestedPackageLineItem'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='RequestedPackageLineItem', fromsubclass_=False): + if self.SequenceNumber is not None: + showIndent(outfile, level) + outfile.write('<%sSequenceNumber>%s\n' % (namespace_, self.gds_format_integer(self.SequenceNumber, input_name='SequenceNumber'), namespace_)) + if self.GroupNumber is not None: + showIndent(outfile, level) + outfile.write('<%sGroupNumber>%s\n' % (namespace_, self.gds_format_integer(self.GroupNumber, input_name='GroupNumber'), namespace_)) + if self.GroupPackageCount is not None: + showIndent(outfile, level) + outfile.write('<%sGroupPackageCount>%s\n' % (namespace_, self.gds_format_integer(self.GroupPackageCount, input_name='GroupPackageCount'), namespace_)) + if self.VariableHandlingChargeDetail: + self.VariableHandlingChargeDetail.export(outfile, level, namespace_, name_='VariableHandlingChargeDetail') + if self.InsuredValue: + self.InsuredValue.export(outfile, level, namespace_, name_='InsuredValue') + if self.Weight: + self.Weight.export(outfile, level, namespace_, name_='Weight') + if self.Dimensions: + self.Dimensions.export(outfile, level, namespace_, name_='Dimensions') + if self.PhysicalPackaging is not None: + showIndent(outfile, level) + outfile.write('<%sPhysicalPackaging>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PhysicalPackaging).encode(ExternalEncoding), input_name='PhysicalPackaging'), namespace_)) + if self.ItemDescription is not None: + showIndent(outfile, level) + outfile.write('<%sItemDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ItemDescription).encode(ExternalEncoding), input_name='ItemDescription'), namespace_)) + for CustomerReferences_ in self.CustomerReferences: + CustomerReferences_.export(outfile, level, namespace_, name_='CustomerReferences') + if self.SpecialServicesRequested: + self.SpecialServicesRequested.export(outfile, level, namespace_, name_='SpecialServicesRequested') + for ContentRecords_ in self.ContentRecords: + ContentRecords_.export(outfile, level, namespace_, name_='ContentRecords') + def hasContent_(self): + if ( + self.SequenceNumber is not None or + self.GroupNumber is not None or + self.GroupPackageCount is not None or + self.VariableHandlingChargeDetail is not None or + self.InsuredValue is not None or + self.Weight is not None or + self.Dimensions is not None or + self.PhysicalPackaging is not None or + self.ItemDescription is not None or + self.CustomerReferences or + self.SpecialServicesRequested is not None or + self.ContentRecords + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='RequestedPackageLineItem'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.SequenceNumber is not None: + showIndent(outfile, level) + outfile.write('SequenceNumber=%d,\n' % self.SequenceNumber) + if self.GroupNumber is not None: + showIndent(outfile, level) + outfile.write('GroupNumber=%d,\n' % self.GroupNumber) + if self.GroupPackageCount is not None: + showIndent(outfile, level) + outfile.write('GroupPackageCount=%d,\n' % self.GroupPackageCount) + if self.VariableHandlingChargeDetail is not None: + showIndent(outfile, level) + outfile.write('VariableHandlingChargeDetail=model_.VariableHandlingChargeDetail(\n') + self.VariableHandlingChargeDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.InsuredValue is not None: + showIndent(outfile, level) + outfile.write('InsuredValue=model_.Money(\n') + self.InsuredValue.exportLiteral(outfile, level, name_='InsuredValue') + showIndent(outfile, level) + outfile.write('),\n') + if self.Weight is not None: + showIndent(outfile, level) + outfile.write('Weight=model_.Weight(\n') + self.Weight.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Dimensions is not None: + showIndent(outfile, level) + outfile.write('Dimensions=model_.Dimensions(\n') + self.Dimensions.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.PhysicalPackaging is not None: + showIndent(outfile, level) + outfile.write('PhysicalPackaging=%s,\n' % quote_python(self.PhysicalPackaging).encode(ExternalEncoding)) + if self.ItemDescription is not None: + showIndent(outfile, level) + outfile.write('ItemDescription=%s,\n' % quote_python(self.ItemDescription).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('CustomerReferences=[\n') + level += 1 + for CustomerReferences_ in self.CustomerReferences: + showIndent(outfile, level) + outfile.write('model_.CustomerReference(\n') + CustomerReferences_.exportLiteral(outfile, level, name_='CustomerReference') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.SpecialServicesRequested is not None: + showIndent(outfile, level) + outfile.write('SpecialServicesRequested=model_.PackageSpecialServicesRequested(\n') + self.SpecialServicesRequested.exportLiteral(outfile, level, name_='SpecialServicesRequested') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('ContentRecords=[\n') + level += 1 + for ContentRecords_ in self.ContentRecords: + showIndent(outfile, level) + outfile.write('model_.ContentRecord(\n') + ContentRecords_.exportLiteral(outfile, level, name_='ContentRecord') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'SequenceNumber': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ <= 0: + raise_parse_error(child_, 'requires positiveInteger') + ival_ = self.gds_validate_integer(ival_, node, 'SequenceNumber') + self.SequenceNumber = ival_ + elif nodeName_ == 'GroupNumber': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'GroupNumber') + self.GroupNumber = ival_ + elif nodeName_ == 'GroupPackageCount': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'GroupPackageCount') + self.GroupPackageCount = ival_ + elif nodeName_ == 'VariableHandlingChargeDetail': + obj_ = VariableHandlingChargeDetail.factory() + obj_.build(child_) + self.set_VariableHandlingChargeDetail(obj_) + elif nodeName_ == 'InsuredValue': + obj_ = Money.factory() + obj_.build(child_) + self.set_InsuredValue(obj_) + elif nodeName_ == 'Weight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_Weight(obj_) + elif nodeName_ == 'Dimensions': + obj_ = Dimensions.factory() + obj_.build(child_) + self.set_Dimensions(obj_) + elif nodeName_ == 'PhysicalPackaging': + PhysicalPackaging_ = child_.text + PhysicalPackaging_ = self.gds_validate_string(PhysicalPackaging_, node, 'PhysicalPackaging') + self.PhysicalPackaging = PhysicalPackaging_ + self.validate_PhysicalPackagingType(self.PhysicalPackaging) # validate type PhysicalPackagingType + elif nodeName_ == 'ItemDescription': + ItemDescription_ = child_.text + ItemDescription_ = self.gds_validate_string(ItemDescription_, node, 'ItemDescription') + self.ItemDescription = ItemDescription_ + elif nodeName_ == 'CustomerReferences': + obj_ = CustomerReference.factory() + obj_.build(child_) + self.CustomerReferences.append(obj_) + elif nodeName_ == 'SpecialServicesRequested': + obj_ = PackageSpecialServicesRequested.factory() + obj_.build(child_) + self.set_SpecialServicesRequested(obj_) + elif nodeName_ == 'ContentRecords': + obj_ = ContentRecord.factory() + obj_.build(child_) + self.ContentRecords.append(obj_) +# end class RequestedPackageLineItem + + +class RequestedShipment(GeneratedsSuper): + """The descriptive data for the shipment being tendered to FedEx.""" + subclass = None + superclass = None + def __init__(self, ShipTimestamp=None, DropoffType=None, ServiceType=None, PackagingType=None, TotalWeight=None, TotalInsuredValue=None, Shipper=None, Recipient=None, RecipientLocationNumber=None, Origin=None, ShippingChargesPayment=None, SpecialServicesRequested=None, ExpressFreightDetail=None, FreightShipmentDetail=None, DeliveryInstructions=None, VariableHandlingChargeDetail=None, CustomsClearanceDetail=None, PickupDetail=None, SmartPostDetail=None, BlockInsightVisibility=None, LabelSpecification=None, ShippingDocumentSpecification=None, RateRequestTypes=None, EdtRequestType=None, PackageCount=None, ShipmentOnlyFields=None, RequestedPackageLineItems=None): + self.ShipTimestamp = ShipTimestamp + self.DropoffType = DropoffType + self.ServiceType = ServiceType + self.PackagingType = PackagingType + self.TotalWeight = TotalWeight + self.TotalInsuredValue = TotalInsuredValue + self.Shipper = Shipper + self.Recipient = Recipient + self.RecipientLocationNumber = RecipientLocationNumber + self.Origin = Origin + self.ShippingChargesPayment = ShippingChargesPayment + self.SpecialServicesRequested = SpecialServicesRequested + self.ExpressFreightDetail = ExpressFreightDetail + self.FreightShipmentDetail = FreightShipmentDetail + self.DeliveryInstructions = DeliveryInstructions + self.VariableHandlingChargeDetail = VariableHandlingChargeDetail + self.CustomsClearanceDetail = CustomsClearanceDetail + self.PickupDetail = PickupDetail + self.SmartPostDetail = SmartPostDetail + self.BlockInsightVisibility = BlockInsightVisibility + self.LabelSpecification = LabelSpecification + self.ShippingDocumentSpecification = ShippingDocumentSpecification + if RateRequestTypes is None: + self.RateRequestTypes = [] + else: + self.RateRequestTypes = RateRequestTypes + self.EdtRequestType = EdtRequestType + self.PackageCount = PackageCount + if ShipmentOnlyFields is None: + self.ShipmentOnlyFields = [] + else: + self.ShipmentOnlyFields = ShipmentOnlyFields + if RequestedPackageLineItems is None: + self.RequestedPackageLineItems = [] + else: + self.RequestedPackageLineItems = RequestedPackageLineItems + def factory(*args_, **kwargs_): + if RequestedShipment.subclass: + return RequestedShipment.subclass(*args_, **kwargs_) + else: + return RequestedShipment(*args_, **kwargs_) + factory = staticmethod(factory) + def get_ShipTimestamp(self): return self.ShipTimestamp + def set_ShipTimestamp(self, ShipTimestamp): self.ShipTimestamp = ShipTimestamp + def get_DropoffType(self): return self.DropoffType + def set_DropoffType(self, DropoffType): self.DropoffType = DropoffType + def validate_DropoffType(self, value): + # Validate type DropoffType, a restriction on xs:string. + pass + def get_ServiceType(self): return self.ServiceType + def set_ServiceType(self, ServiceType): self.ServiceType = ServiceType + def validate_ServiceType(self, value): + # Validate type ServiceType, a restriction on xs:string. + pass + def get_PackagingType(self): return self.PackagingType + def set_PackagingType(self, PackagingType): self.PackagingType = PackagingType + def validate_PackagingType(self, value): + # Validate type PackagingType, a restriction on xs:string. + pass + def get_TotalWeight(self): return self.TotalWeight + def set_TotalWeight(self, TotalWeight): self.TotalWeight = TotalWeight + def get_TotalInsuredValue(self): return self.TotalInsuredValue + def set_TotalInsuredValue(self, TotalInsuredValue): self.TotalInsuredValue = TotalInsuredValue + def get_Shipper(self): return self.Shipper + def set_Shipper(self, Shipper): self.Shipper = Shipper + def get_Recipient(self): return self.Recipient + def set_Recipient(self, Recipient): self.Recipient = Recipient + def get_RecipientLocationNumber(self): return self.RecipientLocationNumber + def set_RecipientLocationNumber(self, RecipientLocationNumber): self.RecipientLocationNumber = RecipientLocationNumber + def get_Origin(self): return self.Origin + def set_Origin(self, Origin): self.Origin = Origin + def get_ShippingChargesPayment(self): return self.ShippingChargesPayment + def set_ShippingChargesPayment(self, ShippingChargesPayment): self.ShippingChargesPayment = ShippingChargesPayment + def get_SpecialServicesRequested(self): return self.SpecialServicesRequested + def set_SpecialServicesRequested(self, SpecialServicesRequested): self.SpecialServicesRequested = SpecialServicesRequested + def get_ExpressFreightDetail(self): return self.ExpressFreightDetail + def set_ExpressFreightDetail(self, ExpressFreightDetail): self.ExpressFreightDetail = ExpressFreightDetail + def get_FreightShipmentDetail(self): return self.FreightShipmentDetail + def set_FreightShipmentDetail(self, FreightShipmentDetail): self.FreightShipmentDetail = FreightShipmentDetail + def get_DeliveryInstructions(self): return self.DeliveryInstructions + def set_DeliveryInstructions(self, DeliveryInstructions): self.DeliveryInstructions = DeliveryInstructions + def get_VariableHandlingChargeDetail(self): return self.VariableHandlingChargeDetail + def set_VariableHandlingChargeDetail(self, VariableHandlingChargeDetail): self.VariableHandlingChargeDetail = VariableHandlingChargeDetail + def get_CustomsClearanceDetail(self): return self.CustomsClearanceDetail + def set_CustomsClearanceDetail(self, CustomsClearanceDetail): self.CustomsClearanceDetail = CustomsClearanceDetail + def get_PickupDetail(self): return self.PickupDetail + def set_PickupDetail(self, PickupDetail): self.PickupDetail = PickupDetail + def get_SmartPostDetail(self): return self.SmartPostDetail + def set_SmartPostDetail(self, SmartPostDetail): self.SmartPostDetail = SmartPostDetail + def get_BlockInsightVisibility(self): return self.BlockInsightVisibility + def set_BlockInsightVisibility(self, BlockInsightVisibility): self.BlockInsightVisibility = BlockInsightVisibility + def get_LabelSpecification(self): return self.LabelSpecification + def set_LabelSpecification(self, LabelSpecification): self.LabelSpecification = LabelSpecification + def get_ShippingDocumentSpecification(self): return self.ShippingDocumentSpecification + def set_ShippingDocumentSpecification(self, ShippingDocumentSpecification): self.ShippingDocumentSpecification = ShippingDocumentSpecification + def get_RateRequestTypes(self): return self.RateRequestTypes + def set_RateRequestTypes(self, RateRequestTypes): self.RateRequestTypes = RateRequestTypes + def add_RateRequestTypes(self, value): self.RateRequestTypes.append(value) + def insert_RateRequestTypes(self, index, value): self.RateRequestTypes[index] = value + def validate_RateRequestType(self, value): + # Validate type RateRequestType, a restriction on xs:string. + pass + def get_EdtRequestType(self): return self.EdtRequestType + def set_EdtRequestType(self, EdtRequestType): self.EdtRequestType = EdtRequestType + def validate_EdtRequestType(self, value): + # Validate type EdtRequestType, a restriction on xs:string. + pass + def get_PackageCount(self): return self.PackageCount + def set_PackageCount(self, PackageCount): self.PackageCount = PackageCount + def get_ShipmentOnlyFields(self): return self.ShipmentOnlyFields + def set_ShipmentOnlyFields(self, ShipmentOnlyFields): self.ShipmentOnlyFields = ShipmentOnlyFields + def add_ShipmentOnlyFields(self, value): self.ShipmentOnlyFields.append(value) + def insert_ShipmentOnlyFields(self, index, value): self.ShipmentOnlyFields[index] = value + def validate_ShipmentOnlyFieldsType(self, value): + # Validate type ShipmentOnlyFieldsType, a restriction on xs:string. + pass + def get_RequestedPackageLineItems(self): return self.RequestedPackageLineItems + def set_RequestedPackageLineItems(self, RequestedPackageLineItems): self.RequestedPackageLineItems = RequestedPackageLineItems + def add_RequestedPackageLineItems(self, value): self.RequestedPackageLineItems.append(value) + def insert_RequestedPackageLineItems(self, index, value): self.RequestedPackageLineItems[index] = value + def export(self, outfile, level, namespace_='ns:', name_='RequestedShipment', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='RequestedShipment') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='RequestedShipment'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='RequestedShipment', fromsubclass_=False): + if self.ShipTimestamp is not None: + showIndent(outfile, level) + outfile.write('<%sShipTimestamp>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ShipTimestamp).encode(ExternalEncoding), input_name='ShipTimestamp'), namespace_)) + if self.DropoffType is not None: + showIndent(outfile, level) + outfile.write('<%sDropoffType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DropoffType).encode(ExternalEncoding), input_name='DropoffType'), namespace_)) + if self.ServiceType is not None: + showIndent(outfile, level) + outfile.write('<%sServiceType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ServiceType).encode(ExternalEncoding), input_name='ServiceType'), namespace_)) + if self.PackagingType is not None: + showIndent(outfile, level) + outfile.write('<%sPackagingType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PackagingType).encode(ExternalEncoding), input_name='PackagingType'), namespace_)) + if self.TotalWeight: + self.TotalWeight.export(outfile, level, namespace_, name_='TotalWeight') + if self.TotalInsuredValue: + self.TotalInsuredValue.export(outfile, level, namespace_, name_='TotalInsuredValue') + if self.Shipper: + self.Shipper.export(outfile, level, namespace_, name_='Shipper', ) + if self.Recipient: + self.Recipient.export(outfile, level, namespace_, name_='Recipient', ) + if self.RecipientLocationNumber is not None: + showIndent(outfile, level) + outfile.write('<%sRecipientLocationNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RecipientLocationNumber).encode(ExternalEncoding), input_name='RecipientLocationNumber'), namespace_)) + if self.Origin: + self.Origin.export(outfile, level, namespace_, name_='Origin') + if self.ShippingChargesPayment: + self.ShippingChargesPayment.export(outfile, level, namespace_, name_='ShippingChargesPayment') + if self.SpecialServicesRequested: + self.SpecialServicesRequested.export(outfile, level, namespace_, name_='SpecialServicesRequested') + if self.ExpressFreightDetail: + self.ExpressFreightDetail.export(outfile, level, namespace_, name_='ExpressFreightDetail') + if self.FreightShipmentDetail: + self.FreightShipmentDetail.export(outfile, level, namespace_, name_='FreightShipmentDetail') + if self.DeliveryInstructions is not None: + showIndent(outfile, level) + outfile.write('<%sDeliveryInstructions>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DeliveryInstructions).encode(ExternalEncoding), input_name='DeliveryInstructions'), namespace_)) + if self.VariableHandlingChargeDetail: + self.VariableHandlingChargeDetail.export(outfile, level, namespace_, name_='VariableHandlingChargeDetail') + if self.CustomsClearanceDetail: + self.CustomsClearanceDetail.export(outfile, level, namespace_, name_='CustomsClearanceDetail') + if self.PickupDetail: + self.PickupDetail.export(outfile, level, namespace_, name_='PickupDetail') + if self.SmartPostDetail: + self.SmartPostDetail.export(outfile, level, namespace_, name_='SmartPostDetail') + if self.BlockInsightVisibility is not None: + showIndent(outfile, level) + outfile.write('<%sBlockInsightVisibility>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.BlockInsightVisibility)), input_name='BlockInsightVisibility'), namespace_)) + if self.LabelSpecification: + self.LabelSpecification.export(outfile, level, namespace_, name_='LabelSpecification') + if self.ShippingDocumentSpecification: + self.ShippingDocumentSpecification.export(outfile, level, namespace_, name_='ShippingDocumentSpecification') + for RateRequestTypes_ in self.RateRequestTypes: + showIndent(outfile, level) + outfile.write('<%sRateRequestTypes>%s\n' % (namespace_, self.gds_format_string(quote_xml(RateRequestTypes_).encode(ExternalEncoding), input_name='RateRequestTypes'), namespace_)) + if self.EdtRequestType is not None: + showIndent(outfile, level) + outfile.write('<%sEdtRequestType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.EdtRequestType).encode(ExternalEncoding), input_name='EdtRequestType'), namespace_)) + if self.PackageCount is not None: + showIndent(outfile, level) + outfile.write('<%sPackageCount>%s\n' % (namespace_, self.gds_format_integer(self.PackageCount, input_name='PackageCount'), namespace_)) + for ShipmentOnlyFields_ in self.ShipmentOnlyFields: + showIndent(outfile, level) + outfile.write('<%sShipmentOnlyFields>%s\n' % (namespace_, self.gds_format_string(quote_xml(ShipmentOnlyFields_).encode(ExternalEncoding), input_name='ShipmentOnlyFields'), namespace_)) + for RequestedPackageLineItems_ in self.RequestedPackageLineItems: + RequestedPackageLineItems_.export(outfile, level, namespace_, name_='RequestedPackageLineItems') + def hasContent_(self): + if ( + self.ShipTimestamp is not None or + self.DropoffType is not None or + self.ServiceType is not None or + self.PackagingType is not None or + self.TotalWeight is not None or + self.TotalInsuredValue is not None or + self.Shipper is not None or + self.Recipient is not None or + self.RecipientLocationNumber is not None or + self.Origin is not None or + self.ShippingChargesPayment is not None or + self.SpecialServicesRequested is not None or + self.ExpressFreightDetail is not None or + self.FreightShipmentDetail is not None or + self.DeliveryInstructions is not None or + self.VariableHandlingChargeDetail is not None or + self.CustomsClearanceDetail is not None or + self.PickupDetail is not None or + self.SmartPostDetail is not None or + self.BlockInsightVisibility is not None or + self.LabelSpecification is not None or + self.ShippingDocumentSpecification is not None or + self.RateRequestTypes or + self.EdtRequestType is not None or + self.PackageCount is not None or + self.ShipmentOnlyFields or + self.RequestedPackageLineItems + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='RequestedShipment'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.ShipTimestamp is not None: + showIndent(outfile, level) + outfile.write('ShipTimestamp=%s,\n' % quote_python(self.ShipTimestamp).encode(ExternalEncoding)) + if self.DropoffType is not None: + showIndent(outfile, level) + outfile.write('DropoffType=%s,\n' % quote_python(self.DropoffType).encode(ExternalEncoding)) + if self.ServiceType is not None: + showIndent(outfile, level) + outfile.write('ServiceType=%s,\n' % quote_python(self.ServiceType).encode(ExternalEncoding)) + if self.PackagingType is not None: + showIndent(outfile, level) + outfile.write('PackagingType=%s,\n' % quote_python(self.PackagingType).encode(ExternalEncoding)) + if self.TotalWeight is not None: + showIndent(outfile, level) + outfile.write('TotalWeight=model_.Weight(\n') + self.TotalWeight.exportLiteral(outfile, level, name_='TotalWeight') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalInsuredValue is not None: + showIndent(outfile, level) + outfile.write('TotalInsuredValue=model_.Money(\n') + self.TotalInsuredValue.exportLiteral(outfile, level, name_='TotalInsuredValue') + showIndent(outfile, level) + outfile.write('),\n') + if self.Shipper is not None: + showIndent(outfile, level) + outfile.write('Shipper=model_.Party(\n') + self.Shipper.exportLiteral(outfile, level, name_='Shipper') + showIndent(outfile, level) + outfile.write('),\n') + if self.Recipient is not None: + showIndent(outfile, level) + outfile.write('Recipient=model_.Party(\n') + self.Recipient.exportLiteral(outfile, level, name_='Recipient') + showIndent(outfile, level) + outfile.write('),\n') + if self.RecipientLocationNumber is not None: + showIndent(outfile, level) + outfile.write('RecipientLocationNumber=%s,\n' % quote_python(self.RecipientLocationNumber).encode(ExternalEncoding)) + if self.Origin is not None: + showIndent(outfile, level) + outfile.write('Origin=model_.ContactAndAddress(\n') + self.Origin.exportLiteral(outfile, level, name_='Origin') + showIndent(outfile, level) + outfile.write('),\n') + if self.ShippingChargesPayment is not None: + showIndent(outfile, level) + outfile.write('ShippingChargesPayment=model_.Payment(\n') + self.ShippingChargesPayment.exportLiteral(outfile, level, name_='ShippingChargesPayment') + showIndent(outfile, level) + outfile.write('),\n') + if self.SpecialServicesRequested is not None: + showIndent(outfile, level) + outfile.write('SpecialServicesRequested=model_.ShipmentSpecialServicesRequested(\n') + self.SpecialServicesRequested.exportLiteral(outfile, level, name_='SpecialServicesRequested') + showIndent(outfile, level) + outfile.write('),\n') + if self.ExpressFreightDetail is not None: + showIndent(outfile, level) + outfile.write('ExpressFreightDetail=model_.ExpressFreightDetail(\n') + self.ExpressFreightDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.FreightShipmentDetail is not None: + showIndent(outfile, level) + outfile.write('FreightShipmentDetail=model_.FreightShipmentDetail(\n') + self.FreightShipmentDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.DeliveryInstructions is not None: + showIndent(outfile, level) + outfile.write('DeliveryInstructions=%s,\n' % quote_python(self.DeliveryInstructions).encode(ExternalEncoding)) + if self.VariableHandlingChargeDetail is not None: + showIndent(outfile, level) + outfile.write('VariableHandlingChargeDetail=model_.VariableHandlingChargeDetail(\n') + self.VariableHandlingChargeDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.CustomsClearanceDetail is not None: + showIndent(outfile, level) + outfile.write('CustomsClearanceDetail=model_.CustomsClearanceDetail(\n') + self.CustomsClearanceDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.PickupDetail is not None: + showIndent(outfile, level) + outfile.write('PickupDetail=model_.PickupDetail(\n') + self.PickupDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.SmartPostDetail is not None: + showIndent(outfile, level) + outfile.write('SmartPostDetail=model_.SmartPostShipmentDetail(\n') + self.SmartPostDetail.exportLiteral(outfile, level, name_='SmartPostDetail') + showIndent(outfile, level) + outfile.write('),\n') + if self.BlockInsightVisibility is not None: + showIndent(outfile, level) + outfile.write('BlockInsightVisibility=%s,\n' % self.BlockInsightVisibility) + if self.LabelSpecification is not None: + showIndent(outfile, level) + outfile.write('LabelSpecification=model_.LabelSpecification(\n') + self.LabelSpecification.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ShippingDocumentSpecification is not None: + showIndent(outfile, level) + outfile.write('ShippingDocumentSpecification=model_.ShippingDocumentSpecification(\n') + self.ShippingDocumentSpecification.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('RateRequestTypes=[\n') + level += 1 + for RateRequestTypes_ in self.RateRequestTypes: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(RateRequestTypes_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.EdtRequestType is not None: + showIndent(outfile, level) + outfile.write('EdtRequestType=%s,\n' % quote_python(self.EdtRequestType).encode(ExternalEncoding)) + if self.PackageCount is not None: + showIndent(outfile, level) + outfile.write('PackageCount=%d,\n' % self.PackageCount) + showIndent(outfile, level) + outfile.write('ShipmentOnlyFields=[\n') + level += 1 + for ShipmentOnlyFields_ in self.ShipmentOnlyFields: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(ShipmentOnlyFields_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('RequestedPackageLineItems=[\n') + level += 1 + for RequestedPackageLineItems_ in self.RequestedPackageLineItems: + showIndent(outfile, level) + outfile.write('model_.RequestedPackageLineItem(\n') + RequestedPackageLineItems_.exportLiteral(outfile, level, name_='RequestedPackageLineItem') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'ShipTimestamp': + ShipTimestamp_ = child_.text + ShipTimestamp_ = self.gds_validate_string(ShipTimestamp_, node, 'ShipTimestamp') + self.ShipTimestamp = ShipTimestamp_ + elif nodeName_ == 'DropoffType': + DropoffType_ = child_.text + DropoffType_ = self.gds_validate_string(DropoffType_, node, 'DropoffType') + self.DropoffType = DropoffType_ + self.validate_DropoffType(self.DropoffType) # validate type DropoffType + elif nodeName_ == 'ServiceType': + ServiceType_ = child_.text + ServiceType_ = self.gds_validate_string(ServiceType_, node, 'ServiceType') + self.ServiceType = ServiceType_ + self.validate_ServiceType(self.ServiceType) # validate type ServiceType + elif nodeName_ == 'PackagingType': + PackagingType_ = child_.text + PackagingType_ = self.gds_validate_string(PackagingType_, node, 'PackagingType') + self.PackagingType = PackagingType_ + self.validate_PackagingType(self.PackagingType) # validate type PackagingType + elif nodeName_ == 'TotalWeight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_TotalWeight(obj_) + elif nodeName_ == 'TotalInsuredValue': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalInsuredValue(obj_) + elif nodeName_ == 'Shipper': + obj_ = Party.factory() + obj_.build(child_) + self.set_Shipper(obj_) + elif nodeName_ == 'Recipient': + obj_ = Party.factory() + obj_.build(child_) + self.set_Recipient(obj_) + elif nodeName_ == 'RecipientLocationNumber': + RecipientLocationNumber_ = child_.text + RecipientLocationNumber_ = self.gds_validate_string(RecipientLocationNumber_, node, 'RecipientLocationNumber') + self.RecipientLocationNumber = RecipientLocationNumber_ + elif nodeName_ == 'Origin': + obj_ = ContactAndAddress.factory() + obj_.build(child_) + self.set_Origin(obj_) + elif nodeName_ == 'ShippingChargesPayment': + obj_ = Payment.factory() + obj_.build(child_) + self.set_ShippingChargesPayment(obj_) + elif nodeName_ == 'SpecialServicesRequested': + obj_ = ShipmentSpecialServicesRequested.factory() + obj_.build(child_) + self.set_SpecialServicesRequested(obj_) + elif nodeName_ == 'ExpressFreightDetail': + obj_ = ExpressFreightDetail.factory() + obj_.build(child_) + self.set_ExpressFreightDetail(obj_) + elif nodeName_ == 'FreightShipmentDetail': + obj_ = FreightShipmentDetail.factory() + obj_.build(child_) + self.set_FreightShipmentDetail(obj_) + elif nodeName_ == 'DeliveryInstructions': + DeliveryInstructions_ = child_.text + DeliveryInstructions_ = self.gds_validate_string(DeliveryInstructions_, node, 'DeliveryInstructions') + self.DeliveryInstructions = DeliveryInstructions_ + elif nodeName_ == 'VariableHandlingChargeDetail': + obj_ = VariableHandlingChargeDetail.factory() + obj_.build(child_) + self.set_VariableHandlingChargeDetail(obj_) + elif nodeName_ == 'CustomsClearanceDetail': + obj_ = CustomsClearanceDetail.factory() + obj_.build(child_) + self.set_CustomsClearanceDetail(obj_) + elif nodeName_ == 'PickupDetail': + obj_ = PickupDetail.factory() + obj_.build(child_) + self.set_PickupDetail(obj_) + elif nodeName_ == 'SmartPostDetail': + obj_ = SmartPostShipmentDetail.factory() + obj_.build(child_) + self.set_SmartPostDetail(obj_) + elif nodeName_ == 'BlockInsightVisibility': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'BlockInsightVisibility') + self.BlockInsightVisibility = ival_ + elif nodeName_ == 'LabelSpecification': + obj_ = LabelSpecification.factory() + obj_.build(child_) + self.set_LabelSpecification(obj_) + elif nodeName_ == 'ShippingDocumentSpecification': + obj_ = ShippingDocumentSpecification.factory() + obj_.build(child_) + self.set_ShippingDocumentSpecification(obj_) + elif nodeName_ == 'RateRequestTypes': + RateRequestTypes_ = child_.text + RateRequestTypes_ = self.gds_validate_string(RateRequestTypes_, node, 'RateRequestTypes') + self.RateRequestTypes.append(RateRequestTypes_) + self.validate_RateRequestType(self.RateRequestTypes) # validate type RateRequestType + elif nodeName_ == 'EdtRequestType': + EdtRequestType_ = child_.text + EdtRequestType_ = self.gds_validate_string(EdtRequestType_, node, 'EdtRequestType') + self.EdtRequestType = EdtRequestType_ + self.validate_EdtRequestType(self.EdtRequestType) # validate type EdtRequestType + elif nodeName_ == 'PackageCount': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'PackageCount') + self.PackageCount = ival_ + elif nodeName_ == 'ShipmentOnlyFields': + ShipmentOnlyFields_ = child_.text + ShipmentOnlyFields_ = self.gds_validate_string(ShipmentOnlyFields_, node, 'ShipmentOnlyFields') + self.ShipmentOnlyFields.append(ShipmentOnlyFields_) + self.validate_ShipmentOnlyFieldsType(self.ShipmentOnlyFields) # validate type ShipmentOnlyFieldsType + elif nodeName_ == 'RequestedPackageLineItems': + obj_ = RequestedPackageLineItem.factory() + obj_.build(child_) + self.RequestedPackageLineItems.append(obj_) +# end class RequestedShipment + + +class ReturnEMailDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, MerchantPhoneNumber=None, AllowedSpecialServices=None): + self.MerchantPhoneNumber = MerchantPhoneNumber + if AllowedSpecialServices is None: + self.AllowedSpecialServices = [] + else: + self.AllowedSpecialServices = AllowedSpecialServices + def factory(*args_, **kwargs_): + if ReturnEMailDetail.subclass: + return ReturnEMailDetail.subclass(*args_, **kwargs_) + else: + return ReturnEMailDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_MerchantPhoneNumber(self): return self.MerchantPhoneNumber + def set_MerchantPhoneNumber(self, MerchantPhoneNumber): self.MerchantPhoneNumber = MerchantPhoneNumber + def get_AllowedSpecialServices(self): return self.AllowedSpecialServices + def set_AllowedSpecialServices(self, AllowedSpecialServices): self.AllowedSpecialServices = AllowedSpecialServices + def add_AllowedSpecialServices(self, value): self.AllowedSpecialServices.append(value) + def insert_AllowedSpecialServices(self, index, value): self.AllowedSpecialServices[index] = value + def validate_ReturnEMailAllowedSpecialServiceType(self, value): + # Validate type ReturnEMailAllowedSpecialServiceType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='ReturnEMailDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ReturnEMailDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ReturnEMailDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ReturnEMailDetail', fromsubclass_=False): + if self.MerchantPhoneNumber is not None: + showIndent(outfile, level) + outfile.write('<%sMerchantPhoneNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.MerchantPhoneNumber).encode(ExternalEncoding), input_name='MerchantPhoneNumber'), namespace_)) + for AllowedSpecialServices_ in self.AllowedSpecialServices: + showIndent(outfile, level) + outfile.write('<%sAllowedSpecialServices>%s\n' % (namespace_, self.gds_format_string(quote_xml(AllowedSpecialServices_).encode(ExternalEncoding), input_name='AllowedSpecialServices'), namespace_)) + def hasContent_(self): + if ( + self.MerchantPhoneNumber is not None or + self.AllowedSpecialServices + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ReturnEMailDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.MerchantPhoneNumber is not None: + showIndent(outfile, level) + outfile.write('MerchantPhoneNumber=%s,\n' % quote_python(self.MerchantPhoneNumber).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('AllowedSpecialServices=[\n') + level += 1 + for AllowedSpecialServices_ in self.AllowedSpecialServices: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(AllowedSpecialServices_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'MerchantPhoneNumber': + MerchantPhoneNumber_ = child_.text + MerchantPhoneNumber_ = self.gds_validate_string(MerchantPhoneNumber_, node, 'MerchantPhoneNumber') + self.MerchantPhoneNumber = MerchantPhoneNumber_ + elif nodeName_ == 'AllowedSpecialServices': + AllowedSpecialServices_ = child_.text + AllowedSpecialServices_ = self.gds_validate_string(AllowedSpecialServices_, node, 'AllowedSpecialServices') + self.AllowedSpecialServices.append(AllowedSpecialServices_) + self.validate_ReturnEMailAllowedSpecialServiceType(self.AllowedSpecialServices) # validate type ReturnEMailAllowedSpecialServiceType +# end class ReturnEMailDetail + + +class ReturnShipmentDetail(GeneratedsSuper): + """Information relating to a return shipment.""" + subclass = None + superclass = None + def __init__(self, ReturnType=None, Rma=None, ReturnEMailDetail=None): + self.ReturnType = ReturnType + self.Rma = Rma + self.ReturnEMailDetail = ReturnEMailDetail + def factory(*args_, **kwargs_): + if ReturnShipmentDetail.subclass: + return ReturnShipmentDetail.subclass(*args_, **kwargs_) + else: + return ReturnShipmentDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_ReturnType(self): return self.ReturnType + def set_ReturnType(self, ReturnType): self.ReturnType = ReturnType + def validate_ReturnType(self, value): + # Validate type ReturnType, a restriction on xs:string. + pass + def get_Rma(self): return self.Rma + def set_Rma(self, Rma): self.Rma = Rma + def get_ReturnEMailDetail(self): return self.ReturnEMailDetail + def set_ReturnEMailDetail(self, ReturnEMailDetail): self.ReturnEMailDetail = ReturnEMailDetail + def export(self, outfile, level, namespace_='ns:', name_='ReturnShipmentDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ReturnShipmentDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ReturnShipmentDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ReturnShipmentDetail', fromsubclass_=False): + if self.ReturnType is not None: + showIndent(outfile, level) + outfile.write('<%sReturnType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ReturnType).encode(ExternalEncoding), input_name='ReturnType'), namespace_)) + if self.Rma: + self.Rma.export(outfile, level, namespace_, name_='Rma') + if self.ReturnEMailDetail: + self.ReturnEMailDetail.export(outfile, level, namespace_, name_='ReturnEMailDetail') + def hasContent_(self): + if ( + self.ReturnType is not None or + self.Rma is not None or + self.ReturnEMailDetail is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ReturnShipmentDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.ReturnType is not None: + showIndent(outfile, level) + outfile.write('ReturnType=%s,\n' % quote_python(self.ReturnType).encode(ExternalEncoding)) + if self.Rma is not None: + showIndent(outfile, level) + outfile.write('Rma=model_.Rma(\n') + self.Rma.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ReturnEMailDetail is not None: + showIndent(outfile, level) + outfile.write('ReturnEMailDetail=model_.ReturnEMailDetail(\n') + self.ReturnEMailDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'ReturnType': + ReturnType_ = child_.text + ReturnType_ = self.gds_validate_string(ReturnType_, node, 'ReturnType') + self.ReturnType = ReturnType_ + self.validate_ReturnType(self.ReturnType) # validate type ReturnType + elif nodeName_ == 'Rma': + obj_ = Rma.factory() + obj_.build(child_) + self.set_Rma(obj_) + elif nodeName_ == 'ReturnEMailDetail': + obj_ = ReturnEMailDetail.factory() + obj_.build(child_) + self.set_ReturnEMailDetail(obj_) +# end class ReturnShipmentDetail + + +class Rma(GeneratedsSuper): + """Return Merchant Authorization""" + subclass = None + superclass = None + def __init__(self, Number=None, Reason=None): + self.Number = Number + self.Reason = Reason + def factory(*args_, **kwargs_): + if Rma.subclass: + return Rma.subclass(*args_, **kwargs_) + else: + return Rma(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Number(self): return self.Number + def set_Number(self, Number): self.Number = Number + def get_Reason(self): return self.Reason + def set_Reason(self, Reason): self.Reason = Reason + def export(self, outfile, level, namespace_='ns:', name_='Rma', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Rma') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Rma'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Rma', fromsubclass_=False): + if self.Number is not None: + showIndent(outfile, level) + outfile.write('<%sNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Number).encode(ExternalEncoding), input_name='Number'), namespace_)) + if self.Reason is not None: + showIndent(outfile, level) + outfile.write('<%sReason>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Reason).encode(ExternalEncoding), input_name='Reason'), namespace_)) + def hasContent_(self): + if ( + self.Number is not None or + self.Reason is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Rma'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Number is not None: + showIndent(outfile, level) + outfile.write('Number=%s,\n' % quote_python(self.Number).encode(ExternalEncoding)) + if self.Reason is not None: + showIndent(outfile, level) + outfile.write('Reason=%s,\n' % quote_python(self.Reason).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Number': + Number_ = child_.text + Number_ = self.gds_validate_string(Number_, node, 'Number') + self.Number = Number_ + elif nodeName_ == 'Reason': + Reason_ = child_.text + Reason_ = self.gds_validate_string(Reason_, node, 'Reason') + self.Reason = Reason_ +# end class Rma + + +class ServiceSubOptionDetail(GeneratedsSuper): + """Supporting detail for applied options identified in a rate quote.""" + subclass = None + superclass = None + def __init__(self, FreightGuarantee=None, SmartPostHubId=None, SmartPostIndicia=None): + self.FreightGuarantee = FreightGuarantee + self.SmartPostHubId = SmartPostHubId + self.SmartPostIndicia = SmartPostIndicia + def factory(*args_, **kwargs_): + if ServiceSubOptionDetail.subclass: + return ServiceSubOptionDetail.subclass(*args_, **kwargs_) + else: + return ServiceSubOptionDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_FreightGuarantee(self): return self.FreightGuarantee + def set_FreightGuarantee(self, FreightGuarantee): self.FreightGuarantee = FreightGuarantee + def validate_FreightGuaranteeType(self, value): + # Validate type FreightGuaranteeType, a restriction on xs:string. + pass + def get_SmartPostHubId(self): return self.SmartPostHubId + def set_SmartPostHubId(self, SmartPostHubId): self.SmartPostHubId = SmartPostHubId + def get_SmartPostIndicia(self): return self.SmartPostIndicia + def set_SmartPostIndicia(self, SmartPostIndicia): self.SmartPostIndicia = SmartPostIndicia + def validate_SmartPostIndiciaType(self, value): + # Validate type SmartPostIndiciaType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='ServiceSubOptionDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ServiceSubOptionDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ServiceSubOptionDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ServiceSubOptionDetail', fromsubclass_=False): + if self.FreightGuarantee is not None: + showIndent(outfile, level) + outfile.write('<%sFreightGuarantee>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.FreightGuarantee).encode(ExternalEncoding), input_name='FreightGuarantee'), namespace_)) + if self.SmartPostHubId is not None: + showIndent(outfile, level) + outfile.write('<%sSmartPostHubId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.SmartPostHubId).encode(ExternalEncoding), input_name='SmartPostHubId'), namespace_)) + if self.SmartPostIndicia is not None: + showIndent(outfile, level) + outfile.write('<%sSmartPostIndicia>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.SmartPostIndicia).encode(ExternalEncoding), input_name='SmartPostIndicia'), namespace_)) + def hasContent_(self): + if ( + self.FreightGuarantee is not None or + self.SmartPostHubId is not None or + self.SmartPostIndicia is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ServiceSubOptionDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.FreightGuarantee is not None: + showIndent(outfile, level) + outfile.write('FreightGuarantee=%s,\n' % quote_python(self.FreightGuarantee).encode(ExternalEncoding)) + if self.SmartPostHubId is not None: + showIndent(outfile, level) + outfile.write('SmartPostHubId=%s,\n' % quote_python(self.SmartPostHubId).encode(ExternalEncoding)) + if self.SmartPostIndicia is not None: + showIndent(outfile, level) + outfile.write('SmartPostIndicia=%s,\n' % quote_python(self.SmartPostIndicia).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'FreightGuarantee': + FreightGuarantee_ = child_.text + FreightGuarantee_ = self.gds_validate_string(FreightGuarantee_, node, 'FreightGuarantee') + self.FreightGuarantee = FreightGuarantee_ + self.validate_FreightGuaranteeType(self.FreightGuarantee) # validate type FreightGuaranteeType + elif nodeName_ == 'SmartPostHubId': + SmartPostHubId_ = child_.text + SmartPostHubId_ = self.gds_validate_string(SmartPostHubId_, node, 'SmartPostHubId') + self.SmartPostHubId = SmartPostHubId_ + elif nodeName_ == 'SmartPostIndicia': + SmartPostIndicia_ = child_.text + SmartPostIndicia_ = self.gds_validate_string(SmartPostIndicia_, node, 'SmartPostIndicia') + self.SmartPostIndicia = SmartPostIndicia_ + self.validate_SmartPostIndiciaType(self.SmartPostIndicia) # validate type SmartPostIndiciaType +# end class ServiceSubOptionDetail + + +class ShipmentDryIceDetail(GeneratedsSuper): + """Shipment-level totals of dry ice data across all packages.""" + subclass = None + superclass = None + def __init__(self, PackageCount=None, TotalWeight=None): + self.PackageCount = PackageCount + self.TotalWeight = TotalWeight + def factory(*args_, **kwargs_): + if ShipmentDryIceDetail.subclass: + return ShipmentDryIceDetail.subclass(*args_, **kwargs_) + else: + return ShipmentDryIceDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_PackageCount(self): return self.PackageCount + def set_PackageCount(self, PackageCount): self.PackageCount = PackageCount + def get_TotalWeight(self): return self.TotalWeight + def set_TotalWeight(self, TotalWeight): self.TotalWeight = TotalWeight + def export(self, outfile, level, namespace_='ns:', name_='ShipmentDryIceDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ShipmentDryIceDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ShipmentDryIceDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ShipmentDryIceDetail', fromsubclass_=False): + if self.PackageCount is not None: + showIndent(outfile, level) + outfile.write('<%sPackageCount>%s\n' % (namespace_, self.gds_format_integer(self.PackageCount, input_name='PackageCount'), namespace_)) + if self.TotalWeight: + self.TotalWeight.export(outfile, level, namespace_, name_='TotalWeight') + def hasContent_(self): + if ( + self.PackageCount is not None or + self.TotalWeight is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ShipmentDryIceDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.PackageCount is not None: + showIndent(outfile, level) + outfile.write('PackageCount=%d,\n' % self.PackageCount) + if self.TotalWeight is not None: + showIndent(outfile, level) + outfile.write('TotalWeight=model_.Weight(\n') + self.TotalWeight.exportLiteral(outfile, level, name_='TotalWeight') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'PackageCount': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'PackageCount') + self.PackageCount = ival_ + elif nodeName_ == 'TotalWeight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_TotalWeight(obj_) +# end class ShipmentDryIceDetail + + +class ShipmentLegRateDetail(GeneratedsSuper): + """Data for a single leg of a shipment's total/summary rates, as + calculated per a specific rate type.""" + subclass = None + superclass = None + def __init__(self, LegDescription=None, LegOrigin=None, LegDestination=None, RateType=None, RateScale=None, RateZone=None, PricingCode=None, RatedWeightMethod=None, MinimumChargeType=None, CurrencyExchangeRate=None, SpecialRatingApplied=None, DimDivisor=None, DimDivisorType=None, FuelSurchargePercent=None, TotalBillingWeight=None, TotalDimWeight=None, TotalBaseCharge=None, TotalFreightDiscounts=None, TotalNetFreight=None, TotalSurcharges=None, TotalNetFedExCharge=None, TotalTaxes=None, TotalNetCharge=None, TotalRebates=None, TotalDutiesAndTaxes=None, TotalNetChargeWithDutiesAndTaxes=None, FreightRateDetail=None, FreightDiscounts=None, Rebates=None, Surcharges=None, Taxes=None, DutiesAndTaxes=None, VariableHandlingCharges=None, TotalVariableHandlingCharges=None): + self.LegDescription = LegDescription + self.LegOrigin = LegOrigin + self.LegDestination = LegDestination + self.RateType = RateType + self.RateScale = RateScale + self.RateZone = RateZone + self.PricingCode = PricingCode + self.RatedWeightMethod = RatedWeightMethod + self.MinimumChargeType = MinimumChargeType + self.CurrencyExchangeRate = CurrencyExchangeRate + if SpecialRatingApplied is None: + self.SpecialRatingApplied = [] + else: + self.SpecialRatingApplied = SpecialRatingApplied + self.DimDivisor = DimDivisor + self.DimDivisorType = DimDivisorType + self.FuelSurchargePercent = FuelSurchargePercent + self.TotalBillingWeight = TotalBillingWeight + self.TotalDimWeight = TotalDimWeight + self.TotalBaseCharge = TotalBaseCharge + self.TotalFreightDiscounts = TotalFreightDiscounts + self.TotalNetFreight = TotalNetFreight + self.TotalSurcharges = TotalSurcharges + self.TotalNetFedExCharge = TotalNetFedExCharge + self.TotalTaxes = TotalTaxes + self.TotalNetCharge = TotalNetCharge + self.TotalRebates = TotalRebates + self.TotalDutiesAndTaxes = TotalDutiesAndTaxes + self.TotalNetChargeWithDutiesAndTaxes = TotalNetChargeWithDutiesAndTaxes + self.FreightRateDetail = FreightRateDetail + if FreightDiscounts is None: + self.FreightDiscounts = [] + else: + self.FreightDiscounts = FreightDiscounts + if Rebates is None: + self.Rebates = [] + else: + self.Rebates = Rebates + if Surcharges is None: + self.Surcharges = [] + else: + self.Surcharges = Surcharges + if Taxes is None: + self.Taxes = [] + else: + self.Taxes = Taxes + if DutiesAndTaxes is None: + self.DutiesAndTaxes = [] + else: + self.DutiesAndTaxes = DutiesAndTaxes + self.VariableHandlingCharges = VariableHandlingCharges + self.TotalVariableHandlingCharges = TotalVariableHandlingCharges + def factory(*args_, **kwargs_): + if ShipmentLegRateDetail.subclass: + return ShipmentLegRateDetail.subclass(*args_, **kwargs_) + else: + return ShipmentLegRateDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_LegDescription(self): return self.LegDescription + def set_LegDescription(self, LegDescription): self.LegDescription = LegDescription + def get_LegOrigin(self): return self.LegOrigin + def set_LegOrigin(self, LegOrigin): self.LegOrigin = LegOrigin + def get_LegDestination(self): return self.LegDestination + def set_LegDestination(self, LegDestination): self.LegDestination = LegDestination + def get_RateType(self): return self.RateType + def set_RateType(self, RateType): self.RateType = RateType + def validate_ReturnedRateType(self, value): + # Validate type ReturnedRateType, a restriction on xs:string. + pass + def get_RateScale(self): return self.RateScale + def set_RateScale(self, RateScale): self.RateScale = RateScale + def get_RateZone(self): return self.RateZone + def set_RateZone(self, RateZone): self.RateZone = RateZone + def get_PricingCode(self): return self.PricingCode + def set_PricingCode(self, PricingCode): self.PricingCode = PricingCode + def validate_PricingCodeType(self, value): + # Validate type PricingCodeType, a restriction on xs:string. + pass + def get_RatedWeightMethod(self): return self.RatedWeightMethod + def set_RatedWeightMethod(self, RatedWeightMethod): self.RatedWeightMethod = RatedWeightMethod + def validate_RatedWeightMethod(self, value): + # Validate type RatedWeightMethod, a restriction on xs:string. + pass + def get_MinimumChargeType(self): return self.MinimumChargeType + def set_MinimumChargeType(self, MinimumChargeType): self.MinimumChargeType = MinimumChargeType + def validate_MinimumChargeType(self, value): + # Validate type MinimumChargeType, a restriction on xs:string. + pass + def get_CurrencyExchangeRate(self): return self.CurrencyExchangeRate + def set_CurrencyExchangeRate(self, CurrencyExchangeRate): self.CurrencyExchangeRate = CurrencyExchangeRate + def get_SpecialRatingApplied(self): return self.SpecialRatingApplied + def set_SpecialRatingApplied(self, SpecialRatingApplied): self.SpecialRatingApplied = SpecialRatingApplied + def add_SpecialRatingApplied(self, value): self.SpecialRatingApplied.append(value) + def insert_SpecialRatingApplied(self, index, value): self.SpecialRatingApplied[index] = value + def validate_SpecialRatingAppliedType(self, value): + # Validate type SpecialRatingAppliedType, a restriction on xs:string. + pass + def get_DimDivisor(self): return self.DimDivisor + def set_DimDivisor(self, DimDivisor): self.DimDivisor = DimDivisor + def get_DimDivisorType(self): return self.DimDivisorType + def set_DimDivisorType(self, DimDivisorType): self.DimDivisorType = DimDivisorType + def validate_RateDimensionalDivisorType(self, value): + # Validate type RateDimensionalDivisorType, a restriction on xs:string. + pass + def get_FuelSurchargePercent(self): return self.FuelSurchargePercent + def set_FuelSurchargePercent(self, FuelSurchargePercent): self.FuelSurchargePercent = FuelSurchargePercent + def get_TotalBillingWeight(self): return self.TotalBillingWeight + def set_TotalBillingWeight(self, TotalBillingWeight): self.TotalBillingWeight = TotalBillingWeight + def get_TotalDimWeight(self): return self.TotalDimWeight + def set_TotalDimWeight(self, TotalDimWeight): self.TotalDimWeight = TotalDimWeight + def get_TotalBaseCharge(self): return self.TotalBaseCharge + def set_TotalBaseCharge(self, TotalBaseCharge): self.TotalBaseCharge = TotalBaseCharge + def get_TotalFreightDiscounts(self): return self.TotalFreightDiscounts + def set_TotalFreightDiscounts(self, TotalFreightDiscounts): self.TotalFreightDiscounts = TotalFreightDiscounts + def get_TotalNetFreight(self): return self.TotalNetFreight + def set_TotalNetFreight(self, TotalNetFreight): self.TotalNetFreight = TotalNetFreight + def get_TotalSurcharges(self): return self.TotalSurcharges + def set_TotalSurcharges(self, TotalSurcharges): self.TotalSurcharges = TotalSurcharges + def get_TotalNetFedExCharge(self): return self.TotalNetFedExCharge + def set_TotalNetFedExCharge(self, TotalNetFedExCharge): self.TotalNetFedExCharge = TotalNetFedExCharge + def get_TotalTaxes(self): return self.TotalTaxes + def set_TotalTaxes(self, TotalTaxes): self.TotalTaxes = TotalTaxes + def get_TotalNetCharge(self): return self.TotalNetCharge + def set_TotalNetCharge(self, TotalNetCharge): self.TotalNetCharge = TotalNetCharge + def get_TotalRebates(self): return self.TotalRebates + def set_TotalRebates(self, TotalRebates): self.TotalRebates = TotalRebates + def get_TotalDutiesAndTaxes(self): return self.TotalDutiesAndTaxes + def set_TotalDutiesAndTaxes(self, TotalDutiesAndTaxes): self.TotalDutiesAndTaxes = TotalDutiesAndTaxes + def get_TotalNetChargeWithDutiesAndTaxes(self): return self.TotalNetChargeWithDutiesAndTaxes + def set_TotalNetChargeWithDutiesAndTaxes(self, TotalNetChargeWithDutiesAndTaxes): self.TotalNetChargeWithDutiesAndTaxes = TotalNetChargeWithDutiesAndTaxes + def get_FreightRateDetail(self): return self.FreightRateDetail + def set_FreightRateDetail(self, FreightRateDetail): self.FreightRateDetail = FreightRateDetail + def get_FreightDiscounts(self): return self.FreightDiscounts + def set_FreightDiscounts(self, FreightDiscounts): self.FreightDiscounts = FreightDiscounts + def add_FreightDiscounts(self, value): self.FreightDiscounts.append(value) + def insert_FreightDiscounts(self, index, value): self.FreightDiscounts[index] = value + def get_Rebates(self): return self.Rebates + def set_Rebates(self, Rebates): self.Rebates = Rebates + def add_Rebates(self, value): self.Rebates.append(value) + def insert_Rebates(self, index, value): self.Rebates[index] = value + def get_Surcharges(self): return self.Surcharges + def set_Surcharges(self, Surcharges): self.Surcharges = Surcharges + def add_Surcharges(self, value): self.Surcharges.append(value) + def insert_Surcharges(self, index, value): self.Surcharges[index] = value + def get_Taxes(self): return self.Taxes + def set_Taxes(self, Taxes): self.Taxes = Taxes + def add_Taxes(self, value): self.Taxes.append(value) + def insert_Taxes(self, index, value): self.Taxes[index] = value + def get_DutiesAndTaxes(self): return self.DutiesAndTaxes + def set_DutiesAndTaxes(self, DutiesAndTaxes): self.DutiesAndTaxes = DutiesAndTaxes + def add_DutiesAndTaxes(self, value): self.DutiesAndTaxes.append(value) + def insert_DutiesAndTaxes(self, index, value): self.DutiesAndTaxes[index] = value + def get_VariableHandlingCharges(self): return self.VariableHandlingCharges + def set_VariableHandlingCharges(self, VariableHandlingCharges): self.VariableHandlingCharges = VariableHandlingCharges + def get_TotalVariableHandlingCharges(self): return self.TotalVariableHandlingCharges + def set_TotalVariableHandlingCharges(self, TotalVariableHandlingCharges): self.TotalVariableHandlingCharges = TotalVariableHandlingCharges + def export(self, outfile, level, namespace_='ns:', name_='ShipmentLegRateDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ShipmentLegRateDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ShipmentLegRateDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ShipmentLegRateDetail', fromsubclass_=False): + if self.LegDescription is not None: + showIndent(outfile, level) + outfile.write('<%sLegDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LegDescription).encode(ExternalEncoding), input_name='LegDescription'), namespace_)) + if self.LegOrigin: + self.LegOrigin.export(outfile, level, namespace_, name_='LegOrigin') + if self.LegDestination: + self.LegDestination.export(outfile, level, namespace_, name_='LegDestination') + if self.RateType is not None: + showIndent(outfile, level) + outfile.write('<%sRateType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RateType).encode(ExternalEncoding), input_name='RateType'), namespace_)) + if self.RateScale is not None: + showIndent(outfile, level) + outfile.write('<%sRateScale>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RateScale).encode(ExternalEncoding), input_name='RateScale'), namespace_)) + if self.RateZone is not None: + showIndent(outfile, level) + outfile.write('<%sRateZone>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RateZone).encode(ExternalEncoding), input_name='RateZone'), namespace_)) + if self.PricingCode is not None: + showIndent(outfile, level) + outfile.write('<%sPricingCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PricingCode).encode(ExternalEncoding), input_name='PricingCode'), namespace_)) + if self.RatedWeightMethod is not None: + showIndent(outfile, level) + outfile.write('<%sRatedWeightMethod>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RatedWeightMethod).encode(ExternalEncoding), input_name='RatedWeightMethod'), namespace_)) + if self.MinimumChargeType is not None: + showIndent(outfile, level) + outfile.write('<%sMinimumChargeType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.MinimumChargeType).encode(ExternalEncoding), input_name='MinimumChargeType'), namespace_)) + if self.CurrencyExchangeRate: + self.CurrencyExchangeRate.export(outfile, level, namespace_, name_='CurrencyExchangeRate') + for SpecialRatingApplied_ in self.SpecialRatingApplied: + showIndent(outfile, level) + outfile.write('<%sSpecialRatingApplied>%s\n' % (namespace_, self.gds_format_string(quote_xml(SpecialRatingApplied_).encode(ExternalEncoding), input_name='SpecialRatingApplied'), namespace_)) + if self.DimDivisor is not None: + showIndent(outfile, level) + outfile.write('<%sDimDivisor>%s\n' % (namespace_, self.gds_format_integer(self.DimDivisor, input_name='DimDivisor'), namespace_)) + if self.DimDivisorType is not None: + showIndent(outfile, level) + outfile.write('<%sDimDivisorType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DimDivisorType).encode(ExternalEncoding), input_name='DimDivisorType'), namespace_)) + if self.FuelSurchargePercent is not None: + showIndent(outfile, level) + outfile.write('<%sFuelSurchargePercent>%s\n' % (namespace_, self.gds_format_float(self.FuelSurchargePercent, input_name='FuelSurchargePercent'), namespace_)) + if self.TotalBillingWeight: + self.TotalBillingWeight.export(outfile, level, namespace_, name_='TotalBillingWeight') + if self.TotalDimWeight: + self.TotalDimWeight.export(outfile, level, namespace_, name_='TotalDimWeight') + if self.TotalBaseCharge: + self.TotalBaseCharge.export(outfile, level, namespace_, name_='TotalBaseCharge') + if self.TotalFreightDiscounts: + self.TotalFreightDiscounts.export(outfile, level, namespace_, name_='TotalFreightDiscounts') + if self.TotalNetFreight: + self.TotalNetFreight.export(outfile, level, namespace_, name_='TotalNetFreight') + if self.TotalSurcharges: + self.TotalSurcharges.export(outfile, level, namespace_, name_='TotalSurcharges') + if self.TotalNetFedExCharge: + self.TotalNetFedExCharge.export(outfile, level, namespace_, name_='TotalNetFedExCharge') + if self.TotalTaxes: + self.TotalTaxes.export(outfile, level, namespace_, name_='TotalTaxes') + if self.TotalNetCharge: + self.TotalNetCharge.export(outfile, level, namespace_, name_='TotalNetCharge') + if self.TotalRebates: + self.TotalRebates.export(outfile, level, namespace_, name_='TotalRebates') + if self.TotalDutiesAndTaxes: + self.TotalDutiesAndTaxes.export(outfile, level, namespace_, name_='TotalDutiesAndTaxes') + if self.TotalNetChargeWithDutiesAndTaxes: + self.TotalNetChargeWithDutiesAndTaxes.export(outfile, level, namespace_, name_='TotalNetChargeWithDutiesAndTaxes') + if self.FreightRateDetail: + self.FreightRateDetail.export(outfile, level, namespace_, name_='FreightRateDetail') + for FreightDiscounts_ in self.FreightDiscounts: + FreightDiscounts_.export(outfile, level, namespace_, name_='FreightDiscounts') + for Rebates_ in self.Rebates: + Rebates_.export(outfile, level, namespace_, name_='Rebates') + for Surcharges_ in self.Surcharges: + Surcharges_.export(outfile, level, namespace_, name_='Surcharges') + for Taxes_ in self.Taxes: + Taxes_.export(outfile, level, namespace_, name_='Taxes') + for DutiesAndTaxes_ in self.DutiesAndTaxes: + DutiesAndTaxes_.export(outfile, level, namespace_, name_='DutiesAndTaxes') + if self.VariableHandlingCharges: + self.VariableHandlingCharges.export(outfile, level, namespace_, name_='VariableHandlingCharges') + if self.TotalVariableHandlingCharges: + self.TotalVariableHandlingCharges.export(outfile, level, namespace_, name_='TotalVariableHandlingCharges') + def hasContent_(self): + if ( + self.LegDescription is not None or + self.LegOrigin is not None or + self.LegDestination is not None or + self.RateType is not None or + self.RateScale is not None or + self.RateZone is not None or + self.PricingCode is not None or + self.RatedWeightMethod is not None or + self.MinimumChargeType is not None or + self.CurrencyExchangeRate is not None or + self.SpecialRatingApplied or + self.DimDivisor is not None or + self.DimDivisorType is not None or + self.FuelSurchargePercent is not None or + self.TotalBillingWeight is not None or + self.TotalDimWeight is not None or + self.TotalBaseCharge is not None or + self.TotalFreightDiscounts is not None or + self.TotalNetFreight is not None or + self.TotalSurcharges is not None or + self.TotalNetFedExCharge is not None or + self.TotalTaxes is not None or + self.TotalNetCharge is not None or + self.TotalRebates is not None or + self.TotalDutiesAndTaxes is not None or + self.TotalNetChargeWithDutiesAndTaxes is not None or + self.FreightRateDetail is not None or + self.FreightDiscounts or + self.Rebates or + self.Surcharges or + self.Taxes or + self.DutiesAndTaxes or + self.VariableHandlingCharges is not None or + self.TotalVariableHandlingCharges is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ShipmentLegRateDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.LegDescription is not None: + showIndent(outfile, level) + outfile.write('LegDescription=%s,\n' % quote_python(self.LegDescription).encode(ExternalEncoding)) + if self.LegOrigin is not None: + showIndent(outfile, level) + outfile.write('LegOrigin=model_.Address(\n') + self.LegOrigin.exportLiteral(outfile, level, name_='LegOrigin') + showIndent(outfile, level) + outfile.write('),\n') + if self.LegDestination is not None: + showIndent(outfile, level) + outfile.write('LegDestination=model_.Address(\n') + self.LegDestination.exportLiteral(outfile, level, name_='LegDestination') + showIndent(outfile, level) + outfile.write('),\n') + if self.RateType is not None: + showIndent(outfile, level) + outfile.write('RateType=%s,\n' % quote_python(self.RateType).encode(ExternalEncoding)) + if self.RateScale is not None: + showIndent(outfile, level) + outfile.write('RateScale=%s,\n' % quote_python(self.RateScale).encode(ExternalEncoding)) + if self.RateZone is not None: + showIndent(outfile, level) + outfile.write('RateZone=%s,\n' % quote_python(self.RateZone).encode(ExternalEncoding)) + if self.PricingCode is not None: + showIndent(outfile, level) + outfile.write('PricingCode=%s,\n' % quote_python(self.PricingCode).encode(ExternalEncoding)) + if self.RatedWeightMethod is not None: + showIndent(outfile, level) + outfile.write('RatedWeightMethod=%s,\n' % quote_python(self.RatedWeightMethod).encode(ExternalEncoding)) + if self.MinimumChargeType is not None: + showIndent(outfile, level) + outfile.write('MinimumChargeType=%s,\n' % quote_python(self.MinimumChargeType).encode(ExternalEncoding)) + if self.CurrencyExchangeRate is not None: + showIndent(outfile, level) + outfile.write('CurrencyExchangeRate=model_.CurrencyExchangeRate(\n') + self.CurrencyExchangeRate.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('SpecialRatingApplied=[\n') + level += 1 + for SpecialRatingApplied_ in self.SpecialRatingApplied: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(SpecialRatingApplied_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.DimDivisor is not None: + showIndent(outfile, level) + outfile.write('DimDivisor=%d,\n' % self.DimDivisor) + if self.DimDivisorType is not None: + showIndent(outfile, level) + outfile.write('DimDivisorType=%s,\n' % quote_python(self.DimDivisorType).encode(ExternalEncoding)) + if self.FuelSurchargePercent is not None: + showIndent(outfile, level) + outfile.write('FuelSurchargePercent=%f,\n' % self.FuelSurchargePercent) + if self.TotalBillingWeight is not None: + showIndent(outfile, level) + outfile.write('TotalBillingWeight=model_.Weight(\n') + self.TotalBillingWeight.exportLiteral(outfile, level, name_='TotalBillingWeight') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalDimWeight is not None: + showIndent(outfile, level) + outfile.write('TotalDimWeight=model_.Weight(\n') + self.TotalDimWeight.exportLiteral(outfile, level, name_='TotalDimWeight') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalBaseCharge is not None: + showIndent(outfile, level) + outfile.write('TotalBaseCharge=model_.Money(\n') + self.TotalBaseCharge.exportLiteral(outfile, level, name_='TotalBaseCharge') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalFreightDiscounts is not None: + showIndent(outfile, level) + outfile.write('TotalFreightDiscounts=model_.Money(\n') + self.TotalFreightDiscounts.exportLiteral(outfile, level, name_='TotalFreightDiscounts') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalNetFreight is not None: + showIndent(outfile, level) + outfile.write('TotalNetFreight=model_.Money(\n') + self.TotalNetFreight.exportLiteral(outfile, level, name_='TotalNetFreight') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalSurcharges is not None: + showIndent(outfile, level) + outfile.write('TotalSurcharges=model_.Money(\n') + self.TotalSurcharges.exportLiteral(outfile, level, name_='TotalSurcharges') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalNetFedExCharge is not None: + showIndent(outfile, level) + outfile.write('TotalNetFedExCharge=model_.Money(\n') + self.TotalNetFedExCharge.exportLiteral(outfile, level, name_='TotalNetFedExCharge') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalTaxes is not None: + showIndent(outfile, level) + outfile.write('TotalTaxes=model_.Money(\n') + self.TotalTaxes.exportLiteral(outfile, level, name_='TotalTaxes') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalNetCharge is not None: + showIndent(outfile, level) + outfile.write('TotalNetCharge=model_.Money(\n') + self.TotalNetCharge.exportLiteral(outfile, level, name_='TotalNetCharge') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalRebates is not None: + showIndent(outfile, level) + outfile.write('TotalRebates=model_.Money(\n') + self.TotalRebates.exportLiteral(outfile, level, name_='TotalRebates') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalDutiesAndTaxes is not None: + showIndent(outfile, level) + outfile.write('TotalDutiesAndTaxes=model_.Money(\n') + self.TotalDutiesAndTaxes.exportLiteral(outfile, level, name_='TotalDutiesAndTaxes') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalNetChargeWithDutiesAndTaxes is not None: + showIndent(outfile, level) + outfile.write('TotalNetChargeWithDutiesAndTaxes=model_.Money(\n') + self.TotalNetChargeWithDutiesAndTaxes.exportLiteral(outfile, level, name_='TotalNetChargeWithDutiesAndTaxes') + showIndent(outfile, level) + outfile.write('),\n') + if self.FreightRateDetail is not None: + showIndent(outfile, level) + outfile.write('FreightRateDetail=model_.FreightRateDetail(\n') + self.FreightRateDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('FreightDiscounts=[\n') + level += 1 + for FreightDiscounts_ in self.FreightDiscounts: + showIndent(outfile, level) + outfile.write('model_.RateDiscount(\n') + FreightDiscounts_.exportLiteral(outfile, level, name_='RateDiscount') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('Rebates=[\n') + level += 1 + for Rebates_ in self.Rebates: + showIndent(outfile, level) + outfile.write('model_.Rebate(\n') + Rebates_.exportLiteral(outfile, level, name_='Rebate') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('Surcharges=[\n') + level += 1 + for Surcharges_ in self.Surcharges: + showIndent(outfile, level) + outfile.write('model_.Surcharge(\n') + Surcharges_.exportLiteral(outfile, level, name_='Surcharge') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('Taxes=[\n') + level += 1 + for Taxes_ in self.Taxes: + showIndent(outfile, level) + outfile.write('model_.Tax(\n') + Taxes_.exportLiteral(outfile, level, name_='Tax') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('DutiesAndTaxes=[\n') + level += 1 + for DutiesAndTaxes_ in self.DutiesAndTaxes: + showIndent(outfile, level) + outfile.write('model_.EdtCommodityTax(\n') + DutiesAndTaxes_.exportLiteral(outfile, level, name_='EdtCommodityTax') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.VariableHandlingCharges is not None: + showIndent(outfile, level) + outfile.write('VariableHandlingCharges=model_.VariableHandlingCharges(\n') + self.VariableHandlingCharges.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalVariableHandlingCharges is not None: + showIndent(outfile, level) + outfile.write('TotalVariableHandlingCharges=model_.VariableHandlingCharges(\n') + self.TotalVariableHandlingCharges.exportLiteral(outfile, level, name_='TotalVariableHandlingCharges') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'LegDescription': + LegDescription_ = child_.text + LegDescription_ = self.gds_validate_string(LegDescription_, node, 'LegDescription') + self.LegDescription = LegDescription_ + elif nodeName_ == 'LegOrigin': + obj_ = Address.factory() + obj_.build(child_) + self.set_LegOrigin(obj_) + elif nodeName_ == 'LegDestination': + obj_ = Address.factory() + obj_.build(child_) + self.set_LegDestination(obj_) + elif nodeName_ == 'RateType': + RateType_ = child_.text + RateType_ = self.gds_validate_string(RateType_, node, 'RateType') + self.RateType = RateType_ + self.validate_ReturnedRateType(self.RateType) # validate type ReturnedRateType + elif nodeName_ == 'RateScale': + RateScale_ = child_.text + RateScale_ = self.gds_validate_string(RateScale_, node, 'RateScale') + self.RateScale = RateScale_ + elif nodeName_ == 'RateZone': + RateZone_ = child_.text + RateZone_ = self.gds_validate_string(RateZone_, node, 'RateZone') + self.RateZone = RateZone_ + elif nodeName_ == 'PricingCode': + PricingCode_ = child_.text + PricingCode_ = self.gds_validate_string(PricingCode_, node, 'PricingCode') + self.PricingCode = PricingCode_ + self.validate_PricingCodeType(self.PricingCode) # validate type PricingCodeType + elif nodeName_ == 'RatedWeightMethod': + RatedWeightMethod_ = child_.text + RatedWeightMethod_ = self.gds_validate_string(RatedWeightMethod_, node, 'RatedWeightMethod') + self.RatedWeightMethod = RatedWeightMethod_ + self.validate_RatedWeightMethod(self.RatedWeightMethod) # validate type RatedWeightMethod + elif nodeName_ == 'MinimumChargeType': + MinimumChargeType_ = child_.text + MinimumChargeType_ = self.gds_validate_string(MinimumChargeType_, node, 'MinimumChargeType') + self.MinimumChargeType = MinimumChargeType_ + self.validate_MinimumChargeType(self.MinimumChargeType) # validate type MinimumChargeType + elif nodeName_ == 'CurrencyExchangeRate': + obj_ = CurrencyExchangeRate.factory() + obj_.build(child_) + self.set_CurrencyExchangeRate(obj_) + elif nodeName_ == 'SpecialRatingApplied': + SpecialRatingApplied_ = child_.text + SpecialRatingApplied_ = self.gds_validate_string(SpecialRatingApplied_, node, 'SpecialRatingApplied') + self.SpecialRatingApplied.append(SpecialRatingApplied_) + self.validate_SpecialRatingAppliedType(self.SpecialRatingApplied) # validate type SpecialRatingAppliedType + elif nodeName_ == 'DimDivisor': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'DimDivisor') + self.DimDivisor = ival_ + elif nodeName_ == 'DimDivisorType': + DimDivisorType_ = child_.text + DimDivisorType_ = self.gds_validate_string(DimDivisorType_, node, 'DimDivisorType') + self.DimDivisorType = DimDivisorType_ + self.validate_RateDimensionalDivisorType(self.DimDivisorType) # validate type RateDimensionalDivisorType + elif nodeName_ == 'FuelSurchargePercent': + sval_ = child_.text + try: + fval_ = float(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires float or double: %s' % exp) + fval_ = self.gds_validate_float(fval_, node, 'FuelSurchargePercent') + self.FuelSurchargePercent = fval_ + elif nodeName_ == 'TotalBillingWeight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_TotalBillingWeight(obj_) + elif nodeName_ == 'TotalDimWeight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_TotalDimWeight(obj_) + elif nodeName_ == 'TotalBaseCharge': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalBaseCharge(obj_) + elif nodeName_ == 'TotalFreightDiscounts': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalFreightDiscounts(obj_) + elif nodeName_ == 'TotalNetFreight': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalNetFreight(obj_) + elif nodeName_ == 'TotalSurcharges': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalSurcharges(obj_) + elif nodeName_ == 'TotalNetFedExCharge': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalNetFedExCharge(obj_) + elif nodeName_ == 'TotalTaxes': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalTaxes(obj_) + elif nodeName_ == 'TotalNetCharge': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalNetCharge(obj_) + elif nodeName_ == 'TotalRebates': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalRebates(obj_) + elif nodeName_ == 'TotalDutiesAndTaxes': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalDutiesAndTaxes(obj_) + elif nodeName_ == 'TotalNetChargeWithDutiesAndTaxes': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalNetChargeWithDutiesAndTaxes(obj_) + elif nodeName_ == 'FreightRateDetail': + obj_ = FreightRateDetail.factory() + obj_.build(child_) + self.set_FreightRateDetail(obj_) + elif nodeName_ == 'FreightDiscounts': + obj_ = RateDiscount.factory() + obj_.build(child_) + self.FreightDiscounts.append(obj_) + elif nodeName_ == 'Rebates': + obj_ = Rebate.factory() + obj_.build(child_) + self.Rebates.append(obj_) + elif nodeName_ == 'Surcharges': + obj_ = Surcharge.factory() + obj_.build(child_) + self.Surcharges.append(obj_) + elif nodeName_ == 'Taxes': + obj_ = Tax.factory() + obj_.build(child_) + self.Taxes.append(obj_) + elif nodeName_ == 'DutiesAndTaxes': + obj_ = EdtCommodityTax.factory() + obj_.build(child_) + self.DutiesAndTaxes.append(obj_) + elif nodeName_ == 'VariableHandlingCharges': + obj_ = VariableHandlingCharges.factory() + obj_.build(child_) + self.set_VariableHandlingCharges(obj_) + elif nodeName_ == 'TotalVariableHandlingCharges': + obj_ = VariableHandlingCharges.factory() + obj_.build(child_) + self.set_TotalVariableHandlingCharges(obj_) +# end class ShipmentLegRateDetail + + +class ShipmentRateDetail(GeneratedsSuper): + """Data for a shipment's total/summary rates, as calculated per a + specific rate type. The "total..." fields may differ from the + sum of corresponding package data for Multiweight or Express + MPS.""" + subclass = None + superclass = None + def __init__(self, RateType=None, RateScale=None, RateZone=None, PricingCode=None, RatedWeightMethod=None, MinimumChargeType=None, CurrencyExchangeRate=None, SpecialRatingApplied=None, DimDivisor=None, DimDivisorType=None, FuelSurchargePercent=None, TotalBillingWeight=None, TotalDimWeight=None, TotalBaseCharge=None, TotalFreightDiscounts=None, TotalNetFreight=None, TotalSurcharges=None, TotalNetFedExCharge=None, TotalTaxes=None, TotalNetCharge=None, TotalRebates=None, TotalDutiesAndTaxes=None, TotalNetChargeWithDutiesAndTaxes=None, ShipmentLegRateDetails=None, FreightRateDetail=None, FreightDiscounts=None, Rebates=None, Surcharges=None, Taxes=None, DutiesAndTaxes=None, VariableHandlingCharges=None, TotalVariableHandlingCharges=None): + self.RateType = RateType + self.RateScale = RateScale + self.RateZone = RateZone + self.PricingCode = PricingCode + self.RatedWeightMethod = RatedWeightMethod + self.MinimumChargeType = MinimumChargeType + self.CurrencyExchangeRate = CurrencyExchangeRate + if SpecialRatingApplied is None: + self.SpecialRatingApplied = [] + else: + self.SpecialRatingApplied = SpecialRatingApplied + self.DimDivisor = DimDivisor + self.DimDivisorType = DimDivisorType + self.FuelSurchargePercent = FuelSurchargePercent + self.TotalBillingWeight = TotalBillingWeight + self.TotalDimWeight = TotalDimWeight + self.TotalBaseCharge = TotalBaseCharge + self.TotalFreightDiscounts = TotalFreightDiscounts + self.TotalNetFreight = TotalNetFreight + self.TotalSurcharges = TotalSurcharges + self.TotalNetFedExCharge = TotalNetFedExCharge + self.TotalTaxes = TotalTaxes + self.TotalNetCharge = TotalNetCharge + self.TotalRebates = TotalRebates + self.TotalDutiesAndTaxes = TotalDutiesAndTaxes + self.TotalNetChargeWithDutiesAndTaxes = TotalNetChargeWithDutiesAndTaxes + if ShipmentLegRateDetails is None: + self.ShipmentLegRateDetails = [] + else: + self.ShipmentLegRateDetails = ShipmentLegRateDetails + self.FreightRateDetail = FreightRateDetail + if FreightDiscounts is None: + self.FreightDiscounts = [] + else: + self.FreightDiscounts = FreightDiscounts + if Rebates is None: + self.Rebates = [] + else: + self.Rebates = Rebates + if Surcharges is None: + self.Surcharges = [] + else: + self.Surcharges = Surcharges + if Taxes is None: + self.Taxes = [] + else: + self.Taxes = Taxes + if DutiesAndTaxes is None: + self.DutiesAndTaxes = [] + else: + self.DutiesAndTaxes = DutiesAndTaxes + self.VariableHandlingCharges = VariableHandlingCharges + self.TotalVariableHandlingCharges = TotalVariableHandlingCharges + def factory(*args_, **kwargs_): + if ShipmentRateDetail.subclass: + return ShipmentRateDetail.subclass(*args_, **kwargs_) + else: + return ShipmentRateDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_RateType(self): return self.RateType + def set_RateType(self, RateType): self.RateType = RateType + def validate_ReturnedRateType(self, value): + # Validate type ReturnedRateType, a restriction on xs:string. + pass + def get_RateScale(self): return self.RateScale + def set_RateScale(self, RateScale): self.RateScale = RateScale + def get_RateZone(self): return self.RateZone + def set_RateZone(self, RateZone): self.RateZone = RateZone + def get_PricingCode(self): return self.PricingCode + def set_PricingCode(self, PricingCode): self.PricingCode = PricingCode + def validate_PricingCodeType(self, value): + # Validate type PricingCodeType, a restriction on xs:string. + pass + def get_RatedWeightMethod(self): return self.RatedWeightMethod + def set_RatedWeightMethod(self, RatedWeightMethod): self.RatedWeightMethod = RatedWeightMethod + def validate_RatedWeightMethod(self, value): + # Validate type RatedWeightMethod, a restriction on xs:string. + pass + def get_MinimumChargeType(self): return self.MinimumChargeType + def set_MinimumChargeType(self, MinimumChargeType): self.MinimumChargeType = MinimumChargeType + def validate_MinimumChargeType(self, value): + # Validate type MinimumChargeType, a restriction on xs:string. + pass + def get_CurrencyExchangeRate(self): return self.CurrencyExchangeRate + def set_CurrencyExchangeRate(self, CurrencyExchangeRate): self.CurrencyExchangeRate = CurrencyExchangeRate + def get_SpecialRatingApplied(self): return self.SpecialRatingApplied + def set_SpecialRatingApplied(self, SpecialRatingApplied): self.SpecialRatingApplied = SpecialRatingApplied + def add_SpecialRatingApplied(self, value): self.SpecialRatingApplied.append(value) + def insert_SpecialRatingApplied(self, index, value): self.SpecialRatingApplied[index] = value + def validate_SpecialRatingAppliedType(self, value): + # Validate type SpecialRatingAppliedType, a restriction on xs:string. + pass + def get_DimDivisor(self): return self.DimDivisor + def set_DimDivisor(self, DimDivisor): self.DimDivisor = DimDivisor + def get_DimDivisorType(self): return self.DimDivisorType + def set_DimDivisorType(self, DimDivisorType): self.DimDivisorType = DimDivisorType + def validate_RateDimensionalDivisorType(self, value): + # Validate type RateDimensionalDivisorType, a restriction on xs:string. + pass + def get_FuelSurchargePercent(self): return self.FuelSurchargePercent + def set_FuelSurchargePercent(self, FuelSurchargePercent): self.FuelSurchargePercent = FuelSurchargePercent + def get_TotalBillingWeight(self): return self.TotalBillingWeight + def set_TotalBillingWeight(self, TotalBillingWeight): self.TotalBillingWeight = TotalBillingWeight + def get_TotalDimWeight(self): return self.TotalDimWeight + def set_TotalDimWeight(self, TotalDimWeight): self.TotalDimWeight = TotalDimWeight + def get_TotalBaseCharge(self): return self.TotalBaseCharge + def set_TotalBaseCharge(self, TotalBaseCharge): self.TotalBaseCharge = TotalBaseCharge + def get_TotalFreightDiscounts(self): return self.TotalFreightDiscounts + def set_TotalFreightDiscounts(self, TotalFreightDiscounts): self.TotalFreightDiscounts = TotalFreightDiscounts + def get_TotalNetFreight(self): return self.TotalNetFreight + def set_TotalNetFreight(self, TotalNetFreight): self.TotalNetFreight = TotalNetFreight + def get_TotalSurcharges(self): return self.TotalSurcharges + def set_TotalSurcharges(self, TotalSurcharges): self.TotalSurcharges = TotalSurcharges + def get_TotalNetFedExCharge(self): return self.TotalNetFedExCharge + def set_TotalNetFedExCharge(self, TotalNetFedExCharge): self.TotalNetFedExCharge = TotalNetFedExCharge + def get_TotalTaxes(self): return self.TotalTaxes + def set_TotalTaxes(self, TotalTaxes): self.TotalTaxes = TotalTaxes + def get_TotalNetCharge(self): return self.TotalNetCharge + def set_TotalNetCharge(self, TotalNetCharge): self.TotalNetCharge = TotalNetCharge + def get_TotalRebates(self): return self.TotalRebates + def set_TotalRebates(self, TotalRebates): self.TotalRebates = TotalRebates + def get_TotalDutiesAndTaxes(self): return self.TotalDutiesAndTaxes + def set_TotalDutiesAndTaxes(self, TotalDutiesAndTaxes): self.TotalDutiesAndTaxes = TotalDutiesAndTaxes + def get_TotalNetChargeWithDutiesAndTaxes(self): return self.TotalNetChargeWithDutiesAndTaxes + def set_TotalNetChargeWithDutiesAndTaxes(self, TotalNetChargeWithDutiesAndTaxes): self.TotalNetChargeWithDutiesAndTaxes = TotalNetChargeWithDutiesAndTaxes + def get_ShipmentLegRateDetails(self): return self.ShipmentLegRateDetails + def set_ShipmentLegRateDetails(self, ShipmentLegRateDetails): self.ShipmentLegRateDetails = ShipmentLegRateDetails + def add_ShipmentLegRateDetails(self, value): self.ShipmentLegRateDetails.append(value) + def insert_ShipmentLegRateDetails(self, index, value): self.ShipmentLegRateDetails[index] = value + def get_FreightRateDetail(self): return self.FreightRateDetail + def set_FreightRateDetail(self, FreightRateDetail): self.FreightRateDetail = FreightRateDetail + def get_FreightDiscounts(self): return self.FreightDiscounts + def set_FreightDiscounts(self, FreightDiscounts): self.FreightDiscounts = FreightDiscounts + def add_FreightDiscounts(self, value): self.FreightDiscounts.append(value) + def insert_FreightDiscounts(self, index, value): self.FreightDiscounts[index] = value + def get_Rebates(self): return self.Rebates + def set_Rebates(self, Rebates): self.Rebates = Rebates + def add_Rebates(self, value): self.Rebates.append(value) + def insert_Rebates(self, index, value): self.Rebates[index] = value + def get_Surcharges(self): return self.Surcharges + def set_Surcharges(self, Surcharges): self.Surcharges = Surcharges + def add_Surcharges(self, value): self.Surcharges.append(value) + def insert_Surcharges(self, index, value): self.Surcharges[index] = value + def get_Taxes(self): return self.Taxes + def set_Taxes(self, Taxes): self.Taxes = Taxes + def add_Taxes(self, value): self.Taxes.append(value) + def insert_Taxes(self, index, value): self.Taxes[index] = value + def get_DutiesAndTaxes(self): return self.DutiesAndTaxes + def set_DutiesAndTaxes(self, DutiesAndTaxes): self.DutiesAndTaxes = DutiesAndTaxes + def add_DutiesAndTaxes(self, value): self.DutiesAndTaxes.append(value) + def insert_DutiesAndTaxes(self, index, value): self.DutiesAndTaxes[index] = value + def get_VariableHandlingCharges(self): return self.VariableHandlingCharges + def set_VariableHandlingCharges(self, VariableHandlingCharges): self.VariableHandlingCharges = VariableHandlingCharges + def get_TotalVariableHandlingCharges(self): return self.TotalVariableHandlingCharges + def set_TotalVariableHandlingCharges(self, TotalVariableHandlingCharges): self.TotalVariableHandlingCharges = TotalVariableHandlingCharges + def export(self, outfile, level, namespace_='ns:', name_='ShipmentRateDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ShipmentRateDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ShipmentRateDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ShipmentRateDetail', fromsubclass_=False): + if self.RateType is not None: + showIndent(outfile, level) + outfile.write('<%sRateType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RateType).encode(ExternalEncoding), input_name='RateType'), namespace_)) + if self.RateScale is not None: + showIndent(outfile, level) + outfile.write('<%sRateScale>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RateScale).encode(ExternalEncoding), input_name='RateScale'), namespace_)) + if self.RateZone is not None: + showIndent(outfile, level) + outfile.write('<%sRateZone>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RateZone).encode(ExternalEncoding), input_name='RateZone'), namespace_)) + if self.PricingCode is not None: + showIndent(outfile, level) + outfile.write('<%sPricingCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PricingCode).encode(ExternalEncoding), input_name='PricingCode'), namespace_)) + if self.RatedWeightMethod is not None: + showIndent(outfile, level) + outfile.write('<%sRatedWeightMethod>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RatedWeightMethod).encode(ExternalEncoding), input_name='RatedWeightMethod'), namespace_)) + if self.MinimumChargeType is not None: + showIndent(outfile, level) + outfile.write('<%sMinimumChargeType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.MinimumChargeType).encode(ExternalEncoding), input_name='MinimumChargeType'), namespace_)) + if self.CurrencyExchangeRate: + self.CurrencyExchangeRate.export(outfile, level, namespace_, name_='CurrencyExchangeRate') + for SpecialRatingApplied_ in self.SpecialRatingApplied: + showIndent(outfile, level) + outfile.write('<%sSpecialRatingApplied>%s\n' % (namespace_, self.gds_format_string(quote_xml(SpecialRatingApplied_).encode(ExternalEncoding), input_name='SpecialRatingApplied'), namespace_)) + if self.DimDivisor is not None: + showIndent(outfile, level) + outfile.write('<%sDimDivisor>%s\n' % (namespace_, self.gds_format_integer(self.DimDivisor, input_name='DimDivisor'), namespace_)) + if self.DimDivisorType is not None: + showIndent(outfile, level) + outfile.write('<%sDimDivisorType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DimDivisorType).encode(ExternalEncoding), input_name='DimDivisorType'), namespace_)) + if self.FuelSurchargePercent is not None: + showIndent(outfile, level) + outfile.write('<%sFuelSurchargePercent>%s\n' % (namespace_, self.gds_format_float(self.FuelSurchargePercent, input_name='FuelSurchargePercent'), namespace_)) + if self.TotalBillingWeight: + self.TotalBillingWeight.export(outfile, level, namespace_, name_='TotalBillingWeight') + if self.TotalDimWeight: + self.TotalDimWeight.export(outfile, level, namespace_, name_='TotalDimWeight') + if self.TotalBaseCharge: + self.TotalBaseCharge.export(outfile, level, namespace_, name_='TotalBaseCharge') + if self.TotalFreightDiscounts: + self.TotalFreightDiscounts.export(outfile, level, namespace_, name_='TotalFreightDiscounts') + if self.TotalNetFreight: + self.TotalNetFreight.export(outfile, level, namespace_, name_='TotalNetFreight') + if self.TotalSurcharges: + self.TotalSurcharges.export(outfile, level, namespace_, name_='TotalSurcharges') + if self.TotalNetFedExCharge: + self.TotalNetFedExCharge.export(outfile, level, namespace_, name_='TotalNetFedExCharge') + if self.TotalTaxes: + self.TotalTaxes.export(outfile, level, namespace_, name_='TotalTaxes') + if self.TotalNetCharge: + self.TotalNetCharge.export(outfile, level, namespace_, name_='TotalNetCharge') + if self.TotalRebates: + self.TotalRebates.export(outfile, level, namespace_, name_='TotalRebates') + if self.TotalDutiesAndTaxes: + self.TotalDutiesAndTaxes.export(outfile, level, namespace_, name_='TotalDutiesAndTaxes') + if self.TotalNetChargeWithDutiesAndTaxes: + self.TotalNetChargeWithDutiesAndTaxes.export(outfile, level, namespace_, name_='TotalNetChargeWithDutiesAndTaxes') + for ShipmentLegRateDetails_ in self.ShipmentLegRateDetails: + ShipmentLegRateDetails_.export(outfile, level, namespace_, name_='ShipmentLegRateDetails') + if self.FreightRateDetail: + self.FreightRateDetail.export(outfile, level, namespace_, name_='FreightRateDetail') + for FreightDiscounts_ in self.FreightDiscounts: + FreightDiscounts_.export(outfile, level, namespace_, name_='FreightDiscounts') + for Rebates_ in self.Rebates: + Rebates_.export(outfile, level, namespace_, name_='Rebates') + for Surcharges_ in self.Surcharges: + Surcharges_.export(outfile, level, namespace_, name_='Surcharges') + for Taxes_ in self.Taxes: + Taxes_.export(outfile, level, namespace_, name_='Taxes') + for DutiesAndTaxes_ in self.DutiesAndTaxes: + DutiesAndTaxes_.export(outfile, level, namespace_, name_='DutiesAndTaxes') + if self.VariableHandlingCharges: + self.VariableHandlingCharges.export(outfile, level, namespace_, name_='VariableHandlingCharges') + if self.TotalVariableHandlingCharges: + self.TotalVariableHandlingCharges.export(outfile, level, namespace_, name_='TotalVariableHandlingCharges') + def hasContent_(self): + if ( + self.RateType is not None or + self.RateScale is not None or + self.RateZone is not None or + self.PricingCode is not None or + self.RatedWeightMethod is not None or + self.MinimumChargeType is not None or + self.CurrencyExchangeRate is not None or + self.SpecialRatingApplied or + self.DimDivisor is not None or + self.DimDivisorType is not None or + self.FuelSurchargePercent is not None or + self.TotalBillingWeight is not None or + self.TotalDimWeight is not None or + self.TotalBaseCharge is not None or + self.TotalFreightDiscounts is not None or + self.TotalNetFreight is not None or + self.TotalSurcharges is not None or + self.TotalNetFedExCharge is not None or + self.TotalTaxes is not None or + self.TotalNetCharge is not None or + self.TotalRebates is not None or + self.TotalDutiesAndTaxes is not None or + self.TotalNetChargeWithDutiesAndTaxes is not None or + self.ShipmentLegRateDetails or + self.FreightRateDetail is not None or + self.FreightDiscounts or + self.Rebates or + self.Surcharges or + self.Taxes or + self.DutiesAndTaxes or + self.VariableHandlingCharges is not None or + self.TotalVariableHandlingCharges is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ShipmentRateDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.RateType is not None: + showIndent(outfile, level) + outfile.write('RateType=%s,\n' % quote_python(self.RateType).encode(ExternalEncoding)) + if self.RateScale is not None: + showIndent(outfile, level) + outfile.write('RateScale=%s,\n' % quote_python(self.RateScale).encode(ExternalEncoding)) + if self.RateZone is not None: + showIndent(outfile, level) + outfile.write('RateZone=%s,\n' % quote_python(self.RateZone).encode(ExternalEncoding)) + if self.PricingCode is not None: + showIndent(outfile, level) + outfile.write('PricingCode=%s,\n' % quote_python(self.PricingCode).encode(ExternalEncoding)) + if self.RatedWeightMethod is not None: + showIndent(outfile, level) + outfile.write('RatedWeightMethod=%s,\n' % quote_python(self.RatedWeightMethod).encode(ExternalEncoding)) + if self.MinimumChargeType is not None: + showIndent(outfile, level) + outfile.write('MinimumChargeType=%s,\n' % quote_python(self.MinimumChargeType).encode(ExternalEncoding)) + if self.CurrencyExchangeRate is not None: + showIndent(outfile, level) + outfile.write('CurrencyExchangeRate=model_.CurrencyExchangeRate(\n') + self.CurrencyExchangeRate.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('SpecialRatingApplied=[\n') + level += 1 + for SpecialRatingApplied_ in self.SpecialRatingApplied: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(SpecialRatingApplied_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.DimDivisor is not None: + showIndent(outfile, level) + outfile.write('DimDivisor=%d,\n' % self.DimDivisor) + if self.DimDivisorType is not None: + showIndent(outfile, level) + outfile.write('DimDivisorType=%s,\n' % quote_python(self.DimDivisorType).encode(ExternalEncoding)) + if self.FuelSurchargePercent is not None: + showIndent(outfile, level) + outfile.write('FuelSurchargePercent=%f,\n' % self.FuelSurchargePercent) + if self.TotalBillingWeight is not None: + showIndent(outfile, level) + outfile.write('TotalBillingWeight=model_.Weight(\n') + self.TotalBillingWeight.exportLiteral(outfile, level, name_='TotalBillingWeight') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalDimWeight is not None: + showIndent(outfile, level) + outfile.write('TotalDimWeight=model_.Weight(\n') + self.TotalDimWeight.exportLiteral(outfile, level, name_='TotalDimWeight') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalBaseCharge is not None: + showIndent(outfile, level) + outfile.write('TotalBaseCharge=model_.Money(\n') + self.TotalBaseCharge.exportLiteral(outfile, level, name_='TotalBaseCharge') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalFreightDiscounts is not None: + showIndent(outfile, level) + outfile.write('TotalFreightDiscounts=model_.Money(\n') + self.TotalFreightDiscounts.exportLiteral(outfile, level, name_='TotalFreightDiscounts') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalNetFreight is not None: + showIndent(outfile, level) + outfile.write('TotalNetFreight=model_.Money(\n') + self.TotalNetFreight.exportLiteral(outfile, level, name_='TotalNetFreight') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalSurcharges is not None: + showIndent(outfile, level) + outfile.write('TotalSurcharges=model_.Money(\n') + self.TotalSurcharges.exportLiteral(outfile, level, name_='TotalSurcharges') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalNetFedExCharge is not None: + showIndent(outfile, level) + outfile.write('TotalNetFedExCharge=model_.Money(\n') + self.TotalNetFedExCharge.exportLiteral(outfile, level, name_='TotalNetFedExCharge') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalTaxes is not None: + showIndent(outfile, level) + outfile.write('TotalTaxes=model_.Money(\n') + self.TotalTaxes.exportLiteral(outfile, level, name_='TotalTaxes') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalNetCharge is not None: + showIndent(outfile, level) + outfile.write('TotalNetCharge=model_.Money(\n') + self.TotalNetCharge.exportLiteral(outfile, level, name_='TotalNetCharge') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalRebates is not None: + showIndent(outfile, level) + outfile.write('TotalRebates=model_.Money(\n') + self.TotalRebates.exportLiteral(outfile, level, name_='TotalRebates') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalDutiesAndTaxes is not None: + showIndent(outfile, level) + outfile.write('TotalDutiesAndTaxes=model_.Money(\n') + self.TotalDutiesAndTaxes.exportLiteral(outfile, level, name_='TotalDutiesAndTaxes') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalNetChargeWithDutiesAndTaxes is not None: + showIndent(outfile, level) + outfile.write('TotalNetChargeWithDutiesAndTaxes=model_.Money(\n') + self.TotalNetChargeWithDutiesAndTaxes.exportLiteral(outfile, level, name_='TotalNetChargeWithDutiesAndTaxes') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('ShipmentLegRateDetails=[\n') + level += 1 + for ShipmentLegRateDetails_ in self.ShipmentLegRateDetails: + showIndent(outfile, level) + outfile.write('model_.ShipmentLegRateDetail(\n') + ShipmentLegRateDetails_.exportLiteral(outfile, level, name_='ShipmentLegRateDetail') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.FreightRateDetail is not None: + showIndent(outfile, level) + outfile.write('FreightRateDetail=model_.FreightRateDetail(\n') + self.FreightRateDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('FreightDiscounts=[\n') + level += 1 + for FreightDiscounts_ in self.FreightDiscounts: + showIndent(outfile, level) + outfile.write('model_.RateDiscount(\n') + FreightDiscounts_.exportLiteral(outfile, level, name_='RateDiscount') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('Rebates=[\n') + level += 1 + for Rebates_ in self.Rebates: + showIndent(outfile, level) + outfile.write('model_.Rebate(\n') + Rebates_.exportLiteral(outfile, level, name_='Rebate') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('Surcharges=[\n') + level += 1 + for Surcharges_ in self.Surcharges: + showIndent(outfile, level) + outfile.write('model_.Surcharge(\n') + Surcharges_.exportLiteral(outfile, level, name_='Surcharge') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('Taxes=[\n') + level += 1 + for Taxes_ in self.Taxes: + showIndent(outfile, level) + outfile.write('model_.Tax(\n') + Taxes_.exportLiteral(outfile, level, name_='Tax') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('DutiesAndTaxes=[\n') + level += 1 + for DutiesAndTaxes_ in self.DutiesAndTaxes: + showIndent(outfile, level) + outfile.write('model_.EdtCommodityTax(\n') + DutiesAndTaxes_.exportLiteral(outfile, level, name_='EdtCommodityTax') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.VariableHandlingCharges is not None: + showIndent(outfile, level) + outfile.write('VariableHandlingCharges=model_.VariableHandlingCharges(\n') + self.VariableHandlingCharges.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalVariableHandlingCharges is not None: + showIndent(outfile, level) + outfile.write('TotalVariableHandlingCharges=model_.VariableHandlingCharges(\n') + self.TotalVariableHandlingCharges.exportLiteral(outfile, level, name_='TotalVariableHandlingCharges') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'RateType': + RateType_ = child_.text + RateType_ = self.gds_validate_string(RateType_, node, 'RateType') + self.RateType = RateType_ + self.validate_ReturnedRateType(self.RateType) # validate type ReturnedRateType + elif nodeName_ == 'RateScale': + RateScale_ = child_.text + RateScale_ = self.gds_validate_string(RateScale_, node, 'RateScale') + self.RateScale = RateScale_ + elif nodeName_ == 'RateZone': + RateZone_ = child_.text + RateZone_ = self.gds_validate_string(RateZone_, node, 'RateZone') + self.RateZone = RateZone_ + elif nodeName_ == 'PricingCode': + PricingCode_ = child_.text + PricingCode_ = self.gds_validate_string(PricingCode_, node, 'PricingCode') + self.PricingCode = PricingCode_ + self.validate_PricingCodeType(self.PricingCode) # validate type PricingCodeType + elif nodeName_ == 'RatedWeightMethod': + RatedWeightMethod_ = child_.text + RatedWeightMethod_ = self.gds_validate_string(RatedWeightMethod_, node, 'RatedWeightMethod') + self.RatedWeightMethod = RatedWeightMethod_ + self.validate_RatedWeightMethod(self.RatedWeightMethod) # validate type RatedWeightMethod + elif nodeName_ == 'MinimumChargeType': + MinimumChargeType_ = child_.text + MinimumChargeType_ = self.gds_validate_string(MinimumChargeType_, node, 'MinimumChargeType') + self.MinimumChargeType = MinimumChargeType_ + self.validate_MinimumChargeType(self.MinimumChargeType) # validate type MinimumChargeType + elif nodeName_ == 'CurrencyExchangeRate': + obj_ = CurrencyExchangeRate.factory() + obj_.build(child_) + self.set_CurrencyExchangeRate(obj_) + elif nodeName_ == 'SpecialRatingApplied': + SpecialRatingApplied_ = child_.text + SpecialRatingApplied_ = self.gds_validate_string(SpecialRatingApplied_, node, 'SpecialRatingApplied') + self.SpecialRatingApplied.append(SpecialRatingApplied_) + self.validate_SpecialRatingAppliedType(self.SpecialRatingApplied) # validate type SpecialRatingAppliedType + elif nodeName_ == 'DimDivisor': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'DimDivisor') + self.DimDivisor = ival_ + elif nodeName_ == 'DimDivisorType': + DimDivisorType_ = child_.text + DimDivisorType_ = self.gds_validate_string(DimDivisorType_, node, 'DimDivisorType') + self.DimDivisorType = DimDivisorType_ + self.validate_RateDimensionalDivisorType(self.DimDivisorType) # validate type RateDimensionalDivisorType + elif nodeName_ == 'FuelSurchargePercent': + sval_ = child_.text + try: + fval_ = float(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires float or double: %s' % exp) + fval_ = self.gds_validate_float(fval_, node, 'FuelSurchargePercent') + self.FuelSurchargePercent = fval_ + elif nodeName_ == 'TotalBillingWeight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_TotalBillingWeight(obj_) + elif nodeName_ == 'TotalDimWeight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_TotalDimWeight(obj_) + elif nodeName_ == 'TotalBaseCharge': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalBaseCharge(obj_) + elif nodeName_ == 'TotalFreightDiscounts': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalFreightDiscounts(obj_) + elif nodeName_ == 'TotalNetFreight': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalNetFreight(obj_) + elif nodeName_ == 'TotalSurcharges': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalSurcharges(obj_) + elif nodeName_ == 'TotalNetFedExCharge': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalNetFedExCharge(obj_) + elif nodeName_ == 'TotalTaxes': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalTaxes(obj_) + elif nodeName_ == 'TotalNetCharge': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalNetCharge(obj_) + elif nodeName_ == 'TotalRebates': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalRebates(obj_) + elif nodeName_ == 'TotalDutiesAndTaxes': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalDutiesAndTaxes(obj_) + elif nodeName_ == 'TotalNetChargeWithDutiesAndTaxes': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalNetChargeWithDutiesAndTaxes(obj_) + elif nodeName_ == 'ShipmentLegRateDetails': + obj_ = ShipmentLegRateDetail.factory() + obj_.build(child_) + self.ShipmentLegRateDetails.append(obj_) + elif nodeName_ == 'FreightRateDetail': + obj_ = FreightRateDetail.factory() + obj_.build(child_) + self.set_FreightRateDetail(obj_) + elif nodeName_ == 'FreightDiscounts': + obj_ = RateDiscount.factory() + obj_.build(child_) + self.FreightDiscounts.append(obj_) + elif nodeName_ == 'Rebates': + obj_ = Rebate.factory() + obj_.build(child_) + self.Rebates.append(obj_) + elif nodeName_ == 'Surcharges': + obj_ = Surcharge.factory() + obj_.build(child_) + self.Surcharges.append(obj_) + elif nodeName_ == 'Taxes': + obj_ = Tax.factory() + obj_.build(child_) + self.Taxes.append(obj_) + elif nodeName_ == 'DutiesAndTaxes': + obj_ = EdtCommodityTax.factory() + obj_.build(child_) + self.DutiesAndTaxes.append(obj_) + elif nodeName_ == 'VariableHandlingCharges': + obj_ = VariableHandlingCharges.factory() + obj_.build(child_) + self.set_VariableHandlingCharges(obj_) + elif nodeName_ == 'TotalVariableHandlingCharges': + obj_ = VariableHandlingCharges.factory() + obj_.build(child_) + self.set_TotalVariableHandlingCharges(obj_) +# end class ShipmentRateDetail + + +class ShipmentSpecialServicesRequested(GeneratedsSuper): + """These special services are available at the shipment level for some + or all service types. If the shipper is requesting a special + service which requires additional data (such as the COD amount), + the shipment special service type must be present in the + specialServiceTypes collection, and the supporting detail must + be provided in the appropriate sub-object below.""" + subclass = None + superclass = None + def __init__(self, SpecialServiceTypes=None, CodDetail=None, HoldAtLocationDetail=None, EMailNotificationDetail=None, ReturnShipmentDetail=None, PendingShipmentDetail=None, ShipmentDryIceDetail=None, HomeDeliveryPremiumDetail=None, FlatbedTrailerDetail=None, FreightGuaranteeDetail=None, EtdDetail=None, CustomDeliveryWindowDetail=None): + if SpecialServiceTypes is None: + self.SpecialServiceTypes = [] + else: + self.SpecialServiceTypes = SpecialServiceTypes + self.CodDetail = CodDetail + self.HoldAtLocationDetail = HoldAtLocationDetail + self.EMailNotificationDetail = EMailNotificationDetail + self.ReturnShipmentDetail = ReturnShipmentDetail + self.PendingShipmentDetail = PendingShipmentDetail + self.ShipmentDryIceDetail = ShipmentDryIceDetail + self.HomeDeliveryPremiumDetail = HomeDeliveryPremiumDetail + self.FlatbedTrailerDetail = FlatbedTrailerDetail + self.FreightGuaranteeDetail = FreightGuaranteeDetail + self.EtdDetail = EtdDetail + self.CustomDeliveryWindowDetail = CustomDeliveryWindowDetail + def factory(*args_, **kwargs_): + if ShipmentSpecialServicesRequested.subclass: + return ShipmentSpecialServicesRequested.subclass(*args_, **kwargs_) + else: + return ShipmentSpecialServicesRequested(*args_, **kwargs_) + factory = staticmethod(factory) + def get_SpecialServiceTypes(self): return self.SpecialServiceTypes + def set_SpecialServiceTypes(self, SpecialServiceTypes): self.SpecialServiceTypes = SpecialServiceTypes + def add_SpecialServiceTypes(self, value): self.SpecialServiceTypes.append(value) + def insert_SpecialServiceTypes(self, index, value): self.SpecialServiceTypes[index] = value + def validate_ShipmentSpecialServiceType(self, value): + # Validate type ShipmentSpecialServiceType, a restriction on xs:string. + pass + def get_CodDetail(self): return self.CodDetail + def set_CodDetail(self, CodDetail): self.CodDetail = CodDetail + def get_HoldAtLocationDetail(self): return self.HoldAtLocationDetail + def set_HoldAtLocationDetail(self, HoldAtLocationDetail): self.HoldAtLocationDetail = HoldAtLocationDetail + def get_EMailNotificationDetail(self): return self.EMailNotificationDetail + def set_EMailNotificationDetail(self, EMailNotificationDetail): self.EMailNotificationDetail = EMailNotificationDetail + def get_ReturnShipmentDetail(self): return self.ReturnShipmentDetail + def set_ReturnShipmentDetail(self, ReturnShipmentDetail): self.ReturnShipmentDetail = ReturnShipmentDetail + def get_PendingShipmentDetail(self): return self.PendingShipmentDetail + def set_PendingShipmentDetail(self, PendingShipmentDetail): self.PendingShipmentDetail = PendingShipmentDetail + def get_ShipmentDryIceDetail(self): return self.ShipmentDryIceDetail + def set_ShipmentDryIceDetail(self, ShipmentDryIceDetail): self.ShipmentDryIceDetail = ShipmentDryIceDetail + def get_HomeDeliveryPremiumDetail(self): return self.HomeDeliveryPremiumDetail + def set_HomeDeliveryPremiumDetail(self, HomeDeliveryPremiumDetail): self.HomeDeliveryPremiumDetail = HomeDeliveryPremiumDetail + def get_FlatbedTrailerDetail(self): return self.FlatbedTrailerDetail + def set_FlatbedTrailerDetail(self, FlatbedTrailerDetail): self.FlatbedTrailerDetail = FlatbedTrailerDetail + def get_FreightGuaranteeDetail(self): return self.FreightGuaranteeDetail + def set_FreightGuaranteeDetail(self, FreightGuaranteeDetail): self.FreightGuaranteeDetail = FreightGuaranteeDetail + def get_EtdDetail(self): return self.EtdDetail + def set_EtdDetail(self, EtdDetail): self.EtdDetail = EtdDetail + def get_CustomDeliveryWindowDetail(self): return self.CustomDeliveryWindowDetail + def set_CustomDeliveryWindowDetail(self, CustomDeliveryWindowDetail): self.CustomDeliveryWindowDetail = CustomDeliveryWindowDetail + def export(self, outfile, level, namespace_='ns:', name_='ShipmentSpecialServicesRequested', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ShipmentSpecialServicesRequested') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ShipmentSpecialServicesRequested'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ShipmentSpecialServicesRequested', fromsubclass_=False): + for SpecialServiceTypes_ in self.SpecialServiceTypes: + showIndent(outfile, level) + outfile.write('<%sSpecialServiceTypes>%s\n' % (namespace_, self.gds_format_string(quote_xml(SpecialServiceTypes_).encode(ExternalEncoding), input_name='SpecialServiceTypes'), namespace_)) + if self.CodDetail: + self.CodDetail.export(outfile, level, namespace_, name_='CodDetail') + if self.HoldAtLocationDetail: + self.HoldAtLocationDetail.export(outfile, level, namespace_, name_='HoldAtLocationDetail') + if self.EMailNotificationDetail: + self.EMailNotificationDetail.export(outfile, level, namespace_, name_='EMailNotificationDetail') + if self.ReturnShipmentDetail: + self.ReturnShipmentDetail.export(outfile, level, namespace_, name_='ReturnShipmentDetail') + if self.PendingShipmentDetail: + self.PendingShipmentDetail.export(outfile, level, namespace_, name_='PendingShipmentDetail') + if self.ShipmentDryIceDetail: + self.ShipmentDryIceDetail.export(outfile, level, namespace_, name_='ShipmentDryIceDetail') + if self.HomeDeliveryPremiumDetail: + self.HomeDeliveryPremiumDetail.export(outfile, level, namespace_, name_='HomeDeliveryPremiumDetail') + if self.FlatbedTrailerDetail: + self.FlatbedTrailerDetail.export(outfile, level, namespace_, name_='FlatbedTrailerDetail') + if self.FreightGuaranteeDetail: + self.FreightGuaranteeDetail.export(outfile, level, namespace_, name_='FreightGuaranteeDetail') + if self.EtdDetail: + self.EtdDetail.export(outfile, level, namespace_, name_='EtdDetail') + if self.CustomDeliveryWindowDetail: + self.CustomDeliveryWindowDetail.export(outfile, level, namespace_, name_='CustomDeliveryWindowDetail') + def hasContent_(self): + if ( + self.SpecialServiceTypes or + self.CodDetail is not None or + self.HoldAtLocationDetail is not None or + self.EMailNotificationDetail is not None or + self.ReturnShipmentDetail is not None or + self.PendingShipmentDetail is not None or + self.ShipmentDryIceDetail is not None or + self.HomeDeliveryPremiumDetail is not None or + self.FlatbedTrailerDetail is not None or + self.FreightGuaranteeDetail is not None or + self.EtdDetail is not None or + self.CustomDeliveryWindowDetail is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ShipmentSpecialServicesRequested'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('SpecialServiceTypes=[\n') + level += 1 + for SpecialServiceTypes_ in self.SpecialServiceTypes: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(SpecialServiceTypes_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.CodDetail is not None: + showIndent(outfile, level) + outfile.write('CodDetail=model_.CodDetail(\n') + self.CodDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.HoldAtLocationDetail is not None: + showIndent(outfile, level) + outfile.write('HoldAtLocationDetail=model_.HoldAtLocationDetail(\n') + self.HoldAtLocationDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.EMailNotificationDetail is not None: + showIndent(outfile, level) + outfile.write('EMailNotificationDetail=model_.EMailNotificationDetail(\n') + self.EMailNotificationDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ReturnShipmentDetail is not None: + showIndent(outfile, level) + outfile.write('ReturnShipmentDetail=model_.ReturnShipmentDetail(\n') + self.ReturnShipmentDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.PendingShipmentDetail is not None: + showIndent(outfile, level) + outfile.write('PendingShipmentDetail=model_.PendingShipmentDetail(\n') + self.PendingShipmentDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ShipmentDryIceDetail is not None: + showIndent(outfile, level) + outfile.write('ShipmentDryIceDetail=model_.ShipmentDryIceDetail(\n') + self.ShipmentDryIceDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.HomeDeliveryPremiumDetail is not None: + showIndent(outfile, level) + outfile.write('HomeDeliveryPremiumDetail=model_.HomeDeliveryPremiumDetail(\n') + self.HomeDeliveryPremiumDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.FlatbedTrailerDetail is not None: + showIndent(outfile, level) + outfile.write('FlatbedTrailerDetail=model_.FlatbedTrailerDetail(\n') + self.FlatbedTrailerDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.FreightGuaranteeDetail is not None: + showIndent(outfile, level) + outfile.write('FreightGuaranteeDetail=model_.FreightGuaranteeDetail(\n') + self.FreightGuaranteeDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.EtdDetail is not None: + showIndent(outfile, level) + outfile.write('EtdDetail=model_.EtdDetail(\n') + self.EtdDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.CustomDeliveryWindowDetail is not None: + showIndent(outfile, level) + outfile.write('CustomDeliveryWindowDetail=model_.CustomDeliveryWindowDetail(\n') + self.CustomDeliveryWindowDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'SpecialServiceTypes': + SpecialServiceTypes_ = child_.text + SpecialServiceTypes_ = self.gds_validate_string(SpecialServiceTypes_, node, 'SpecialServiceTypes') + self.SpecialServiceTypes.append(SpecialServiceTypes_) + self.validate_ShipmentSpecialServiceType(self.SpecialServiceTypes) # validate type ShipmentSpecialServiceType + elif nodeName_ == 'CodDetail': + obj_ = CodDetail.factory() + obj_.build(child_) + self.set_CodDetail(obj_) + elif nodeName_ == 'HoldAtLocationDetail': + obj_ = HoldAtLocationDetail.factory() + obj_.build(child_) + self.set_HoldAtLocationDetail(obj_) + elif nodeName_ == 'EMailNotificationDetail': + obj_ = EMailNotificationDetail.factory() + obj_.build(child_) + self.set_EMailNotificationDetail(obj_) + elif nodeName_ == 'ReturnShipmentDetail': + obj_ = ReturnShipmentDetail.factory() + obj_.build(child_) + self.set_ReturnShipmentDetail(obj_) + elif nodeName_ == 'PendingShipmentDetail': + obj_ = PendingShipmentDetail.factory() + obj_.build(child_) + self.set_PendingShipmentDetail(obj_) + elif nodeName_ == 'ShipmentDryIceDetail': + obj_ = ShipmentDryIceDetail.factory() + obj_.build(child_) + self.set_ShipmentDryIceDetail(obj_) + elif nodeName_ == 'HomeDeliveryPremiumDetail': + obj_ = HomeDeliveryPremiumDetail.factory() + obj_.build(child_) + self.set_HomeDeliveryPremiumDetail(obj_) + elif nodeName_ == 'FlatbedTrailerDetail': + obj_ = FlatbedTrailerDetail.factory() + obj_.build(child_) + self.set_FlatbedTrailerDetail(obj_) + elif nodeName_ == 'FreightGuaranteeDetail': + obj_ = FreightGuaranteeDetail.factory() + obj_.build(child_) + self.set_FreightGuaranteeDetail(obj_) + elif nodeName_ == 'EtdDetail': + obj_ = EtdDetail.factory() + obj_.build(child_) + self.set_EtdDetail(obj_) + elif nodeName_ == 'CustomDeliveryWindowDetail': + obj_ = CustomDeliveryWindowDetail.factory() + obj_.build(child_) + self.set_CustomDeliveryWindowDetail(obj_) +# end class ShipmentSpecialServicesRequested + + +class ShippingDocumentDispositionDetail(GeneratedsSuper): + """Each occurrence of this class specifies a particular way in which a + kind of shipping document is to be produced and provided.""" + subclass = None + superclass = None + def __init__(self, DispositionType=None, Grouping=None, EMailDetail=None, PrintDetail=None): + self.DispositionType = DispositionType + self.Grouping = Grouping + self.EMailDetail = EMailDetail + self.PrintDetail = PrintDetail + def factory(*args_, **kwargs_): + if ShippingDocumentDispositionDetail.subclass: + return ShippingDocumentDispositionDetail.subclass(*args_, **kwargs_) + else: + return ShippingDocumentDispositionDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_DispositionType(self): return self.DispositionType + def set_DispositionType(self, DispositionType): self.DispositionType = DispositionType + def validate_ShippingDocumentDispositionType(self, value): + # Validate type ShippingDocumentDispositionType, a restriction on xs:string. + pass + def get_Grouping(self): return self.Grouping + def set_Grouping(self, Grouping): self.Grouping = Grouping + def validate_ShippingDocumentGroupingType(self, value): + # Validate type ShippingDocumentGroupingType, a restriction on xs:string. + pass + def get_EMailDetail(self): return self.EMailDetail + def set_EMailDetail(self, EMailDetail): self.EMailDetail = EMailDetail + def get_PrintDetail(self): return self.PrintDetail + def set_PrintDetail(self, PrintDetail): self.PrintDetail = PrintDetail + def export(self, outfile, level, namespace_='ns:', name_='ShippingDocumentDispositionDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ShippingDocumentDispositionDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ShippingDocumentDispositionDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ShippingDocumentDispositionDetail', fromsubclass_=False): + if self.DispositionType is not None: + showIndent(outfile, level) + outfile.write('<%sDispositionType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DispositionType).encode(ExternalEncoding), input_name='DispositionType'), namespace_)) + if self.Grouping is not None: + showIndent(outfile, level) + outfile.write('<%sGrouping>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Grouping).encode(ExternalEncoding), input_name='Grouping'), namespace_)) + if self.EMailDetail: + self.EMailDetail.export(outfile, level, namespace_, name_='EMailDetail') + if self.PrintDetail: + self.PrintDetail.export(outfile, level, namespace_, name_='PrintDetail') + def hasContent_(self): + if ( + self.DispositionType is not None or + self.Grouping is not None or + self.EMailDetail is not None or + self.PrintDetail is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ShippingDocumentDispositionDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.DispositionType is not None: + showIndent(outfile, level) + outfile.write('DispositionType=%s,\n' % quote_python(self.DispositionType).encode(ExternalEncoding)) + if self.Grouping is not None: + showIndent(outfile, level) + outfile.write('Grouping=%s,\n' % quote_python(self.Grouping).encode(ExternalEncoding)) + if self.EMailDetail is not None: + showIndent(outfile, level) + outfile.write('EMailDetail=model_.ShippingDocumentEMailDetail(\n') + self.EMailDetail.exportLiteral(outfile, level, name_='EMailDetail') + showIndent(outfile, level) + outfile.write('),\n') + if self.PrintDetail is not None: + showIndent(outfile, level) + outfile.write('PrintDetail=model_.ShippingDocumentPrintDetail(\n') + self.PrintDetail.exportLiteral(outfile, level, name_='PrintDetail') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'DispositionType': + DispositionType_ = child_.text + DispositionType_ = self.gds_validate_string(DispositionType_, node, 'DispositionType') + self.DispositionType = DispositionType_ + self.validate_ShippingDocumentDispositionType(self.DispositionType) # validate type ShippingDocumentDispositionType + elif nodeName_ == 'Grouping': + Grouping_ = child_.text + Grouping_ = self.gds_validate_string(Grouping_, node, 'Grouping') + self.Grouping = Grouping_ + self.validate_ShippingDocumentGroupingType(self.Grouping) # validate type ShippingDocumentGroupingType + elif nodeName_ == 'EMailDetail': + obj_ = ShippingDocumentEMailDetail.factory() + obj_.build(child_) + self.set_EMailDetail(obj_) + elif nodeName_ == 'PrintDetail': + obj_ = ShippingDocumentPrintDetail.factory() + obj_.build(child_) + self.set_PrintDetail(obj_) +# end class ShippingDocumentDispositionDetail + + +class ShippingDocumentEMailDetail(GeneratedsSuper): + """Specifies how to e-mail shipping documents.""" + subclass = None + superclass = None + def __init__(self, EMailRecipients=None, Grouping=None): + if EMailRecipients is None: + self.EMailRecipients = [] + else: + self.EMailRecipients = EMailRecipients + self.Grouping = Grouping + def factory(*args_, **kwargs_): + if ShippingDocumentEMailDetail.subclass: + return ShippingDocumentEMailDetail.subclass(*args_, **kwargs_) + else: + return ShippingDocumentEMailDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_EMailRecipients(self): return self.EMailRecipients + def set_EMailRecipients(self, EMailRecipients): self.EMailRecipients = EMailRecipients + def add_EMailRecipients(self, value): self.EMailRecipients.append(value) + def insert_EMailRecipients(self, index, value): self.EMailRecipients[index] = value + def get_Grouping(self): return self.Grouping + def set_Grouping(self, Grouping): self.Grouping = Grouping + def validate_ShippingDocumentEMailGroupingType(self, value): + # Validate type ShippingDocumentEMailGroupingType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='ShippingDocumentEMailDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ShippingDocumentEMailDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ShippingDocumentEMailDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ShippingDocumentEMailDetail', fromsubclass_=False): + for EMailRecipients_ in self.EMailRecipients: + EMailRecipients_.export(outfile, level, namespace_, name_='EMailRecipients') + if self.Grouping is not None: + showIndent(outfile, level) + outfile.write('<%sGrouping>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Grouping).encode(ExternalEncoding), input_name='Grouping'), namespace_)) + def hasContent_(self): + if ( + self.EMailRecipients or + self.Grouping is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ShippingDocumentEMailDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('EMailRecipients=[\n') + level += 1 + for EMailRecipients_ in self.EMailRecipients: + showIndent(outfile, level) + outfile.write('model_.ShippingDocumentEMailRecipient(\n') + EMailRecipients_.exportLiteral(outfile, level, name_='ShippingDocumentEMailRecipient') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.Grouping is not None: + showIndent(outfile, level) + outfile.write('Grouping=%s,\n' % quote_python(self.Grouping).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'EMailRecipients': + obj_ = ShippingDocumentEMailRecipient.factory() + obj_.build(child_) + self.EMailRecipients.append(obj_) + elif nodeName_ == 'Grouping': + Grouping_ = child_.text + Grouping_ = self.gds_validate_string(Grouping_, node, 'Grouping') + self.Grouping = Grouping_ + self.validate_ShippingDocumentEMailGroupingType(self.Grouping) # validate type ShippingDocumentEMailGroupingType +# end class ShippingDocumentEMailDetail + + +class ShippingDocumentEMailRecipient(GeneratedsSuper): + """Specifies an individual recipient of e-mailed shipping document(s).""" + subclass = None + superclass = None + def __init__(self, RecipientType=None, Address=None): + self.RecipientType = RecipientType + self.Address = Address + def factory(*args_, **kwargs_): + if ShippingDocumentEMailRecipient.subclass: + return ShippingDocumentEMailRecipient.subclass(*args_, **kwargs_) + else: + return ShippingDocumentEMailRecipient(*args_, **kwargs_) + factory = staticmethod(factory) + def get_RecipientType(self): return self.RecipientType + def set_RecipientType(self, RecipientType): self.RecipientType = RecipientType + def validate_EMailNotificationRecipientType(self, value): + # Validate type EMailNotificationRecipientType, a restriction on xs:string. + pass + def get_Address(self): return self.Address + def set_Address(self, Address): self.Address = Address + def export(self, outfile, level, namespace_='ns:', name_='ShippingDocumentEMailRecipient', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ShippingDocumentEMailRecipient') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ShippingDocumentEMailRecipient'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ShippingDocumentEMailRecipient', fromsubclass_=False): + if self.RecipientType is not None: + showIndent(outfile, level) + outfile.write('<%sRecipientType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RecipientType).encode(ExternalEncoding), input_name='RecipientType'), namespace_)) + if self.Address is not None: + showIndent(outfile, level) + outfile.write('<%sAddress>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Address).encode(ExternalEncoding), input_name='Address'), namespace_)) + def hasContent_(self): + if ( + self.RecipientType is not None or + self.Address is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ShippingDocumentEMailRecipient'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.RecipientType is not None: + showIndent(outfile, level) + outfile.write('RecipientType=%s,\n' % quote_python(self.RecipientType).encode(ExternalEncoding)) + if self.Address is not None: + showIndent(outfile, level) + outfile.write('Address=%s,\n' % quote_python(self.Address).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'RecipientType': + RecipientType_ = child_.text + RecipientType_ = self.gds_validate_string(RecipientType_, node, 'RecipientType') + self.RecipientType = RecipientType_ + self.validate_EMailNotificationRecipientType(self.RecipientType) # validate type EMailNotificationRecipientType + elif nodeName_ == 'Address': + Address_ = child_.text + Address_ = self.gds_validate_string(Address_, node, 'Address') + self.Address = Address_ +# end class ShippingDocumentEMailRecipient + + +class ShippingDocumentFormat(GeneratedsSuper): + """Specifies characteristics of a shipping document to be produced.""" + subclass = None + superclass = None + def __init__(self, Dispositions=None, TopOfPageOffset=None, ImageType=None, StockType=None, ProvideInstructions=None, Localization=None): + if Dispositions is None: + self.Dispositions = [] + else: + self.Dispositions = Dispositions + self.TopOfPageOffset = TopOfPageOffset + self.ImageType = ImageType + self.StockType = StockType + self.ProvideInstructions = ProvideInstructions + self.Localization = Localization + def factory(*args_, **kwargs_): + if ShippingDocumentFormat.subclass: + return ShippingDocumentFormat.subclass(*args_, **kwargs_) + else: + return ShippingDocumentFormat(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Dispositions(self): return self.Dispositions + def set_Dispositions(self, Dispositions): self.Dispositions = Dispositions + def add_Dispositions(self, value): self.Dispositions.append(value) + def insert_Dispositions(self, index, value): self.Dispositions[index] = value + def get_TopOfPageOffset(self): return self.TopOfPageOffset + def set_TopOfPageOffset(self, TopOfPageOffset): self.TopOfPageOffset = TopOfPageOffset + def get_ImageType(self): return self.ImageType + def set_ImageType(self, ImageType): self.ImageType = ImageType + def validate_ShippingDocumentImageType(self, value): + # Validate type ShippingDocumentImageType, a restriction on xs:string. + pass + def get_StockType(self): return self.StockType + def set_StockType(self, StockType): self.StockType = StockType + def validate_ShippingDocumentStockType(self, value): + # Validate type ShippingDocumentStockType, a restriction on xs:string. + pass + def get_ProvideInstructions(self): return self.ProvideInstructions + def set_ProvideInstructions(self, ProvideInstructions): self.ProvideInstructions = ProvideInstructions + def get_Localization(self): return self.Localization + def set_Localization(self, Localization): self.Localization = Localization + def export(self, outfile, level, namespace_='ns:', name_='ShippingDocumentFormat', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ShippingDocumentFormat') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ShippingDocumentFormat'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ShippingDocumentFormat', fromsubclass_=False): + for Dispositions_ in self.Dispositions: + Dispositions_.export(outfile, level, namespace_, name_='Dispositions') + if self.TopOfPageOffset: + self.TopOfPageOffset.export(outfile, level, namespace_, name_='TopOfPageOffset') + if self.ImageType is not None: + showIndent(outfile, level) + outfile.write('<%sImageType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ImageType).encode(ExternalEncoding), input_name='ImageType'), namespace_)) + if self.StockType is not None: + showIndent(outfile, level) + outfile.write('<%sStockType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.StockType).encode(ExternalEncoding), input_name='StockType'), namespace_)) + if self.ProvideInstructions is not None: + showIndent(outfile, level) + outfile.write('<%sProvideInstructions>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.ProvideInstructions)), input_name='ProvideInstructions'), namespace_)) + if self.Localization: + self.Localization.export(outfile, level, namespace_, name_='Localization') + def hasContent_(self): + if ( + self.Dispositions or + self.TopOfPageOffset is not None or + self.ImageType is not None or + self.StockType is not None or + self.ProvideInstructions is not None or + self.Localization is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ShippingDocumentFormat'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('Dispositions=[\n') + level += 1 + for Dispositions_ in self.Dispositions: + showIndent(outfile, level) + outfile.write('model_.ShippingDocumentDispositionDetail(\n') + Dispositions_.exportLiteral(outfile, level, name_='ShippingDocumentDispositionDetail') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.TopOfPageOffset is not None: + showIndent(outfile, level) + outfile.write('TopOfPageOffset=model_.LinearMeasure(\n') + self.TopOfPageOffset.exportLiteral(outfile, level, name_='TopOfPageOffset') + showIndent(outfile, level) + outfile.write('),\n') + if self.ImageType is not None: + showIndent(outfile, level) + outfile.write('ImageType=%s,\n' % quote_python(self.ImageType).encode(ExternalEncoding)) + if self.StockType is not None: + showIndent(outfile, level) + outfile.write('StockType=%s,\n' % quote_python(self.StockType).encode(ExternalEncoding)) + if self.ProvideInstructions is not None: + showIndent(outfile, level) + outfile.write('ProvideInstructions=%s,\n' % self.ProvideInstructions) + if self.Localization is not None: + showIndent(outfile, level) + outfile.write('Localization=model_.Localization(\n') + self.Localization.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Dispositions': + obj_ = ShippingDocumentDispositionDetail.factory() + obj_.build(child_) + self.Dispositions.append(obj_) + elif nodeName_ == 'TopOfPageOffset': + obj_ = LinearMeasure.factory() + obj_.build(child_) + self.set_TopOfPageOffset(obj_) + elif nodeName_ == 'ImageType': + ImageType_ = child_.text + ImageType_ = self.gds_validate_string(ImageType_, node, 'ImageType') + self.ImageType = ImageType_ + self.validate_ShippingDocumentImageType(self.ImageType) # validate type ShippingDocumentImageType + elif nodeName_ == 'StockType': + StockType_ = child_.text + StockType_ = self.gds_validate_string(StockType_, node, 'StockType') + self.StockType = StockType_ + self.validate_ShippingDocumentStockType(self.StockType) # validate type ShippingDocumentStockType + elif nodeName_ == 'ProvideInstructions': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'ProvideInstructions') + self.ProvideInstructions = ival_ + elif nodeName_ == 'Localization': + obj_ = Localization.factory() + obj_.build(child_) + self.set_Localization(obj_) +# end class ShippingDocumentFormat + + +class ShippingDocumentPrintDetail(GeneratedsSuper): + """Specifies printing options for a shipping document.""" + subclass = None + superclass = None + def __init__(self, PrinterId=None): + self.PrinterId = PrinterId + def factory(*args_, **kwargs_): + if ShippingDocumentPrintDetail.subclass: + return ShippingDocumentPrintDetail.subclass(*args_, **kwargs_) + else: + return ShippingDocumentPrintDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_PrinterId(self): return self.PrinterId + def set_PrinterId(self, PrinterId): self.PrinterId = PrinterId + def export(self, outfile, level, namespace_='ns:', name_='ShippingDocumentPrintDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ShippingDocumentPrintDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ShippingDocumentPrintDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ShippingDocumentPrintDetail', fromsubclass_=False): + if self.PrinterId is not None: + showIndent(outfile, level) + outfile.write('<%sPrinterId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PrinterId).encode(ExternalEncoding), input_name='PrinterId'), namespace_)) + def hasContent_(self): + if ( + self.PrinterId is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ShippingDocumentPrintDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.PrinterId is not None: + showIndent(outfile, level) + outfile.write('PrinterId=%s,\n' % quote_python(self.PrinterId).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'PrinterId': + PrinterId_ = child_.text + PrinterId_ = self.gds_validate_string(PrinterId_, node, 'PrinterId') + self.PrinterId = PrinterId_ +# end class ShippingDocumentPrintDetail + + +class ShippingDocumentSpecification(GeneratedsSuper): + """Contains all data required for additional (non-label) shipping + documents to be produced in conjunction with a specific + shipment.""" + subclass = None + superclass = None + def __init__(self, ShippingDocumentTypes=None, CertificateOfOrigin=None, CommercialInvoiceDetail=None, CustomPackageDocumentDetail=None, CustomShipmentDocumentDetail=None, GeneralAgencyAgreementDetail=None, NaftaCertificateOfOriginDetail=None, Op900Detail=None): + if ShippingDocumentTypes is None: + self.ShippingDocumentTypes = [] + else: + self.ShippingDocumentTypes = ShippingDocumentTypes + self.CertificateOfOrigin = CertificateOfOrigin + self.CommercialInvoiceDetail = CommercialInvoiceDetail + if CustomPackageDocumentDetail is None: + self.CustomPackageDocumentDetail = [] + else: + self.CustomPackageDocumentDetail = CustomPackageDocumentDetail + if CustomShipmentDocumentDetail is None: + self.CustomShipmentDocumentDetail = [] + else: + self.CustomShipmentDocumentDetail = CustomShipmentDocumentDetail + self.GeneralAgencyAgreementDetail = GeneralAgencyAgreementDetail + self.NaftaCertificateOfOriginDetail = NaftaCertificateOfOriginDetail + self.Op900Detail = Op900Detail + def factory(*args_, **kwargs_): + if ShippingDocumentSpecification.subclass: + return ShippingDocumentSpecification.subclass(*args_, **kwargs_) + else: + return ShippingDocumentSpecification(*args_, **kwargs_) + factory = staticmethod(factory) + def get_ShippingDocumentTypes(self): return self.ShippingDocumentTypes + def set_ShippingDocumentTypes(self, ShippingDocumentTypes): self.ShippingDocumentTypes = ShippingDocumentTypes + def add_ShippingDocumentTypes(self, value): self.ShippingDocumentTypes.append(value) + def insert_ShippingDocumentTypes(self, index, value): self.ShippingDocumentTypes[index] = value + def validate_RequestedShippingDocumentType(self, value): + # Validate type RequestedShippingDocumentType, a restriction on xs:string. + pass + def get_CertificateOfOrigin(self): return self.CertificateOfOrigin + def set_CertificateOfOrigin(self, CertificateOfOrigin): self.CertificateOfOrigin = CertificateOfOrigin + def get_CommercialInvoiceDetail(self): return self.CommercialInvoiceDetail + def set_CommercialInvoiceDetail(self, CommercialInvoiceDetail): self.CommercialInvoiceDetail = CommercialInvoiceDetail + def get_CustomPackageDocumentDetail(self): return self.CustomPackageDocumentDetail + def set_CustomPackageDocumentDetail(self, CustomPackageDocumentDetail): self.CustomPackageDocumentDetail = CustomPackageDocumentDetail + def add_CustomPackageDocumentDetail(self, value): self.CustomPackageDocumentDetail.append(value) + def insert_CustomPackageDocumentDetail(self, index, value): self.CustomPackageDocumentDetail[index] = value + def get_CustomShipmentDocumentDetail(self): return self.CustomShipmentDocumentDetail + def set_CustomShipmentDocumentDetail(self, CustomShipmentDocumentDetail): self.CustomShipmentDocumentDetail = CustomShipmentDocumentDetail + def add_CustomShipmentDocumentDetail(self, value): self.CustomShipmentDocumentDetail.append(value) + def insert_CustomShipmentDocumentDetail(self, index, value): self.CustomShipmentDocumentDetail[index] = value + def get_GeneralAgencyAgreementDetail(self): return self.GeneralAgencyAgreementDetail + def set_GeneralAgencyAgreementDetail(self, GeneralAgencyAgreementDetail): self.GeneralAgencyAgreementDetail = GeneralAgencyAgreementDetail + def get_NaftaCertificateOfOriginDetail(self): return self.NaftaCertificateOfOriginDetail + def set_NaftaCertificateOfOriginDetail(self, NaftaCertificateOfOriginDetail): self.NaftaCertificateOfOriginDetail = NaftaCertificateOfOriginDetail + def get_Op900Detail(self): return self.Op900Detail + def set_Op900Detail(self, Op900Detail): self.Op900Detail = Op900Detail + def export(self, outfile, level, namespace_='ns:', name_='ShippingDocumentSpecification', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ShippingDocumentSpecification') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ShippingDocumentSpecification'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ShippingDocumentSpecification', fromsubclass_=False): + for ShippingDocumentTypes_ in self.ShippingDocumentTypes: + showIndent(outfile, level) + outfile.write('<%sShippingDocumentTypes>%s\n' % (namespace_, self.gds_format_string(quote_xml(ShippingDocumentTypes_).encode(ExternalEncoding), input_name='ShippingDocumentTypes'), namespace_)) + if self.CertificateOfOrigin: + self.CertificateOfOrigin.export(outfile, level, namespace_, name_='CertificateOfOrigin') + if self.CommercialInvoiceDetail: + self.CommercialInvoiceDetail.export(outfile, level, namespace_, name_='CommercialInvoiceDetail') + for CustomPackageDocumentDetail_ in self.CustomPackageDocumentDetail: + CustomPackageDocumentDetail_.export(outfile, level, namespace_, name_='CustomPackageDocumentDetail') + for CustomShipmentDocumentDetail_ in self.CustomShipmentDocumentDetail: + CustomShipmentDocumentDetail_.export(outfile, level, namespace_, name_='CustomShipmentDocumentDetail') + if self.GeneralAgencyAgreementDetail: + self.GeneralAgencyAgreementDetail.export(outfile, level, namespace_, name_='GeneralAgencyAgreementDetail') + if self.NaftaCertificateOfOriginDetail: + self.NaftaCertificateOfOriginDetail.export(outfile, level, namespace_, name_='NaftaCertificateOfOriginDetail') + if self.Op900Detail: + self.Op900Detail.export(outfile, level, namespace_, name_='Op900Detail') + def hasContent_(self): + if ( + self.ShippingDocumentTypes or + self.CertificateOfOrigin is not None or + self.CommercialInvoiceDetail is not None or + self.CustomPackageDocumentDetail or + self.CustomShipmentDocumentDetail or + self.GeneralAgencyAgreementDetail is not None or + self.NaftaCertificateOfOriginDetail is not None or + self.Op900Detail is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ShippingDocumentSpecification'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('ShippingDocumentTypes=[\n') + level += 1 + for ShippingDocumentTypes_ in self.ShippingDocumentTypes: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(ShippingDocumentTypes_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.CertificateOfOrigin is not None: + showIndent(outfile, level) + outfile.write('CertificateOfOrigin=model_.CertificateOfOriginDetail(\n') + self.CertificateOfOrigin.exportLiteral(outfile, level, name_='CertificateOfOrigin') + showIndent(outfile, level) + outfile.write('),\n') + if self.CommercialInvoiceDetail is not None: + showIndent(outfile, level) + outfile.write('CommercialInvoiceDetail=model_.CommercialInvoiceDetail(\n') + self.CommercialInvoiceDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('CustomPackageDocumentDetail=[\n') + level += 1 + for CustomPackageDocumentDetail_ in self.CustomPackageDocumentDetail: + showIndent(outfile, level) + outfile.write('model_.CustomDocumentDetail(\n') + CustomPackageDocumentDetail_.exportLiteral(outfile, level, name_='CustomDocumentDetail') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('CustomShipmentDocumentDetail=[\n') + level += 1 + for CustomShipmentDocumentDetail_ in self.CustomShipmentDocumentDetail: + showIndent(outfile, level) + outfile.write('model_.CustomDocumentDetail(\n') + CustomShipmentDocumentDetail_.exportLiteral(outfile, level, name_='CustomDocumentDetail') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.GeneralAgencyAgreementDetail is not None: + showIndent(outfile, level) + outfile.write('GeneralAgencyAgreementDetail=model_.GeneralAgencyAgreementDetail(\n') + self.GeneralAgencyAgreementDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.NaftaCertificateOfOriginDetail is not None: + showIndent(outfile, level) + outfile.write('NaftaCertificateOfOriginDetail=model_.NaftaCertificateOfOriginDetail(\n') + self.NaftaCertificateOfOriginDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Op900Detail is not None: + showIndent(outfile, level) + outfile.write('Op900Detail=model_.Op900Detail(\n') + self.Op900Detail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'ShippingDocumentTypes': + ShippingDocumentTypes_ = child_.text + ShippingDocumentTypes_ = self.gds_validate_string(ShippingDocumentTypes_, node, 'ShippingDocumentTypes') + self.ShippingDocumentTypes.append(ShippingDocumentTypes_) + self.validate_RequestedShippingDocumentType(self.ShippingDocumentTypes) # validate type RequestedShippingDocumentType + elif nodeName_ == 'CertificateOfOrigin': + obj_ = CertificateOfOriginDetail.factory() + obj_.build(child_) + self.set_CertificateOfOrigin(obj_) + elif nodeName_ == 'CommercialInvoiceDetail': + obj_ = CommercialInvoiceDetail.factory() + obj_.build(child_) + self.set_CommercialInvoiceDetail(obj_) + elif nodeName_ == 'CustomPackageDocumentDetail': + obj_ = CustomDocumentDetail.factory() + obj_.build(child_) + self.CustomPackageDocumentDetail.append(obj_) + elif nodeName_ == 'CustomShipmentDocumentDetail': + obj_ = CustomDocumentDetail.factory() + obj_.build(child_) + self.CustomShipmentDocumentDetail.append(obj_) + elif nodeName_ == 'GeneralAgencyAgreementDetail': + obj_ = GeneralAgencyAgreementDetail.factory() + obj_.build(child_) + self.set_GeneralAgencyAgreementDetail(obj_) + elif nodeName_ == 'NaftaCertificateOfOriginDetail': + obj_ = NaftaCertificateOfOriginDetail.factory() + obj_.build(child_) + self.set_NaftaCertificateOfOriginDetail(obj_) + elif nodeName_ == 'Op900Detail': + obj_ = Op900Detail.factory() + obj_.build(child_) + self.set_Op900Detail(obj_) +# end class ShippingDocumentSpecification + + +class SignatureOptionDetail(GeneratedsSuper): + """The descriptive data required for FedEx delivery signature services.""" + subclass = None + superclass = None + def __init__(self, OptionType=None, SignatureReleaseNumber=None): + self.OptionType = OptionType + self.SignatureReleaseNumber = SignatureReleaseNumber + def factory(*args_, **kwargs_): + if SignatureOptionDetail.subclass: + return SignatureOptionDetail.subclass(*args_, **kwargs_) + else: + return SignatureOptionDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_OptionType(self): return self.OptionType + def set_OptionType(self, OptionType): self.OptionType = OptionType + def validate_SignatureOptionType(self, value): + # Validate type SignatureOptionType, a restriction on xs:string. + pass + def get_SignatureReleaseNumber(self): return self.SignatureReleaseNumber + def set_SignatureReleaseNumber(self, SignatureReleaseNumber): self.SignatureReleaseNumber = SignatureReleaseNumber + def export(self, outfile, level, namespace_='ns:', name_='SignatureOptionDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='SignatureOptionDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='SignatureOptionDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='SignatureOptionDetail', fromsubclass_=False): + if self.OptionType is not None: + showIndent(outfile, level) + outfile.write('<%sOptionType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.OptionType).encode(ExternalEncoding), input_name='OptionType'), namespace_)) + if self.SignatureReleaseNumber is not None: + showIndent(outfile, level) + outfile.write('<%sSignatureReleaseNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.SignatureReleaseNumber).encode(ExternalEncoding), input_name='SignatureReleaseNumber'), namespace_)) + def hasContent_(self): + if ( + self.OptionType is not None or + self.SignatureReleaseNumber is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='SignatureOptionDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.OptionType is not None: + showIndent(outfile, level) + outfile.write('OptionType=%s,\n' % quote_python(self.OptionType).encode(ExternalEncoding)) + if self.SignatureReleaseNumber is not None: + showIndent(outfile, level) + outfile.write('SignatureReleaseNumber=%s,\n' % quote_python(self.SignatureReleaseNumber).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'OptionType': + OptionType_ = child_.text + OptionType_ = self.gds_validate_string(OptionType_, node, 'OptionType') + self.OptionType = OptionType_ + self.validate_SignatureOptionType(self.OptionType) # validate type SignatureOptionType + elif nodeName_ == 'SignatureReleaseNumber': + SignatureReleaseNumber_ = child_.text + SignatureReleaseNumber_ = self.gds_validate_string(SignatureReleaseNumber_, node, 'SignatureReleaseNumber') + self.SignatureReleaseNumber = SignatureReleaseNumber_ +# end class SignatureOptionDetail + + +class SmartPostShipmentDetail(GeneratedsSuper): + """Data required for shipments handled under the SMART_POST and + GROUND_SMART_POST service types.""" + subclass = None + superclass = None + def __init__(self, Indicia=None, AncillaryEndorsement=None, HubId=None, CustomerManifestId=None): + self.Indicia = Indicia + self.AncillaryEndorsement = AncillaryEndorsement + self.HubId = HubId + self.CustomerManifestId = CustomerManifestId + def factory(*args_, **kwargs_): + if SmartPostShipmentDetail.subclass: + return SmartPostShipmentDetail.subclass(*args_, **kwargs_) + else: + return SmartPostShipmentDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Indicia(self): return self.Indicia + def set_Indicia(self, Indicia): self.Indicia = Indicia + def validate_SmartPostIndiciaType(self, value): + # Validate type SmartPostIndiciaType, a restriction on xs:string. + pass + def get_AncillaryEndorsement(self): return self.AncillaryEndorsement + def set_AncillaryEndorsement(self, AncillaryEndorsement): self.AncillaryEndorsement = AncillaryEndorsement + def validate_SmartPostAncillaryEndorsementType(self, value): + # Validate type SmartPostAncillaryEndorsementType, a restriction on xs:string. + pass + def get_HubId(self): return self.HubId + def set_HubId(self, HubId): self.HubId = HubId + def get_CustomerManifestId(self): return self.CustomerManifestId + def set_CustomerManifestId(self, CustomerManifestId): self.CustomerManifestId = CustomerManifestId + def export(self, outfile, level, namespace_='ns:', name_='SmartPostShipmentDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='SmartPostShipmentDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='SmartPostShipmentDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='SmartPostShipmentDetail', fromsubclass_=False): + if self.Indicia is not None: + showIndent(outfile, level) + outfile.write('<%sIndicia>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Indicia).encode(ExternalEncoding), input_name='Indicia'), namespace_)) + if self.AncillaryEndorsement is not None: + showIndent(outfile, level) + outfile.write('<%sAncillaryEndorsement>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AncillaryEndorsement).encode(ExternalEncoding), input_name='AncillaryEndorsement'), namespace_)) + if self.HubId is not None: + showIndent(outfile, level) + outfile.write('<%sHubId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HubId).encode(ExternalEncoding), input_name='HubId'), namespace_)) + if self.CustomerManifestId is not None: + showIndent(outfile, level) + outfile.write('<%sCustomerManifestId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CustomerManifestId).encode(ExternalEncoding), input_name='CustomerManifestId'), namespace_)) + def hasContent_(self): + if ( + self.Indicia is not None or + self.AncillaryEndorsement is not None or + self.HubId is not None or + self.CustomerManifestId is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='SmartPostShipmentDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Indicia is not None: + showIndent(outfile, level) + outfile.write('Indicia=%s,\n' % quote_python(self.Indicia).encode(ExternalEncoding)) + if self.AncillaryEndorsement is not None: + showIndent(outfile, level) + outfile.write('AncillaryEndorsement=%s,\n' % quote_python(self.AncillaryEndorsement).encode(ExternalEncoding)) + if self.HubId is not None: + showIndent(outfile, level) + outfile.write('HubId=%s,\n' % quote_python(self.HubId).encode(ExternalEncoding)) + if self.CustomerManifestId is not None: + showIndent(outfile, level) + outfile.write('CustomerManifestId=%s,\n' % quote_python(self.CustomerManifestId).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Indicia': + Indicia_ = child_.text + Indicia_ = self.gds_validate_string(Indicia_, node, 'Indicia') + self.Indicia = Indicia_ + self.validate_SmartPostIndiciaType(self.Indicia) # validate type SmartPostIndiciaType + elif nodeName_ == 'AncillaryEndorsement': + AncillaryEndorsement_ = child_.text + AncillaryEndorsement_ = self.gds_validate_string(AncillaryEndorsement_, node, 'AncillaryEndorsement') + self.AncillaryEndorsement = AncillaryEndorsement_ + self.validate_SmartPostAncillaryEndorsementType(self.AncillaryEndorsement) # validate type SmartPostAncillaryEndorsementType + elif nodeName_ == 'HubId': + HubId_ = child_.text + HubId_ = self.gds_validate_string(HubId_, node, 'HubId') + self.HubId = HubId_ + elif nodeName_ == 'CustomerManifestId': + CustomerManifestId_ = child_.text + CustomerManifestId_ = self.gds_validate_string(CustomerManifestId_, node, 'CustomerManifestId') + self.CustomerManifestId = CustomerManifestId_ +# end class SmartPostShipmentDetail + + +class Surcharge(GeneratedsSuper): + """Identifies each surcharge applied to the shipment.""" + subclass = None + superclass = None + def __init__(self, SurchargeType=None, Level=None, Description=None, Amount=None): + self.SurchargeType = SurchargeType + self.Level = Level + self.Description = Description + self.Amount = Amount + def factory(*args_, **kwargs_): + if Surcharge.subclass: + return Surcharge.subclass(*args_, **kwargs_) + else: + return Surcharge(*args_, **kwargs_) + factory = staticmethod(factory) + def get_SurchargeType(self): return self.SurchargeType + def set_SurchargeType(self, SurchargeType): self.SurchargeType = SurchargeType + def validate_SurchargeType(self, value): + # Validate type SurchargeType, a restriction on xs:string. + pass + def get_Level(self): return self.Level + def set_Level(self, Level): self.Level = Level + def validate_SurchargeLevelType(self, value): + # Validate type SurchargeLevelType, a restriction on xs:string. + pass + def get_Description(self): return self.Description + def set_Description(self, Description): self.Description = Description + def get_Amount(self): return self.Amount + def set_Amount(self, Amount): self.Amount = Amount + def export(self, outfile, level, namespace_='ns:', name_='Surcharge', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Surcharge') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Surcharge'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Surcharge', fromsubclass_=False): + if self.SurchargeType is not None: + showIndent(outfile, level) + outfile.write('<%sSurchargeType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.SurchargeType).encode(ExternalEncoding), input_name='SurchargeType'), namespace_)) + if self.Level is not None: + showIndent(outfile, level) + outfile.write('<%sLevel>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Level).encode(ExternalEncoding), input_name='Level'), namespace_)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('<%sDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Description).encode(ExternalEncoding), input_name='Description'), namespace_)) + if self.Amount: + self.Amount.export(outfile, level, namespace_, name_='Amount') + def hasContent_(self): + if ( + self.SurchargeType is not None or + self.Level is not None or + self.Description is not None or + self.Amount is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Surcharge'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.SurchargeType is not None: + showIndent(outfile, level) + outfile.write('SurchargeType=%s,\n' % quote_python(self.SurchargeType).encode(ExternalEncoding)) + if self.Level is not None: + showIndent(outfile, level) + outfile.write('Level=%s,\n' % quote_python(self.Level).encode(ExternalEncoding)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('Description=%s,\n' % quote_python(self.Description).encode(ExternalEncoding)) + if self.Amount is not None: + showIndent(outfile, level) + outfile.write('Amount=model_.Money(\n') + self.Amount.exportLiteral(outfile, level, name_='Amount') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'SurchargeType': + SurchargeType_ = child_.text + SurchargeType_ = self.gds_validate_string(SurchargeType_, node, 'SurchargeType') + self.SurchargeType = SurchargeType_ + self.validate_SurchargeType(self.SurchargeType) # validate type SurchargeType + elif nodeName_ == 'Level': + Level_ = child_.text + Level_ = self.gds_validate_string(Level_, node, 'Level') + self.Level = Level_ + self.validate_SurchargeLevelType(self.Level) # validate type SurchargeLevelType + elif nodeName_ == 'Description': + Description_ = child_.text + Description_ = self.gds_validate_string(Description_, node, 'Description') + self.Description = Description_ + elif nodeName_ == 'Amount': + obj_ = Money.factory() + obj_.build(child_) + self.set_Amount(obj_) +# end class Surcharge + + +class Tax(GeneratedsSuper): + """Identifies each tax applied to the shipment.""" + subclass = None + superclass = None + def __init__(self, TaxType=None, Description=None, Amount=None): + self.TaxType = TaxType + self.Description = Description + self.Amount = Amount + def factory(*args_, **kwargs_): + if Tax.subclass: + return Tax.subclass(*args_, **kwargs_) + else: + return Tax(*args_, **kwargs_) + factory = staticmethod(factory) + def get_TaxType(self): return self.TaxType + def set_TaxType(self, TaxType): self.TaxType = TaxType + def validate_TaxType(self, value): + # Validate type TaxType, a restriction on xs:string. + pass + def get_Description(self): return self.Description + def set_Description(self, Description): self.Description = Description + def get_Amount(self): return self.Amount + def set_Amount(self, Amount): self.Amount = Amount + def export(self, outfile, level, namespace_='ns:', name_='Tax', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Tax') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Tax'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Tax', fromsubclass_=False): + if self.TaxType is not None: + showIndent(outfile, level) + outfile.write('<%sTaxType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.TaxType).encode(ExternalEncoding), input_name='TaxType'), namespace_)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('<%sDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Description).encode(ExternalEncoding), input_name='Description'), namespace_)) + if self.Amount: + self.Amount.export(outfile, level, namespace_, name_='Amount') + def hasContent_(self): + if ( + self.TaxType is not None or + self.Description is not None or + self.Amount is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Tax'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.TaxType is not None: + showIndent(outfile, level) + outfile.write('TaxType=%s,\n' % quote_python(self.TaxType).encode(ExternalEncoding)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('Description=%s,\n' % quote_python(self.Description).encode(ExternalEncoding)) + if self.Amount is not None: + showIndent(outfile, level) + outfile.write('Amount=model_.Money(\n') + self.Amount.exportLiteral(outfile, level, name_='Amount') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'TaxType': + TaxType_ = child_.text + TaxType_ = self.gds_validate_string(TaxType_, node, 'TaxType') + self.TaxType = TaxType_ + self.validate_TaxType(self.TaxType) # validate type TaxType + elif nodeName_ == 'Description': + Description_ = child_.text + Description_ = self.gds_validate_string(Description_, node, 'Description') + self.Description = Description_ + elif nodeName_ == 'Amount': + obj_ = Money.factory() + obj_.build(child_) + self.set_Amount(obj_) +# end class Tax + + +class TaxpayerIdentification(GeneratedsSuper): + """The descriptive data for taxpayer identification information.""" + subclass = None + superclass = None + def __init__(self, TinType=None, Number=None, Usage=None): + self.TinType = TinType + self.Number = Number + self.Usage = Usage + def factory(*args_, **kwargs_): + if TaxpayerIdentification.subclass: + return TaxpayerIdentification.subclass(*args_, **kwargs_) + else: + return TaxpayerIdentification(*args_, **kwargs_) + factory = staticmethod(factory) + def get_TinType(self): return self.TinType + def set_TinType(self, TinType): self.TinType = TinType + def validate_TinType(self, value): + # Validate type TinType, a restriction on xs:string. + pass + def get_Number(self): return self.Number + def set_Number(self, Number): self.Number = Number + def get_Usage(self): return self.Usage + def set_Usage(self, Usage): self.Usage = Usage + def export(self, outfile, level, namespace_='ns:', name_='TaxpayerIdentification', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='TaxpayerIdentification') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='TaxpayerIdentification'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='TaxpayerIdentification', fromsubclass_=False): + if self.TinType is not None: + showIndent(outfile, level) + outfile.write('<%sTinType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.TinType).encode(ExternalEncoding), input_name='TinType'), namespace_)) + if self.Number is not None: + showIndent(outfile, level) + outfile.write('<%sNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Number).encode(ExternalEncoding), input_name='Number'), namespace_)) + if self.Usage is not None: + showIndent(outfile, level) + outfile.write('<%sUsage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Usage).encode(ExternalEncoding), input_name='Usage'), namespace_)) + def hasContent_(self): + if ( + self.TinType is not None or + self.Number is not None or + self.Usage is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='TaxpayerIdentification'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.TinType is not None: + showIndent(outfile, level) + outfile.write('TinType=%s,\n' % quote_python(self.TinType).encode(ExternalEncoding)) + if self.Number is not None: + showIndent(outfile, level) + outfile.write('Number=%s,\n' % quote_python(self.Number).encode(ExternalEncoding)) + if self.Usage is not None: + showIndent(outfile, level) + outfile.write('Usage=%s,\n' % quote_python(self.Usage).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'TinType': + TinType_ = child_.text + TinType_ = self.gds_validate_string(TinType_, node, 'TinType') + self.TinType = TinType_ + self.validate_TinType(self.TinType) # validate type TinType + elif nodeName_ == 'Number': + Number_ = child_.text + Number_ = self.gds_validate_string(Number_, node, 'Number') + self.Number = Number_ + elif nodeName_ == 'Usage': + Usage_ = child_.text + Usage_ = self.gds_validate_string(Usage_, node, 'Usage') + self.Usage = Usage_ +# end class TaxpayerIdentification + + +class TrackingId(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, TrackingIdType=None, FormId=None, TrackingNumber=None): + self.TrackingIdType = TrackingIdType + self.FormId = FormId + self.TrackingNumber = TrackingNumber + def factory(*args_, **kwargs_): + if TrackingId.subclass: + return TrackingId.subclass(*args_, **kwargs_) + else: + return TrackingId(*args_, **kwargs_) + factory = staticmethod(factory) + def get_TrackingIdType(self): return self.TrackingIdType + def set_TrackingIdType(self, TrackingIdType): self.TrackingIdType = TrackingIdType + def validate_TrackingIdType(self, value): + # Validate type TrackingIdType, a restriction on xs:string. + pass + def get_FormId(self): return self.FormId + def set_FormId(self, FormId): self.FormId = FormId + def get_TrackingNumber(self): return self.TrackingNumber + def set_TrackingNumber(self, TrackingNumber): self.TrackingNumber = TrackingNumber + def export(self, outfile, level, namespace_='ns:', name_='TrackingId', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='TrackingId') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='TrackingId'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='TrackingId', fromsubclass_=False): + if self.TrackingIdType is not None: + showIndent(outfile, level) + outfile.write('<%sTrackingIdType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.TrackingIdType).encode(ExternalEncoding), input_name='TrackingIdType'), namespace_)) + if self.FormId is not None: + showIndent(outfile, level) + outfile.write('<%sFormId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.FormId).encode(ExternalEncoding), input_name='FormId'), namespace_)) + if self.TrackingNumber is not None: + showIndent(outfile, level) + outfile.write('<%sTrackingNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.TrackingNumber).encode(ExternalEncoding), input_name='TrackingNumber'), namespace_)) + def hasContent_(self): + if ( + self.TrackingIdType is not None or + self.FormId is not None or + self.TrackingNumber is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='TrackingId'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.TrackingIdType is not None: + showIndent(outfile, level) + outfile.write('TrackingIdType=%s,\n' % quote_python(self.TrackingIdType).encode(ExternalEncoding)) + if self.FormId is not None: + showIndent(outfile, level) + outfile.write('FormId=%s,\n' % quote_python(self.FormId).encode(ExternalEncoding)) + if self.TrackingNumber is not None: + showIndent(outfile, level) + outfile.write('TrackingNumber=%s,\n' % quote_python(self.TrackingNumber).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'TrackingIdType': + TrackingIdType_ = child_.text + TrackingIdType_ = self.gds_validate_string(TrackingIdType_, node, 'TrackingIdType') + self.TrackingIdType = TrackingIdType_ + self.validate_TrackingIdType(self.TrackingIdType) # validate type TrackingIdType + elif nodeName_ == 'FormId': + FormId_ = child_.text + FormId_ = self.gds_validate_string(FormId_, node, 'FormId') + self.FormId = FormId_ + elif nodeName_ == 'TrackingNumber': + TrackingNumber_ = child_.text + TrackingNumber_ = self.gds_validate_string(TrackingNumber_, node, 'TrackingNumber') + self.TrackingNumber = TrackingNumber_ +# end class TrackingId + + +class TransactionDetail(GeneratedsSuper): + """Descriptive data for this customer transaction. The + TransactionDetail from the request is echoed back to the caller + in the corresponding reply.""" + subclass = None + superclass = None + def __init__(self, CustomerTransactionId=None, Localization=None): + self.CustomerTransactionId = CustomerTransactionId + self.Localization = Localization + def factory(*args_, **kwargs_): + if TransactionDetail.subclass: + return TransactionDetail.subclass(*args_, **kwargs_) + else: + return TransactionDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_CustomerTransactionId(self): return self.CustomerTransactionId + def set_CustomerTransactionId(self, CustomerTransactionId): self.CustomerTransactionId = CustomerTransactionId + def get_Localization(self): return self.Localization + def set_Localization(self, Localization): self.Localization = Localization + def export(self, outfile, level, namespace_='ns:', name_='TransactionDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='TransactionDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='TransactionDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='TransactionDetail', fromsubclass_=False): + if self.CustomerTransactionId is not None: + showIndent(outfile, level) + outfile.write('<%sCustomerTransactionId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CustomerTransactionId).encode(ExternalEncoding), input_name='CustomerTransactionId'), namespace_)) + if self.Localization: + self.Localization.export(outfile, level, namespace_, name_='Localization') + def hasContent_(self): + if ( + self.CustomerTransactionId is not None or + self.Localization is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='TransactionDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.CustomerTransactionId is not None: + showIndent(outfile, level) + outfile.write('CustomerTransactionId=%s,\n' % quote_python(self.CustomerTransactionId).encode(ExternalEncoding)) + if self.Localization is not None: + showIndent(outfile, level) + outfile.write('Localization=model_.Localization(\n') + self.Localization.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'CustomerTransactionId': + CustomerTransactionId_ = child_.text + CustomerTransactionId_ = self.gds_validate_string(CustomerTransactionId_, node, 'CustomerTransactionId') + self.CustomerTransactionId = CustomerTransactionId_ + elif nodeName_ == 'Localization': + obj_ = Localization.factory() + obj_.build(child_) + self.set_Localization(obj_) +# end class TransactionDetail + + +class UploadDocumentDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, LineNumber=None, CustomerReference=None, DocumentProducer=None, DocumentType=None, FileName=None, DocumentContent=None): + self.LineNumber = LineNumber + self.CustomerReference = CustomerReference + self.DocumentProducer = DocumentProducer + self.DocumentType = DocumentType + self.FileName = FileName + self.DocumentContent = DocumentContent + def factory(*args_, **kwargs_): + if UploadDocumentDetail.subclass: + return UploadDocumentDetail.subclass(*args_, **kwargs_) + else: + return UploadDocumentDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_LineNumber(self): return self.LineNumber + def set_LineNumber(self, LineNumber): self.LineNumber = LineNumber + def get_CustomerReference(self): return self.CustomerReference + def set_CustomerReference(self, CustomerReference): self.CustomerReference = CustomerReference + def get_DocumentProducer(self): return self.DocumentProducer + def set_DocumentProducer(self, DocumentProducer): self.DocumentProducer = DocumentProducer + def validate_UploadDocumentProducerType(self, value): + # Validate type UploadDocumentProducerType, a restriction on xs:string. + pass + def get_DocumentType(self): return self.DocumentType + def set_DocumentType(self, DocumentType): self.DocumentType = DocumentType + def validate_UploadDocumentType(self, value): + # Validate type UploadDocumentType, a restriction on xs:string. + pass + def get_FileName(self): return self.FileName + def set_FileName(self, FileName): self.FileName = FileName + def get_DocumentContent(self): return self.DocumentContent + def set_DocumentContent(self, DocumentContent): self.DocumentContent = DocumentContent + def export(self, outfile, level, namespace_='ns:', name_='UploadDocumentDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='UploadDocumentDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='UploadDocumentDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='UploadDocumentDetail', fromsubclass_=False): + if self.LineNumber is not None: + showIndent(outfile, level) + outfile.write('<%sLineNumber>%s\n' % (namespace_, self.gds_format_integer(self.LineNumber, input_name='LineNumber'), namespace_)) + if self.CustomerReference is not None: + showIndent(outfile, level) + outfile.write('<%sCustomerReference>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CustomerReference).encode(ExternalEncoding), input_name='CustomerReference'), namespace_)) + if self.DocumentProducer is not None: + showIndent(outfile, level) + outfile.write('<%sDocumentProducer>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DocumentProducer).encode(ExternalEncoding), input_name='DocumentProducer'), namespace_)) + if self.DocumentType is not None: + showIndent(outfile, level) + outfile.write('<%sDocumentType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DocumentType).encode(ExternalEncoding), input_name='DocumentType'), namespace_)) + if self.FileName is not None: + showIndent(outfile, level) + outfile.write('<%sFileName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.FileName).encode(ExternalEncoding), input_name='FileName'), namespace_)) + if self.DocumentContent: + self.DocumentContent.export(outfile, level, namespace_, name_='DocumentContent') + def hasContent_(self): + if ( + self.LineNumber is not None or + self.CustomerReference is not None or + self.DocumentProducer is not None or + self.DocumentType is not None or + self.FileName is not None or + self.DocumentContent is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='UploadDocumentDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.LineNumber is not None: + showIndent(outfile, level) + outfile.write('LineNumber=%d,\n' % self.LineNumber) + if self.CustomerReference is not None: + showIndent(outfile, level) + outfile.write('CustomerReference=%s,\n' % quote_python(self.CustomerReference).encode(ExternalEncoding)) + if self.DocumentProducer is not None: + showIndent(outfile, level) + outfile.write('DocumentProducer=%s,\n' % quote_python(self.DocumentProducer).encode(ExternalEncoding)) + if self.DocumentType is not None: + showIndent(outfile, level) + outfile.write('DocumentType=%s,\n' % quote_python(self.DocumentType).encode(ExternalEncoding)) + if self.FileName is not None: + showIndent(outfile, level) + outfile.write('FileName=%s,\n' % quote_python(self.FileName).encode(ExternalEncoding)) + if self.DocumentContent is not None: + showIndent(outfile, level) + outfile.write('DocumentContent=model_.xs_base64Binary(\n') + self.DocumentContent.exportLiteral(outfile, level, name_='DocumentContent') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'LineNumber': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'LineNumber') + self.LineNumber = ival_ + elif nodeName_ == 'CustomerReference': + CustomerReference_ = child_.text + CustomerReference_ = self.gds_validate_string(CustomerReference_, node, 'CustomerReference') + self.CustomerReference = CustomerReference_ + elif nodeName_ == 'DocumentProducer': + DocumentProducer_ = child_.text + DocumentProducer_ = self.gds_validate_string(DocumentProducer_, node, 'DocumentProducer') + self.DocumentProducer = DocumentProducer_ + self.validate_UploadDocumentProducerType(self.DocumentProducer) # validate type UploadDocumentProducerType + elif nodeName_ == 'DocumentType': + DocumentType_ = child_.text + DocumentType_ = self.gds_validate_string(DocumentType_, node, 'DocumentType') + self.DocumentType = DocumentType_ + self.validate_UploadDocumentType(self.DocumentType) # validate type UploadDocumentType + elif nodeName_ == 'FileName': + FileName_ = child_.text + FileName_ = self.gds_validate_string(FileName_, node, 'FileName') + self.FileName = FileName_ + elif nodeName_ == 'DocumentContent': + obj_ = xs_base64Binary.factory() + obj_.build(child_) + self.set_DocumentContent(obj_) +# end class UploadDocumentDetail + + +class UploadDocumentReferenceDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, LineNumber=None, CustomerReference=None, DocumentProducer=None, DocumentType=None, DocumentId=None, DocumentIdProducer=None): + self.LineNumber = LineNumber + self.CustomerReference = CustomerReference + self.DocumentProducer = DocumentProducer + self.DocumentType = DocumentType + self.DocumentId = DocumentId + self.DocumentIdProducer = DocumentIdProducer + def factory(*args_, **kwargs_): + if UploadDocumentReferenceDetail.subclass: + return UploadDocumentReferenceDetail.subclass(*args_, **kwargs_) + else: + return UploadDocumentReferenceDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_LineNumber(self): return self.LineNumber + def set_LineNumber(self, LineNumber): self.LineNumber = LineNumber + def get_CustomerReference(self): return self.CustomerReference + def set_CustomerReference(self, CustomerReference): self.CustomerReference = CustomerReference + def get_DocumentProducer(self): return self.DocumentProducer + def set_DocumentProducer(self, DocumentProducer): self.DocumentProducer = DocumentProducer + def validate_UploadDocumentProducerType(self, value): + # Validate type UploadDocumentProducerType, a restriction on xs:string. + pass + def get_DocumentType(self): return self.DocumentType + def set_DocumentType(self, DocumentType): self.DocumentType = DocumentType + def validate_UploadDocumentType(self, value): + # Validate type UploadDocumentType, a restriction on xs:string. + pass + def get_DocumentId(self): return self.DocumentId + def set_DocumentId(self, DocumentId): self.DocumentId = DocumentId + def get_DocumentIdProducer(self): return self.DocumentIdProducer + def set_DocumentIdProducer(self, DocumentIdProducer): self.DocumentIdProducer = DocumentIdProducer + def validate_UploadDocumentIdProducer(self, value): + # Validate type UploadDocumentIdProducer, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='UploadDocumentReferenceDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='UploadDocumentReferenceDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='UploadDocumentReferenceDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='UploadDocumentReferenceDetail', fromsubclass_=False): + if self.LineNumber is not None: + showIndent(outfile, level) + outfile.write('<%sLineNumber>%s\n' % (namespace_, self.gds_format_integer(self.LineNumber, input_name='LineNumber'), namespace_)) + if self.CustomerReference is not None: + showIndent(outfile, level) + outfile.write('<%sCustomerReference>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CustomerReference).encode(ExternalEncoding), input_name='CustomerReference'), namespace_)) + if self.DocumentProducer is not None: + showIndent(outfile, level) + outfile.write('<%sDocumentProducer>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DocumentProducer).encode(ExternalEncoding), input_name='DocumentProducer'), namespace_)) + if self.DocumentType is not None: + showIndent(outfile, level) + outfile.write('<%sDocumentType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DocumentType).encode(ExternalEncoding), input_name='DocumentType'), namespace_)) + if self.DocumentId is not None: + showIndent(outfile, level) + outfile.write('<%sDocumentId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DocumentId).encode(ExternalEncoding), input_name='DocumentId'), namespace_)) + if self.DocumentIdProducer is not None: + showIndent(outfile, level) + outfile.write('<%sDocumentIdProducer>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DocumentIdProducer).encode(ExternalEncoding), input_name='DocumentIdProducer'), namespace_)) + def hasContent_(self): + if ( + self.LineNumber is not None or + self.CustomerReference is not None or + self.DocumentProducer is not None or + self.DocumentType is not None or + self.DocumentId is not None or + self.DocumentIdProducer is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='UploadDocumentReferenceDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.LineNumber is not None: + showIndent(outfile, level) + outfile.write('LineNumber=%d,\n' % self.LineNumber) + if self.CustomerReference is not None: + showIndent(outfile, level) + outfile.write('CustomerReference=%s,\n' % quote_python(self.CustomerReference).encode(ExternalEncoding)) + if self.DocumentProducer is not None: + showIndent(outfile, level) + outfile.write('DocumentProducer=%s,\n' % quote_python(self.DocumentProducer).encode(ExternalEncoding)) + if self.DocumentType is not None: + showIndent(outfile, level) + outfile.write('DocumentType=%s,\n' % quote_python(self.DocumentType).encode(ExternalEncoding)) + if self.DocumentId is not None: + showIndent(outfile, level) + outfile.write('DocumentId=%s,\n' % quote_python(self.DocumentId).encode(ExternalEncoding)) + if self.DocumentIdProducer is not None: + showIndent(outfile, level) + outfile.write('DocumentIdProducer=%s,\n' % quote_python(self.DocumentIdProducer).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'LineNumber': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'LineNumber') + self.LineNumber = ival_ + elif nodeName_ == 'CustomerReference': + CustomerReference_ = child_.text + CustomerReference_ = self.gds_validate_string(CustomerReference_, node, 'CustomerReference') + self.CustomerReference = CustomerReference_ + elif nodeName_ == 'DocumentProducer': + DocumentProducer_ = child_.text + DocumentProducer_ = self.gds_validate_string(DocumentProducer_, node, 'DocumentProducer') + self.DocumentProducer = DocumentProducer_ + self.validate_UploadDocumentProducerType(self.DocumentProducer) # validate type UploadDocumentProducerType + elif nodeName_ == 'DocumentType': + DocumentType_ = child_.text + DocumentType_ = self.gds_validate_string(DocumentType_, node, 'DocumentType') + self.DocumentType = DocumentType_ + self.validate_UploadDocumentType(self.DocumentType) # validate type UploadDocumentType + elif nodeName_ == 'DocumentId': + DocumentId_ = child_.text + DocumentId_ = self.gds_validate_string(DocumentId_, node, 'DocumentId') + self.DocumentId = DocumentId_ + elif nodeName_ == 'DocumentIdProducer': + DocumentIdProducer_ = child_.text + DocumentIdProducer_ = self.gds_validate_string(DocumentIdProducer_, node, 'DocumentIdProducer') + self.DocumentIdProducer = DocumentIdProducer_ + self.validate_UploadDocumentIdProducer(self.DocumentIdProducer) # validate type UploadDocumentIdProducer +# end class UploadDocumentReferenceDetail + + +class VariableHandlingChargeDetail(GeneratedsSuper): + """This definition of variable handling charge detail is intended for + use in Jan 2011 corp load.""" + subclass = None + superclass = None + def __init__(self, FixedValue=None, PercentValue=None, RateElementBasis=None, RateTypeBasis=None): + self.FixedValue = FixedValue + self.PercentValue = PercentValue + self.RateElementBasis = RateElementBasis + self.RateTypeBasis = RateTypeBasis + def factory(*args_, **kwargs_): + if VariableHandlingChargeDetail.subclass: + return VariableHandlingChargeDetail.subclass(*args_, **kwargs_) + else: + return VariableHandlingChargeDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_FixedValue(self): return self.FixedValue + def set_FixedValue(self, FixedValue): self.FixedValue = FixedValue + def get_PercentValue(self): return self.PercentValue + def set_PercentValue(self, PercentValue): self.PercentValue = PercentValue + def get_RateElementBasis(self): return self.RateElementBasis + def set_RateElementBasis(self, RateElementBasis): self.RateElementBasis = RateElementBasis + def validate_RateElementBasisType(self, value): + # Validate type RateElementBasisType, a restriction on xs:string. + pass + def get_RateTypeBasis(self): return self.RateTypeBasis + def set_RateTypeBasis(self, RateTypeBasis): self.RateTypeBasis = RateTypeBasis + def validate_RateTypeBasisType(self, value): + # Validate type RateTypeBasisType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='VariableHandlingChargeDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='VariableHandlingChargeDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='VariableHandlingChargeDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='VariableHandlingChargeDetail', fromsubclass_=False): + if self.FixedValue: + self.FixedValue.export(outfile, level, namespace_, name_='FixedValue') + if self.PercentValue is not None: + showIndent(outfile, level) + outfile.write('<%sPercentValue>%s\n' % (namespace_, self.gds_format_float(self.PercentValue, input_name='PercentValue'), namespace_)) + if self.RateElementBasis is not None: + showIndent(outfile, level) + outfile.write('<%sRateElementBasis>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RateElementBasis).encode(ExternalEncoding), input_name='RateElementBasis'), namespace_)) + if self.RateTypeBasis is not None: + showIndent(outfile, level) + outfile.write('<%sRateTypeBasis>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RateTypeBasis).encode(ExternalEncoding), input_name='RateTypeBasis'), namespace_)) + def hasContent_(self): + if ( + self.FixedValue is not None or + self.PercentValue is not None or + self.RateElementBasis is not None or + self.RateTypeBasis is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='VariableHandlingChargeDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.FixedValue is not None: + showIndent(outfile, level) + outfile.write('FixedValue=model_.Money(\n') + self.FixedValue.exportLiteral(outfile, level, name_='FixedValue') + showIndent(outfile, level) + outfile.write('),\n') + if self.PercentValue is not None: + showIndent(outfile, level) + outfile.write('PercentValue=%f,\n' % self.PercentValue) + if self.RateElementBasis is not None: + showIndent(outfile, level) + outfile.write('RateElementBasis=%s,\n' % quote_python(self.RateElementBasis).encode(ExternalEncoding)) + if self.RateTypeBasis is not None: + showIndent(outfile, level) + outfile.write('RateTypeBasis=%s,\n' % quote_python(self.RateTypeBasis).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'FixedValue': + obj_ = Money.factory() + obj_.build(child_) + self.set_FixedValue(obj_) + elif nodeName_ == 'PercentValue': + sval_ = child_.text + try: + fval_ = float(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires float or double: %s' % exp) + fval_ = self.gds_validate_float(fval_, node, 'PercentValue') + self.PercentValue = fval_ + elif nodeName_ == 'RateElementBasis': + RateElementBasis_ = child_.text + RateElementBasis_ = self.gds_validate_string(RateElementBasis_, node, 'RateElementBasis') + self.RateElementBasis = RateElementBasis_ + self.validate_RateElementBasisType(self.RateElementBasis) # validate type RateElementBasisType + elif nodeName_ == 'RateTypeBasis': + RateTypeBasis_ = child_.text + RateTypeBasis_ = self.gds_validate_string(RateTypeBasis_, node, 'RateTypeBasis') + self.RateTypeBasis = RateTypeBasis_ + self.validate_RateTypeBasisType(self.RateTypeBasis) # validate type RateTypeBasisType +# end class VariableHandlingChargeDetail + + +class VariableHandlingCharges(GeneratedsSuper): + """The variable handling charges calculated based on the type variable + handling charges requested.""" + subclass = None + superclass = None + def __init__(self, VariableHandlingCharge=None, TotalCustomerCharge=None): + self.VariableHandlingCharge = VariableHandlingCharge + self.TotalCustomerCharge = TotalCustomerCharge + def factory(*args_, **kwargs_): + if VariableHandlingCharges.subclass: + return VariableHandlingCharges.subclass(*args_, **kwargs_) + else: + return VariableHandlingCharges(*args_, **kwargs_) + factory = staticmethod(factory) + def get_VariableHandlingCharge(self): return self.VariableHandlingCharge + def set_VariableHandlingCharge(self, VariableHandlingCharge): self.VariableHandlingCharge = VariableHandlingCharge + def get_TotalCustomerCharge(self): return self.TotalCustomerCharge + def set_TotalCustomerCharge(self, TotalCustomerCharge): self.TotalCustomerCharge = TotalCustomerCharge + def export(self, outfile, level, namespace_='ns:', name_='VariableHandlingCharges', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='VariableHandlingCharges') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='VariableHandlingCharges'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='VariableHandlingCharges', fromsubclass_=False): + if self.VariableHandlingCharge: + self.VariableHandlingCharge.export(outfile, level, namespace_, name_='VariableHandlingCharge') + if self.TotalCustomerCharge: + self.TotalCustomerCharge.export(outfile, level, namespace_, name_='TotalCustomerCharge') + def hasContent_(self): + if ( + self.VariableHandlingCharge is not None or + self.TotalCustomerCharge is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='VariableHandlingCharges'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.VariableHandlingCharge is not None: + showIndent(outfile, level) + outfile.write('VariableHandlingCharge=model_.Money(\n') + self.VariableHandlingCharge.exportLiteral(outfile, level, name_='VariableHandlingCharge') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalCustomerCharge is not None: + showIndent(outfile, level) + outfile.write('TotalCustomerCharge=model_.Money(\n') + self.TotalCustomerCharge.exportLiteral(outfile, level, name_='TotalCustomerCharge') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'VariableHandlingCharge': + obj_ = Money.factory() + obj_.build(child_) + self.set_VariableHandlingCharge(obj_) + elif nodeName_ == 'TotalCustomerCharge': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalCustomerCharge(obj_) +# end class VariableHandlingCharges + + +class Volume(GeneratedsSuper): + """Three-dimensional volume/cubic measurement.""" + subclass = None + superclass = None + def __init__(self, Units=None, Value=None): + self.Units = Units + self.Value = Value + def factory(*args_, **kwargs_): + if Volume.subclass: + return Volume.subclass(*args_, **kwargs_) + else: + return Volume(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Units(self): return self.Units + def set_Units(self, Units): self.Units = Units + def validate_VolumeUnits(self, value): + # Validate type VolumeUnits, a restriction on xs:string. + pass + def get_Value(self): return self.Value + def set_Value(self, Value): self.Value = Value + def export(self, outfile, level, namespace_='ns:', name_='Volume', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Volume') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Volume'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Volume', fromsubclass_=False): + if self.Units is not None: + showIndent(outfile, level) + outfile.write('<%sUnits>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Units).encode(ExternalEncoding), input_name='Units'), namespace_)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('<%sValue>%s\n' % (namespace_, self.gds_format_float(self.Value, input_name='Value'), namespace_)) + def hasContent_(self): + if ( + self.Units is not None or + self.Value is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Volume'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Units is not None: + showIndent(outfile, level) + outfile.write('Units=%s,\n' % quote_python(self.Units).encode(ExternalEncoding)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('Value=%f,\n' % self.Value) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Units': + Units_ = child_.text + Units_ = self.gds_validate_string(Units_, node, 'Units') + self.Units = Units_ + self.validate_VolumeUnits(self.Units) # validate type VolumeUnits + elif nodeName_ == 'Value': + sval_ = child_.text + try: + fval_ = float(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires float or double: %s' % exp) + fval_ = self.gds_validate_float(fval_, node, 'Value') + self.Value = fval_ +# end class Volume + + +class Weight(GeneratedsSuper): + """The descriptive data for the heaviness of an object.""" + subclass = None + superclass = None + def __init__(self, Units=None, Value=None): + self.Units = Units + self.Value = Value + def factory(*args_, **kwargs_): + if Weight.subclass: + return Weight.subclass(*args_, **kwargs_) + else: + return Weight(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Units(self): return self.Units + def set_Units(self, Units): self.Units = Units + def validate_WeightUnits(self, value): + # Validate type WeightUnits, a restriction on xs:string. + pass + def get_Value(self): return self.Value + def set_Value(self, Value): self.Value = Value + def export(self, outfile, level, namespace_='ns:', name_='Weight', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Weight') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Weight'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Weight', fromsubclass_=False): + if self.Units is not None: + showIndent(outfile, level) + outfile.write('<%sUnits>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Units).encode(ExternalEncoding), input_name='Units'), namespace_)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('<%sValue>%s\n' % (namespace_, self.gds_format_float(self.Value, input_name='Value'), namespace_)) + def hasContent_(self): + if ( + self.Units is not None or + self.Value is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Weight'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Units is not None: + showIndent(outfile, level) + outfile.write('Units=%s,\n' % quote_python(self.Units).encode(ExternalEncoding)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('Value=%f,\n' % self.Value) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Units': + Units_ = child_.text + Units_ = self.gds_validate_string(Units_, node, 'Units') + self.Units = Units_ + self.validate_WeightUnits(self.Units) # validate type WeightUnits + elif nodeName_ == 'Value': + sval_ = child_.text + try: + fval_ = float(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires float or double: %s' % exp) + fval_ = self.gds_validate_float(fval_, node, 'Value') + self.Value = fval_ +# end class Weight + + +class WebAuthenticationDetail(GeneratedsSuper): + """Used in authentication of the sender's identity.""" + subclass = None + superclass = None + def __init__(self, UserCredential=None): + self.UserCredential = UserCredential + def factory(*args_, **kwargs_): + if WebAuthenticationDetail.subclass: + return WebAuthenticationDetail.subclass(*args_, **kwargs_) + else: + return WebAuthenticationDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_UserCredential(self): return self.UserCredential + def set_UserCredential(self, UserCredential): self.UserCredential = UserCredential + def export(self, outfile, level, namespace_='ns:', name_='WebAuthenticationDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='WebAuthenticationDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='WebAuthenticationDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='WebAuthenticationDetail', fromsubclass_=False): + if self.UserCredential: + self.UserCredential.export(outfile, level, namespace_, name_='UserCredential', ) + def hasContent_(self): + if ( + self.UserCredential is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='WebAuthenticationDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.UserCredential is not None: + showIndent(outfile, level) + outfile.write('UserCredential=model_.WebAuthenticationCredential(\n') + self.UserCredential.exportLiteral(outfile, level, name_='UserCredential') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'UserCredential': + obj_ = WebAuthenticationCredential.factory() + obj_.build(child_) + self.set_UserCredential(obj_) +# end class WebAuthenticationDetail + + +class WebAuthenticationCredential(GeneratedsSuper): + """Two part authentication string used for the sender's identity""" + subclass = None + superclass = None + def __init__(self, Key=None, Password=None): + self.Key = Key + self.Password = Password + def factory(*args_, **kwargs_): + if WebAuthenticationCredential.subclass: + return WebAuthenticationCredential.subclass(*args_, **kwargs_) + else: + return WebAuthenticationCredential(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Key(self): return self.Key + def set_Key(self, Key): self.Key = Key + def get_Password(self): return self.Password + def set_Password(self, Password): self.Password = Password + def export(self, outfile, level, namespace_='ns:', name_='WebAuthenticationCredential', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='WebAuthenticationCredential') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='WebAuthenticationCredential'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='WebAuthenticationCredential', fromsubclass_=False): + if self.Key is not None: + showIndent(outfile, level) + outfile.write('<%sKey>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Key).encode(ExternalEncoding), input_name='Key'), namespace_)) + if self.Password is not None: + showIndent(outfile, level) + outfile.write('<%sPassword>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Password).encode(ExternalEncoding), input_name='Password'), namespace_)) + def hasContent_(self): + if ( + self.Key is not None or + self.Password is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='WebAuthenticationCredential'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Key is not None: + showIndent(outfile, level) + outfile.write('Key=%s,\n' % quote_python(self.Key).encode(ExternalEncoding)) + if self.Password is not None: + showIndent(outfile, level) + outfile.write('Password=%s,\n' % quote_python(self.Password).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Key': + Key_ = child_.text + Key_ = self.gds_validate_string(Key_, node, 'Key') + self.Key = Key_ + elif nodeName_ == 'Password': + Password_ = child_.text + Password_ = self.gds_validate_string(Password_, node, 'Password') + self.Password = Password_ +# end class WebAuthenticationCredential + + +class VersionId(GeneratedsSuper): + """Identifies the version/level of a service operation expected by a + caller (in each request) and performed by the callee (in each + reply).""" + subclass = None + superclass = None + def __init__(self, ServiceId=None, Major=None, Intermediate=None, Minor=None): + self.ServiceId = ServiceId + self.Major = Major + self.Intermediate = Intermediate + self.Minor = Minor + def factory(*args_, **kwargs_): + if VersionId.subclass: + return VersionId.subclass(*args_, **kwargs_) + else: + return VersionId(*args_, **kwargs_) + factory = staticmethod(factory) + def get_ServiceId(self): return self.ServiceId + def set_ServiceId(self, ServiceId): self.ServiceId = ServiceId + def get_Major(self): return self.Major + def set_Major(self, Major): self.Major = Major + def get_Intermediate(self): return self.Intermediate + def set_Intermediate(self, Intermediate): self.Intermediate = Intermediate + def get_Minor(self): return self.Minor + def set_Minor(self, Minor): self.Minor = Minor + def export(self, outfile, level, namespace_='ns:', name_='VersionId', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='VersionId') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='VersionId'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='VersionId', fromsubclass_=False): + if self.ServiceId is not None: + showIndent(outfile, level) + outfile.write('<%sServiceId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ServiceId).encode(ExternalEncoding), input_name='ServiceId'), namespace_)) + if self.Major is not None: + showIndent(outfile, level) + outfile.write('<%sMajor>%s\n' % (namespace_, self.gds_format_integer(self.Major, input_name='Major'), namespace_)) + if self.Intermediate is not None: + showIndent(outfile, level) + outfile.write('<%sIntermediate>%s\n' % (namespace_, self.gds_format_integer(self.Intermediate, input_name='Intermediate'), namespace_)) + if self.Minor is not None: + showIndent(outfile, level) + outfile.write('<%sMinor>%s\n' % (namespace_, self.gds_format_integer(self.Minor, input_name='Minor'), namespace_)) + def hasContent_(self): + if ( + self.ServiceId is not None or + self.Major is not None or + self.Intermediate is not None or + self.Minor is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='VersionId'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.ServiceId is not None: + showIndent(outfile, level) + outfile.write('ServiceId=%s,\n' % quote_python(self.ServiceId).encode(ExternalEncoding)) + if self.Major is not None: + showIndent(outfile, level) + outfile.write('Major=%d,\n' % self.Major) + if self.Intermediate is not None: + showIndent(outfile, level) + outfile.write('Intermediate=%d,\n' % self.Intermediate) + if self.Minor is not None: + showIndent(outfile, level) + outfile.write('Minor=%d,\n' % self.Minor) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'ServiceId': + ServiceId_ = child_.text + ServiceId_ = self.gds_validate_string(ServiceId_, node, 'ServiceId') + self.ServiceId = ServiceId_ + elif nodeName_ == 'Major': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'Major') + self.Major = ival_ + elif nodeName_ == 'Intermediate': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'Intermediate') + self.Intermediate = ival_ + elif nodeName_ == 'Minor': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'Minor') + self.Minor = ival_ +# end class VersionId + + +USAGE_TEXT = """ +Usage: python .py [ -s ] +""" + +def usage(): + print USAGE_TEXT + sys.exit(1) + + +def get_root_tag(node): + tag = Tag_pattern_.match(node.tag).groups()[-1] + rootClass = globals().get(tag) + return tag, rootClass + + +def parse(inFileName): + doc = parsexml_(inFileName) + rootNode = doc.getroot() + rootTag, rootClass = get_root_tag(rootNode) + if rootClass is None: + rootTag = 'RateReply' + rootClass = RateReply + rootObj = rootClass.factory() + rootObj.build(rootNode) + # Enable Python to collect the space used by the DOM. + doc = None + sys.stdout.write('\n') + rootObj.export(sys.stdout, 0, name_=rootTag, + namespacedef_='') + return rootObj + + +def parseString(inString): + from StringIO import StringIO + doc = parsexml_(StringIO(inString)) + rootNode = doc.getroot() + rootTag, rootClass = get_root_tag(rootNode) + if rootClass is None: + rootTag = 'RateReply' + rootClass = RateReply + rootObj = rootClass.factory() + rootObj.build(rootNode) + # Enable Python to collect the space used by the DOM. + doc = None + sys.stdout.write('\n') + rootObj.export(sys.stdout, 0, name_="RateReply", + namespacedef_='') + return rootObj + + +def parseLiteral(inFileName): + doc = parsexml_(inFileName) + rootNode = doc.getroot() + rootTag, rootClass = get_root_tag(rootNode) + if rootClass is None: + rootTag = 'RateReply' + rootClass = RateReply + rootObj = rootClass.factory() + rootObj.build(rootNode) + # Enable Python to collect the space used by the DOM. + doc = None + sys.stdout.write('#from rate import *\n\n') + sys.stdout.write('import rate as model_\n\n') + sys.stdout.write('rootObj = model_.rootTag(\n') + rootObj.exportLiteral(sys.stdout, 0, name_=rootTag) + sys.stdout.write(')\n') + return rootObj + + +def main(): + args = sys.argv[1:] + if len(args) == 1: + parse(args[0]) + else: + usage() + + +if __name__ == '__main__': + #import pdb; pdb.set_trace() + main() + + +__all__ = [ + "AdditionalLabelsDetail", + "Address", + "CertificateOfOriginDetail", + "ClientDetail", + "CodAddTransportationChargesDetail", + "CodDetail", + "CommercialInvoice", + "CommercialInvoiceDetail", + "CommitDetail", + "Commodity", + "ConfigurableLabelReferenceEntry", + "Contact", + "ContactAndAddress", + "ContentRecord", + "CurrencyExchangeRate", + "CustomDeliveryWindowDetail", + "CustomDocumentDetail", + "CustomLabelBarcodeEntry", + "CustomLabelBoxEntry", + "CustomLabelDetail", + "CustomLabelGraphicEntry", + "CustomLabelPosition", + "CustomLabelTextEntry", + "CustomerImageUsage", + "CustomerReference", + "CustomerSpecifiedLabelDetail", + "CustomsClearanceDetail", + "DangerousGoodsDetail", + "DateRange", + "DelayDetail", + "DestinationControlDetail", + "Dimensions", + "Distance", + "DocTabContent", + "DocTabContentBarcoded", + "DocTabContentZone001", + "DocTabZoneSpecification", + "EMailLabelDetail", + "EMailNotificationDetail", + "EMailNotificationRecipient", + "EdtCommodityTax", + "EdtExciseCondition", + "EdtTaxDetail", + "EtdDetail", + "ExportDetail", + "ExpressFreightDetail", + "ExpressFreightDetailContact", + "FlatbedTrailerDetail", + "FreightBaseCharge", + "FreightCommitDetail", + "FreightGuaranteeDetail", + "FreightRateDetail", + "FreightRateNotation", + "FreightServiceCenterDetail", + "FreightShipmentDetail", + "FreightShipmentLineItem", + "FreightSpecialServicePayment", + "GeneralAgencyAgreementDetail", + "HazardousCommodityContent", + "HazardousCommodityDescription", + "HazardousCommodityOptionDetail", + "HazardousCommodityPackagingDetail", + "HazardousCommodityQuantityDetail", + "HoldAtLocationDetail", + "HomeDeliveryPremiumDetail", + "LabelSpecification", + "LiabilityCoverageDetail", + "LinearMeasure", + "Localization", + "Measure", + "Money", + "NaftaCertificateOfOriginDetail", + "NaftaCommodityDetail", + "NaftaProducer", + "Notification", + "NotificationParameter", + "Op900Detail", + "PackageRateDetail", + "PackageSpecialServicesRequested", + "Party", + "Payment", + "Payor", + "PendingShipmentDetail", + "PickupDetail", + "PriorityAlertDetail", + "RateDiscount", + "RateReply", + "RateReplyDetail", + "RateRequest", + "RatedPackageDetail", + "RatedShipmentDetail", + "Rebate", + "RecipientCustomsId", + "RequestedPackageLineItem", + "RequestedShipment", + "ReturnEMailDetail", + "ReturnShipmentDetail", + "Rma", + "ServiceSubOptionDetail", + "ShipmentDryIceDetail", + "ShipmentLegRateDetail", + "ShipmentRateDetail", + "ShipmentSpecialServicesRequested", + "ShippingDocumentDispositionDetail", + "ShippingDocumentEMailDetail", + "ShippingDocumentEMailRecipient", + "ShippingDocumentFormat", + "ShippingDocumentPrintDetail", + "ShippingDocumentSpecification", + "SignatureOptionDetail", + "SmartPostShipmentDetail", + "Surcharge", + "Tax", + "TaxpayerIdentification", + "TrackingId", + "TransactionDetail", + "UploadDocumentDetail", + "UploadDocumentReferenceDetail", + "VariableHandlingChargeDetail", + "VariableHandlingCharges", + "VersionId", + "Volume", + "WebAuthenticationCredential", + "WebAuthenticationDetail", + "Weight" + ] diff --git a/webxml/fedex/return.py b/webxml/fedex/return.py new file mode 100644 index 0000000..13351aa --- /dev/null +++ b/webxml/fedex/return.py @@ -0,0 +1,1740 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# +# Generated Mon Nov 28 15:43:58 2011 by generateDS.py version 2.6a. +# + +import sys +import getopt +import re as re_ + +etree_ = None +Verbose_import_ = False +( XMLParser_import_none, XMLParser_import_lxml, + XMLParser_import_elementtree + ) = range(3) +XMLParser_import_library = None +try: + # lxml + from lxml import etree as etree_ + XMLParser_import_library = XMLParser_import_lxml + if Verbose_import_: + print("running with lxml.etree") +except ImportError: + try: + # cElementTree from Python 2.5+ + import xml.etree.cElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with cElementTree on Python 2.5+") + except ImportError: + try: + # ElementTree from Python 2.5+ + import xml.etree.ElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with ElementTree on Python 2.5+") + except ImportError: + try: + # normal cElementTree install + import cElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with cElementTree") + except ImportError: + try: + # normal ElementTree install + import elementtree.ElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with ElementTree") + except ImportError: + raise ImportError("Failed to import ElementTree from any known place") + +def parsexml_(*args, **kwargs): + if (XMLParser_import_library == XMLParser_import_lxml and + 'parser' not in kwargs): + # Use the lxml ElementTree compatible parser so that, e.g., + # we ignore comments. + kwargs['parser'] = etree_.ETCompatXMLParser() + doc = etree_.parse(*args, **kwargs) + return doc + +# +# User methods +# +# Calls to the methods in these classes are generated by generateDS.py. +# You can replace these methods by re-implementing the following class +# in a module named generatedssuper.py. + +try: + from generatedssuper import GeneratedsSuper +except ImportError, exp: + + class GeneratedsSuper(object): + def gds_format_string(self, input_data, input_name=''): + return input_data + def gds_validate_string(self, input_data, node, input_name=''): + return input_data + def gds_format_integer(self, input_data, input_name=''): + return '%d' % input_data + def gds_validate_integer(self, input_data, node, input_name=''): + return input_data + def gds_format_integer_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_integer_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + try: + fvalue = float(value) + except (TypeError, ValueError), exp: + raise_parse_error(node, 'Requires sequence of integers') + return input_data + def gds_format_float(self, input_data, input_name=''): + return '%f' % input_data + def gds_validate_float(self, input_data, node, input_name=''): + return input_data + def gds_format_float_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_float_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + try: + fvalue = float(value) + except (TypeError, ValueError), exp: + raise_parse_error(node, 'Requires sequence of floats') + return input_data + def gds_format_double(self, input_data, input_name=''): + return '%e' % input_data + def gds_validate_double(self, input_data, node, input_name=''): + return input_data + def gds_format_double_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_double_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + try: + fvalue = float(value) + except (TypeError, ValueError), exp: + raise_parse_error(node, 'Requires sequence of doubles') + return input_data + def gds_format_boolean(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_boolean(self, input_data, node, input_name=''): + return input_data + def gds_format_boolean_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_boolean_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + if value not in ('true', '1', 'false', '0', ): + raise_parse_error(node, 'Requires sequence of booleans ("true", "1", "false", "0")') + return input_data + def gds_str_lower(self, instring): + return instring.lower() + def get_path_(self, node): + path_list = [] + self.get_path_list_(node, path_list) + path_list.reverse() + path = '/'.join(path_list) + return path + Tag_strip_pattern_ = re_.compile(r'\{.*\}') + def get_path_list_(self, node, path_list): + if node is None: + return + tag = GeneratedsSuper.Tag_strip_pattern_.sub('', node.tag) + if tag: + path_list.append(tag) + self.get_path_list_(node.getparent(), path_list) + def get_class_obj_(self, node, default_class=None): + class_obj1 = default_class + if 'xsi' in node.nsmap: + classname = node.get('{%s}type' % node.nsmap['xsi']) + if classname is not None: + names = classname.split(':') + if len(names) == 2: + classname = names[1] + class_obj2 = globals().get(classname) + if class_obj2 is not None: + class_obj1 = class_obj2 + return class_obj1 + + +# +# If you have installed IPython you can uncomment and use the following. +# IPython is available from http://ipython.scipy.org/. +# + +## from IPython.Shell import IPShellEmbed +## args = '' +## ipshell = IPShellEmbed(args, +## banner = 'Dropping into IPython', +## exit_msg = 'Leaving Interpreter, back to program.') + +# Then use the following line where and when you want to drop into the +# IPython shell: +# ipshell(' -- Entering ipshell.\nHit Ctrl-D to exit') + +# +# Globals +# + +ExternalEncoding = 'ascii' +Tag_pattern_ = re_.compile(r'({.*})?(.*)') +String_cleanup_pat_ = re_.compile(r"[\n\r\s]+") +Namespace_extract_pat_ = re_.compile(r'{(.*)}(.*)') + +# +# Support/utility functions. +# + +def showIndent(outfile, level): + for idx in range(level): + outfile.write(' ') + +def quote_xml(inStr): + if not inStr: + return '' + s1 = (isinstance(inStr, basestring) and inStr or + '%s' % inStr) + s1 = s1.replace('&', '&') + s1 = s1.replace('<', '<') + s1 = s1.replace('>', '>') + return s1 + +def quote_attrib(inStr): + s1 = (isinstance(inStr, basestring) and inStr or + '%s' % inStr) + s1 = s1.replace('&', '&') + s1 = s1.replace('<', '<') + s1 = s1.replace('>', '>') + if '"' in s1: + if "'" in s1: + s1 = '"%s"' % s1.replace('"', """) + else: + s1 = "'%s'" % s1 + else: + s1 = '"%s"' % s1 + return s1 + +def quote_python(inStr): + s1 = inStr + if s1.find("'") == -1: + if s1.find('\n') == -1: + return "'%s'" % s1 + else: + return "'''%s'''" % s1 + else: + if s1.find('"') != -1: + s1 = s1.replace('"', '\\"') + if s1.find('\n') == -1: + return '"%s"' % s1 + else: + return '"""%s"""' % s1 + +def get_all_text_(node): + if node.text is not None: + text = node.text + else: + text = '' + for child in node: + if child.tail is not None: + text += child.tail + return text + +def find_attr_value_(attr_name, node): + attrs = node.attrib + attr_parts = attr_name.split(':') + value = None + if len(attr_parts) == 1: + value = attrs.get(attr_name) + elif len(attr_parts) == 2: + prefix, name = attr_parts + namespace = node.nsmap.get(prefix) + if namespace is not None: + value = attrs.get('{%s}%s' % (namespace, name, )) + return value + + +class GDSParseError(Exception): + pass + +def raise_parse_error(node, msg): + if XMLParser_import_library == XMLParser_import_lxml: + msg = '%s (element %s/line %d)' % (msg, node.tag, node.sourceline, ) + else: + msg = '%s (element %s)' % (msg, node.tag, ) + raise GDSParseError(msg) + + +class MixedContainer: + # Constants for category: + CategoryNone = 0 + CategoryText = 1 + CategorySimple = 2 + CategoryComplex = 3 + # Constants for content_type: + TypeNone = 0 + TypeText = 1 + TypeString = 2 + TypeInteger = 3 + TypeFloat = 4 + TypeDecimal = 5 + TypeDouble = 6 + TypeBoolean = 7 + def __init__(self, category, content_type, name, value): + self.category = category + self.content_type = content_type + self.name = name + self.value = value + def getCategory(self): + return self.category + def getContenttype(self, content_type): + return self.content_type + def getValue(self): + return self.value + def getName(self): + return self.name + def export(self, outfile, level, name, namespace): + if self.category == MixedContainer.CategoryText: + # Prevent exporting empty content as empty lines. + if self.value.strip(): + outfile.write(self.value) + elif self.category == MixedContainer.CategorySimple: + self.exportSimple(outfile, level, name) + else: # category == MixedContainer.CategoryComplex + self.value.export(outfile, level, namespace,name) + def exportSimple(self, outfile, level, name): + if self.content_type == MixedContainer.TypeString: + outfile.write('<%s>%s' % (self.name, self.value, self.name)) + elif self.content_type == MixedContainer.TypeInteger or \ + self.content_type == MixedContainer.TypeBoolean: + outfile.write('<%s>%d' % (self.name, self.value, self.name)) + elif self.content_type == MixedContainer.TypeFloat or \ + self.content_type == MixedContainer.TypeDecimal: + outfile.write('<%s>%f' % (self.name, self.value, self.name)) + elif self.content_type == MixedContainer.TypeDouble: + outfile.write('<%s>%g' % (self.name, self.value, self.name)) + def exportLiteral(self, outfile, level, name): + if self.category == MixedContainer.CategoryText: + showIndent(outfile, level) + outfile.write('model_.MixedContainer(%d, %d, "%s", "%s"),\n' % \ + (self.category, self.content_type, self.name, self.value)) + elif self.category == MixedContainer.CategorySimple: + showIndent(outfile, level) + outfile.write('model_.MixedContainer(%d, %d, "%s", "%s"),\n' % \ + (self.category, self.content_type, self.name, self.value)) + else: # category == MixedContainer.CategoryComplex + showIndent(outfile, level) + outfile.write('model_.MixedContainer(%d, %d, "%s",\n' % \ + (self.category, self.content_type, self.name,)) + self.value.exportLiteral(outfile, level + 1) + showIndent(outfile, level) + outfile.write(')\n') + + +class MemberSpec_(object): + def __init__(self, name='', data_type='', container=0): + self.name = name + self.data_type = data_type + self.container = container + def set_name(self, name): self.name = name + def get_name(self): return self.name + def set_data_type(self, data_type): self.data_type = data_type + def get_data_type_chain(self): return self.data_type + def get_data_type(self): + if isinstance(self.data_type, list): + if len(self.data_type) > 0: + return self.data_type[-1] + else: + return 'xs:string' + else: + return self.data_type + def set_container(self, container): self.container = container + def get_container(self): return self.container + +def _cast(typ, value): + if typ is None or value is None: + return value + return typ(value) + +# +# Data representation classes. +# + +class WebAuthenticationDetail(GeneratedsSuper): + """Used in authentication of the sender's identity.""" + subclass = None + superclass = None + def __init__(self, UserCredential=None): + self.UserCredential = UserCredential + def factory(*args_, **kwargs_): + if WebAuthenticationDetail.subclass: + return WebAuthenticationDetail.subclass(*args_, **kwargs_) + else: + return WebAuthenticationDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_UserCredential(self): return self.UserCredential + def set_UserCredential(self, UserCredential): self.UserCredential = UserCredential + def export(self, outfile, level, namespace_='ns:', name_='WebAuthenticationDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='WebAuthenticationDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='WebAuthenticationDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='WebAuthenticationDetail', fromsubclass_=False): + if self.UserCredential: + self.UserCredential.export(outfile, level, namespace_, name_='UserCredential', ) + def hasContent_(self): + if ( + self.UserCredential is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='WebAuthenticationDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.UserCredential is not None: + showIndent(outfile, level) + outfile.write('UserCredential=model_.WebAuthenticationCredential(\n') + self.UserCredential.exportLiteral(outfile, level, name_='UserCredential') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'UserCredential': + obj_ = WebAuthenticationCredential.factory() + obj_.build(child_) + self.set_UserCredential(obj_) +# end class WebAuthenticationDetail + + +class WebAuthenticationCredential(GeneratedsSuper): + """Two part authentication string used for the sender's identity.""" + subclass = None + superclass = None + def __init__(self, Key=None, Password=None): + self.Key = Key + self.Password = Password + def factory(*args_, **kwargs_): + if WebAuthenticationCredential.subclass: + return WebAuthenticationCredential.subclass(*args_, **kwargs_) + else: + return WebAuthenticationCredential(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Key(self): return self.Key + def set_Key(self, Key): self.Key = Key + def get_Password(self): return self.Password + def set_Password(self, Password): self.Password = Password + def export(self, outfile, level, namespace_='ns:', name_='WebAuthenticationCredential', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='WebAuthenticationCredential') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='WebAuthenticationCredential'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='WebAuthenticationCredential', fromsubclass_=False): + if self.Key is not None: + showIndent(outfile, level) + outfile.write('<%sKey>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Key).encode(ExternalEncoding), input_name='Key'), namespace_)) + if self.Password is not None: + showIndent(outfile, level) + outfile.write('<%sPassword>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Password).encode(ExternalEncoding), input_name='Password'), namespace_)) + def hasContent_(self): + if ( + self.Key is not None or + self.Password is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='WebAuthenticationCredential'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Key is not None: + showIndent(outfile, level) + outfile.write('Key=%s,\n' % quote_python(self.Key).encode(ExternalEncoding)) + if self.Password is not None: + showIndent(outfile, level) + outfile.write('Password=%s,\n' % quote_python(self.Password).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Key': + Key_ = child_.text + Key_ = self.gds_validate_string(Key_, node, 'Key') + self.Key = Key_ + elif nodeName_ == 'Password': + Password_ = child_.text + Password_ = self.gds_validate_string(Password_, node, 'Password') + self.Password = Password_ +# end class WebAuthenticationCredential + + +class ClientDetail(GeneratedsSuper): + """The descriptive data identifying the client submitting the + transaction.""" + subclass = None + superclass = None + def __init__(self, AccountNumber=None, MeterNumber=None, Localization=None): + self.AccountNumber = AccountNumber + self.MeterNumber = MeterNumber + self.Localization = Localization + def factory(*args_, **kwargs_): + if ClientDetail.subclass: + return ClientDetail.subclass(*args_, **kwargs_) + else: + return ClientDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_AccountNumber(self): return self.AccountNumber + def set_AccountNumber(self, AccountNumber): self.AccountNumber = AccountNumber + def get_MeterNumber(self): return self.MeterNumber + def set_MeterNumber(self, MeterNumber): self.MeterNumber = MeterNumber + def get_Localization(self): return self.Localization + def set_Localization(self, Localization): self.Localization = Localization + def export(self, outfile, level, namespace_='ns:', name_='ClientDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ClientDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ClientDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ClientDetail', fromsubclass_=False): + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('<%sAccountNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AccountNumber).encode(ExternalEncoding), input_name='AccountNumber'), namespace_)) + if self.MeterNumber is not None: + showIndent(outfile, level) + outfile.write('<%sMeterNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.MeterNumber).encode(ExternalEncoding), input_name='MeterNumber'), namespace_)) + if self.Localization: + self.Localization.export(outfile, level, namespace_, name_='Localization') + def hasContent_(self): + if ( + self.AccountNumber is not None or + self.MeterNumber is not None or + self.Localization is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ClientDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('AccountNumber=%s,\n' % quote_python(self.AccountNumber).encode(ExternalEncoding)) + if self.MeterNumber is not None: + showIndent(outfile, level) + outfile.write('MeterNumber=%s,\n' % quote_python(self.MeterNumber).encode(ExternalEncoding)) + if self.Localization is not None: + showIndent(outfile, level) + outfile.write('Localization=model_.Localization(\n') + self.Localization.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'AccountNumber': + AccountNumber_ = child_.text + AccountNumber_ = self.gds_validate_string(AccountNumber_, node, 'AccountNumber') + self.AccountNumber = AccountNumber_ + elif nodeName_ == 'MeterNumber': + MeterNumber_ = child_.text + MeterNumber_ = self.gds_validate_string(MeterNumber_, node, 'MeterNumber') + self.MeterNumber = MeterNumber_ + elif nodeName_ == 'Localization': + obj_ = Localization.factory() + obj_.build(child_) + self.set_Localization(obj_) +# end class ClientDetail + + +class TransactionDetail(GeneratedsSuper): + """The descriptive data that governs data payload + language/translations.""" + subclass = None + superclass = None + def __init__(self, CustomerTransactionId=None, Localization=None): + self.CustomerTransactionId = CustomerTransactionId + self.Localization = Localization + def factory(*args_, **kwargs_): + if TransactionDetail.subclass: + return TransactionDetail.subclass(*args_, **kwargs_) + else: + return TransactionDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_CustomerTransactionId(self): return self.CustomerTransactionId + def set_CustomerTransactionId(self, CustomerTransactionId): self.CustomerTransactionId = CustomerTransactionId + def get_Localization(self): return self.Localization + def set_Localization(self, Localization): self.Localization = Localization + def export(self, outfile, level, namespace_='ns:', name_='TransactionDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='TransactionDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='TransactionDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='TransactionDetail', fromsubclass_=False): + if self.CustomerTransactionId is not None: + showIndent(outfile, level) + outfile.write('<%sCustomerTransactionId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CustomerTransactionId).encode(ExternalEncoding), input_name='CustomerTransactionId'), namespace_)) + if self.Localization: + self.Localization.export(outfile, level, namespace_, name_='Localization') + def hasContent_(self): + if ( + self.CustomerTransactionId is not None or + self.Localization is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='TransactionDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.CustomerTransactionId is not None: + showIndent(outfile, level) + outfile.write('CustomerTransactionId=%s,\n' % quote_python(self.CustomerTransactionId).encode(ExternalEncoding)) + if self.Localization is not None: + showIndent(outfile, level) + outfile.write('Localization=model_.Localization(\n') + self.Localization.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'CustomerTransactionId': + CustomerTransactionId_ = child_.text + CustomerTransactionId_ = self.gds_validate_string(CustomerTransactionId_, node, 'CustomerTransactionId') + self.CustomerTransactionId = CustomerTransactionId_ + elif nodeName_ == 'Localization': + obj_ = Localization.factory() + obj_.build(child_) + self.set_Localization(obj_) +# end class TransactionDetail + + +class Localization(GeneratedsSuper): + """The descriptive data for the local language and locale (i.e. + country).""" + subclass = None + superclass = None + def __init__(self, LanguageCode=None, LocaleCode=None): + self.LanguageCode = LanguageCode + self.LocaleCode = LocaleCode + def factory(*args_, **kwargs_): + if Localization.subclass: + return Localization.subclass(*args_, **kwargs_) + else: + return Localization(*args_, **kwargs_) + factory = staticmethod(factory) + def get_LanguageCode(self): return self.LanguageCode + def set_LanguageCode(self, LanguageCode): self.LanguageCode = LanguageCode + def get_LocaleCode(self): return self.LocaleCode + def set_LocaleCode(self, LocaleCode): self.LocaleCode = LocaleCode + def export(self, outfile, level, namespace_='ns:', name_='Localization', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Localization') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Localization'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Localization', fromsubclass_=False): + if self.LanguageCode is not None: + showIndent(outfile, level) + outfile.write('<%sLanguageCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LanguageCode).encode(ExternalEncoding), input_name='LanguageCode'), namespace_)) + if self.LocaleCode is not None: + showIndent(outfile, level) + outfile.write('<%sLocaleCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LocaleCode).encode(ExternalEncoding), input_name='LocaleCode'), namespace_)) + def hasContent_(self): + if ( + self.LanguageCode is not None or + self.LocaleCode is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Localization'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.LanguageCode is not None: + showIndent(outfile, level) + outfile.write('LanguageCode=%s,\n' % quote_python(self.LanguageCode).encode(ExternalEncoding)) + if self.LocaleCode is not None: + showIndent(outfile, level) + outfile.write('LocaleCode=%s,\n' % quote_python(self.LocaleCode).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'LanguageCode': + LanguageCode_ = child_.text + LanguageCode_ = self.gds_validate_string(LanguageCode_, node, 'LanguageCode') + self.LanguageCode = LanguageCode_ + elif nodeName_ == 'LocaleCode': + LocaleCode_ = child_.text + LocaleCode_ = self.gds_validate_string(LocaleCode_, node, 'LocaleCode') + self.LocaleCode = LocaleCode_ +# end class Localization + + +class VersionId(GeneratedsSuper): + """The descriptive data regarding the version/level of a service + operation performed by the callee (in each reply).""" + subclass = None + superclass = None + def __init__(self, ServiceId=None, Major=None, Intermediate=None, Minor=None): + self.ServiceId = ServiceId + self.Major = Major + self.Intermediate = Intermediate + self.Minor = Minor + def factory(*args_, **kwargs_): + if VersionId.subclass: + return VersionId.subclass(*args_, **kwargs_) + else: + return VersionId(*args_, **kwargs_) + factory = staticmethod(factory) + def get_ServiceId(self): return self.ServiceId + def set_ServiceId(self, ServiceId): self.ServiceId = ServiceId + def get_Major(self): return self.Major + def set_Major(self, Major): self.Major = Major + def get_Intermediate(self): return self.Intermediate + def set_Intermediate(self, Intermediate): self.Intermediate = Intermediate + def get_Minor(self): return self.Minor + def set_Minor(self, Minor): self.Minor = Minor + def export(self, outfile, level, namespace_='ns:', name_='VersionId', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='VersionId') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='VersionId'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='VersionId', fromsubclass_=False): + if self.ServiceId is not None: + showIndent(outfile, level) + outfile.write('<%sServiceId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ServiceId).encode(ExternalEncoding), input_name='ServiceId'), namespace_)) + if self.Major is not None: + showIndent(outfile, level) + outfile.write('<%sMajor>%s\n' % (namespace_, self.gds_format_integer(self.Major, input_name='Major'), namespace_)) + if self.Intermediate is not None: + showIndent(outfile, level) + outfile.write('<%sIntermediate>%s\n' % (namespace_, self.gds_format_integer(self.Intermediate, input_name='Intermediate'), namespace_)) + if self.Minor is not None: + showIndent(outfile, level) + outfile.write('<%sMinor>%s\n' % (namespace_, self.gds_format_integer(self.Minor, input_name='Minor'), namespace_)) + def hasContent_(self): + if ( + self.ServiceId is not None or + self.Major is not None or + self.Intermediate is not None or + self.Minor is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='VersionId'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.ServiceId is not None: + showIndent(outfile, level) + outfile.write('ServiceId=%s,\n' % quote_python(self.ServiceId).encode(ExternalEncoding)) + if self.Major is not None: + showIndent(outfile, level) + outfile.write('Major=%d,\n' % self.Major) + if self.Intermediate is not None: + showIndent(outfile, level) + outfile.write('Intermediate=%d,\n' % self.Intermediate) + if self.Minor is not None: + showIndent(outfile, level) + outfile.write('Minor=%d,\n' % self.Minor) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'ServiceId': + ServiceId_ = child_.text + ServiceId_ = self.gds_validate_string(ServiceId_, node, 'ServiceId') + self.ServiceId = ServiceId_ + elif nodeName_ == 'Major': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'Major') + self.Major = ival_ + elif nodeName_ == 'Intermediate': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'Intermediate') + self.Intermediate = ival_ + elif nodeName_ == 'Minor': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'Minor') + self.Minor = ival_ +# end class VersionId + + +class Address(GeneratedsSuper): + """The descriptive data for a physical location.""" + subclass = None + superclass = None + def __init__(self, StreetLines=None, City=None, StateOrProvinceCode=None, PostalCode=None, UrbanizationCode=None, CountryCode=None, Residential=None): + if StreetLines is None: + self.StreetLines = [] + else: + self.StreetLines = StreetLines + self.City = City + self.StateOrProvinceCode = StateOrProvinceCode + self.PostalCode = PostalCode + self.UrbanizationCode = UrbanizationCode + self.CountryCode = CountryCode + self.Residential = Residential + def factory(*args_, **kwargs_): + if Address.subclass: + return Address.subclass(*args_, **kwargs_) + else: + return Address(*args_, **kwargs_) + factory = staticmethod(factory) + def get_StreetLines(self): return self.StreetLines + def set_StreetLines(self, StreetLines): self.StreetLines = StreetLines + def add_StreetLines(self, value): self.StreetLines.append(value) + def insert_StreetLines(self, index, value): self.StreetLines[index] = value + def get_City(self): return self.City + def set_City(self, City): self.City = City + def get_StateOrProvinceCode(self): return self.StateOrProvinceCode + def set_StateOrProvinceCode(self, StateOrProvinceCode): self.StateOrProvinceCode = StateOrProvinceCode + def get_PostalCode(self): return self.PostalCode + def set_PostalCode(self, PostalCode): self.PostalCode = PostalCode + def get_UrbanizationCode(self): return self.UrbanizationCode + def set_UrbanizationCode(self, UrbanizationCode): self.UrbanizationCode = UrbanizationCode + def get_CountryCode(self): return self.CountryCode + def set_CountryCode(self, CountryCode): self.CountryCode = CountryCode + def get_Residential(self): return self.Residential + def set_Residential(self, Residential): self.Residential = Residential + def export(self, outfile, level, namespace_='ns:', name_='Address', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Address') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Address'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Address', fromsubclass_=False): + for StreetLines_ in self.StreetLines: + showIndent(outfile, level) + outfile.write('<%sStreetLines>%s\n' % (namespace_, self.gds_format_string(quote_xml(StreetLines_).encode(ExternalEncoding), input_name='StreetLines'), namespace_)) + if self.City is not None: + showIndent(outfile, level) + outfile.write('<%sCity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.City).encode(ExternalEncoding), input_name='City'), namespace_)) + if self.StateOrProvinceCode is not None: + showIndent(outfile, level) + outfile.write('<%sStateOrProvinceCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.StateOrProvinceCode).encode(ExternalEncoding), input_name='StateOrProvinceCode'), namespace_)) + if self.PostalCode is not None: + showIndent(outfile, level) + outfile.write('<%sPostalCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PostalCode).encode(ExternalEncoding), input_name='PostalCode'), namespace_)) + if self.UrbanizationCode is not None: + showIndent(outfile, level) + outfile.write('<%sUrbanizationCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.UrbanizationCode).encode(ExternalEncoding), input_name='UrbanizationCode'), namespace_)) + if self.CountryCode is not None: + showIndent(outfile, level) + outfile.write('<%sCountryCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CountryCode).encode(ExternalEncoding), input_name='CountryCode'), namespace_)) + if self.Residential is not None: + showIndent(outfile, level) + outfile.write('<%sResidential>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.Residential)), input_name='Residential'), namespace_)) + def hasContent_(self): + if ( + self.StreetLines or + self.City is not None or + self.StateOrProvinceCode is not None or + self.PostalCode is not None or + self.UrbanizationCode is not None or + self.CountryCode is not None or + self.Residential is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Address'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('StreetLines=[\n') + level += 1 + for StreetLines_ in self.StreetLines: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(StreetLines_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.City is not None: + showIndent(outfile, level) + outfile.write('City=%s,\n' % quote_python(self.City).encode(ExternalEncoding)) + if self.StateOrProvinceCode is not None: + showIndent(outfile, level) + outfile.write('StateOrProvinceCode=%s,\n' % quote_python(self.StateOrProvinceCode).encode(ExternalEncoding)) + if self.PostalCode is not None: + showIndent(outfile, level) + outfile.write('PostalCode=%s,\n' % quote_python(self.PostalCode).encode(ExternalEncoding)) + if self.UrbanizationCode is not None: + showIndent(outfile, level) + outfile.write('UrbanizationCode=%s,\n' % quote_python(self.UrbanizationCode).encode(ExternalEncoding)) + if self.CountryCode is not None: + showIndent(outfile, level) + outfile.write('CountryCode=%s,\n' % quote_python(self.CountryCode).encode(ExternalEncoding)) + if self.Residential is not None: + showIndent(outfile, level) + outfile.write('Residential=%s,\n' % self.Residential) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'StreetLines': + StreetLines_ = child_.text + StreetLines_ = self.gds_validate_string(StreetLines_, node, 'StreetLines') + self.StreetLines.append(StreetLines_) + elif nodeName_ == 'City': + City_ = child_.text + City_ = self.gds_validate_string(City_, node, 'City') + self.City = City_ + elif nodeName_ == 'StateOrProvinceCode': + StateOrProvinceCode_ = child_.text + StateOrProvinceCode_ = self.gds_validate_string(StateOrProvinceCode_, node, 'StateOrProvinceCode') + self.StateOrProvinceCode = StateOrProvinceCode_ + elif nodeName_ == 'PostalCode': + PostalCode_ = child_.text + PostalCode_ = self.gds_validate_string(PostalCode_, node, 'PostalCode') + self.PostalCode = PostalCode_ + elif nodeName_ == 'UrbanizationCode': + UrbanizationCode_ = child_.text + UrbanizationCode_ = self.gds_validate_string(UrbanizationCode_, node, 'UrbanizationCode') + self.UrbanizationCode = UrbanizationCode_ + elif nodeName_ == 'CountryCode': + CountryCode_ = child_.text + CountryCode_ = self.gds_validate_string(CountryCode_, node, 'CountryCode') + self.CountryCode = CountryCode_ + elif nodeName_ == 'Residential': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'Residential') + self.Residential = ival_ +# end class Address + + +class Notification(GeneratedsSuper): + """The descriptive data regarding the results of the submitted + transaction.""" + subclass = None + superclass = None + def __init__(self, Severity=None, Source=None, Code=None, Message=None, LocalizedMessage=None, MessageParameters=None): + self.Severity = Severity + self.Source = Source + self.Code = Code + self.Message = Message + self.LocalizedMessage = LocalizedMessage + if MessageParameters is None: + self.MessageParameters = [] + else: + self.MessageParameters = MessageParameters + def factory(*args_, **kwargs_): + if Notification.subclass: + return Notification.subclass(*args_, **kwargs_) + else: + return Notification(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Severity(self): return self.Severity + def set_Severity(self, Severity): self.Severity = Severity + def validate_NotificationSeverityType(self, value): + # Validate type NotificationSeverityType, a restriction on xs:string. + pass + def get_Source(self): return self.Source + def set_Source(self, Source): self.Source = Source + def get_Code(self): return self.Code + def set_Code(self, Code): self.Code = Code + def get_Message(self): return self.Message + def set_Message(self, Message): self.Message = Message + def get_LocalizedMessage(self): return self.LocalizedMessage + def set_LocalizedMessage(self, LocalizedMessage): self.LocalizedMessage = LocalizedMessage + def get_MessageParameters(self): return self.MessageParameters + def set_MessageParameters(self, MessageParameters): self.MessageParameters = MessageParameters + def add_MessageParameters(self, value): self.MessageParameters.append(value) + def insert_MessageParameters(self, index, value): self.MessageParameters[index] = value + def export(self, outfile, level, namespace_='ns:', name_='Notification', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Notification') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Notification'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Notification', fromsubclass_=False): + if self.Severity is not None: + showIndent(outfile, level) + outfile.write('<%sSeverity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Severity).encode(ExternalEncoding), input_name='Severity'), namespace_)) + if self.Source is not None: + showIndent(outfile, level) + outfile.write('<%sSource>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Source).encode(ExternalEncoding), input_name='Source'), namespace_)) + if self.Code is not None: + showIndent(outfile, level) + outfile.write('<%sCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Code).encode(ExternalEncoding), input_name='Code'), namespace_)) + if self.Message is not None: + showIndent(outfile, level) + outfile.write('<%sMessage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Message).encode(ExternalEncoding), input_name='Message'), namespace_)) + if self.LocalizedMessage is not None: + showIndent(outfile, level) + outfile.write('<%sLocalizedMessage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LocalizedMessage).encode(ExternalEncoding), input_name='LocalizedMessage'), namespace_)) + for MessageParameters_ in self.MessageParameters: + MessageParameters_.export(outfile, level, namespace_, name_='MessageParameters') + def hasContent_(self): + if ( + self.Severity is not None or + self.Source is not None or + self.Code is not None or + self.Message is not None or + self.LocalizedMessage is not None or + self.MessageParameters + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Notification'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Severity is not None: + showIndent(outfile, level) + outfile.write('Severity=%s,\n' % quote_python(self.Severity).encode(ExternalEncoding)) + if self.Source is not None: + showIndent(outfile, level) + outfile.write('Source=%s,\n' % quote_python(self.Source).encode(ExternalEncoding)) + if self.Code is not None: + showIndent(outfile, level) + outfile.write('Code=%s,\n' % quote_python(self.Code).encode(ExternalEncoding)) + if self.Message is not None: + showIndent(outfile, level) + outfile.write('Message=%s,\n' % quote_python(self.Message).encode(ExternalEncoding)) + if self.LocalizedMessage is not None: + showIndent(outfile, level) + outfile.write('LocalizedMessage=%s,\n' % quote_python(self.LocalizedMessage).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('MessageParameters=[\n') + level += 1 + for MessageParameters_ in self.MessageParameters: + showIndent(outfile, level) + outfile.write('model_.NotificationParameter(\n') + MessageParameters_.exportLiteral(outfile, level, name_='NotificationParameter') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Severity': + Severity_ = child_.text + Severity_ = self.gds_validate_string(Severity_, node, 'Severity') + self.Severity = Severity_ + self.validate_NotificationSeverityType(self.Severity) # validate type NotificationSeverityType + elif nodeName_ == 'Source': + Source_ = child_.text + Source_ = self.gds_validate_string(Source_, node, 'Source') + self.Source = Source_ + elif nodeName_ == 'Code': + Code_ = child_.text + Code_ = self.gds_validate_string(Code_, node, 'Code') + self.Code = Code_ + elif nodeName_ == 'Message': + Message_ = child_.text + Message_ = self.gds_validate_string(Message_, node, 'Message') + self.Message = Message_ + elif nodeName_ == 'LocalizedMessage': + LocalizedMessage_ = child_.text + LocalizedMessage_ = self.gds_validate_string(LocalizedMessage_, node, 'LocalizedMessage') + self.LocalizedMessage = LocalizedMessage_ + elif nodeName_ == 'MessageParameters': + obj_ = NotificationParameter.factory() + obj_.build(child_) + self.MessageParameters.append(obj_) +# end class Notification + + +class NotificationParameter(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Id=None, Value=None): + self.Id = Id + self.Value = Value + def factory(*args_, **kwargs_): + if NotificationParameter.subclass: + return NotificationParameter.subclass(*args_, **kwargs_) + else: + return NotificationParameter(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Id(self): return self.Id + def set_Id(self, Id): self.Id = Id + def get_Value(self): return self.Value + def set_Value(self, Value): self.Value = Value + def export(self, outfile, level, namespace_='ns:', name_='NotificationParameter', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='NotificationParameter') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='NotificationParameter'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='NotificationParameter', fromsubclass_=False): + if self.Id is not None: + showIndent(outfile, level) + outfile.write('<%sId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Id).encode(ExternalEncoding), input_name='Id'), namespace_)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('<%sValue>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Value).encode(ExternalEncoding), input_name='Value'), namespace_)) + def hasContent_(self): + if ( + self.Id is not None or + self.Value is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='NotificationParameter'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Id is not None: + showIndent(outfile, level) + outfile.write('Id=%s,\n' % quote_python(self.Id).encode(ExternalEncoding)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('Value=%s,\n' % quote_python(self.Value).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Id': + Id_ = child_.text + Id_ = self.gds_validate_string(Id_, node, 'Id') + self.Id = Id_ + elif nodeName_ == 'Value': + Value_ = child_.text + Value_ = self.gds_validate_string(Value_, node, 'Value') + self.Value = Value_ +# end class NotificationParameter + + +class ExpressTagAvailabilityRequest(GeneratedsSuper): + """FedEx Express Tag Availability request.""" + subclass = None + superclass = None + def __init__(self, WebAuthenticationDetail=None, ClientDetail=None, TransactionDetail=None, Version=None, ReadyDateTime=None, OriginAddress=None, Service=None, Packaging=None): + self.WebAuthenticationDetail = WebAuthenticationDetail + self.ClientDetail = ClientDetail + self.TransactionDetail = TransactionDetail + self.Version = Version + self.ReadyDateTime = ReadyDateTime + self.OriginAddress = OriginAddress + self.Service = Service + self.Packaging = Packaging + def factory(*args_, **kwargs_): + if ExpressTagAvailabilityRequest.subclass: + return ExpressTagAvailabilityRequest.subclass(*args_, **kwargs_) + else: + return ExpressTagAvailabilityRequest(*args_, **kwargs_) + factory = staticmethod(factory) + def get_WebAuthenticationDetail(self): return self.WebAuthenticationDetail + def set_WebAuthenticationDetail(self, WebAuthenticationDetail): self.WebAuthenticationDetail = WebAuthenticationDetail + def get_ClientDetail(self): return self.ClientDetail + def set_ClientDetail(self, ClientDetail): self.ClientDetail = ClientDetail + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_ReadyDateTime(self): return self.ReadyDateTime + def set_ReadyDateTime(self, ReadyDateTime): self.ReadyDateTime = ReadyDateTime + def get_OriginAddress(self): return self.OriginAddress + def set_OriginAddress(self, OriginAddress): self.OriginAddress = OriginAddress + def get_Service(self): return self.Service + def set_Service(self, Service): self.Service = Service + def validate_ServiceType(self, value): + # Validate type ServiceType, a restriction on xs:string. + pass + def get_Packaging(self): return self.Packaging + def set_Packaging(self, Packaging): self.Packaging = Packaging + def validate_PackagingType(self, value): + # Validate type PackagingType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='ExpressTagAvailabilityRequest', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ExpressTagAvailabilityRequest') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ExpressTagAvailabilityRequest'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ExpressTagAvailabilityRequest', fromsubclass_=False): + if self.WebAuthenticationDetail: + self.WebAuthenticationDetail.export(outfile, level, namespace_, name_='WebAuthenticationDetail', ) + if self.ClientDetail: + self.ClientDetail.export(outfile, level, namespace_, name_='ClientDetail', ) + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.ReadyDateTime is not None: + showIndent(outfile, level) + outfile.write('<%sReadyDateTime>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ReadyDateTime).encode(ExternalEncoding), input_name='ReadyDateTime'), namespace_)) + if self.OriginAddress: + self.OriginAddress.export(outfile, level, namespace_, name_='OriginAddress', ) + if self.Service is not None: + showIndent(outfile, level) + outfile.write('<%sService>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Service).encode(ExternalEncoding), input_name='Service'), namespace_)) + if self.Packaging is not None: + showIndent(outfile, level) + outfile.write('<%sPackaging>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Packaging).encode(ExternalEncoding), input_name='Packaging'), namespace_)) + def hasContent_(self): + if ( + self.WebAuthenticationDetail is not None or + self.ClientDetail is not None or + self.TransactionDetail is not None or + self.Version is not None or + self.ReadyDateTime is not None or + self.OriginAddress is not None or + self.Service is not None or + self.Packaging is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ExpressTagAvailabilityRequest'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.WebAuthenticationDetail is not None: + showIndent(outfile, level) + outfile.write('WebAuthenticationDetail=model_.WebAuthenticationDetail(\n') + self.WebAuthenticationDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ClientDetail is not None: + showIndent(outfile, level) + outfile.write('ClientDetail=model_.ClientDetail(\n') + self.ClientDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.ReadyDateTime is not None: + showIndent(outfile, level) + outfile.write('ReadyDateTime=%s,\n' % quote_python(self.ReadyDateTime).encode(ExternalEncoding)) + if self.OriginAddress is not None: + showIndent(outfile, level) + outfile.write('OriginAddress=model_.Address(\n') + self.OriginAddress.exportLiteral(outfile, level, name_='OriginAddress') + showIndent(outfile, level) + outfile.write('),\n') + if self.Service is not None: + showIndent(outfile, level) + outfile.write('Service=%s,\n' % quote_python(self.Service).encode(ExternalEncoding)) + if self.Packaging is not None: + showIndent(outfile, level) + outfile.write('Packaging=%s,\n' % quote_python(self.Packaging).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'WebAuthenticationDetail': + obj_ = WebAuthenticationDetail.factory() + obj_.build(child_) + self.set_WebAuthenticationDetail(obj_) + elif nodeName_ == 'ClientDetail': + obj_ = ClientDetail.factory() + obj_.build(child_) + self.set_ClientDetail(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'ReadyDateTime': + ReadyDateTime_ = child_.text + ReadyDateTime_ = self.gds_validate_string(ReadyDateTime_, node, 'ReadyDateTime') + self.ReadyDateTime = ReadyDateTime_ + elif nodeName_ == 'OriginAddress': + obj_ = Address.factory() + obj_.build(child_) + self.set_OriginAddress(obj_) + elif nodeName_ == 'Service': + Service_ = child_.text + Service_ = self.gds_validate_string(Service_, node, 'Service') + self.Service = Service_ + self.validate_ServiceType(self.Service) # validate type ServiceType + elif nodeName_ == 'Packaging': + Packaging_ = child_.text + Packaging_ = self.gds_validate_string(Packaging_, node, 'Packaging') + self.Packaging = Packaging_ + self.validate_PackagingType(self.Packaging) # validate type PackagingType +# end class ExpressTagAvailabilityRequest + + +class ExpressTagAvailabilityReply(GeneratedsSuper): + """FedEx Express Tag Availability reply.""" + subclass = None + superclass = None + def __init__(self, HighestSeverity=None, Notifications=None, TransactionDetail=None, Version=None, AccessTime=None, ReadyTime=None, Availability=None): + self.HighestSeverity = HighestSeverity + if Notifications is None: + self.Notifications = [] + else: + self.Notifications = Notifications + self.TransactionDetail = TransactionDetail + self.Version = Version + self.AccessTime = AccessTime + self.ReadyTime = ReadyTime + self.Availability = Availability + def factory(*args_, **kwargs_): + if ExpressTagAvailabilityReply.subclass: + return ExpressTagAvailabilityReply.subclass(*args_, **kwargs_) + else: + return ExpressTagAvailabilityReply(*args_, **kwargs_) + factory = staticmethod(factory) + def get_HighestSeverity(self): return self.HighestSeverity + def set_HighestSeverity(self, HighestSeverity): self.HighestSeverity = HighestSeverity + def validate_NotificationSeverityType(self, value): + # Validate type NotificationSeverityType, a restriction on xs:string. + pass + def get_Notifications(self): return self.Notifications + def set_Notifications(self, Notifications): self.Notifications = Notifications + def add_Notifications(self, value): self.Notifications.append(value) + def insert_Notifications(self, index, value): self.Notifications[index] = value + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_AccessTime(self): return self.AccessTime + def set_AccessTime(self, AccessTime): self.AccessTime = AccessTime + def get_ReadyTime(self): return self.ReadyTime + def set_ReadyTime(self, ReadyTime): self.ReadyTime = ReadyTime + def get_Availability(self): return self.Availability + def set_Availability(self, Availability): self.Availability = Availability + def validate_ExpressTagAvailabilityType(self, value): + # Validate type ExpressTagAvailabilityType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='ExpressTagAvailabilityReply', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ExpressTagAvailabilityReply') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ExpressTagAvailabilityReply'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ExpressTagAvailabilityReply', fromsubclass_=False): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('<%sHighestSeverity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HighestSeverity).encode(ExternalEncoding), input_name='HighestSeverity'), namespace_)) + for Notifications_ in self.Notifications: + Notifications_.export(outfile, level, namespace_, name_='Notifications') + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version') + if self.AccessTime: + self.AccessTime.export(outfile, level, namespace_, name_='AccessTime') + if self.ReadyTime: + self.ReadyTime.export(outfile, level, namespace_, name_='ReadyTime') + if self.Availability is not None: + showIndent(outfile, level) + outfile.write('<%sAvailability>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Availability).encode(ExternalEncoding), input_name='Availability'), namespace_)) + def hasContent_(self): + if ( + self.HighestSeverity is not None or + self.Notifications or + self.TransactionDetail is not None or + self.Version is not None or + self.AccessTime is not None or + self.ReadyTime is not None or + self.Availability is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ExpressTagAvailabilityReply'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('HighestSeverity=%s,\n' % quote_python(self.HighestSeverity).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Notifications=[\n') + level += 1 + for Notifications_ in self.Notifications: + showIndent(outfile, level) + outfile.write('model_.Notification(\n') + Notifications_.exportLiteral(outfile, level, name_='Notification') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.AccessTime is not None: + showIndent(outfile, level) + outfile.write('AccessTime=model_.xs_time(\n') + self.AccessTime.exportLiteral(outfile, level, name_='AccessTime') + showIndent(outfile, level) + outfile.write('),\n') + if self.ReadyTime is not None: + showIndent(outfile, level) + outfile.write('ReadyTime=model_.xs_time(\n') + self.ReadyTime.exportLiteral(outfile, level, name_='ReadyTime') + showIndent(outfile, level) + outfile.write('),\n') + if self.Availability is not None: + showIndent(outfile, level) + outfile.write('Availability=%s,\n' % quote_python(self.Availability).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'HighestSeverity': + HighestSeverity_ = child_.text + HighestSeverity_ = self.gds_validate_string(HighestSeverity_, node, 'HighestSeverity') + self.HighestSeverity = HighestSeverity_ + self.validate_NotificationSeverityType(self.HighestSeverity) # validate type NotificationSeverityType + elif nodeName_ == 'Notifications': + obj_ = Notification.factory() + obj_.build(child_) + self.Notifications.append(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'AccessTime': + obj_ = xs_time.factory() + obj_.build(child_) + self.set_AccessTime(obj_) + elif nodeName_ == 'ReadyTime': + obj_ = xs_time.factory() + obj_.build(child_) + self.set_ReadyTime(obj_) + elif nodeName_ == 'Availability': + Availability_ = child_.text + Availability_ = self.gds_validate_string(Availability_, node, 'Availability') + self.Availability = Availability_ + self.validate_ExpressTagAvailabilityType(self.Availability) # validate type ExpressTagAvailabilityType +# end class ExpressTagAvailabilityReply + + +USAGE_TEXT = """ +Usage: python .py [ -s ] +""" + +def usage(): + print USAGE_TEXT + sys.exit(1) + + +def get_root_tag(node): + tag = Tag_pattern_.match(node.tag).groups()[-1] + rootClass = globals().get(tag) + return tag, rootClass + + +def parse(inFileName): + doc = parsexml_(inFileName) + rootNode = doc.getroot() + rootTag, rootClass = get_root_tag(rootNode) + if rootClass is None: + rootTag = 'ExpressTagAvailabilityRequest' + rootClass = ExpressTagAvailabilityRequest + rootObj = rootClass.factory() + rootObj.build(rootNode) + # Enable Python to collect the space used by the DOM. + doc = None + sys.stdout.write('\n') + rootObj.export(sys.stdout, 0, name_=rootTag, + namespacedef_='') + return rootObj + + +def parseString(inString): + from StringIO import StringIO + doc = parsexml_(StringIO(inString)) + rootNode = doc.getroot() + rootTag, rootClass = get_root_tag(rootNode) + if rootClass is None: + rootTag = 'ExpressTagAvailabilityRequest' + rootClass = ExpressTagAvailabilityRequest + rootObj = rootClass.factory() + rootObj.build(rootNode) + # Enable Python to collect the space used by the DOM. + doc = None + sys.stdout.write('\n') + rootObj.export(sys.stdout, 0, name_="ExpressTagAvailabilityRequest", + namespacedef_='') + return rootObj + + +def parseLiteral(inFileName): + doc = parsexml_(inFileName) + rootNode = doc.getroot() + rootTag, rootClass = get_root_tag(rootNode) + if rootClass is None: + rootTag = 'ExpressTagAvailabilityRequest' + rootClass = ExpressTagAvailabilityRequest + rootObj = rootClass.factory() + rootObj.build(rootNode) + # Enable Python to collect the space used by the DOM. + doc = None + sys.stdout.write('#from return import *\n\n') + sys.stdout.write('import return as model_\n\n') + sys.stdout.write('rootObj = model_.rootTag(\n') + rootObj.exportLiteral(sys.stdout, 0, name_=rootTag) + sys.stdout.write(')\n') + return rootObj + + +def main(): + args = sys.argv[1:] + if len(args) == 1: + parse(args[0]) + else: + usage() + + +if __name__ == '__main__': + #import pdb; pdb.set_trace() + main() + + +__all__ = [ + "Address", + "ClientDetail", + "ExpressTagAvailabilityReply", + "ExpressTagAvailabilityRequest", + "Localization", + "Notification", + "NotificationParameter", + "TransactionDetail", + "VersionId", + "WebAuthenticationCredential", + "WebAuthenticationDetail" + ] diff --git a/webxml/fedex/ship.py b/webxml/fedex/ship.py new file mode 100644 index 0000000..21b7969 --- /dev/null +++ b/webxml/fedex/ship.py @@ -0,0 +1,21125 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# +# Generated Mon Nov 28 15:44:08 2011 by generateDS.py version 2.6a. +# + +import sys +import getopt +import re as re_ + +etree_ = None +Verbose_import_ = False +( XMLParser_import_none, XMLParser_import_lxml, + XMLParser_import_elementtree + ) = range(3) +XMLParser_import_library = None +try: + # lxml + from lxml import etree as etree_ + XMLParser_import_library = XMLParser_import_lxml + if Verbose_import_: + print("running with lxml.etree") +except ImportError: + try: + # cElementTree from Python 2.5+ + import xml.etree.cElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with cElementTree on Python 2.5+") + except ImportError: + try: + # ElementTree from Python 2.5+ + import xml.etree.ElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with ElementTree on Python 2.5+") + except ImportError: + try: + # normal cElementTree install + import cElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with cElementTree") + except ImportError: + try: + # normal ElementTree install + import elementtree.ElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with ElementTree") + except ImportError: + raise ImportError("Failed to import ElementTree from any known place") + +def parsexml_(*args, **kwargs): + if (XMLParser_import_library == XMLParser_import_lxml and + 'parser' not in kwargs): + # Use the lxml ElementTree compatible parser so that, e.g., + # we ignore comments. + kwargs['parser'] = etree_.ETCompatXMLParser() + doc = etree_.parse(*args, **kwargs) + return doc + +# +# User methods +# +# Calls to the methods in these classes are generated by generateDS.py. +# You can replace these methods by re-implementing the following class +# in a module named generatedssuper.py. + +try: + from generatedssuper import GeneratedsSuper +except ImportError, exp: + + class GeneratedsSuper(object): + def gds_format_string(self, input_data, input_name=''): + return input_data + def gds_validate_string(self, input_data, node, input_name=''): + return input_data + def gds_format_integer(self, input_data, input_name=''): + return '%d' % input_data + def gds_validate_integer(self, input_data, node, input_name=''): + return input_data + def gds_format_integer_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_integer_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + try: + fvalue = float(value) + except (TypeError, ValueError), exp: + raise_parse_error(node, 'Requires sequence of integers') + return input_data + def gds_format_float(self, input_data, input_name=''): + return '%f' % input_data + def gds_validate_float(self, input_data, node, input_name=''): + return input_data + def gds_format_float_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_float_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + try: + fvalue = float(value) + except (TypeError, ValueError), exp: + raise_parse_error(node, 'Requires sequence of floats') + return input_data + def gds_format_double(self, input_data, input_name=''): + return '%e' % input_data + def gds_validate_double(self, input_data, node, input_name=''): + return input_data + def gds_format_double_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_double_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + try: + fvalue = float(value) + except (TypeError, ValueError), exp: + raise_parse_error(node, 'Requires sequence of doubles') + return input_data + def gds_format_boolean(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_boolean(self, input_data, node, input_name=''): + return input_data + def gds_format_boolean_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_boolean_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + if value not in ('true', '1', 'false', '0', ): + raise_parse_error(node, 'Requires sequence of booleans ("true", "1", "false", "0")') + return input_data + def gds_str_lower(self, instring): + return instring.lower() + def get_path_(self, node): + path_list = [] + self.get_path_list_(node, path_list) + path_list.reverse() + path = '/'.join(path_list) + return path + Tag_strip_pattern_ = re_.compile(r'\{.*\}') + def get_path_list_(self, node, path_list): + if node is None: + return + tag = GeneratedsSuper.Tag_strip_pattern_.sub('', node.tag) + if tag: + path_list.append(tag) + self.get_path_list_(node.getparent(), path_list) + def get_class_obj_(self, node, default_class=None): + class_obj1 = default_class + if 'xsi' in node.nsmap: + classname = node.get('{%s}type' % node.nsmap['xsi']) + if classname is not None: + names = classname.split(':') + if len(names) == 2: + classname = names[1] + class_obj2 = globals().get(classname) + if class_obj2 is not None: + class_obj1 = class_obj2 + return class_obj1 + + +# +# If you have installed IPython you can uncomment and use the following. +# IPython is available from http://ipython.scipy.org/. +# + +## from IPython.Shell import IPShellEmbed +## args = '' +## ipshell = IPShellEmbed(args, +## banner = 'Dropping into IPython', +## exit_msg = 'Leaving Interpreter, back to program.') + +# Then use the following line where and when you want to drop into the +# IPython shell: +# ipshell(' -- Entering ipshell.\nHit Ctrl-D to exit') + +# +# Globals +# + +ExternalEncoding = 'ascii' +Tag_pattern_ = re_.compile(r'({.*})?(.*)') +String_cleanup_pat_ = re_.compile(r"[\n\r\s]+") +Namespace_extract_pat_ = re_.compile(r'{(.*)}(.*)') + +# +# Support/utility functions. +# + +def showIndent(outfile, level): + for idx in range(level): + outfile.write(' ') + +def quote_xml(inStr): + if not inStr: + return '' + s1 = (isinstance(inStr, basestring) and inStr or + '%s' % inStr) + s1 = s1.replace('&', '&') + s1 = s1.replace('<', '<') + s1 = s1.replace('>', '>') + return s1 + +def quote_attrib(inStr): + s1 = (isinstance(inStr, basestring) and inStr or + '%s' % inStr) + s1 = s1.replace('&', '&') + s1 = s1.replace('<', '<') + s1 = s1.replace('>', '>') + if '"' in s1: + if "'" in s1: + s1 = '"%s"' % s1.replace('"', """) + else: + s1 = "'%s'" % s1 + else: + s1 = '"%s"' % s1 + return s1 + +def quote_python(inStr): + s1 = inStr + if s1.find("'") == -1: + if s1.find('\n') == -1: + return "'%s'" % s1 + else: + return "'''%s'''" % s1 + else: + if s1.find('"') != -1: + s1 = s1.replace('"', '\\"') + if s1.find('\n') == -1: + return '"%s"' % s1 + else: + return '"""%s"""' % s1 + +def get_all_text_(node): + if node.text is not None: + text = node.text + else: + text = '' + for child in node: + if child.tail is not None: + text += child.tail + return text + +def find_attr_value_(attr_name, node): + attrs = node.attrib + attr_parts = attr_name.split(':') + value = None + if len(attr_parts) == 1: + value = attrs.get(attr_name) + elif len(attr_parts) == 2: + prefix, name = attr_parts + namespace = node.nsmap.get(prefix) + if namespace is not None: + value = attrs.get('{%s}%s' % (namespace, name, )) + return value + + +class GDSParseError(Exception): + pass + +def raise_parse_error(node, msg): + if XMLParser_import_library == XMLParser_import_lxml: + msg = '%s (element %s/line %d)' % (msg, node.tag, node.sourceline, ) + else: + msg = '%s (element %s)' % (msg, node.tag, ) + raise GDSParseError(msg) + + +class MixedContainer: + # Constants for category: + CategoryNone = 0 + CategoryText = 1 + CategorySimple = 2 + CategoryComplex = 3 + # Constants for content_type: + TypeNone = 0 + TypeText = 1 + TypeString = 2 + TypeInteger = 3 + TypeFloat = 4 + TypeDecimal = 5 + TypeDouble = 6 + TypeBoolean = 7 + def __init__(self, category, content_type, name, value): + self.category = category + self.content_type = content_type + self.name = name + self.value = value + def getCategory(self): + return self.category + def getContenttype(self, content_type): + return self.content_type + def getValue(self): + return self.value + def getName(self): + return self.name + def export(self, outfile, level, name, namespace): + if self.category == MixedContainer.CategoryText: + # Prevent exporting empty content as empty lines. + if self.value.strip(): + outfile.write(self.value) + elif self.category == MixedContainer.CategorySimple: + self.exportSimple(outfile, level, name) + else: # category == MixedContainer.CategoryComplex + self.value.export(outfile, level, namespace,name) + def exportSimple(self, outfile, level, name): + if self.content_type == MixedContainer.TypeString: + outfile.write('<%s>%s' % (self.name, self.value, self.name)) + elif self.content_type == MixedContainer.TypeInteger or \ + self.content_type == MixedContainer.TypeBoolean: + outfile.write('<%s>%d' % (self.name, self.value, self.name)) + elif self.content_type == MixedContainer.TypeFloat or \ + self.content_type == MixedContainer.TypeDecimal: + outfile.write('<%s>%f' % (self.name, self.value, self.name)) + elif self.content_type == MixedContainer.TypeDouble: + outfile.write('<%s>%g' % (self.name, self.value, self.name)) + def exportLiteral(self, outfile, level, name): + if self.category == MixedContainer.CategoryText: + showIndent(outfile, level) + outfile.write('model_.MixedContainer(%d, %d, "%s", "%s"),\n' % \ + (self.category, self.content_type, self.name, self.value)) + elif self.category == MixedContainer.CategorySimple: + showIndent(outfile, level) + outfile.write('model_.MixedContainer(%d, %d, "%s", "%s"),\n' % \ + (self.category, self.content_type, self.name, self.value)) + else: # category == MixedContainer.CategoryComplex + showIndent(outfile, level) + outfile.write('model_.MixedContainer(%d, %d, "%s",\n' % \ + (self.category, self.content_type, self.name,)) + self.value.exportLiteral(outfile, level + 1) + showIndent(outfile, level) + outfile.write(')\n') + + +class MemberSpec_(object): + def __init__(self, name='', data_type='', container=0): + self.name = name + self.data_type = data_type + self.container = container + def set_name(self, name): self.name = name + def get_name(self): return self.name + def set_data_type(self, data_type): self.data_type = data_type + def get_data_type_chain(self): return self.data_type + def get_data_type(self): + if isinstance(self.data_type, list): + if len(self.data_type) > 0: + return self.data_type[-1] + else: + return 'xs:string' + else: + return self.data_type + def set_container(self, container): self.container = container + def get_container(self): return self.container + +def _cast(typ, value): + if typ is None or value is None: + return value + return typ(value) + +# +# Data representation classes. +# + +class AdditionalLabelsDetail(GeneratedsSuper): + """Specifies additional labels to be produced. All required labels for + shipments will be produced without the need to request + additional labels. These are only available as thermal labels.""" + subclass = None + superclass = None + def __init__(self, Type=None, Count=None): + self.Type = Type + self.Count = Count + def factory(*args_, **kwargs_): + if AdditionalLabelsDetail.subclass: + return AdditionalLabelsDetail.subclass(*args_, **kwargs_) + else: + return AdditionalLabelsDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Type(self): return self.Type + def set_Type(self, Type): self.Type = Type + def validate_AdditionalLabelsType(self, value): + # Validate type AdditionalLabelsType, a restriction on xs:string. + pass + def get_Count(self): return self.Count + def set_Count(self, Count): self.Count = Count + def export(self, outfile, level, namespace_='ns:', name_='AdditionalLabelsDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='AdditionalLabelsDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='AdditionalLabelsDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='AdditionalLabelsDetail', fromsubclass_=False): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('<%sType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Type).encode(ExternalEncoding), input_name='Type'), namespace_)) + if self.Count is not None: + showIndent(outfile, level) + outfile.write('<%sCount>%s\n' % (namespace_, self.gds_format_integer(self.Count, input_name='Count'), namespace_)) + def hasContent_(self): + if ( + self.Type is not None or + self.Count is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='AdditionalLabelsDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('Type=%s,\n' % quote_python(self.Type).encode(ExternalEncoding)) + if self.Count is not None: + showIndent(outfile, level) + outfile.write('Count=%d,\n' % self.Count) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Type': + Type_ = child_.text + Type_ = self.gds_validate_string(Type_, node, 'Type') + self.Type = Type_ + self.validate_AdditionalLabelsType(self.Type) # validate type AdditionalLabelsType + elif nodeName_ == 'Count': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'Count') + self.Count = ival_ +# end class AdditionalLabelsDetail + + +class Address(GeneratedsSuper): + """Descriptive data for a physical location. May be used as an actual + physical address (place to which one could go), or as a + container of "address parts" which should be handled as a unit + (such as a city-state-ZIP combination within the US).""" + subclass = None + superclass = None + def __init__(self, StreetLines=None, City=None, StateOrProvinceCode=None, PostalCode=None, UrbanizationCode=None, CountryCode=None, Residential=None): + if StreetLines is None: + self.StreetLines = [] + else: + self.StreetLines = StreetLines + self.City = City + self.StateOrProvinceCode = StateOrProvinceCode + self.PostalCode = PostalCode + self.UrbanizationCode = UrbanizationCode + self.CountryCode = CountryCode + self.Residential = Residential + def factory(*args_, **kwargs_): + if Address.subclass: + return Address.subclass(*args_, **kwargs_) + else: + return Address(*args_, **kwargs_) + factory = staticmethod(factory) + def get_StreetLines(self): return self.StreetLines + def set_StreetLines(self, StreetLines): self.StreetLines = StreetLines + def add_StreetLines(self, value): self.StreetLines.append(value) + def insert_StreetLines(self, index, value): self.StreetLines[index] = value + def get_City(self): return self.City + def set_City(self, City): self.City = City + def get_StateOrProvinceCode(self): return self.StateOrProvinceCode + def set_StateOrProvinceCode(self, StateOrProvinceCode): self.StateOrProvinceCode = StateOrProvinceCode + def get_PostalCode(self): return self.PostalCode + def set_PostalCode(self, PostalCode): self.PostalCode = PostalCode + def get_UrbanizationCode(self): return self.UrbanizationCode + def set_UrbanizationCode(self, UrbanizationCode): self.UrbanizationCode = UrbanizationCode + def get_CountryCode(self): return self.CountryCode + def set_CountryCode(self, CountryCode): self.CountryCode = CountryCode + def get_Residential(self): return self.Residential + def set_Residential(self, Residential): self.Residential = Residential + def export(self, outfile, level, namespace_='ns:', name_='Address', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Address') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Address'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Address', fromsubclass_=False): + for StreetLines_ in self.StreetLines: + showIndent(outfile, level) + outfile.write('<%sStreetLines>%s\n' % (namespace_, self.gds_format_string(quote_xml(StreetLines_).encode(ExternalEncoding), input_name='StreetLines'), namespace_)) + if self.City is not None: + showIndent(outfile, level) + outfile.write('<%sCity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.City).encode(ExternalEncoding), input_name='City'), namespace_)) + if self.StateOrProvinceCode is not None: + showIndent(outfile, level) + outfile.write('<%sStateOrProvinceCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.StateOrProvinceCode).encode(ExternalEncoding), input_name='StateOrProvinceCode'), namespace_)) + if self.PostalCode is not None: + showIndent(outfile, level) + outfile.write('<%sPostalCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PostalCode).encode(ExternalEncoding), input_name='PostalCode'), namespace_)) + if self.UrbanizationCode is not None: + showIndent(outfile, level) + outfile.write('<%sUrbanizationCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.UrbanizationCode).encode(ExternalEncoding), input_name='UrbanizationCode'), namespace_)) + if self.CountryCode is not None: + showIndent(outfile, level) + outfile.write('<%sCountryCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CountryCode).encode(ExternalEncoding), input_name='CountryCode'), namespace_)) + if self.Residential is not None: + showIndent(outfile, level) + outfile.write('<%sResidential>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.Residential)), input_name='Residential'), namespace_)) + def hasContent_(self): + if ( + self.StreetLines or + self.City is not None or + self.StateOrProvinceCode is not None or + self.PostalCode is not None or + self.UrbanizationCode is not None or + self.CountryCode is not None or + self.Residential is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Address'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('StreetLines=[\n') + level += 1 + for StreetLines_ in self.StreetLines: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(StreetLines_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.City is not None: + showIndent(outfile, level) + outfile.write('City=%s,\n' % quote_python(self.City).encode(ExternalEncoding)) + if self.StateOrProvinceCode is not None: + showIndent(outfile, level) + outfile.write('StateOrProvinceCode=%s,\n' % quote_python(self.StateOrProvinceCode).encode(ExternalEncoding)) + if self.PostalCode is not None: + showIndent(outfile, level) + outfile.write('PostalCode=%s,\n' % quote_python(self.PostalCode).encode(ExternalEncoding)) + if self.UrbanizationCode is not None: + showIndent(outfile, level) + outfile.write('UrbanizationCode=%s,\n' % quote_python(self.UrbanizationCode).encode(ExternalEncoding)) + if self.CountryCode is not None: + showIndent(outfile, level) + outfile.write('CountryCode=%s,\n' % quote_python(self.CountryCode).encode(ExternalEncoding)) + if self.Residential is not None: + showIndent(outfile, level) + outfile.write('Residential=%s,\n' % self.Residential) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'StreetLines': + StreetLines_ = child_.text + StreetLines_ = self.gds_validate_string(StreetLines_, node, 'StreetLines') + self.StreetLines.append(StreetLines_) + elif nodeName_ == 'City': + City_ = child_.text + City_ = self.gds_validate_string(City_, node, 'City') + self.City = City_ + elif nodeName_ == 'StateOrProvinceCode': + StateOrProvinceCode_ = child_.text + StateOrProvinceCode_ = self.gds_validate_string(StateOrProvinceCode_, node, 'StateOrProvinceCode') + self.StateOrProvinceCode = StateOrProvinceCode_ + elif nodeName_ == 'PostalCode': + PostalCode_ = child_.text + PostalCode_ = self.gds_validate_string(PostalCode_, node, 'PostalCode') + self.PostalCode = PostalCode_ + elif nodeName_ == 'UrbanizationCode': + UrbanizationCode_ = child_.text + UrbanizationCode_ = self.gds_validate_string(UrbanizationCode_, node, 'UrbanizationCode') + self.UrbanizationCode = UrbanizationCode_ + elif nodeName_ == 'CountryCode': + CountryCode_ = child_.text + CountryCode_ = self.gds_validate_string(CountryCode_, node, 'CountryCode') + self.CountryCode = CountryCode_ + elif nodeName_ == 'Residential': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'Residential') + self.Residential = ival_ +# end class Address + + +class BinaryBarcode(GeneratedsSuper): + """Each instance of this data type represents a barcode whose content + must be represented as binary data (i.e. not ASCII text).""" + subclass = None + superclass = None + def __init__(self, Type=None, Value=None): + self.Type = Type + self.Value = Value + def factory(*args_, **kwargs_): + if BinaryBarcode.subclass: + return BinaryBarcode.subclass(*args_, **kwargs_) + else: + return BinaryBarcode(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Type(self): return self.Type + def set_Type(self, Type): self.Type = Type + def validate_BinaryBarcodeType(self, value): + # Validate type BinaryBarcodeType, a restriction on xs:string. + pass + def get_Value(self): return self.Value + def set_Value(self, Value): self.Value = Value + def export(self, outfile, level, namespace_='ns:', name_='BinaryBarcode', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='BinaryBarcode') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='BinaryBarcode'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='BinaryBarcode', fromsubclass_=False): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('<%sType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Type).encode(ExternalEncoding), input_name='Type'), namespace_)) + if self.Value: + self.Value.export(outfile, level, namespace_, name_='Value') + def hasContent_(self): + if ( + self.Type is not None or + self.Value is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='BinaryBarcode'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('Type=%s,\n' % quote_python(self.Type).encode(ExternalEncoding)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('Value=model_.xs_base64Binary(\n') + self.Value.exportLiteral(outfile, level, name_='Value') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Type': + Type_ = child_.text + Type_ = self.gds_validate_string(Type_, node, 'Type') + self.Type = Type_ + self.validate_BinaryBarcodeType(self.Type) # validate type BinaryBarcodeType + elif nodeName_ == 'Value': + obj_ = xs_base64Binary.factory() + obj_.build(child_) + self.set_Value(obj_) +# end class BinaryBarcode + + +class CancelPendingShipmentReply(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, HighestSeverity=None, Notifications=None, TransactionDetail=None, Version=None): + self.HighestSeverity = HighestSeverity + if Notifications is None: + self.Notifications = [] + else: + self.Notifications = Notifications + self.TransactionDetail = TransactionDetail + self.Version = Version + def factory(*args_, **kwargs_): + if CancelPendingShipmentReply.subclass: + return CancelPendingShipmentReply.subclass(*args_, **kwargs_) + else: + return CancelPendingShipmentReply(*args_, **kwargs_) + factory = staticmethod(factory) + def get_HighestSeverity(self): return self.HighestSeverity + def set_HighestSeverity(self, HighestSeverity): self.HighestSeverity = HighestSeverity + def validate_NotificationSeverityType(self, value): + # Validate type NotificationSeverityType, a restriction on xs:string. + pass + def get_Notifications(self): return self.Notifications + def set_Notifications(self, Notifications): self.Notifications = Notifications + def add_Notifications(self, value): self.Notifications.append(value) + def insert_Notifications(self, index, value): self.Notifications[index] = value + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def export(self, outfile, level, namespace_='ns:', name_='CancelPendingShipmentReply', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CancelPendingShipmentReply') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CancelPendingShipmentReply'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CancelPendingShipmentReply', fromsubclass_=False): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('<%sHighestSeverity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HighestSeverity).encode(ExternalEncoding), input_name='HighestSeverity'), namespace_)) + for Notifications_ in self.Notifications: + Notifications_.export(outfile, level, namespace_, name_='Notifications') + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + def hasContent_(self): + if ( + self.HighestSeverity is not None or + self.Notifications or + self.TransactionDetail is not None or + self.Version is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CancelPendingShipmentReply'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('HighestSeverity=%s,\n' % quote_python(self.HighestSeverity).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Notifications=[\n') + level += 1 + for Notifications_ in self.Notifications: + showIndent(outfile, level) + outfile.write('model_.Notification(\n') + Notifications_.exportLiteral(outfile, level, name_='Notification') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'HighestSeverity': + HighestSeverity_ = child_.text + HighestSeverity_ = self.gds_validate_string(HighestSeverity_, node, 'HighestSeverity') + self.HighestSeverity = HighestSeverity_ + self.validate_NotificationSeverityType(self.HighestSeverity) # validate type NotificationSeverityType + elif nodeName_ == 'Notifications': + obj_ = Notification.factory() + obj_.build(child_) + self.Notifications.append(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) +# end class CancelPendingShipmentReply + + +class CancelPendingShipmentRequest(GeneratedsSuper): + """Descriptive data sent to FedEx by a customer in order to Cancel a + Pending shipment.""" + subclass = None + superclass = None + def __init__(self, WebAuthenticationDetail=None, ClientDetail=None, TransactionDetail=None, Version=None, TrackingId=None): + self.WebAuthenticationDetail = WebAuthenticationDetail + self.ClientDetail = ClientDetail + self.TransactionDetail = TransactionDetail + self.Version = Version + self.TrackingId = TrackingId + def factory(*args_, **kwargs_): + if CancelPendingShipmentRequest.subclass: + return CancelPendingShipmentRequest.subclass(*args_, **kwargs_) + else: + return CancelPendingShipmentRequest(*args_, **kwargs_) + factory = staticmethod(factory) + def get_WebAuthenticationDetail(self): return self.WebAuthenticationDetail + def set_WebAuthenticationDetail(self, WebAuthenticationDetail): self.WebAuthenticationDetail = WebAuthenticationDetail + def get_ClientDetail(self): return self.ClientDetail + def set_ClientDetail(self, ClientDetail): self.ClientDetail = ClientDetail + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_TrackingId(self): return self.TrackingId + def set_TrackingId(self, TrackingId): self.TrackingId = TrackingId + def export(self, outfile, level, namespace_='ns:', name_='CancelPendingShipmentRequest', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CancelPendingShipmentRequest') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CancelPendingShipmentRequest'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CancelPendingShipmentRequest', fromsubclass_=False): + if self.WebAuthenticationDetail: + self.WebAuthenticationDetail.export(outfile, level, namespace_, name_='WebAuthenticationDetail', ) + if self.ClientDetail: + self.ClientDetail.export(outfile, level, namespace_, name_='ClientDetail', ) + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.TrackingId: + self.TrackingId.export(outfile, level, namespace_, name_='TrackingId') + def hasContent_(self): + if ( + self.WebAuthenticationDetail is not None or + self.ClientDetail is not None or + self.TransactionDetail is not None or + self.Version is not None or + self.TrackingId is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CancelPendingShipmentRequest'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.WebAuthenticationDetail is not None: + showIndent(outfile, level) + outfile.write('WebAuthenticationDetail=model_.WebAuthenticationDetail(\n') + self.WebAuthenticationDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ClientDetail is not None: + showIndent(outfile, level) + outfile.write('ClientDetail=model_.ClientDetail(\n') + self.ClientDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.TrackingId is not None: + showIndent(outfile, level) + outfile.write('TrackingId=model_.TrackingId(\n') + self.TrackingId.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'WebAuthenticationDetail': + obj_ = WebAuthenticationDetail.factory() + obj_.build(child_) + self.set_WebAuthenticationDetail(obj_) + elif nodeName_ == 'ClientDetail': + obj_ = ClientDetail.factory() + obj_.build(child_) + self.set_ClientDetail(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'TrackingId': + obj_ = TrackingId.factory() + obj_.build(child_) + self.set_TrackingId(obj_) +# end class CancelPendingShipmentRequest + + +class CertificateOfOriginDetail(GeneratedsSuper): + """The instructions indicating how to print the Certificate of Origin ( + e.g. whether or not to include the instructions, image type, etc + ...)""" + subclass = None + superclass = None + def __init__(self, DocumentFormat=None, CustomerImageUsages=None): + self.DocumentFormat = DocumentFormat + if CustomerImageUsages is None: + self.CustomerImageUsages = [] + else: + self.CustomerImageUsages = CustomerImageUsages + def factory(*args_, **kwargs_): + if CertificateOfOriginDetail.subclass: + return CertificateOfOriginDetail.subclass(*args_, **kwargs_) + else: + return CertificateOfOriginDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_DocumentFormat(self): return self.DocumentFormat + def set_DocumentFormat(self, DocumentFormat): self.DocumentFormat = DocumentFormat + def get_CustomerImageUsages(self): return self.CustomerImageUsages + def set_CustomerImageUsages(self, CustomerImageUsages): self.CustomerImageUsages = CustomerImageUsages + def add_CustomerImageUsages(self, value): self.CustomerImageUsages.append(value) + def insert_CustomerImageUsages(self, index, value): self.CustomerImageUsages[index] = value + def export(self, outfile, level, namespace_='ns:', name_='CertificateOfOriginDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CertificateOfOriginDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CertificateOfOriginDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CertificateOfOriginDetail', fromsubclass_=False): + if self.DocumentFormat: + self.DocumentFormat.export(outfile, level, namespace_, name_='DocumentFormat') + for CustomerImageUsages_ in self.CustomerImageUsages: + CustomerImageUsages_.export(outfile, level, namespace_, name_='CustomerImageUsages') + def hasContent_(self): + if ( + self.DocumentFormat is not None or + self.CustomerImageUsages + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CertificateOfOriginDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.DocumentFormat is not None: + showIndent(outfile, level) + outfile.write('DocumentFormat=model_.ShippingDocumentFormat(\n') + self.DocumentFormat.exportLiteral(outfile, level, name_='DocumentFormat') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('CustomerImageUsages=[\n') + level += 1 + for CustomerImageUsages_ in self.CustomerImageUsages: + showIndent(outfile, level) + outfile.write('model_.CustomerImageUsage(\n') + CustomerImageUsages_.exportLiteral(outfile, level, name_='CustomerImageUsage') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'DocumentFormat': + obj_ = ShippingDocumentFormat.factory() + obj_.build(child_) + self.set_DocumentFormat(obj_) + elif nodeName_ == 'CustomerImageUsages': + obj_ = CustomerImageUsage.factory() + obj_.build(child_) + self.CustomerImageUsages.append(obj_) +# end class CertificateOfOriginDetail + + +class ClientDetail(GeneratedsSuper): + """Descriptive data for the client submitting a transaction.""" + subclass = None + superclass = None + def __init__(self, AccountNumber=None, MeterNumber=None, IntegratorId=None, Localization=None): + self.AccountNumber = AccountNumber + self.MeterNumber = MeterNumber + self.IntegratorId = IntegratorId + self.Localization = Localization + def factory(*args_, **kwargs_): + if ClientDetail.subclass: + return ClientDetail.subclass(*args_, **kwargs_) + else: + return ClientDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_AccountNumber(self): return self.AccountNumber + def set_AccountNumber(self, AccountNumber): self.AccountNumber = AccountNumber + def get_MeterNumber(self): return self.MeterNumber + def set_MeterNumber(self, MeterNumber): self.MeterNumber = MeterNumber + def get_IntegratorId(self): return self.IntegratorId + def set_IntegratorId(self, IntegratorId): self.IntegratorId = IntegratorId + def get_Localization(self): return self.Localization + def set_Localization(self, Localization): self.Localization = Localization + def export(self, outfile, level, namespace_='ns:', name_='ClientDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ClientDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ClientDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ClientDetail', fromsubclass_=False): + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('<%sAccountNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AccountNumber).encode(ExternalEncoding), input_name='AccountNumber'), namespace_)) + if self.MeterNumber is not None: + showIndent(outfile, level) + outfile.write('<%sMeterNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.MeterNumber).encode(ExternalEncoding), input_name='MeterNumber'), namespace_)) + if self.IntegratorId is not None: + showIndent(outfile, level) + outfile.write('<%sIntegratorId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.IntegratorId).encode(ExternalEncoding), input_name='IntegratorId'), namespace_)) + if self.Localization: + self.Localization.export(outfile, level, namespace_, name_='Localization') + def hasContent_(self): + if ( + self.AccountNumber is not None or + self.MeterNumber is not None or + self.IntegratorId is not None or + self.Localization is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ClientDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('AccountNumber=%s,\n' % quote_python(self.AccountNumber).encode(ExternalEncoding)) + if self.MeterNumber is not None: + showIndent(outfile, level) + outfile.write('MeterNumber=%s,\n' % quote_python(self.MeterNumber).encode(ExternalEncoding)) + if self.IntegratorId is not None: + showIndent(outfile, level) + outfile.write('IntegratorId=%s,\n' % quote_python(self.IntegratorId).encode(ExternalEncoding)) + if self.Localization is not None: + showIndent(outfile, level) + outfile.write('Localization=model_.Localization(\n') + self.Localization.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'AccountNumber': + AccountNumber_ = child_.text + AccountNumber_ = self.gds_validate_string(AccountNumber_, node, 'AccountNumber') + self.AccountNumber = AccountNumber_ + elif nodeName_ == 'MeterNumber': + MeterNumber_ = child_.text + MeterNumber_ = self.gds_validate_string(MeterNumber_, node, 'MeterNumber') + self.MeterNumber = MeterNumber_ + elif nodeName_ == 'IntegratorId': + IntegratorId_ = child_.text + IntegratorId_ = self.gds_validate_string(IntegratorId_, node, 'IntegratorId') + self.IntegratorId = IntegratorId_ + elif nodeName_ == 'Localization': + obj_ = Localization.factory() + obj_.build(child_) + self.set_Localization(obj_) +# end class ClientDetail + + +class CodAddTransportationChargesDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, RateTypeBasis=None, ChargeBasis=None, ChargeBasisLevel=None): + self.RateTypeBasis = RateTypeBasis + self.ChargeBasis = ChargeBasis + self.ChargeBasisLevel = ChargeBasisLevel + def factory(*args_, **kwargs_): + if CodAddTransportationChargesDetail.subclass: + return CodAddTransportationChargesDetail.subclass(*args_, **kwargs_) + else: + return CodAddTransportationChargesDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_RateTypeBasis(self): return self.RateTypeBasis + def set_RateTypeBasis(self, RateTypeBasis): self.RateTypeBasis = RateTypeBasis + def validate_RateTypeBasisType(self, value): + # Validate type RateTypeBasisType, a restriction on xs:string. + pass + def get_ChargeBasis(self): return self.ChargeBasis + def set_ChargeBasis(self, ChargeBasis): self.ChargeBasis = ChargeBasis + def validate_CodAddTransportationChargeBasisType(self, value): + # Validate type CodAddTransportationChargeBasisType, a restriction on xs:string. + pass + def get_ChargeBasisLevel(self): return self.ChargeBasisLevel + def set_ChargeBasisLevel(self, ChargeBasisLevel): self.ChargeBasisLevel = ChargeBasisLevel + def validate_ChargeBasisLevelType(self, value): + # Validate type ChargeBasisLevelType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='CodAddTransportationChargesDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CodAddTransportationChargesDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CodAddTransportationChargesDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CodAddTransportationChargesDetail', fromsubclass_=False): + if self.RateTypeBasis is not None: + showIndent(outfile, level) + outfile.write('<%sRateTypeBasis>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RateTypeBasis).encode(ExternalEncoding), input_name='RateTypeBasis'), namespace_)) + if self.ChargeBasis is not None: + showIndent(outfile, level) + outfile.write('<%sChargeBasis>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ChargeBasis).encode(ExternalEncoding), input_name='ChargeBasis'), namespace_)) + if self.ChargeBasisLevel is not None: + showIndent(outfile, level) + outfile.write('<%sChargeBasisLevel>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ChargeBasisLevel).encode(ExternalEncoding), input_name='ChargeBasisLevel'), namespace_)) + def hasContent_(self): + if ( + self.RateTypeBasis is not None or + self.ChargeBasis is not None or + self.ChargeBasisLevel is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CodAddTransportationChargesDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.RateTypeBasis is not None: + showIndent(outfile, level) + outfile.write('RateTypeBasis=%s,\n' % quote_python(self.RateTypeBasis).encode(ExternalEncoding)) + if self.ChargeBasis is not None: + showIndent(outfile, level) + outfile.write('ChargeBasis=%s,\n' % quote_python(self.ChargeBasis).encode(ExternalEncoding)) + if self.ChargeBasisLevel is not None: + showIndent(outfile, level) + outfile.write('ChargeBasisLevel=%s,\n' % quote_python(self.ChargeBasisLevel).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'RateTypeBasis': + RateTypeBasis_ = child_.text + RateTypeBasis_ = self.gds_validate_string(RateTypeBasis_, node, 'RateTypeBasis') + self.RateTypeBasis = RateTypeBasis_ + self.validate_RateTypeBasisType(self.RateTypeBasis) # validate type RateTypeBasisType + elif nodeName_ == 'ChargeBasis': + ChargeBasis_ = child_.text + ChargeBasis_ = self.gds_validate_string(ChargeBasis_, node, 'ChargeBasis') + self.ChargeBasis = ChargeBasis_ + self.validate_CodAddTransportationChargeBasisType(self.ChargeBasis) # validate type CodAddTransportationChargeBasisType + elif nodeName_ == 'ChargeBasisLevel': + ChargeBasisLevel_ = child_.text + ChargeBasisLevel_ = self.gds_validate_string(ChargeBasisLevel_, node, 'ChargeBasisLevel') + self.ChargeBasisLevel = ChargeBasisLevel_ + self.validate_ChargeBasisLevelType(self.ChargeBasisLevel) # validate type ChargeBasisLevelType +# end class CodAddTransportationChargesDetail + + +class CodDetail(GeneratedsSuper): + """Descriptive data required for a FedEx COD (Collect-On-Delivery) + shipment.""" + subclass = None + superclass = None + def __init__(self, CodCollectionAmount=None, AddTransportationChargesDetail=None, CollectionType=None, CodRecipient=None, ReferenceIndicator=None): + self.CodCollectionAmount = CodCollectionAmount + self.AddTransportationChargesDetail = AddTransportationChargesDetail + self.CollectionType = CollectionType + self.CodRecipient = CodRecipient + self.ReferenceIndicator = ReferenceIndicator + def factory(*args_, **kwargs_): + if CodDetail.subclass: + return CodDetail.subclass(*args_, **kwargs_) + else: + return CodDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_CodCollectionAmount(self): return self.CodCollectionAmount + def set_CodCollectionAmount(self, CodCollectionAmount): self.CodCollectionAmount = CodCollectionAmount + def get_AddTransportationChargesDetail(self): return self.AddTransportationChargesDetail + def set_AddTransportationChargesDetail(self, AddTransportationChargesDetail): self.AddTransportationChargesDetail = AddTransportationChargesDetail + def get_CollectionType(self): return self.CollectionType + def set_CollectionType(self, CollectionType): self.CollectionType = CollectionType + def validate_CodCollectionType(self, value): + # Validate type CodCollectionType, a restriction on xs:string. + pass + def get_CodRecipient(self): return self.CodRecipient + def set_CodRecipient(self, CodRecipient): self.CodRecipient = CodRecipient + def get_ReferenceIndicator(self): return self.ReferenceIndicator + def set_ReferenceIndicator(self, ReferenceIndicator): self.ReferenceIndicator = ReferenceIndicator + def validate_CodReturnReferenceIndicatorType(self, value): + # Validate type CodReturnReferenceIndicatorType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='CodDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CodDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CodDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CodDetail', fromsubclass_=False): + if self.CodCollectionAmount: + self.CodCollectionAmount.export(outfile, level, namespace_, name_='CodCollectionAmount') + if self.AddTransportationChargesDetail: + self.AddTransportationChargesDetail.export(outfile, level, namespace_, name_='AddTransportationChargesDetail') + if self.CollectionType is not None: + showIndent(outfile, level) + outfile.write('<%sCollectionType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CollectionType).encode(ExternalEncoding), input_name='CollectionType'), namespace_)) + if self.CodRecipient: + self.CodRecipient.export(outfile, level, namespace_, name_='CodRecipient') + if self.ReferenceIndicator is not None: + showIndent(outfile, level) + outfile.write('<%sReferenceIndicator>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ReferenceIndicator).encode(ExternalEncoding), input_name='ReferenceIndicator'), namespace_)) + def hasContent_(self): + if ( + self.CodCollectionAmount is not None or + self.AddTransportationChargesDetail is not None or + self.CollectionType is not None or + self.CodRecipient is not None or + self.ReferenceIndicator is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CodDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.CodCollectionAmount is not None: + showIndent(outfile, level) + outfile.write('CodCollectionAmount=model_.Money(\n') + self.CodCollectionAmount.exportLiteral(outfile, level, name_='CodCollectionAmount') + showIndent(outfile, level) + outfile.write('),\n') + if self.AddTransportationChargesDetail is not None: + showIndent(outfile, level) + outfile.write('AddTransportationChargesDetail=model_.CodAddTransportationChargesDetail(\n') + self.AddTransportationChargesDetail.exportLiteral(outfile, level, name_='AddTransportationChargesDetail') + showIndent(outfile, level) + outfile.write('),\n') + if self.CollectionType is not None: + showIndent(outfile, level) + outfile.write('CollectionType=%s,\n' % quote_python(self.CollectionType).encode(ExternalEncoding)) + if self.CodRecipient is not None: + showIndent(outfile, level) + outfile.write('CodRecipient=model_.Party(\n') + self.CodRecipient.exportLiteral(outfile, level, name_='CodRecipient') + showIndent(outfile, level) + outfile.write('),\n') + if self.ReferenceIndicator is not None: + showIndent(outfile, level) + outfile.write('ReferenceIndicator=%s,\n' % quote_python(self.ReferenceIndicator).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'CodCollectionAmount': + obj_ = Money.factory() + obj_.build(child_) + self.set_CodCollectionAmount(obj_) + elif nodeName_ == 'AddTransportationChargesDetail': + obj_ = CodAddTransportationChargesDetail.factory() + obj_.build(child_) + self.set_AddTransportationChargesDetail(obj_) + elif nodeName_ == 'CollectionType': + CollectionType_ = child_.text + CollectionType_ = self.gds_validate_string(CollectionType_, node, 'CollectionType') + self.CollectionType = CollectionType_ + self.validate_CodCollectionType(self.CollectionType) # validate type CodCollectionType + elif nodeName_ == 'CodRecipient': + obj_ = Party.factory() + obj_.build(child_) + self.set_CodRecipient(obj_) + elif nodeName_ == 'ReferenceIndicator': + ReferenceIndicator_ = child_.text + ReferenceIndicator_ = self.gds_validate_string(ReferenceIndicator_, node, 'ReferenceIndicator') + self.ReferenceIndicator = ReferenceIndicator_ + self.validate_CodReturnReferenceIndicatorType(self.ReferenceIndicator) # validate type CodReturnReferenceIndicatorType +# end class CodDetail + + +class CodReturnPackageDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, CollectionAmount=None, Electronic=None, Barcodes=None, Label=None): + self.CollectionAmount = CollectionAmount + self.Electronic = Electronic + self.Barcodes = Barcodes + self.Label = Label + def factory(*args_, **kwargs_): + if CodReturnPackageDetail.subclass: + return CodReturnPackageDetail.subclass(*args_, **kwargs_) + else: + return CodReturnPackageDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_CollectionAmount(self): return self.CollectionAmount + def set_CollectionAmount(self, CollectionAmount): self.CollectionAmount = CollectionAmount + def get_Electronic(self): return self.Electronic + def set_Electronic(self, Electronic): self.Electronic = Electronic + def get_Barcodes(self): return self.Barcodes + def set_Barcodes(self, Barcodes): self.Barcodes = Barcodes + def get_Label(self): return self.Label + def set_Label(self, Label): self.Label = Label + def export(self, outfile, level, namespace_='ns:', name_='CodReturnPackageDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CodReturnPackageDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CodReturnPackageDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CodReturnPackageDetail', fromsubclass_=False): + if self.CollectionAmount: + self.CollectionAmount.export(outfile, level, namespace_, name_='CollectionAmount') + if self.Electronic is not None: + showIndent(outfile, level) + outfile.write('<%sElectronic>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.Electronic)), input_name='Electronic'), namespace_)) + if self.Barcodes: + self.Barcodes.export(outfile, level, namespace_, name_='Barcodes') + if self.Label: + self.Label.export(outfile, level, namespace_, name_='Label') + def hasContent_(self): + if ( + self.CollectionAmount is not None or + self.Electronic is not None or + self.Barcodes is not None or + self.Label is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CodReturnPackageDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.CollectionAmount is not None: + showIndent(outfile, level) + outfile.write('CollectionAmount=model_.Money(\n') + self.CollectionAmount.exportLiteral(outfile, level, name_='CollectionAmount') + showIndent(outfile, level) + outfile.write('),\n') + if self.Electronic is not None: + showIndent(outfile, level) + outfile.write('Electronic=%s,\n' % self.Electronic) + if self.Barcodes is not None: + showIndent(outfile, level) + outfile.write('Barcodes=model_.PackageBarcodes(\n') + self.Barcodes.exportLiteral(outfile, level, name_='Barcodes') + showIndent(outfile, level) + outfile.write('),\n') + if self.Label is not None: + showIndent(outfile, level) + outfile.write('Label=model_.ShippingDocument(\n') + self.Label.exportLiteral(outfile, level, name_='Label') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'CollectionAmount': + obj_ = Money.factory() + obj_.build(child_) + self.set_CollectionAmount(obj_) + elif nodeName_ == 'Electronic': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'Electronic') + self.Electronic = ival_ + elif nodeName_ == 'Barcodes': + obj_ = PackageBarcodes.factory() + obj_.build(child_) + self.set_Barcodes(obj_) + elif nodeName_ == 'Label': + obj_ = ShippingDocument.factory() + obj_.build(child_) + self.set_Label(obj_) +# end class CodReturnPackageDetail + + +class CodReturnShipmentDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, CollectionAmount=None, Remitter=None, CodRecipient=None, ShipmentOperationalDetail=None, TrackingId=None, PackageOperationalDetail=None, Label=None): + self.CollectionAmount = CollectionAmount + self.Remitter = Remitter + self.CodRecipient = CodRecipient + self.ShipmentOperationalDetail = ShipmentOperationalDetail + self.TrackingId = TrackingId + self.PackageOperationalDetail = PackageOperationalDetail + self.Label = Label + def factory(*args_, **kwargs_): + if CodReturnShipmentDetail.subclass: + return CodReturnShipmentDetail.subclass(*args_, **kwargs_) + else: + return CodReturnShipmentDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_CollectionAmount(self): return self.CollectionAmount + def set_CollectionAmount(self, CollectionAmount): self.CollectionAmount = CollectionAmount + def get_Remitter(self): return self.Remitter + def set_Remitter(self, Remitter): self.Remitter = Remitter + def get_CodRecipient(self): return self.CodRecipient + def set_CodRecipient(self, CodRecipient): self.CodRecipient = CodRecipient + def get_ShipmentOperationalDetail(self): return self.ShipmentOperationalDetail + def set_ShipmentOperationalDetail(self, ShipmentOperationalDetail): self.ShipmentOperationalDetail = ShipmentOperationalDetail + def get_TrackingId(self): return self.TrackingId + def set_TrackingId(self, TrackingId): self.TrackingId = TrackingId + def get_PackageOperationalDetail(self): return self.PackageOperationalDetail + def set_PackageOperationalDetail(self, PackageOperationalDetail): self.PackageOperationalDetail = PackageOperationalDetail + def get_Label(self): return self.Label + def set_Label(self, Label): self.Label = Label + def export(self, outfile, level, namespace_='ns:', name_='CodReturnShipmentDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CodReturnShipmentDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CodReturnShipmentDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CodReturnShipmentDetail', fromsubclass_=False): + if self.CollectionAmount: + self.CollectionAmount.export(outfile, level, namespace_, name_='CollectionAmount') + if self.Remitter: + self.Remitter.export(outfile, level, namespace_, name_='Remitter') + if self.CodRecipient: + self.CodRecipient.export(outfile, level, namespace_, name_='CodRecipient') + if self.ShipmentOperationalDetail: + self.ShipmentOperationalDetail.export(outfile, level, namespace_, name_='ShipmentOperationalDetail') + if self.TrackingId: + self.TrackingId.export(outfile, level, namespace_, name_='TrackingId') + if self.PackageOperationalDetail: + self.PackageOperationalDetail.export(outfile, level, namespace_, name_='PackageOperationalDetail') + if self.Label: + self.Label.export(outfile, level, namespace_, name_='Label') + def hasContent_(self): + if ( + self.CollectionAmount is not None or + self.Remitter is not None or + self.CodRecipient is not None or + self.ShipmentOperationalDetail is not None or + self.TrackingId is not None or + self.PackageOperationalDetail is not None or + self.Label is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CodReturnShipmentDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.CollectionAmount is not None: + showIndent(outfile, level) + outfile.write('CollectionAmount=model_.Money(\n') + self.CollectionAmount.exportLiteral(outfile, level, name_='CollectionAmount') + showIndent(outfile, level) + outfile.write('),\n') + if self.Remitter is not None: + showIndent(outfile, level) + outfile.write('Remitter=model_.Party(\n') + self.Remitter.exportLiteral(outfile, level, name_='Remitter') + showIndent(outfile, level) + outfile.write('),\n') + if self.CodRecipient is not None: + showIndent(outfile, level) + outfile.write('CodRecipient=model_.Party(\n') + self.CodRecipient.exportLiteral(outfile, level, name_='CodRecipient') + showIndent(outfile, level) + outfile.write('),\n') + if self.ShipmentOperationalDetail is not None: + showIndent(outfile, level) + outfile.write('ShipmentOperationalDetail=model_.ShipmentOperationalDetail(\n') + self.ShipmentOperationalDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.TrackingId is not None: + showIndent(outfile, level) + outfile.write('TrackingId=model_.TrackingId(\n') + self.TrackingId.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.PackageOperationalDetail is not None: + showIndent(outfile, level) + outfile.write('PackageOperationalDetail=model_.PackageOperationalDetail(\n') + self.PackageOperationalDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Label is not None: + showIndent(outfile, level) + outfile.write('Label=model_.ShippingDocument(\n') + self.Label.exportLiteral(outfile, level, name_='Label') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'CollectionAmount': + obj_ = Money.factory() + obj_.build(child_) + self.set_CollectionAmount(obj_) + elif nodeName_ == 'Remitter': + obj_ = Party.factory() + obj_.build(child_) + self.set_Remitter(obj_) + elif nodeName_ == 'CodRecipient': + obj_ = Party.factory() + obj_.build(child_) + self.set_CodRecipient(obj_) + elif nodeName_ == 'ShipmentOperationalDetail': + obj_ = ShipmentOperationalDetail.factory() + obj_.build(child_) + self.set_ShipmentOperationalDetail(obj_) + elif nodeName_ == 'TrackingId': + obj_ = TrackingId.factory() + obj_.build(child_) + self.set_TrackingId(obj_) + elif nodeName_ == 'PackageOperationalDetail': + obj_ = PackageOperationalDetail.factory() + obj_.build(child_) + self.set_PackageOperationalDetail(obj_) + elif nodeName_ == 'Label': + obj_ = ShippingDocument.factory() + obj_.build(child_) + self.set_Label(obj_) +# end class CodReturnShipmentDetail + + +class CommercialInvoice(GeneratedsSuper): + """CommercialInvoice element is required for electronic upload of CI + data. It will serve to create/transmit an Electronic Commercial + Invoice through the FedEx Systems. Customers are responsible for + printing their own Commercial Invoice.If you would likeFedEx to + generate a Commercial Invoice and transmit it to Customs. for + clearance purposes, you need to specify that in the + ShippingDocumentSpecification element. If you would like a copy + of the Commercial Invoice that FedEx generated returned to you + in reply it needs to be specified in the + ETDDetail/RequestedDocumentCopies element. Commercial Invoice + support consists of maximum of 99 commodity line items.""" + subclass = None + superclass = None + def __init__(self, Comments=None, FreightCharge=None, TaxesOrMiscellaneousCharge=None, PackingCosts=None, HandlingCosts=None, SpecialInstructions=None, DeclarationStatment=None, PaymentTerms=None, Purpose=None, CustomerInvoiceNumber=None, OriginatorName=None, TermsOfSale=None): + if Comments is None: + self.Comments = [] + else: + self.Comments = Comments + self.FreightCharge = FreightCharge + self.TaxesOrMiscellaneousCharge = TaxesOrMiscellaneousCharge + self.PackingCosts = PackingCosts + self.HandlingCosts = HandlingCosts + self.SpecialInstructions = SpecialInstructions + self.DeclarationStatment = DeclarationStatment + self.PaymentTerms = PaymentTerms + self.Purpose = Purpose + self.CustomerInvoiceNumber = CustomerInvoiceNumber + self.OriginatorName = OriginatorName + self.TermsOfSale = TermsOfSale + def factory(*args_, **kwargs_): + if CommercialInvoice.subclass: + return CommercialInvoice.subclass(*args_, **kwargs_) + else: + return CommercialInvoice(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Comments(self): return self.Comments + def set_Comments(self, Comments): self.Comments = Comments + def add_Comments(self, value): self.Comments.append(value) + def insert_Comments(self, index, value): self.Comments[index] = value + def get_FreightCharge(self): return self.FreightCharge + def set_FreightCharge(self, FreightCharge): self.FreightCharge = FreightCharge + def get_TaxesOrMiscellaneousCharge(self): return self.TaxesOrMiscellaneousCharge + def set_TaxesOrMiscellaneousCharge(self, TaxesOrMiscellaneousCharge): self.TaxesOrMiscellaneousCharge = TaxesOrMiscellaneousCharge + def get_PackingCosts(self): return self.PackingCosts + def set_PackingCosts(self, PackingCosts): self.PackingCosts = PackingCosts + def get_HandlingCosts(self): return self.HandlingCosts + def set_HandlingCosts(self, HandlingCosts): self.HandlingCosts = HandlingCosts + def get_SpecialInstructions(self): return self.SpecialInstructions + def set_SpecialInstructions(self, SpecialInstructions): self.SpecialInstructions = SpecialInstructions + def get_DeclarationStatment(self): return self.DeclarationStatment + def set_DeclarationStatment(self, DeclarationStatment): self.DeclarationStatment = DeclarationStatment + def get_PaymentTerms(self): return self.PaymentTerms + def set_PaymentTerms(self, PaymentTerms): self.PaymentTerms = PaymentTerms + def get_Purpose(self): return self.Purpose + def set_Purpose(self, Purpose): self.Purpose = Purpose + def validate_PurposeOfShipmentType(self, value): + # Validate type PurposeOfShipmentType, a restriction on xs:string. + pass + def get_CustomerInvoiceNumber(self): return self.CustomerInvoiceNumber + def set_CustomerInvoiceNumber(self, CustomerInvoiceNumber): self.CustomerInvoiceNumber = CustomerInvoiceNumber + def get_OriginatorName(self): return self.OriginatorName + def set_OriginatorName(self, OriginatorName): self.OriginatorName = OriginatorName + def get_TermsOfSale(self): return self.TermsOfSale + def set_TermsOfSale(self, TermsOfSale): self.TermsOfSale = TermsOfSale + def validate_TermsOfSaleType(self, value): + # Validate type TermsOfSaleType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='CommercialInvoice', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CommercialInvoice') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CommercialInvoice'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CommercialInvoice', fromsubclass_=False): + for Comments_ in self.Comments: + showIndent(outfile, level) + outfile.write('<%sComments>%s\n' % (namespace_, self.gds_format_string(quote_xml(Comments_).encode(ExternalEncoding), input_name='Comments'), namespace_)) + if self.FreightCharge: + self.FreightCharge.export(outfile, level, namespace_, name_='FreightCharge') + if self.TaxesOrMiscellaneousCharge: + self.TaxesOrMiscellaneousCharge.export(outfile, level, namespace_, name_='TaxesOrMiscellaneousCharge') + if self.PackingCosts: + self.PackingCosts.export(outfile, level, namespace_, name_='PackingCosts') + if self.HandlingCosts: + self.HandlingCosts.export(outfile, level, namespace_, name_='HandlingCosts') + if self.SpecialInstructions is not None: + showIndent(outfile, level) + outfile.write('<%sSpecialInstructions>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.SpecialInstructions).encode(ExternalEncoding), input_name='SpecialInstructions'), namespace_)) + if self.DeclarationStatment is not None: + showIndent(outfile, level) + outfile.write('<%sDeclarationStatment>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DeclarationStatment).encode(ExternalEncoding), input_name='DeclarationStatment'), namespace_)) + if self.PaymentTerms is not None: + showIndent(outfile, level) + outfile.write('<%sPaymentTerms>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PaymentTerms).encode(ExternalEncoding), input_name='PaymentTerms'), namespace_)) + if self.Purpose is not None: + showIndent(outfile, level) + outfile.write('<%sPurpose>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Purpose).encode(ExternalEncoding), input_name='Purpose'), namespace_)) + if self.CustomerInvoiceNumber is not None: + showIndent(outfile, level) + outfile.write('<%sCustomerInvoiceNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CustomerInvoiceNumber).encode(ExternalEncoding), input_name='CustomerInvoiceNumber'), namespace_)) + if self.OriginatorName is not None: + showIndent(outfile, level) + outfile.write('<%sOriginatorName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.OriginatorName).encode(ExternalEncoding), input_name='OriginatorName'), namespace_)) + if self.TermsOfSale is not None: + showIndent(outfile, level) + outfile.write('<%sTermsOfSale>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.TermsOfSale).encode(ExternalEncoding), input_name='TermsOfSale'), namespace_)) + def hasContent_(self): + if ( + self.Comments or + self.FreightCharge is not None or + self.TaxesOrMiscellaneousCharge is not None or + self.PackingCosts is not None or + self.HandlingCosts is not None or + self.SpecialInstructions is not None or + self.DeclarationStatment is not None or + self.PaymentTerms is not None or + self.Purpose is not None or + self.CustomerInvoiceNumber is not None or + self.OriginatorName is not None or + self.TermsOfSale is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CommercialInvoice'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('Comments=[\n') + level += 1 + for Comments_ in self.Comments: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(Comments_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.FreightCharge is not None: + showIndent(outfile, level) + outfile.write('FreightCharge=model_.Money(\n') + self.FreightCharge.exportLiteral(outfile, level, name_='FreightCharge') + showIndent(outfile, level) + outfile.write('),\n') + if self.TaxesOrMiscellaneousCharge is not None: + showIndent(outfile, level) + outfile.write('TaxesOrMiscellaneousCharge=model_.Money(\n') + self.TaxesOrMiscellaneousCharge.exportLiteral(outfile, level, name_='TaxesOrMiscellaneousCharge') + showIndent(outfile, level) + outfile.write('),\n') + if self.PackingCosts is not None: + showIndent(outfile, level) + outfile.write('PackingCosts=model_.Money(\n') + self.PackingCosts.exportLiteral(outfile, level, name_='PackingCosts') + showIndent(outfile, level) + outfile.write('),\n') + if self.HandlingCosts is not None: + showIndent(outfile, level) + outfile.write('HandlingCosts=model_.Money(\n') + self.HandlingCosts.exportLiteral(outfile, level, name_='HandlingCosts') + showIndent(outfile, level) + outfile.write('),\n') + if self.SpecialInstructions is not None: + showIndent(outfile, level) + outfile.write('SpecialInstructions=%s,\n' % quote_python(self.SpecialInstructions).encode(ExternalEncoding)) + if self.DeclarationStatment is not None: + showIndent(outfile, level) + outfile.write('DeclarationStatment=%s,\n' % quote_python(self.DeclarationStatment).encode(ExternalEncoding)) + if self.PaymentTerms is not None: + showIndent(outfile, level) + outfile.write('PaymentTerms=%s,\n' % quote_python(self.PaymentTerms).encode(ExternalEncoding)) + if self.Purpose is not None: + showIndent(outfile, level) + outfile.write('Purpose=%s,\n' % quote_python(self.Purpose).encode(ExternalEncoding)) + if self.CustomerInvoiceNumber is not None: + showIndent(outfile, level) + outfile.write('CustomerInvoiceNumber=%s,\n' % quote_python(self.CustomerInvoiceNumber).encode(ExternalEncoding)) + if self.OriginatorName is not None: + showIndent(outfile, level) + outfile.write('OriginatorName=%s,\n' % quote_python(self.OriginatorName).encode(ExternalEncoding)) + if self.TermsOfSale is not None: + showIndent(outfile, level) + outfile.write('TermsOfSale=%s,\n' % quote_python(self.TermsOfSale).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Comments': + Comments_ = child_.text + Comments_ = self.gds_validate_string(Comments_, node, 'Comments') + self.Comments.append(Comments_) + elif nodeName_ == 'FreightCharge': + obj_ = Money.factory() + obj_.build(child_) + self.set_FreightCharge(obj_) + elif nodeName_ == 'TaxesOrMiscellaneousCharge': + obj_ = Money.factory() + obj_.build(child_) + self.set_TaxesOrMiscellaneousCharge(obj_) + elif nodeName_ == 'PackingCosts': + obj_ = Money.factory() + obj_.build(child_) + self.set_PackingCosts(obj_) + elif nodeName_ == 'HandlingCosts': + obj_ = Money.factory() + obj_.build(child_) + self.set_HandlingCosts(obj_) + elif nodeName_ == 'SpecialInstructions': + SpecialInstructions_ = child_.text + SpecialInstructions_ = self.gds_validate_string(SpecialInstructions_, node, 'SpecialInstructions') + self.SpecialInstructions = SpecialInstructions_ + elif nodeName_ == 'DeclarationStatment': + DeclarationStatment_ = child_.text + DeclarationStatment_ = self.gds_validate_string(DeclarationStatment_, node, 'DeclarationStatment') + self.DeclarationStatment = DeclarationStatment_ + elif nodeName_ == 'PaymentTerms': + PaymentTerms_ = child_.text + PaymentTerms_ = self.gds_validate_string(PaymentTerms_, node, 'PaymentTerms') + self.PaymentTerms = PaymentTerms_ + elif nodeName_ == 'Purpose': + Purpose_ = child_.text + Purpose_ = self.gds_validate_string(Purpose_, node, 'Purpose') + self.Purpose = Purpose_ + self.validate_PurposeOfShipmentType(self.Purpose) # validate type PurposeOfShipmentType + elif nodeName_ == 'CustomerInvoiceNumber': + CustomerInvoiceNumber_ = child_.text + CustomerInvoiceNumber_ = self.gds_validate_string(CustomerInvoiceNumber_, node, 'CustomerInvoiceNumber') + self.CustomerInvoiceNumber = CustomerInvoiceNumber_ + elif nodeName_ == 'OriginatorName': + OriginatorName_ = child_.text + OriginatorName_ = self.gds_validate_string(OriginatorName_, node, 'OriginatorName') + self.OriginatorName = OriginatorName_ + elif nodeName_ == 'TermsOfSale': + TermsOfSale_ = child_.text + TermsOfSale_ = self.gds_validate_string(TermsOfSale_, node, 'TermsOfSale') + self.TermsOfSale = TermsOfSale_ + self.validate_TermsOfSaleType(self.TermsOfSale) # validate type TermsOfSaleType +# end class CommercialInvoice + + +class CommercialInvoiceDetail(GeneratedsSuper): + """The instructions indicating how to print the Commercial Invoice( + e.g. image type) Specifies characteristics of a shipping + document to be produced.""" + subclass = None + superclass = None + def __init__(self, Format=None, CustomerImageUsages=None): + self.Format = Format + if CustomerImageUsages is None: + self.CustomerImageUsages = [] + else: + self.CustomerImageUsages = CustomerImageUsages + def factory(*args_, **kwargs_): + if CommercialInvoiceDetail.subclass: + return CommercialInvoiceDetail.subclass(*args_, **kwargs_) + else: + return CommercialInvoiceDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Format(self): return self.Format + def set_Format(self, Format): self.Format = Format + def get_CustomerImageUsages(self): return self.CustomerImageUsages + def set_CustomerImageUsages(self, CustomerImageUsages): self.CustomerImageUsages = CustomerImageUsages + def add_CustomerImageUsages(self, value): self.CustomerImageUsages.append(value) + def insert_CustomerImageUsages(self, index, value): self.CustomerImageUsages[index] = value + def export(self, outfile, level, namespace_='ns:', name_='CommercialInvoiceDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CommercialInvoiceDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CommercialInvoiceDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CommercialInvoiceDetail', fromsubclass_=False): + if self.Format: + self.Format.export(outfile, level, namespace_, name_='Format') + for CustomerImageUsages_ in self.CustomerImageUsages: + CustomerImageUsages_.export(outfile, level, namespace_, name_='CustomerImageUsages') + def hasContent_(self): + if ( + self.Format is not None or + self.CustomerImageUsages + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CommercialInvoiceDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Format is not None: + showIndent(outfile, level) + outfile.write('Format=model_.ShippingDocumentFormat(\n') + self.Format.exportLiteral(outfile, level, name_='Format') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('CustomerImageUsages=[\n') + level += 1 + for CustomerImageUsages_ in self.CustomerImageUsages: + showIndent(outfile, level) + outfile.write('model_.CustomerImageUsage(\n') + CustomerImageUsages_.exportLiteral(outfile, level, name_='CustomerImageUsage') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Format': + obj_ = ShippingDocumentFormat.factory() + obj_.build(child_) + self.set_Format(obj_) + elif nodeName_ == 'CustomerImageUsages': + obj_ = CustomerImageUsage.factory() + obj_.build(child_) + self.CustomerImageUsages.append(obj_) +# end class CommercialInvoiceDetail + + +class Commodity(GeneratedsSuper): + """For international multiple piece shipments, commodity information + must be passed in the Master and on each child transaction. If + this shipment cotains more than four commodities line items, the + four highest valued should be included in the first 4 occurances + for this request.""" + subclass = None + superclass = None + def __init__(self, Name=None, NumberOfPieces=None, Description=None, CountryOfManufacture=None, HarmonizedCode=None, Weight=None, Quantity=None, QuantityUnits=None, AdditionalMeasures=None, UnitPrice=None, CustomsValue=None, ExciseConditions=None, ExportLicenseNumber=None, ExportLicenseExpirationDate=None, CIMarksAndNumbers=None, NaftaDetail=None): + self.Name = Name + self.NumberOfPieces = NumberOfPieces + self.Description = Description + self.CountryOfManufacture = CountryOfManufacture + self.HarmonizedCode = HarmonizedCode + self.Weight = Weight + self.Quantity = Quantity + self.QuantityUnits = QuantityUnits + if AdditionalMeasures is None: + self.AdditionalMeasures = [] + else: + self.AdditionalMeasures = AdditionalMeasures + self.UnitPrice = UnitPrice + self.CustomsValue = CustomsValue + if ExciseConditions is None: + self.ExciseConditions = [] + else: + self.ExciseConditions = ExciseConditions + self.ExportLicenseNumber = ExportLicenseNumber + self.ExportLicenseExpirationDate = ExportLicenseExpirationDate + self.CIMarksAndNumbers = CIMarksAndNumbers + self.NaftaDetail = NaftaDetail + def factory(*args_, **kwargs_): + if Commodity.subclass: + return Commodity.subclass(*args_, **kwargs_) + else: + return Commodity(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Name(self): return self.Name + def set_Name(self, Name): self.Name = Name + def get_NumberOfPieces(self): return self.NumberOfPieces + def set_NumberOfPieces(self, NumberOfPieces): self.NumberOfPieces = NumberOfPieces + def get_Description(self): return self.Description + def set_Description(self, Description): self.Description = Description + def get_CountryOfManufacture(self): return self.CountryOfManufacture + def set_CountryOfManufacture(self, CountryOfManufacture): self.CountryOfManufacture = CountryOfManufacture + def get_HarmonizedCode(self): return self.HarmonizedCode + def set_HarmonizedCode(self, HarmonizedCode): self.HarmonizedCode = HarmonizedCode + def get_Weight(self): return self.Weight + def set_Weight(self, Weight): self.Weight = Weight + def get_Quantity(self): return self.Quantity + def set_Quantity(self, Quantity): self.Quantity = Quantity + def get_QuantityUnits(self): return self.QuantityUnits + def set_QuantityUnits(self, QuantityUnits): self.QuantityUnits = QuantityUnits + def get_AdditionalMeasures(self): return self.AdditionalMeasures + def set_AdditionalMeasures(self, AdditionalMeasures): self.AdditionalMeasures = AdditionalMeasures + def add_AdditionalMeasures(self, value): self.AdditionalMeasures.append(value) + def insert_AdditionalMeasures(self, index, value): self.AdditionalMeasures[index] = value + def get_UnitPrice(self): return self.UnitPrice + def set_UnitPrice(self, UnitPrice): self.UnitPrice = UnitPrice + def get_CustomsValue(self): return self.CustomsValue + def set_CustomsValue(self, CustomsValue): self.CustomsValue = CustomsValue + def get_ExciseConditions(self): return self.ExciseConditions + def set_ExciseConditions(self, ExciseConditions): self.ExciseConditions = ExciseConditions + def add_ExciseConditions(self, value): self.ExciseConditions.append(value) + def insert_ExciseConditions(self, index, value): self.ExciseConditions[index] = value + def get_ExportLicenseNumber(self): return self.ExportLicenseNumber + def set_ExportLicenseNumber(self, ExportLicenseNumber): self.ExportLicenseNumber = ExportLicenseNumber + def get_ExportLicenseExpirationDate(self): return self.ExportLicenseExpirationDate + def set_ExportLicenseExpirationDate(self, ExportLicenseExpirationDate): self.ExportLicenseExpirationDate = ExportLicenseExpirationDate + def get_CIMarksAndNumbers(self): return self.CIMarksAndNumbers + def set_CIMarksAndNumbers(self, CIMarksAndNumbers): self.CIMarksAndNumbers = CIMarksAndNumbers + def get_NaftaDetail(self): return self.NaftaDetail + def set_NaftaDetail(self, NaftaDetail): self.NaftaDetail = NaftaDetail + def export(self, outfile, level, namespace_='ns:', name_='Commodity', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Commodity') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Commodity'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Commodity', fromsubclass_=False): + if self.Name is not None: + showIndent(outfile, level) + outfile.write('<%sName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Name).encode(ExternalEncoding), input_name='Name'), namespace_)) + if self.NumberOfPieces is not None: + showIndent(outfile, level) + outfile.write('<%sNumberOfPieces>%s\n' % (namespace_, self.gds_format_integer(self.NumberOfPieces, input_name='NumberOfPieces'), namespace_)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('<%sDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Description).encode(ExternalEncoding), input_name='Description'), namespace_)) + if self.CountryOfManufacture is not None: + showIndent(outfile, level) + outfile.write('<%sCountryOfManufacture>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CountryOfManufacture).encode(ExternalEncoding), input_name='CountryOfManufacture'), namespace_)) + if self.HarmonizedCode is not None: + showIndent(outfile, level) + outfile.write('<%sHarmonizedCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HarmonizedCode).encode(ExternalEncoding), input_name='HarmonizedCode'), namespace_)) + if self.Weight: + self.Weight.export(outfile, level, namespace_, name_='Weight', ) + if self.Quantity is not None: + showIndent(outfile, level) + outfile.write('<%sQuantity>%s\n' % (namespace_, self.gds_format_integer(self.Quantity, input_name='Quantity'), namespace_)) + if self.QuantityUnits is not None: + showIndent(outfile, level) + outfile.write('<%sQuantityUnits>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.QuantityUnits).encode(ExternalEncoding), input_name='QuantityUnits'), namespace_)) + for AdditionalMeasures_ in self.AdditionalMeasures: + AdditionalMeasures_.export(outfile, level, namespace_, name_='AdditionalMeasures') + if self.UnitPrice: + self.UnitPrice.export(outfile, level, namespace_, name_='UnitPrice') + if self.CustomsValue: + self.CustomsValue.export(outfile, level, namespace_, name_='CustomsValue') + for ExciseConditions_ in self.ExciseConditions: + ExciseConditions_.export(outfile, level, namespace_, name_='ExciseConditions') + if self.ExportLicenseNumber is not None: + showIndent(outfile, level) + outfile.write('<%sExportLicenseNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ExportLicenseNumber).encode(ExternalEncoding), input_name='ExportLicenseNumber'), namespace_)) + if self.ExportLicenseExpirationDate is not None: + showIndent(outfile, level) + outfile.write('<%sExportLicenseExpirationDate>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ExportLicenseExpirationDate).encode(ExternalEncoding), input_name='ExportLicenseExpirationDate'), namespace_)) + if self.CIMarksAndNumbers is not None: + showIndent(outfile, level) + outfile.write('<%sCIMarksAndNumbers>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CIMarksAndNumbers).encode(ExternalEncoding), input_name='CIMarksAndNumbers'), namespace_)) + if self.NaftaDetail: + self.NaftaDetail.export(outfile, level, namespace_, name_='NaftaDetail') + def hasContent_(self): + if ( + self.Name is not None or + self.NumberOfPieces is not None or + self.Description is not None or + self.CountryOfManufacture is not None or + self.HarmonizedCode is not None or + self.Weight is not None or + self.Quantity is not None or + self.QuantityUnits is not None or + self.AdditionalMeasures or + self.UnitPrice is not None or + self.CustomsValue is not None or + self.ExciseConditions or + self.ExportLicenseNumber is not None or + self.ExportLicenseExpirationDate is not None or + self.CIMarksAndNumbers is not None or + self.NaftaDetail is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Commodity'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Name is not None: + showIndent(outfile, level) + outfile.write('Name=%s,\n' % quote_python(self.Name).encode(ExternalEncoding)) + if self.NumberOfPieces is not None: + showIndent(outfile, level) + outfile.write('NumberOfPieces=%d,\n' % self.NumberOfPieces) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('Description=%s,\n' % quote_python(self.Description).encode(ExternalEncoding)) + if self.CountryOfManufacture is not None: + showIndent(outfile, level) + outfile.write('CountryOfManufacture=%s,\n' % quote_python(self.CountryOfManufacture).encode(ExternalEncoding)) + if self.HarmonizedCode is not None: + showIndent(outfile, level) + outfile.write('HarmonizedCode=%s,\n' % quote_python(self.HarmonizedCode).encode(ExternalEncoding)) + if self.Weight is not None: + showIndent(outfile, level) + outfile.write('Weight=model_.Weight(\n') + self.Weight.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Quantity is not None: + showIndent(outfile, level) + outfile.write('Quantity=%d,\n' % self.Quantity) + if self.QuantityUnits is not None: + showIndent(outfile, level) + outfile.write('QuantityUnits=%s,\n' % quote_python(self.QuantityUnits).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('AdditionalMeasures=[\n') + level += 1 + for AdditionalMeasures_ in self.AdditionalMeasures: + showIndent(outfile, level) + outfile.write('model_.Measure(\n') + AdditionalMeasures_.exportLiteral(outfile, level, name_='Measure') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.UnitPrice is not None: + showIndent(outfile, level) + outfile.write('UnitPrice=model_.Money(\n') + self.UnitPrice.exportLiteral(outfile, level, name_='UnitPrice') + showIndent(outfile, level) + outfile.write('),\n') + if self.CustomsValue is not None: + showIndent(outfile, level) + outfile.write('CustomsValue=model_.Money(\n') + self.CustomsValue.exportLiteral(outfile, level, name_='CustomsValue') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('ExciseConditions=[\n') + level += 1 + for ExciseConditions_ in self.ExciseConditions: + showIndent(outfile, level) + outfile.write('model_.EdtExciseCondition(\n') + ExciseConditions_.exportLiteral(outfile, level, name_='EdtExciseCondition') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.ExportLicenseNumber is not None: + showIndent(outfile, level) + outfile.write('ExportLicenseNumber=%s,\n' % quote_python(self.ExportLicenseNumber).encode(ExternalEncoding)) + if self.ExportLicenseExpirationDate is not None: + showIndent(outfile, level) + outfile.write('ExportLicenseExpirationDate=%s,\n' % quote_python(self.ExportLicenseExpirationDate).encode(ExternalEncoding)) + if self.CIMarksAndNumbers is not None: + showIndent(outfile, level) + outfile.write('CIMarksAndNumbers=%s,\n' % quote_python(self.CIMarksAndNumbers).encode(ExternalEncoding)) + if self.NaftaDetail is not None: + showIndent(outfile, level) + outfile.write('NaftaDetail=model_.NaftaCommodityDetail(\n') + self.NaftaDetail.exportLiteral(outfile, level, name_='NaftaDetail') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Name': + Name_ = child_.text + Name_ = self.gds_validate_string(Name_, node, 'Name') + self.Name = Name_ + elif nodeName_ == 'NumberOfPieces': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'NumberOfPieces') + self.NumberOfPieces = ival_ + elif nodeName_ == 'Description': + Description_ = child_.text + Description_ = self.gds_validate_string(Description_, node, 'Description') + self.Description = Description_ + elif nodeName_ == 'CountryOfManufacture': + CountryOfManufacture_ = child_.text + CountryOfManufacture_ = self.gds_validate_string(CountryOfManufacture_, node, 'CountryOfManufacture') + self.CountryOfManufacture = CountryOfManufacture_ + elif nodeName_ == 'HarmonizedCode': + HarmonizedCode_ = child_.text + HarmonizedCode_ = self.gds_validate_string(HarmonizedCode_, node, 'HarmonizedCode') + self.HarmonizedCode = HarmonizedCode_ + elif nodeName_ == 'Weight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_Weight(obj_) + elif nodeName_ == 'Quantity': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'Quantity') + self.Quantity = ival_ + elif nodeName_ == 'QuantityUnits': + QuantityUnits_ = child_.text + QuantityUnits_ = self.gds_validate_string(QuantityUnits_, node, 'QuantityUnits') + self.QuantityUnits = QuantityUnits_ + elif nodeName_ == 'AdditionalMeasures': + obj_ = Measure.factory() + obj_.build(child_) + self.AdditionalMeasures.append(obj_) + elif nodeName_ == 'UnitPrice': + obj_ = Money.factory() + obj_.build(child_) + self.set_UnitPrice(obj_) + elif nodeName_ == 'CustomsValue': + obj_ = Money.factory() + obj_.build(child_) + self.set_CustomsValue(obj_) + elif nodeName_ == 'ExciseConditions': + obj_ = EdtExciseCondition.factory() + obj_.build(child_) + self.ExciseConditions.append(obj_) + elif nodeName_ == 'ExportLicenseNumber': + ExportLicenseNumber_ = child_.text + ExportLicenseNumber_ = self.gds_validate_string(ExportLicenseNumber_, node, 'ExportLicenseNumber') + self.ExportLicenseNumber = ExportLicenseNumber_ + elif nodeName_ == 'ExportLicenseExpirationDate': + ExportLicenseExpirationDate_ = child_.text + ExportLicenseExpirationDate_ = self.gds_validate_string(ExportLicenseExpirationDate_, node, 'ExportLicenseExpirationDate') + self.ExportLicenseExpirationDate = ExportLicenseExpirationDate_ + elif nodeName_ == 'CIMarksAndNumbers': + CIMarksAndNumbers_ = child_.text + CIMarksAndNumbers_ = self.gds_validate_string(CIMarksAndNumbers_, node, 'CIMarksAndNumbers') + self.CIMarksAndNumbers = CIMarksAndNumbers_ + elif nodeName_ == 'NaftaDetail': + obj_ = NaftaCommodityDetail.factory() + obj_.build(child_) + self.set_NaftaDetail(obj_) +# end class Commodity + + +class CompletedEtdDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, FolderId=None, UploadDocumentReferenceDetails=None): + self.FolderId = FolderId + if UploadDocumentReferenceDetails is None: + self.UploadDocumentReferenceDetails = [] + else: + self.UploadDocumentReferenceDetails = UploadDocumentReferenceDetails + def factory(*args_, **kwargs_): + if CompletedEtdDetail.subclass: + return CompletedEtdDetail.subclass(*args_, **kwargs_) + else: + return CompletedEtdDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_FolderId(self): return self.FolderId + def set_FolderId(self, FolderId): self.FolderId = FolderId + def get_UploadDocumentReferenceDetails(self): return self.UploadDocumentReferenceDetails + def set_UploadDocumentReferenceDetails(self, UploadDocumentReferenceDetails): self.UploadDocumentReferenceDetails = UploadDocumentReferenceDetails + def add_UploadDocumentReferenceDetails(self, value): self.UploadDocumentReferenceDetails.append(value) + def insert_UploadDocumentReferenceDetails(self, index, value): self.UploadDocumentReferenceDetails[index] = value + def export(self, outfile, level, namespace_='ns:', name_='CompletedEtdDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CompletedEtdDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CompletedEtdDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CompletedEtdDetail', fromsubclass_=False): + if self.FolderId is not None: + showIndent(outfile, level) + outfile.write('<%sFolderId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.FolderId).encode(ExternalEncoding), input_name='FolderId'), namespace_)) + for UploadDocumentReferenceDetails_ in self.UploadDocumentReferenceDetails: + UploadDocumentReferenceDetails_.export(outfile, level, namespace_, name_='UploadDocumentReferenceDetails') + def hasContent_(self): + if ( + self.FolderId is not None or + self.UploadDocumentReferenceDetails + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CompletedEtdDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.FolderId is not None: + showIndent(outfile, level) + outfile.write('FolderId=%s,\n' % quote_python(self.FolderId).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('UploadDocumentReferenceDetails=[\n') + level += 1 + for UploadDocumentReferenceDetails_ in self.UploadDocumentReferenceDetails: + showIndent(outfile, level) + outfile.write('model_.UploadDocumentReferenceDetail(\n') + UploadDocumentReferenceDetails_.exportLiteral(outfile, level, name_='UploadDocumentReferenceDetail') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'FolderId': + FolderId_ = child_.text + FolderId_ = self.gds_validate_string(FolderId_, node, 'FolderId') + self.FolderId = FolderId_ + elif nodeName_ == 'UploadDocumentReferenceDetails': + obj_ = UploadDocumentReferenceDetail.factory() + obj_.build(child_) + self.UploadDocumentReferenceDetails.append(obj_) +# end class CompletedEtdDetail + + +class CompletedHoldAtLocationDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, HoldingLocation=None, HoldingLocationType=None): + self.HoldingLocation = HoldingLocation + self.HoldingLocationType = HoldingLocationType + def factory(*args_, **kwargs_): + if CompletedHoldAtLocationDetail.subclass: + return CompletedHoldAtLocationDetail.subclass(*args_, **kwargs_) + else: + return CompletedHoldAtLocationDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_HoldingLocation(self): return self.HoldingLocation + def set_HoldingLocation(self, HoldingLocation): self.HoldingLocation = HoldingLocation + def get_HoldingLocationType(self): return self.HoldingLocationType + def set_HoldingLocationType(self, HoldingLocationType): self.HoldingLocationType = HoldingLocationType + def validate_FedExLocationType(self, value): + # Validate type FedExLocationType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='CompletedHoldAtLocationDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CompletedHoldAtLocationDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CompletedHoldAtLocationDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CompletedHoldAtLocationDetail', fromsubclass_=False): + if self.HoldingLocation: + self.HoldingLocation.export(outfile, level, namespace_, name_='HoldingLocation') + if self.HoldingLocationType is not None: + showIndent(outfile, level) + outfile.write('<%sHoldingLocationType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HoldingLocationType).encode(ExternalEncoding), input_name='HoldingLocationType'), namespace_)) + def hasContent_(self): + if ( + self.HoldingLocation is not None or + self.HoldingLocationType is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CompletedHoldAtLocationDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.HoldingLocation is not None: + showIndent(outfile, level) + outfile.write('HoldingLocation=model_.ContactAndAddress(\n') + self.HoldingLocation.exportLiteral(outfile, level, name_='HoldingLocation') + showIndent(outfile, level) + outfile.write('),\n') + if self.HoldingLocationType is not None: + showIndent(outfile, level) + outfile.write('HoldingLocationType=%s,\n' % quote_python(self.HoldingLocationType).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'HoldingLocation': + obj_ = ContactAndAddress.factory() + obj_.build(child_) + self.set_HoldingLocation(obj_) + elif nodeName_ == 'HoldingLocationType': + HoldingLocationType_ = child_.text + HoldingLocationType_ = self.gds_validate_string(HoldingLocationType_, node, 'HoldingLocationType') + self.HoldingLocationType = HoldingLocationType_ + self.validate_FedExLocationType(self.HoldingLocationType) # validate type FedExLocationType +# end class CompletedHoldAtLocationDetail + + +class CompletedPackageDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, SequenceNumber=None, TrackingIds=None, GroupNumber=None, OversizeClass=None, PackageRating=None, OperationalDetail=None, Label=None, PackageDocuments=None, CodReturnDetail=None, SignatureOption=None, HazardousCommodities=None): + self.SequenceNumber = SequenceNumber + if TrackingIds is None: + self.TrackingIds = [] + else: + self.TrackingIds = TrackingIds + self.GroupNumber = GroupNumber + self.OversizeClass = OversizeClass + self.PackageRating = PackageRating + self.OperationalDetail = OperationalDetail + self.Label = Label + if PackageDocuments is None: + self.PackageDocuments = [] + else: + self.PackageDocuments = PackageDocuments + self.CodReturnDetail = CodReturnDetail + self.SignatureOption = SignatureOption + if HazardousCommodities is None: + self.HazardousCommodities = [] + else: + self.HazardousCommodities = HazardousCommodities + def factory(*args_, **kwargs_): + if CompletedPackageDetail.subclass: + return CompletedPackageDetail.subclass(*args_, **kwargs_) + else: + return CompletedPackageDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_SequenceNumber(self): return self.SequenceNumber + def set_SequenceNumber(self, SequenceNumber): self.SequenceNumber = SequenceNumber + def get_TrackingIds(self): return self.TrackingIds + def set_TrackingIds(self, TrackingIds): self.TrackingIds = TrackingIds + def add_TrackingIds(self, value): self.TrackingIds.append(value) + def insert_TrackingIds(self, index, value): self.TrackingIds[index] = value + def get_GroupNumber(self): return self.GroupNumber + def set_GroupNumber(self, GroupNumber): self.GroupNumber = GroupNumber + def get_OversizeClass(self): return self.OversizeClass + def set_OversizeClass(self, OversizeClass): self.OversizeClass = OversizeClass + def validate_OversizeClassType(self, value): + # Validate type OversizeClassType, a restriction on xs:string. + pass + def get_PackageRating(self): return self.PackageRating + def set_PackageRating(self, PackageRating): self.PackageRating = PackageRating + def get_OperationalDetail(self): return self.OperationalDetail + def set_OperationalDetail(self, OperationalDetail): self.OperationalDetail = OperationalDetail + def get_Label(self): return self.Label + def set_Label(self, Label): self.Label = Label + def get_PackageDocuments(self): return self.PackageDocuments + def set_PackageDocuments(self, PackageDocuments): self.PackageDocuments = PackageDocuments + def add_PackageDocuments(self, value): self.PackageDocuments.append(value) + def insert_PackageDocuments(self, index, value): self.PackageDocuments[index] = value + def get_CodReturnDetail(self): return self.CodReturnDetail + def set_CodReturnDetail(self, CodReturnDetail): self.CodReturnDetail = CodReturnDetail + def get_SignatureOption(self): return self.SignatureOption + def set_SignatureOption(self, SignatureOption): self.SignatureOption = SignatureOption + def validate_SignatureOptionType(self, value): + # Validate type SignatureOptionType, a restriction on xs:string. + pass + def get_HazardousCommodities(self): return self.HazardousCommodities + def set_HazardousCommodities(self, HazardousCommodities): self.HazardousCommodities = HazardousCommodities + def add_HazardousCommodities(self, value): self.HazardousCommodities.append(value) + def insert_HazardousCommodities(self, index, value): self.HazardousCommodities[index] = value + def export(self, outfile, level, namespace_='ns:', name_='CompletedPackageDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CompletedPackageDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CompletedPackageDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CompletedPackageDetail', fromsubclass_=False): + if self.SequenceNumber is not None: + showIndent(outfile, level) + outfile.write('<%sSequenceNumber>%s\n' % (namespace_, self.gds_format_integer(self.SequenceNumber, input_name='SequenceNumber'), namespace_)) + for TrackingIds_ in self.TrackingIds: + TrackingIds_.export(outfile, level, namespace_, name_='TrackingIds') + if self.GroupNumber is not None: + showIndent(outfile, level) + outfile.write('<%sGroupNumber>%s\n' % (namespace_, self.gds_format_integer(self.GroupNumber, input_name='GroupNumber'), namespace_)) + if self.OversizeClass is not None: + showIndent(outfile, level) + outfile.write('<%sOversizeClass>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.OversizeClass).encode(ExternalEncoding), input_name='OversizeClass'), namespace_)) + if self.PackageRating: + self.PackageRating.export(outfile, level, namespace_, name_='PackageRating') + if self.OperationalDetail: + self.OperationalDetail.export(outfile, level, namespace_, name_='OperationalDetail') + if self.Label: + self.Label.export(outfile, level, namespace_, name_='Label') + for PackageDocuments_ in self.PackageDocuments: + PackageDocuments_.export(outfile, level, namespace_, name_='PackageDocuments') + if self.CodReturnDetail: + self.CodReturnDetail.export(outfile, level, namespace_, name_='CodReturnDetail') + if self.SignatureOption is not None: + showIndent(outfile, level) + outfile.write('<%sSignatureOption>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.SignatureOption).encode(ExternalEncoding), input_name='SignatureOption'), namespace_)) + for HazardousCommodities_ in self.HazardousCommodities: + HazardousCommodities_.export(outfile, level, namespace_, name_='HazardousCommodities') + def hasContent_(self): + if ( + self.SequenceNumber is not None or + self.TrackingIds or + self.GroupNumber is not None or + self.OversizeClass is not None or + self.PackageRating is not None or + self.OperationalDetail is not None or + self.Label is not None or + self.PackageDocuments or + self.CodReturnDetail is not None or + self.SignatureOption is not None or + self.HazardousCommodities + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CompletedPackageDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.SequenceNumber is not None: + showIndent(outfile, level) + outfile.write('SequenceNumber=%d,\n' % self.SequenceNumber) + showIndent(outfile, level) + outfile.write('TrackingIds=[\n') + level += 1 + for TrackingIds_ in self.TrackingIds: + showIndent(outfile, level) + outfile.write('model_.TrackingId(\n') + TrackingIds_.exportLiteral(outfile, level, name_='TrackingId') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.GroupNumber is not None: + showIndent(outfile, level) + outfile.write('GroupNumber=%d,\n' % self.GroupNumber) + if self.OversizeClass is not None: + showIndent(outfile, level) + outfile.write('OversizeClass=%s,\n' % quote_python(self.OversizeClass).encode(ExternalEncoding)) + if self.PackageRating is not None: + showIndent(outfile, level) + outfile.write('PackageRating=model_.PackageRating(\n') + self.PackageRating.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.OperationalDetail is not None: + showIndent(outfile, level) + outfile.write('OperationalDetail=model_.PackageOperationalDetail(\n') + self.OperationalDetail.exportLiteral(outfile, level, name_='OperationalDetail') + showIndent(outfile, level) + outfile.write('),\n') + if self.Label is not None: + showIndent(outfile, level) + outfile.write('Label=model_.ShippingDocument(\n') + self.Label.exportLiteral(outfile, level, name_='Label') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('PackageDocuments=[\n') + level += 1 + for PackageDocuments_ in self.PackageDocuments: + showIndent(outfile, level) + outfile.write('model_.ShippingDocument(\n') + PackageDocuments_.exportLiteral(outfile, level, name_='ShippingDocument') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.CodReturnDetail is not None: + showIndent(outfile, level) + outfile.write('CodReturnDetail=model_.CodReturnPackageDetail(\n') + self.CodReturnDetail.exportLiteral(outfile, level, name_='CodReturnDetail') + showIndent(outfile, level) + outfile.write('),\n') + if self.SignatureOption is not None: + showIndent(outfile, level) + outfile.write('SignatureOption=%s,\n' % quote_python(self.SignatureOption).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('HazardousCommodities=[\n') + level += 1 + for HazardousCommodities_ in self.HazardousCommodities: + showIndent(outfile, level) + outfile.write('model_.ValidatedHazardousCommodityContent(\n') + HazardousCommodities_.exportLiteral(outfile, level, name_='ValidatedHazardousCommodityContent') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'SequenceNumber': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ <= 0: + raise_parse_error(child_, 'requires positiveInteger') + ival_ = self.gds_validate_integer(ival_, node, 'SequenceNumber') + self.SequenceNumber = ival_ + elif nodeName_ == 'TrackingIds': + obj_ = TrackingId.factory() + obj_.build(child_) + self.TrackingIds.append(obj_) + elif nodeName_ == 'GroupNumber': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'GroupNumber') + self.GroupNumber = ival_ + elif nodeName_ == 'OversizeClass': + OversizeClass_ = child_.text + OversizeClass_ = self.gds_validate_string(OversizeClass_, node, 'OversizeClass') + self.OversizeClass = OversizeClass_ + self.validate_OversizeClassType(self.OversizeClass) # validate type OversizeClassType + elif nodeName_ == 'PackageRating': + obj_ = PackageRating.factory() + obj_.build(child_) + self.set_PackageRating(obj_) + elif nodeName_ == 'OperationalDetail': + obj_ = PackageOperationalDetail.factory() + obj_.build(child_) + self.set_OperationalDetail(obj_) + elif nodeName_ == 'Label': + obj_ = ShippingDocument.factory() + obj_.build(child_) + self.set_Label(obj_) + elif nodeName_ == 'PackageDocuments': + obj_ = ShippingDocument.factory() + obj_.build(child_) + self.PackageDocuments.append(obj_) + elif nodeName_ == 'CodReturnDetail': + obj_ = CodReturnPackageDetail.factory() + obj_.build(child_) + self.set_CodReturnDetail(obj_) + elif nodeName_ == 'SignatureOption': + SignatureOption_ = child_.text + SignatureOption_ = self.gds_validate_string(SignatureOption_, node, 'SignatureOption') + self.SignatureOption = SignatureOption_ + self.validate_SignatureOptionType(self.SignatureOption) # validate type SignatureOptionType + elif nodeName_ == 'HazardousCommodities': + obj_ = ValidatedHazardousCommodityContent.factory() + obj_.build(child_) + self.HazardousCommodities.append(obj_) +# end class CompletedPackageDetail + + +class CompletedShipmentDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, UsDomestic=None, CarrierCode=None, MasterTrackingId=None, ServiceTypeDescription=None, PackagingDescription=None, OperationalDetail=None, AccessDetail=None, TagDetail=None, SmartPostDetail=None, ShipmentRating=None, CodReturnDetail=None, CompletedHoldAtLocationDetail=None, IneligibleForMoneyBackGuarantee=None, ExportComplianceStatement=None, CompletedEtdDetail=None, ShipmentDocuments=None, CompletedPackageDetails=None): + self.UsDomestic = UsDomestic + self.CarrierCode = CarrierCode + self.MasterTrackingId = MasterTrackingId + self.ServiceTypeDescription = ServiceTypeDescription + self.PackagingDescription = PackagingDescription + self.OperationalDetail = OperationalDetail + self.AccessDetail = AccessDetail + self.TagDetail = TagDetail + self.SmartPostDetail = SmartPostDetail + self.ShipmentRating = ShipmentRating + self.CodReturnDetail = CodReturnDetail + self.CompletedHoldAtLocationDetail = CompletedHoldAtLocationDetail + self.IneligibleForMoneyBackGuarantee = IneligibleForMoneyBackGuarantee + self.ExportComplianceStatement = ExportComplianceStatement + self.CompletedEtdDetail = CompletedEtdDetail + if ShipmentDocuments is None: + self.ShipmentDocuments = [] + else: + self.ShipmentDocuments = ShipmentDocuments + if CompletedPackageDetails is None: + self.CompletedPackageDetails = [] + else: + self.CompletedPackageDetails = CompletedPackageDetails + def factory(*args_, **kwargs_): + if CompletedShipmentDetail.subclass: + return CompletedShipmentDetail.subclass(*args_, **kwargs_) + else: + return CompletedShipmentDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_UsDomestic(self): return self.UsDomestic + def set_UsDomestic(self, UsDomestic): self.UsDomestic = UsDomestic + def get_CarrierCode(self): return self.CarrierCode + def set_CarrierCode(self, CarrierCode): self.CarrierCode = CarrierCode + def validate_CarrierCodeType(self, value): + # Validate type CarrierCodeType, a restriction on xs:string. + pass + def get_MasterTrackingId(self): return self.MasterTrackingId + def set_MasterTrackingId(self, MasterTrackingId): self.MasterTrackingId = MasterTrackingId + def get_ServiceTypeDescription(self): return self.ServiceTypeDescription + def set_ServiceTypeDescription(self, ServiceTypeDescription): self.ServiceTypeDescription = ServiceTypeDescription + def get_PackagingDescription(self): return self.PackagingDescription + def set_PackagingDescription(self, PackagingDescription): self.PackagingDescription = PackagingDescription + def get_OperationalDetail(self): return self.OperationalDetail + def set_OperationalDetail(self, OperationalDetail): self.OperationalDetail = OperationalDetail + def get_AccessDetail(self): return self.AccessDetail + def set_AccessDetail(self, AccessDetail): self.AccessDetail = AccessDetail + def get_TagDetail(self): return self.TagDetail + def set_TagDetail(self, TagDetail): self.TagDetail = TagDetail + def get_SmartPostDetail(self): return self.SmartPostDetail + def set_SmartPostDetail(self, SmartPostDetail): self.SmartPostDetail = SmartPostDetail + def get_ShipmentRating(self): return self.ShipmentRating + def set_ShipmentRating(self, ShipmentRating): self.ShipmentRating = ShipmentRating + def get_CodReturnDetail(self): return self.CodReturnDetail + def set_CodReturnDetail(self, CodReturnDetail): self.CodReturnDetail = CodReturnDetail + def get_CompletedHoldAtLocationDetail(self): return self.CompletedHoldAtLocationDetail + def set_CompletedHoldAtLocationDetail(self, CompletedHoldAtLocationDetail): self.CompletedHoldAtLocationDetail = CompletedHoldAtLocationDetail + def get_IneligibleForMoneyBackGuarantee(self): return self.IneligibleForMoneyBackGuarantee + def set_IneligibleForMoneyBackGuarantee(self, IneligibleForMoneyBackGuarantee): self.IneligibleForMoneyBackGuarantee = IneligibleForMoneyBackGuarantee + def get_ExportComplianceStatement(self): return self.ExportComplianceStatement + def set_ExportComplianceStatement(self, ExportComplianceStatement): self.ExportComplianceStatement = ExportComplianceStatement + def get_CompletedEtdDetail(self): return self.CompletedEtdDetail + def set_CompletedEtdDetail(self, CompletedEtdDetail): self.CompletedEtdDetail = CompletedEtdDetail + def get_ShipmentDocuments(self): return self.ShipmentDocuments + def set_ShipmentDocuments(self, ShipmentDocuments): self.ShipmentDocuments = ShipmentDocuments + def add_ShipmentDocuments(self, value): self.ShipmentDocuments.append(value) + def insert_ShipmentDocuments(self, index, value): self.ShipmentDocuments[index] = value + def get_CompletedPackageDetails(self): return self.CompletedPackageDetails + def set_CompletedPackageDetails(self, CompletedPackageDetails): self.CompletedPackageDetails = CompletedPackageDetails + def add_CompletedPackageDetails(self, value): self.CompletedPackageDetails.append(value) + def insert_CompletedPackageDetails(self, index, value): self.CompletedPackageDetails[index] = value + def export(self, outfile, level, namespace_='ns:', name_='CompletedShipmentDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CompletedShipmentDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CompletedShipmentDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CompletedShipmentDetail', fromsubclass_=False): + if self.UsDomestic is not None: + showIndent(outfile, level) + outfile.write('<%sUsDomestic>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.UsDomestic)), input_name='UsDomestic'), namespace_)) + if self.CarrierCode is not None: + showIndent(outfile, level) + outfile.write('<%sCarrierCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CarrierCode).encode(ExternalEncoding), input_name='CarrierCode'), namespace_)) + if self.MasterTrackingId: + self.MasterTrackingId.export(outfile, level, namespace_, name_='MasterTrackingId') + if self.ServiceTypeDescription is not None: + showIndent(outfile, level) + outfile.write('<%sServiceTypeDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ServiceTypeDescription).encode(ExternalEncoding), input_name='ServiceTypeDescription'), namespace_)) + if self.PackagingDescription is not None: + showIndent(outfile, level) + outfile.write('<%sPackagingDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PackagingDescription).encode(ExternalEncoding), input_name='PackagingDescription'), namespace_)) + if self.OperationalDetail: + self.OperationalDetail.export(outfile, level, namespace_, name_='OperationalDetail') + if self.AccessDetail: + self.AccessDetail.export(outfile, level, namespace_, name_='AccessDetail') + if self.TagDetail: + self.TagDetail.export(outfile, level, namespace_, name_='TagDetail') + if self.SmartPostDetail: + self.SmartPostDetail.export(outfile, level, namespace_, name_='SmartPostDetail') + if self.ShipmentRating: + self.ShipmentRating.export(outfile, level, namespace_, name_='ShipmentRating') + if self.CodReturnDetail: + self.CodReturnDetail.export(outfile, level, namespace_, name_='CodReturnDetail') + if self.CompletedHoldAtLocationDetail: + self.CompletedHoldAtLocationDetail.export(outfile, level, namespace_, name_='CompletedHoldAtLocationDetail') + if self.IneligibleForMoneyBackGuarantee is not None: + showIndent(outfile, level) + outfile.write('<%sIneligibleForMoneyBackGuarantee>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.IneligibleForMoneyBackGuarantee)), input_name='IneligibleForMoneyBackGuarantee'), namespace_)) + if self.ExportComplianceStatement is not None: + showIndent(outfile, level) + outfile.write('<%sExportComplianceStatement>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ExportComplianceStatement).encode(ExternalEncoding), input_name='ExportComplianceStatement'), namespace_)) + if self.CompletedEtdDetail: + self.CompletedEtdDetail.export(outfile, level, namespace_, name_='CompletedEtdDetail') + for ShipmentDocuments_ in self.ShipmentDocuments: + ShipmentDocuments_.export(outfile, level, namespace_, name_='ShipmentDocuments') + for CompletedPackageDetails_ in self.CompletedPackageDetails: + CompletedPackageDetails_.export(outfile, level, namespace_, name_='CompletedPackageDetails') + def hasContent_(self): + if ( + self.UsDomestic is not None or + self.CarrierCode is not None or + self.MasterTrackingId is not None or + self.ServiceTypeDescription is not None or + self.PackagingDescription is not None or + self.OperationalDetail is not None or + self.AccessDetail is not None or + self.TagDetail is not None or + self.SmartPostDetail is not None or + self.ShipmentRating is not None or + self.CodReturnDetail is not None or + self.CompletedHoldAtLocationDetail is not None or + self.IneligibleForMoneyBackGuarantee is not None or + self.ExportComplianceStatement is not None or + self.CompletedEtdDetail is not None or + self.ShipmentDocuments or + self.CompletedPackageDetails + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CompletedShipmentDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.UsDomestic is not None: + showIndent(outfile, level) + outfile.write('UsDomestic=%s,\n' % self.UsDomestic) + if self.CarrierCode is not None: + showIndent(outfile, level) + outfile.write('CarrierCode=%s,\n' % quote_python(self.CarrierCode).encode(ExternalEncoding)) + if self.MasterTrackingId is not None: + showIndent(outfile, level) + outfile.write('MasterTrackingId=model_.TrackingId(\n') + self.MasterTrackingId.exportLiteral(outfile, level, name_='MasterTrackingId') + showIndent(outfile, level) + outfile.write('),\n') + if self.ServiceTypeDescription is not None: + showIndent(outfile, level) + outfile.write('ServiceTypeDescription=%s,\n' % quote_python(self.ServiceTypeDescription).encode(ExternalEncoding)) + if self.PackagingDescription is not None: + showIndent(outfile, level) + outfile.write('PackagingDescription=%s,\n' % quote_python(self.PackagingDescription).encode(ExternalEncoding)) + if self.OperationalDetail is not None: + showIndent(outfile, level) + outfile.write('OperationalDetail=model_.ShipmentOperationalDetail(\n') + self.OperationalDetail.exportLiteral(outfile, level, name_='OperationalDetail') + showIndent(outfile, level) + outfile.write('),\n') + if self.AccessDetail is not None: + showIndent(outfile, level) + outfile.write('AccessDetail=model_.PendingShipmentAccessDetail(\n') + self.AccessDetail.exportLiteral(outfile, level, name_='AccessDetail') + showIndent(outfile, level) + outfile.write('),\n') + if self.TagDetail is not None: + showIndent(outfile, level) + outfile.write('TagDetail=model_.CompletedTagDetail(\n') + self.TagDetail.exportLiteral(outfile, level, name_='TagDetail') + showIndent(outfile, level) + outfile.write('),\n') + if self.SmartPostDetail is not None: + showIndent(outfile, level) + outfile.write('SmartPostDetail=model_.CompletedSmartPostDetail(\n') + self.SmartPostDetail.exportLiteral(outfile, level, name_='SmartPostDetail') + showIndent(outfile, level) + outfile.write('),\n') + if self.ShipmentRating is not None: + showIndent(outfile, level) + outfile.write('ShipmentRating=model_.ShipmentRating(\n') + self.ShipmentRating.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.CodReturnDetail is not None: + showIndent(outfile, level) + outfile.write('CodReturnDetail=model_.CodReturnShipmentDetail(\n') + self.CodReturnDetail.exportLiteral(outfile, level, name_='CodReturnDetail') + showIndent(outfile, level) + outfile.write('),\n') + if self.CompletedHoldAtLocationDetail is not None: + showIndent(outfile, level) + outfile.write('CompletedHoldAtLocationDetail=model_.CompletedHoldAtLocationDetail(\n') + self.CompletedHoldAtLocationDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.IneligibleForMoneyBackGuarantee is not None: + showIndent(outfile, level) + outfile.write('IneligibleForMoneyBackGuarantee=%s,\n' % self.IneligibleForMoneyBackGuarantee) + if self.ExportComplianceStatement is not None: + showIndent(outfile, level) + outfile.write('ExportComplianceStatement=%s,\n' % quote_python(self.ExportComplianceStatement).encode(ExternalEncoding)) + if self.CompletedEtdDetail is not None: + showIndent(outfile, level) + outfile.write('CompletedEtdDetail=model_.CompletedEtdDetail(\n') + self.CompletedEtdDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('ShipmentDocuments=[\n') + level += 1 + for ShipmentDocuments_ in self.ShipmentDocuments: + showIndent(outfile, level) + outfile.write('model_.ShippingDocument(\n') + ShipmentDocuments_.exportLiteral(outfile, level, name_='ShippingDocument') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('CompletedPackageDetails=[\n') + level += 1 + for CompletedPackageDetails_ in self.CompletedPackageDetails: + showIndent(outfile, level) + outfile.write('model_.CompletedPackageDetail(\n') + CompletedPackageDetails_.exportLiteral(outfile, level, name_='CompletedPackageDetail') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'UsDomestic': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'UsDomestic') + self.UsDomestic = ival_ + elif nodeName_ == 'CarrierCode': + CarrierCode_ = child_.text + CarrierCode_ = self.gds_validate_string(CarrierCode_, node, 'CarrierCode') + self.CarrierCode = CarrierCode_ + self.validate_CarrierCodeType(self.CarrierCode) # validate type CarrierCodeType + elif nodeName_ == 'MasterTrackingId': + obj_ = TrackingId.factory() + obj_.build(child_) + self.set_MasterTrackingId(obj_) + elif nodeName_ == 'ServiceTypeDescription': + ServiceTypeDescription_ = child_.text + ServiceTypeDescription_ = self.gds_validate_string(ServiceTypeDescription_, node, 'ServiceTypeDescription') + self.ServiceTypeDescription = ServiceTypeDescription_ + elif nodeName_ == 'PackagingDescription': + PackagingDescription_ = child_.text + PackagingDescription_ = self.gds_validate_string(PackagingDescription_, node, 'PackagingDescription') + self.PackagingDescription = PackagingDescription_ + elif nodeName_ == 'OperationalDetail': + obj_ = ShipmentOperationalDetail.factory() + obj_.build(child_) + self.set_OperationalDetail(obj_) + elif nodeName_ == 'AccessDetail': + obj_ = PendingShipmentAccessDetail.factory() + obj_.build(child_) + self.set_AccessDetail(obj_) + elif nodeName_ == 'TagDetail': + obj_ = CompletedTagDetail.factory() + obj_.build(child_) + self.set_TagDetail(obj_) + elif nodeName_ == 'SmartPostDetail': + obj_ = CompletedSmartPostDetail.factory() + obj_.build(child_) + self.set_SmartPostDetail(obj_) + elif nodeName_ == 'ShipmentRating': + obj_ = ShipmentRating.factory() + obj_.build(child_) + self.set_ShipmentRating(obj_) + elif nodeName_ == 'CodReturnDetail': + obj_ = CodReturnShipmentDetail.factory() + obj_.build(child_) + self.set_CodReturnDetail(obj_) + elif nodeName_ == 'CompletedHoldAtLocationDetail': + obj_ = CompletedHoldAtLocationDetail.factory() + obj_.build(child_) + self.set_CompletedHoldAtLocationDetail(obj_) + elif nodeName_ == 'IneligibleForMoneyBackGuarantee': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'IneligibleForMoneyBackGuarantee') + self.IneligibleForMoneyBackGuarantee = ival_ + elif nodeName_ == 'ExportComplianceStatement': + ExportComplianceStatement_ = child_.text + ExportComplianceStatement_ = self.gds_validate_string(ExportComplianceStatement_, node, 'ExportComplianceStatement') + self.ExportComplianceStatement = ExportComplianceStatement_ + elif nodeName_ == 'CompletedEtdDetail': + obj_ = CompletedEtdDetail.factory() + obj_.build(child_) + self.set_CompletedEtdDetail(obj_) + elif nodeName_ == 'ShipmentDocuments': + obj_ = ShippingDocument.factory() + obj_.build(child_) + self.ShipmentDocuments.append(obj_) + elif nodeName_ == 'CompletedPackageDetails': + obj_ = CompletedPackageDetail.factory() + obj_.build(child_) + self.CompletedPackageDetails.append(obj_) +# end class CompletedShipmentDetail + + +class CompletedSmartPostDetail(GeneratedsSuper): + """Provides reply information specific to SmartPost shipments.""" + subclass = None + superclass = None + def __init__(self, PickUpCarrier=None, Machinable=None): + self.PickUpCarrier = PickUpCarrier + self.Machinable = Machinable + def factory(*args_, **kwargs_): + if CompletedSmartPostDetail.subclass: + return CompletedSmartPostDetail.subclass(*args_, **kwargs_) + else: + return CompletedSmartPostDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_PickUpCarrier(self): return self.PickUpCarrier + def set_PickUpCarrier(self, PickUpCarrier): self.PickUpCarrier = PickUpCarrier + def validate_CarrierCodeType(self, value): + # Validate type CarrierCodeType, a restriction on xs:string. + pass + def get_Machinable(self): return self.Machinable + def set_Machinable(self, Machinable): self.Machinable = Machinable + def export(self, outfile, level, namespace_='ns:', name_='CompletedSmartPostDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CompletedSmartPostDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CompletedSmartPostDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CompletedSmartPostDetail', fromsubclass_=False): + if self.PickUpCarrier is not None: + showIndent(outfile, level) + outfile.write('<%sPickUpCarrier>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PickUpCarrier).encode(ExternalEncoding), input_name='PickUpCarrier'), namespace_)) + if self.Machinable is not None: + showIndent(outfile, level) + outfile.write('<%sMachinable>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.Machinable)), input_name='Machinable'), namespace_)) + def hasContent_(self): + if ( + self.PickUpCarrier is not None or + self.Machinable is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CompletedSmartPostDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.PickUpCarrier is not None: + showIndent(outfile, level) + outfile.write('PickUpCarrier=%s,\n' % quote_python(self.PickUpCarrier).encode(ExternalEncoding)) + if self.Machinable is not None: + showIndent(outfile, level) + outfile.write('Machinable=%s,\n' % self.Machinable) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'PickUpCarrier': + PickUpCarrier_ = child_.text + PickUpCarrier_ = self.gds_validate_string(PickUpCarrier_, node, 'PickUpCarrier') + self.PickUpCarrier = PickUpCarrier_ + self.validate_CarrierCodeType(self.PickUpCarrier) # validate type CarrierCodeType + elif nodeName_ == 'Machinable': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'Machinable') + self.Machinable = ival_ +# end class CompletedSmartPostDetail + + +class CompletedTagDetail(GeneratedsSuper): + """Provides reply information specific to a tag request.""" + subclass = None + superclass = None + def __init__(self, ConfirmationNumber=None, AccessTime=None, CutoffTime=None, Location=None, DeliveryCommitment=None, DispatchDate=None): + self.ConfirmationNumber = ConfirmationNumber + self.AccessTime = AccessTime + self.CutoffTime = CutoffTime + self.Location = Location + self.DeliveryCommitment = DeliveryCommitment + self.DispatchDate = DispatchDate + def factory(*args_, **kwargs_): + if CompletedTagDetail.subclass: + return CompletedTagDetail.subclass(*args_, **kwargs_) + else: + return CompletedTagDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_ConfirmationNumber(self): return self.ConfirmationNumber + def set_ConfirmationNumber(self, ConfirmationNumber): self.ConfirmationNumber = ConfirmationNumber + def get_AccessTime(self): return self.AccessTime + def set_AccessTime(self, AccessTime): self.AccessTime = AccessTime + def get_CutoffTime(self): return self.CutoffTime + def set_CutoffTime(self, CutoffTime): self.CutoffTime = CutoffTime + def get_Location(self): return self.Location + def set_Location(self, Location): self.Location = Location + def get_DeliveryCommitment(self): return self.DeliveryCommitment + def set_DeliveryCommitment(self, DeliveryCommitment): self.DeliveryCommitment = DeliveryCommitment + def get_DispatchDate(self): return self.DispatchDate + def set_DispatchDate(self, DispatchDate): self.DispatchDate = DispatchDate + def export(self, outfile, level, namespace_='ns:', name_='CompletedTagDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CompletedTagDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CompletedTagDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CompletedTagDetail', fromsubclass_=False): + if self.ConfirmationNumber is not None: + showIndent(outfile, level) + outfile.write('<%sConfirmationNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ConfirmationNumber).encode(ExternalEncoding), input_name='ConfirmationNumber'), namespace_)) + if self.AccessTime is not None: + showIndent(outfile, level) + outfile.write('<%sAccessTime>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AccessTime).encode(ExternalEncoding), input_name='AccessTime'), namespace_)) + if self.CutoffTime: + self.CutoffTime.export(outfile, level, namespace_, name_='CutoffTime') + if self.Location is not None: + showIndent(outfile, level) + outfile.write('<%sLocation>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Location).encode(ExternalEncoding), input_name='Location'), namespace_)) + if self.DeliveryCommitment is not None: + showIndent(outfile, level) + outfile.write('<%sDeliveryCommitment>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DeliveryCommitment).encode(ExternalEncoding), input_name='DeliveryCommitment'), namespace_)) + if self.DispatchDate is not None: + showIndent(outfile, level) + outfile.write('<%sDispatchDate>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DispatchDate).encode(ExternalEncoding), input_name='DispatchDate'), namespace_)) + def hasContent_(self): + if ( + self.ConfirmationNumber is not None or + self.AccessTime is not None or + self.CutoffTime is not None or + self.Location is not None or + self.DeliveryCommitment is not None or + self.DispatchDate is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CompletedTagDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.ConfirmationNumber is not None: + showIndent(outfile, level) + outfile.write('ConfirmationNumber=%s,\n' % quote_python(self.ConfirmationNumber).encode(ExternalEncoding)) + if self.AccessTime is not None: + showIndent(outfile, level) + outfile.write('AccessTime=%s,\n' % quote_python(self.AccessTime).encode(ExternalEncoding)) + if self.CutoffTime is not None: + showIndent(outfile, level) + outfile.write('CutoffTime=model_.xs_time(\n') + self.CutoffTime.exportLiteral(outfile, level, name_='CutoffTime') + showIndent(outfile, level) + outfile.write('),\n') + if self.Location is not None: + showIndent(outfile, level) + outfile.write('Location=%s,\n' % quote_python(self.Location).encode(ExternalEncoding)) + if self.DeliveryCommitment is not None: + showIndent(outfile, level) + outfile.write('DeliveryCommitment=%s,\n' % quote_python(self.DeliveryCommitment).encode(ExternalEncoding)) + if self.DispatchDate is not None: + showIndent(outfile, level) + outfile.write('DispatchDate=%s,\n' % quote_python(self.DispatchDate).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'ConfirmationNumber': + ConfirmationNumber_ = child_.text + ConfirmationNumber_ = self.gds_validate_string(ConfirmationNumber_, node, 'ConfirmationNumber') + self.ConfirmationNumber = ConfirmationNumber_ + elif nodeName_ == 'AccessTime': + AccessTime_ = child_.text + AccessTime_ = self.gds_validate_string(AccessTime_, node, 'AccessTime') + self.AccessTime = AccessTime_ + elif nodeName_ == 'CutoffTime': + obj_ = xs_time.factory() + obj_.build(child_) + self.set_CutoffTime(obj_) + elif nodeName_ == 'Location': + Location_ = child_.text + Location_ = self.gds_validate_string(Location_, node, 'Location') + self.Location = Location_ + elif nodeName_ == 'DeliveryCommitment': + DeliveryCommitment_ = child_.text + DeliveryCommitment_ = self.gds_validate_string(DeliveryCommitment_, node, 'DeliveryCommitment') + self.DeliveryCommitment = DeliveryCommitment_ + elif nodeName_ == 'DispatchDate': + DispatchDate_ = child_.text + DispatchDate_ = self.gds_validate_string(DispatchDate_, node, 'DispatchDate') + self.DispatchDate = DispatchDate_ +# end class CompletedTagDetail + + +class ConfigurableLabelReferenceEntry(GeneratedsSuper): + """Defines additional data to print in the Configurable portion of the + label, this allows you to print the same type information on the + label that can also be printed on the doc tab.""" + subclass = None + superclass = None + def __init__(self, ZoneNumber=None, Header=None, DataField=None, LiteralValue=None): + self.ZoneNumber = ZoneNumber + self.Header = Header + self.DataField = DataField + self.LiteralValue = LiteralValue + def factory(*args_, **kwargs_): + if ConfigurableLabelReferenceEntry.subclass: + return ConfigurableLabelReferenceEntry.subclass(*args_, **kwargs_) + else: + return ConfigurableLabelReferenceEntry(*args_, **kwargs_) + factory = staticmethod(factory) + def get_ZoneNumber(self): return self.ZoneNumber + def set_ZoneNumber(self, ZoneNumber): self.ZoneNumber = ZoneNumber + def get_Header(self): return self.Header + def set_Header(self, Header): self.Header = Header + def get_DataField(self): return self.DataField + def set_DataField(self, DataField): self.DataField = DataField + def get_LiteralValue(self): return self.LiteralValue + def set_LiteralValue(self, LiteralValue): self.LiteralValue = LiteralValue + def export(self, outfile, level, namespace_='ns:', name_='ConfigurableLabelReferenceEntry', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ConfigurableLabelReferenceEntry') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ConfigurableLabelReferenceEntry'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ConfigurableLabelReferenceEntry', fromsubclass_=False): + if self.ZoneNumber is not None: + showIndent(outfile, level) + outfile.write('<%sZoneNumber>%s\n' % (namespace_, self.gds_format_integer(self.ZoneNumber, input_name='ZoneNumber'), namespace_)) + if self.Header is not None: + showIndent(outfile, level) + outfile.write('<%sHeader>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Header).encode(ExternalEncoding), input_name='Header'), namespace_)) + if self.DataField is not None: + showIndent(outfile, level) + outfile.write('<%sDataField>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DataField).encode(ExternalEncoding), input_name='DataField'), namespace_)) + if self.LiteralValue is not None: + showIndent(outfile, level) + outfile.write('<%sLiteralValue>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LiteralValue).encode(ExternalEncoding), input_name='LiteralValue'), namespace_)) + def hasContent_(self): + if ( + self.ZoneNumber is not None or + self.Header is not None or + self.DataField is not None or + self.LiteralValue is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ConfigurableLabelReferenceEntry'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.ZoneNumber is not None: + showIndent(outfile, level) + outfile.write('ZoneNumber=%d,\n' % self.ZoneNumber) + if self.Header is not None: + showIndent(outfile, level) + outfile.write('Header=%s,\n' % quote_python(self.Header).encode(ExternalEncoding)) + if self.DataField is not None: + showIndent(outfile, level) + outfile.write('DataField=%s,\n' % quote_python(self.DataField).encode(ExternalEncoding)) + if self.LiteralValue is not None: + showIndent(outfile, level) + outfile.write('LiteralValue=%s,\n' % quote_python(self.LiteralValue).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'ZoneNumber': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ <= 0: + raise_parse_error(child_, 'requires positiveInteger') + ival_ = self.gds_validate_integer(ival_, node, 'ZoneNumber') + self.ZoneNumber = ival_ + elif nodeName_ == 'Header': + Header_ = child_.text + Header_ = self.gds_validate_string(Header_, node, 'Header') + self.Header = Header_ + elif nodeName_ == 'DataField': + DataField_ = child_.text + DataField_ = self.gds_validate_string(DataField_, node, 'DataField') + self.DataField = DataField_ + elif nodeName_ == 'LiteralValue': + LiteralValue_ = child_.text + LiteralValue_ = self.gds_validate_string(LiteralValue_, node, 'LiteralValue') + self.LiteralValue = LiteralValue_ +# end class ConfigurableLabelReferenceEntry + + +class Contact(GeneratedsSuper): + """The descriptive data for a point-of-contact person.""" + subclass = None + superclass = None + def __init__(self, ContactId=None, PersonName=None, Title=None, CompanyName=None, PhoneNumber=None, PhoneExtension=None, PagerNumber=None, FaxNumber=None, EMailAddress=None): + self.ContactId = ContactId + self.PersonName = PersonName + self.Title = Title + self.CompanyName = CompanyName + self.PhoneNumber = PhoneNumber + self.PhoneExtension = PhoneExtension + self.PagerNumber = PagerNumber + self.FaxNumber = FaxNumber + self.EMailAddress = EMailAddress + def factory(*args_, **kwargs_): + if Contact.subclass: + return Contact.subclass(*args_, **kwargs_) + else: + return Contact(*args_, **kwargs_) + factory = staticmethod(factory) + def get_ContactId(self): return self.ContactId + def set_ContactId(self, ContactId): self.ContactId = ContactId + def get_PersonName(self): return self.PersonName + def set_PersonName(self, PersonName): self.PersonName = PersonName + def get_Title(self): return self.Title + def set_Title(self, Title): self.Title = Title + def get_CompanyName(self): return self.CompanyName + def set_CompanyName(self, CompanyName): self.CompanyName = CompanyName + def get_PhoneNumber(self): return self.PhoneNumber + def set_PhoneNumber(self, PhoneNumber): self.PhoneNumber = PhoneNumber + def get_PhoneExtension(self): return self.PhoneExtension + def set_PhoneExtension(self, PhoneExtension): self.PhoneExtension = PhoneExtension + def get_PagerNumber(self): return self.PagerNumber + def set_PagerNumber(self, PagerNumber): self.PagerNumber = PagerNumber + def get_FaxNumber(self): return self.FaxNumber + def set_FaxNumber(self, FaxNumber): self.FaxNumber = FaxNumber + def get_EMailAddress(self): return self.EMailAddress + def set_EMailAddress(self, EMailAddress): self.EMailAddress = EMailAddress + def export(self, outfile, level, namespace_='ns:', name_='Contact', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Contact') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Contact'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Contact', fromsubclass_=False): + if self.ContactId is not None: + showIndent(outfile, level) + outfile.write('<%sContactId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ContactId).encode(ExternalEncoding), input_name='ContactId'), namespace_)) + if self.PersonName is not None: + showIndent(outfile, level) + outfile.write('<%sPersonName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PersonName).encode(ExternalEncoding), input_name='PersonName'), namespace_)) + if self.Title is not None: + showIndent(outfile, level) + outfile.write('<%sTitle>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Title).encode(ExternalEncoding), input_name='Title'), namespace_)) + if self.CompanyName is not None: + showIndent(outfile, level) + outfile.write('<%sCompanyName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CompanyName).encode(ExternalEncoding), input_name='CompanyName'), namespace_)) + if self.PhoneNumber is not None: + showIndent(outfile, level) + outfile.write('<%sPhoneNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PhoneNumber).encode(ExternalEncoding), input_name='PhoneNumber'), namespace_)) + if self.PhoneExtension is not None: + showIndent(outfile, level) + outfile.write('<%sPhoneExtension>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PhoneExtension).encode(ExternalEncoding), input_name='PhoneExtension'), namespace_)) + if self.PagerNumber is not None: + showIndent(outfile, level) + outfile.write('<%sPagerNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PagerNumber).encode(ExternalEncoding), input_name='PagerNumber'), namespace_)) + if self.FaxNumber is not None: + showIndent(outfile, level) + outfile.write('<%sFaxNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.FaxNumber).encode(ExternalEncoding), input_name='FaxNumber'), namespace_)) + if self.EMailAddress is not None: + showIndent(outfile, level) + outfile.write('<%sEMailAddress>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.EMailAddress).encode(ExternalEncoding), input_name='EMailAddress'), namespace_)) + def hasContent_(self): + if ( + self.ContactId is not None or + self.PersonName is not None or + self.Title is not None or + self.CompanyName is not None or + self.PhoneNumber is not None or + self.PhoneExtension is not None or + self.PagerNumber is not None or + self.FaxNumber is not None or + self.EMailAddress is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Contact'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.ContactId is not None: + showIndent(outfile, level) + outfile.write('ContactId=%s,\n' % quote_python(self.ContactId).encode(ExternalEncoding)) + if self.PersonName is not None: + showIndent(outfile, level) + outfile.write('PersonName=%s,\n' % quote_python(self.PersonName).encode(ExternalEncoding)) + if self.Title is not None: + showIndent(outfile, level) + outfile.write('Title=%s,\n' % quote_python(self.Title).encode(ExternalEncoding)) + if self.CompanyName is not None: + showIndent(outfile, level) + outfile.write('CompanyName=%s,\n' % quote_python(self.CompanyName).encode(ExternalEncoding)) + if self.PhoneNumber is not None: + showIndent(outfile, level) + outfile.write('PhoneNumber=%s,\n' % quote_python(self.PhoneNumber).encode(ExternalEncoding)) + if self.PhoneExtension is not None: + showIndent(outfile, level) + outfile.write('PhoneExtension=%s,\n' % quote_python(self.PhoneExtension).encode(ExternalEncoding)) + if self.PagerNumber is not None: + showIndent(outfile, level) + outfile.write('PagerNumber=%s,\n' % quote_python(self.PagerNumber).encode(ExternalEncoding)) + if self.FaxNumber is not None: + showIndent(outfile, level) + outfile.write('FaxNumber=%s,\n' % quote_python(self.FaxNumber).encode(ExternalEncoding)) + if self.EMailAddress is not None: + showIndent(outfile, level) + outfile.write('EMailAddress=%s,\n' % quote_python(self.EMailAddress).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'ContactId': + ContactId_ = child_.text + ContactId_ = self.gds_validate_string(ContactId_, node, 'ContactId') + self.ContactId = ContactId_ + elif nodeName_ == 'PersonName': + PersonName_ = child_.text + PersonName_ = self.gds_validate_string(PersonName_, node, 'PersonName') + self.PersonName = PersonName_ + elif nodeName_ == 'Title': + Title_ = child_.text + Title_ = self.gds_validate_string(Title_, node, 'Title') + self.Title = Title_ + elif nodeName_ == 'CompanyName': + CompanyName_ = child_.text + CompanyName_ = self.gds_validate_string(CompanyName_, node, 'CompanyName') + self.CompanyName = CompanyName_ + elif nodeName_ == 'PhoneNumber': + PhoneNumber_ = child_.text + PhoneNumber_ = self.gds_validate_string(PhoneNumber_, node, 'PhoneNumber') + self.PhoneNumber = PhoneNumber_ + elif nodeName_ == 'PhoneExtension': + PhoneExtension_ = child_.text + PhoneExtension_ = self.gds_validate_string(PhoneExtension_, node, 'PhoneExtension') + self.PhoneExtension = PhoneExtension_ + elif nodeName_ == 'PagerNumber': + PagerNumber_ = child_.text + PagerNumber_ = self.gds_validate_string(PagerNumber_, node, 'PagerNumber') + self.PagerNumber = PagerNumber_ + elif nodeName_ == 'FaxNumber': + FaxNumber_ = child_.text + FaxNumber_ = self.gds_validate_string(FaxNumber_, node, 'FaxNumber') + self.FaxNumber = FaxNumber_ + elif nodeName_ == 'EMailAddress': + EMailAddress_ = child_.text + EMailAddress_ = self.gds_validate_string(EMailAddress_, node, 'EMailAddress') + self.EMailAddress = EMailAddress_ +# end class Contact + + +class ContactAndAddress(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Contact=None, Address=None): + self.Contact = Contact + self.Address = Address + def factory(*args_, **kwargs_): + if ContactAndAddress.subclass: + return ContactAndAddress.subclass(*args_, **kwargs_) + else: + return ContactAndAddress(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Contact(self): return self.Contact + def set_Contact(self, Contact): self.Contact = Contact + def get_Address(self): return self.Address + def set_Address(self, Address): self.Address = Address + def export(self, outfile, level, namespace_='ns:', name_='ContactAndAddress', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ContactAndAddress') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ContactAndAddress'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ContactAndAddress', fromsubclass_=False): + if self.Contact: + self.Contact.export(outfile, level, namespace_, name_='Contact', ) + if self.Address: + self.Address.export(outfile, level, namespace_, name_='Address') + def hasContent_(self): + if ( + self.Contact is not None or + self.Address is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ContactAndAddress'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Contact is not None: + showIndent(outfile, level) + outfile.write('Contact=model_.Contact(\n') + self.Contact.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Address is not None: + showIndent(outfile, level) + outfile.write('Address=model_.Address(\n') + self.Address.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Contact': + obj_ = Contact.factory() + obj_.build(child_) + self.set_Contact(obj_) + elif nodeName_ == 'Address': + obj_ = Address.factory() + obj_.build(child_) + self.set_Address(obj_) +# end class ContactAndAddress + + +class ContentRecord(GeneratedsSuper): + """Content Record.""" + subclass = None + superclass = None + def __init__(self, PartNumber=None, ItemNumber=None, ReceivedQuantity=None, Description=None): + self.PartNumber = PartNumber + self.ItemNumber = ItemNumber + self.ReceivedQuantity = ReceivedQuantity + self.Description = Description + def factory(*args_, **kwargs_): + if ContentRecord.subclass: + return ContentRecord.subclass(*args_, **kwargs_) + else: + return ContentRecord(*args_, **kwargs_) + factory = staticmethod(factory) + def get_PartNumber(self): return self.PartNumber + def set_PartNumber(self, PartNumber): self.PartNumber = PartNumber + def get_ItemNumber(self): return self.ItemNumber + def set_ItemNumber(self, ItemNumber): self.ItemNumber = ItemNumber + def get_ReceivedQuantity(self): return self.ReceivedQuantity + def set_ReceivedQuantity(self, ReceivedQuantity): self.ReceivedQuantity = ReceivedQuantity + def get_Description(self): return self.Description + def set_Description(self, Description): self.Description = Description + def export(self, outfile, level, namespace_='ns:', name_='ContentRecord', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ContentRecord') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ContentRecord'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ContentRecord', fromsubclass_=False): + if self.PartNumber is not None: + showIndent(outfile, level) + outfile.write('<%sPartNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PartNumber).encode(ExternalEncoding), input_name='PartNumber'), namespace_)) + if self.ItemNumber is not None: + showIndent(outfile, level) + outfile.write('<%sItemNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ItemNumber).encode(ExternalEncoding), input_name='ItemNumber'), namespace_)) + if self.ReceivedQuantity is not None: + showIndent(outfile, level) + outfile.write('<%sReceivedQuantity>%s\n' % (namespace_, self.gds_format_integer(self.ReceivedQuantity, input_name='ReceivedQuantity'), namespace_)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('<%sDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Description).encode(ExternalEncoding), input_name='Description'), namespace_)) + def hasContent_(self): + if ( + self.PartNumber is not None or + self.ItemNumber is not None or + self.ReceivedQuantity is not None or + self.Description is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ContentRecord'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.PartNumber is not None: + showIndent(outfile, level) + outfile.write('PartNumber=%s,\n' % quote_python(self.PartNumber).encode(ExternalEncoding)) + if self.ItemNumber is not None: + showIndent(outfile, level) + outfile.write('ItemNumber=%s,\n' % quote_python(self.ItemNumber).encode(ExternalEncoding)) + if self.ReceivedQuantity is not None: + showIndent(outfile, level) + outfile.write('ReceivedQuantity=%d,\n' % self.ReceivedQuantity) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('Description=%s,\n' % quote_python(self.Description).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'PartNumber': + PartNumber_ = child_.text + PartNumber_ = self.gds_validate_string(PartNumber_, node, 'PartNumber') + self.PartNumber = PartNumber_ + elif nodeName_ == 'ItemNumber': + ItemNumber_ = child_.text + ItemNumber_ = self.gds_validate_string(ItemNumber_, node, 'ItemNumber') + self.ItemNumber = ItemNumber_ + elif nodeName_ == 'ReceivedQuantity': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'ReceivedQuantity') + self.ReceivedQuantity = ival_ + elif nodeName_ == 'Description': + Description_ = child_.text + Description_ = self.gds_validate_string(Description_, node, 'Description') + self.Description = Description_ +# end class ContentRecord + + +class CreatePendingShipmentReply(GeneratedsSuper): + """Reply to the Close Request transaction. The Close Reply bring back + the ASCII data buffer which will be used to print the Close + Manifest. The Manifest is essential at the time of pickup.""" + subclass = None + superclass = None + def __init__(self, HighestSeverity=None, Notifications=None, TransactionDetail=None, Version=None, CompletedShipmentDetail=None): + self.HighestSeverity = HighestSeverity + if Notifications is None: + self.Notifications = [] + else: + self.Notifications = Notifications + self.TransactionDetail = TransactionDetail + self.Version = Version + self.CompletedShipmentDetail = CompletedShipmentDetail + def factory(*args_, **kwargs_): + if CreatePendingShipmentReply.subclass: + return CreatePendingShipmentReply.subclass(*args_, **kwargs_) + else: + return CreatePendingShipmentReply(*args_, **kwargs_) + factory = staticmethod(factory) + def get_HighestSeverity(self): return self.HighestSeverity + def set_HighestSeverity(self, HighestSeverity): self.HighestSeverity = HighestSeverity + def validate_NotificationSeverityType(self, value): + # Validate type NotificationSeverityType, a restriction on xs:string. + pass + def get_Notifications(self): return self.Notifications + def set_Notifications(self, Notifications): self.Notifications = Notifications + def add_Notifications(self, value): self.Notifications.append(value) + def insert_Notifications(self, index, value): self.Notifications[index] = value + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_CompletedShipmentDetail(self): return self.CompletedShipmentDetail + def set_CompletedShipmentDetail(self, CompletedShipmentDetail): self.CompletedShipmentDetail = CompletedShipmentDetail + def export(self, outfile, level, namespace_='ns:', name_='CreatePendingShipmentReply', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CreatePendingShipmentReply') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CreatePendingShipmentReply'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CreatePendingShipmentReply', fromsubclass_=False): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('<%sHighestSeverity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HighestSeverity).encode(ExternalEncoding), input_name='HighestSeverity'), namespace_)) + for Notifications_ in self.Notifications: + Notifications_.export(outfile, level, namespace_, name_='Notifications') + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.CompletedShipmentDetail: + self.CompletedShipmentDetail.export(outfile, level, namespace_, name_='CompletedShipmentDetail') + def hasContent_(self): + if ( + self.HighestSeverity is not None or + self.Notifications or + self.TransactionDetail is not None or + self.Version is not None or + self.CompletedShipmentDetail is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CreatePendingShipmentReply'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('HighestSeverity=%s,\n' % quote_python(self.HighestSeverity).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Notifications=[\n') + level += 1 + for Notifications_ in self.Notifications: + showIndent(outfile, level) + outfile.write('model_.Notification(\n') + Notifications_.exportLiteral(outfile, level, name_='Notification') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.CompletedShipmentDetail is not None: + showIndent(outfile, level) + outfile.write('CompletedShipmentDetail=model_.CompletedShipmentDetail(\n') + self.CompletedShipmentDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'HighestSeverity': + HighestSeverity_ = child_.text + HighestSeverity_ = self.gds_validate_string(HighestSeverity_, node, 'HighestSeverity') + self.HighestSeverity = HighestSeverity_ + self.validate_NotificationSeverityType(self.HighestSeverity) # validate type NotificationSeverityType + elif nodeName_ == 'Notifications': + obj_ = Notification.factory() + obj_.build(child_) + self.Notifications.append(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'CompletedShipmentDetail': + obj_ = CompletedShipmentDetail.factory() + obj_.build(child_) + self.set_CompletedShipmentDetail(obj_) +# end class CreatePendingShipmentReply + + +class CreatePendingShipmentRequest(GeneratedsSuper): + """Create Pending Shipment Request""" + subclass = None + superclass = None + def __init__(self, WebAuthenticationDetail=None, ClientDetail=None, TransactionDetail=None, Version=None, RequestedShipment=None): + self.WebAuthenticationDetail = WebAuthenticationDetail + self.ClientDetail = ClientDetail + self.TransactionDetail = TransactionDetail + self.Version = Version + self.RequestedShipment = RequestedShipment + def factory(*args_, **kwargs_): + if CreatePendingShipmentRequest.subclass: + return CreatePendingShipmentRequest.subclass(*args_, **kwargs_) + else: + return CreatePendingShipmentRequest(*args_, **kwargs_) + factory = staticmethod(factory) + def get_WebAuthenticationDetail(self): return self.WebAuthenticationDetail + def set_WebAuthenticationDetail(self, WebAuthenticationDetail): self.WebAuthenticationDetail = WebAuthenticationDetail + def get_ClientDetail(self): return self.ClientDetail + def set_ClientDetail(self, ClientDetail): self.ClientDetail = ClientDetail + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_RequestedShipment(self): return self.RequestedShipment + def set_RequestedShipment(self, RequestedShipment): self.RequestedShipment = RequestedShipment + def export(self, outfile, level, namespace_='ns:', name_='CreatePendingShipmentRequest', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CreatePendingShipmentRequest') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CreatePendingShipmentRequest'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CreatePendingShipmentRequest', fromsubclass_=False): + if self.WebAuthenticationDetail: + self.WebAuthenticationDetail.export(outfile, level, namespace_, name_='WebAuthenticationDetail', ) + if self.ClientDetail: + self.ClientDetail.export(outfile, level, namespace_, name_='ClientDetail', ) + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.RequestedShipment: + self.RequestedShipment.export(outfile, level, namespace_, name_='RequestedShipment', ) + def hasContent_(self): + if ( + self.WebAuthenticationDetail is not None or + self.ClientDetail is not None or + self.TransactionDetail is not None or + self.Version is not None or + self.RequestedShipment is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CreatePendingShipmentRequest'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.WebAuthenticationDetail is not None: + showIndent(outfile, level) + outfile.write('WebAuthenticationDetail=model_.WebAuthenticationDetail(\n') + self.WebAuthenticationDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ClientDetail is not None: + showIndent(outfile, level) + outfile.write('ClientDetail=model_.ClientDetail(\n') + self.ClientDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.RequestedShipment is not None: + showIndent(outfile, level) + outfile.write('RequestedShipment=model_.RequestedShipment(\n') + self.RequestedShipment.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'WebAuthenticationDetail': + obj_ = WebAuthenticationDetail.factory() + obj_.build(child_) + self.set_WebAuthenticationDetail(obj_) + elif nodeName_ == 'ClientDetail': + obj_ = ClientDetail.factory() + obj_.build(child_) + self.set_ClientDetail(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'RequestedShipment': + obj_ = RequestedShipment.factory() + obj_.build(child_) + self.set_RequestedShipment(obj_) +# end class CreatePendingShipmentRequest + + +class CurrencyExchangeRate(GeneratedsSuper): + """Currency exchange rate information.""" + subclass = None + superclass = None + def __init__(self, FromCurrency=None, IntoCurrency=None, Rate=None): + self.FromCurrency = FromCurrency + self.IntoCurrency = IntoCurrency + self.Rate = Rate + def factory(*args_, **kwargs_): + if CurrencyExchangeRate.subclass: + return CurrencyExchangeRate.subclass(*args_, **kwargs_) + else: + return CurrencyExchangeRate(*args_, **kwargs_) + factory = staticmethod(factory) + def get_FromCurrency(self): return self.FromCurrency + def set_FromCurrency(self, FromCurrency): self.FromCurrency = FromCurrency + def get_IntoCurrency(self): return self.IntoCurrency + def set_IntoCurrency(self, IntoCurrency): self.IntoCurrency = IntoCurrency + def get_Rate(self): return self.Rate + def set_Rate(self, Rate): self.Rate = Rate + def export(self, outfile, level, namespace_='ns:', name_='CurrencyExchangeRate', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CurrencyExchangeRate') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CurrencyExchangeRate'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CurrencyExchangeRate', fromsubclass_=False): + if self.FromCurrency is not None: + showIndent(outfile, level) + outfile.write('<%sFromCurrency>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.FromCurrency).encode(ExternalEncoding), input_name='FromCurrency'), namespace_)) + if self.IntoCurrency is not None: + showIndent(outfile, level) + outfile.write('<%sIntoCurrency>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.IntoCurrency).encode(ExternalEncoding), input_name='IntoCurrency'), namespace_)) + if self.Rate is not None: + showIndent(outfile, level) + outfile.write('<%sRate>%s\n' % (namespace_, self.gds_format_float(self.Rate, input_name='Rate'), namespace_)) + def hasContent_(self): + if ( + self.FromCurrency is not None or + self.IntoCurrency is not None or + self.Rate is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CurrencyExchangeRate'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.FromCurrency is not None: + showIndent(outfile, level) + outfile.write('FromCurrency=%s,\n' % quote_python(self.FromCurrency).encode(ExternalEncoding)) + if self.IntoCurrency is not None: + showIndent(outfile, level) + outfile.write('IntoCurrency=%s,\n' % quote_python(self.IntoCurrency).encode(ExternalEncoding)) + if self.Rate is not None: + showIndent(outfile, level) + outfile.write('Rate=%f,\n' % self.Rate) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'FromCurrency': + FromCurrency_ = child_.text + FromCurrency_ = self.gds_validate_string(FromCurrency_, node, 'FromCurrency') + self.FromCurrency = FromCurrency_ + elif nodeName_ == 'IntoCurrency': + IntoCurrency_ = child_.text + IntoCurrency_ = self.gds_validate_string(IntoCurrency_, node, 'IntoCurrency') + self.IntoCurrency = IntoCurrency_ + elif nodeName_ == 'Rate': + sval_ = child_.text + try: + fval_ = float(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires float or double: %s' % exp) + fval_ = self.gds_validate_float(fval_, node, 'Rate') + self.Rate = fval_ +# end class CurrencyExchangeRate + + +class CustomDeliveryWindowDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Type=None, RequestTime=None, RequestRange=None, RequestDate=None): + self.Type = Type + self.RequestTime = RequestTime + self.RequestRange = RequestRange + self.RequestDate = RequestDate + def factory(*args_, **kwargs_): + if CustomDeliveryWindowDetail.subclass: + return CustomDeliveryWindowDetail.subclass(*args_, **kwargs_) + else: + return CustomDeliveryWindowDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Type(self): return self.Type + def set_Type(self, Type): self.Type = Type + def validate_CustomDeliveryWindowType(self, value): + # Validate type CustomDeliveryWindowType, a restriction on xs:string. + pass + def get_RequestTime(self): return self.RequestTime + def set_RequestTime(self, RequestTime): self.RequestTime = RequestTime + def get_RequestRange(self): return self.RequestRange + def set_RequestRange(self, RequestRange): self.RequestRange = RequestRange + def get_RequestDate(self): return self.RequestDate + def set_RequestDate(self, RequestDate): self.RequestDate = RequestDate + def export(self, outfile, level, namespace_='ns:', name_='CustomDeliveryWindowDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CustomDeliveryWindowDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CustomDeliveryWindowDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CustomDeliveryWindowDetail', fromsubclass_=False): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('<%sType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Type).encode(ExternalEncoding), input_name='Type'), namespace_)) + if self.RequestTime: + self.RequestTime.export(outfile, level, namespace_, name_='RequestTime') + if self.RequestRange: + self.RequestRange.export(outfile, level, namespace_, name_='RequestRange') + if self.RequestDate is not None: + showIndent(outfile, level) + outfile.write('<%sRequestDate>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RequestDate).encode(ExternalEncoding), input_name='RequestDate'), namespace_)) + def hasContent_(self): + if ( + self.Type is not None or + self.RequestTime is not None or + self.RequestRange is not None or + self.RequestDate is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CustomDeliveryWindowDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('Type=%s,\n' % quote_python(self.Type).encode(ExternalEncoding)) + if self.RequestTime is not None: + showIndent(outfile, level) + outfile.write('RequestTime=model_.xs_time(\n') + self.RequestTime.exportLiteral(outfile, level, name_='RequestTime') + showIndent(outfile, level) + outfile.write('),\n') + if self.RequestRange is not None: + showIndent(outfile, level) + outfile.write('RequestRange=model_.DateRange(\n') + self.RequestRange.exportLiteral(outfile, level, name_='RequestRange') + showIndent(outfile, level) + outfile.write('),\n') + if self.RequestDate is not None: + showIndent(outfile, level) + outfile.write('RequestDate=%s,\n' % quote_python(self.RequestDate).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Type': + Type_ = child_.text + Type_ = self.gds_validate_string(Type_, node, 'Type') + self.Type = Type_ + self.validate_CustomDeliveryWindowType(self.Type) # validate type CustomDeliveryWindowType + elif nodeName_ == 'RequestTime': + obj_ = xs_time.factory() + obj_.build(child_) + self.set_RequestTime(obj_) + elif nodeName_ == 'RequestRange': + obj_ = DateRange.factory() + obj_.build(child_) + self.set_RequestRange(obj_) + elif nodeName_ == 'RequestDate': + RequestDate_ = child_.text + RequestDate_ = self.gds_validate_string(RequestDate_, node, 'RequestDate') + self.RequestDate = RequestDate_ +# end class CustomDeliveryWindowDetail + + +class CustomDocumentDetail(GeneratedsSuper): + """Data required to produce a custom-specified document, either at + shipment or package level.""" + subclass = None + superclass = None + def __init__(self, Format=None, LabelPrintingOrientation=None, LabelRotation=None, SpecificationId=None, CustomDocumentIdentifier=None, DocTabContent=None): + self.Format = Format + self.LabelPrintingOrientation = LabelPrintingOrientation + self.LabelRotation = LabelRotation + self.SpecificationId = SpecificationId + self.CustomDocumentIdentifier = CustomDocumentIdentifier + self.DocTabContent = DocTabContent + def factory(*args_, **kwargs_): + if CustomDocumentDetail.subclass: + return CustomDocumentDetail.subclass(*args_, **kwargs_) + else: + return CustomDocumentDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Format(self): return self.Format + def set_Format(self, Format): self.Format = Format + def get_LabelPrintingOrientation(self): return self.LabelPrintingOrientation + def set_LabelPrintingOrientation(self, LabelPrintingOrientation): self.LabelPrintingOrientation = LabelPrintingOrientation + def validate_LabelPrintingOrientationType(self, value): + # Validate type LabelPrintingOrientationType, a restriction on xs:string. + pass + def get_LabelRotation(self): return self.LabelRotation + def set_LabelRotation(self, LabelRotation): self.LabelRotation = LabelRotation + def validate_LabelRotationType(self, value): + # Validate type LabelRotationType, a restriction on xs:string. + pass + def get_SpecificationId(self): return self.SpecificationId + def set_SpecificationId(self, SpecificationId): self.SpecificationId = SpecificationId + def get_CustomDocumentIdentifier(self): return self.CustomDocumentIdentifier + def set_CustomDocumentIdentifier(self, CustomDocumentIdentifier): self.CustomDocumentIdentifier = CustomDocumentIdentifier + def get_DocTabContent(self): return self.DocTabContent + def set_DocTabContent(self, DocTabContent): self.DocTabContent = DocTabContent + def export(self, outfile, level, namespace_='ns:', name_='CustomDocumentDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CustomDocumentDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CustomDocumentDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CustomDocumentDetail', fromsubclass_=False): + if self.Format: + self.Format.export(outfile, level, namespace_, name_='Format') + if self.LabelPrintingOrientation is not None: + showIndent(outfile, level) + outfile.write('<%sLabelPrintingOrientation>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LabelPrintingOrientation).encode(ExternalEncoding), input_name='LabelPrintingOrientation'), namespace_)) + if self.LabelRotation is not None: + showIndent(outfile, level) + outfile.write('<%sLabelRotation>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LabelRotation).encode(ExternalEncoding), input_name='LabelRotation'), namespace_)) + if self.SpecificationId is not None: + showIndent(outfile, level) + outfile.write('<%sSpecificationId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.SpecificationId).encode(ExternalEncoding), input_name='SpecificationId'), namespace_)) + if self.CustomDocumentIdentifier is not None: + showIndent(outfile, level) + outfile.write('<%sCustomDocumentIdentifier>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CustomDocumentIdentifier).encode(ExternalEncoding), input_name='CustomDocumentIdentifier'), namespace_)) + if self.DocTabContent: + self.DocTabContent.export(outfile, level, namespace_, name_='DocTabContent') + def hasContent_(self): + if ( + self.Format is not None or + self.LabelPrintingOrientation is not None or + self.LabelRotation is not None or + self.SpecificationId is not None or + self.CustomDocumentIdentifier is not None or + self.DocTabContent is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CustomDocumentDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Format is not None: + showIndent(outfile, level) + outfile.write('Format=model_.ShippingDocumentFormat(\n') + self.Format.exportLiteral(outfile, level, name_='Format') + showIndent(outfile, level) + outfile.write('),\n') + if self.LabelPrintingOrientation is not None: + showIndent(outfile, level) + outfile.write('LabelPrintingOrientation=%s,\n' % quote_python(self.LabelPrintingOrientation).encode(ExternalEncoding)) + if self.LabelRotation is not None: + showIndent(outfile, level) + outfile.write('LabelRotation=%s,\n' % quote_python(self.LabelRotation).encode(ExternalEncoding)) + if self.SpecificationId is not None: + showIndent(outfile, level) + outfile.write('SpecificationId=%s,\n' % quote_python(self.SpecificationId).encode(ExternalEncoding)) + if self.CustomDocumentIdentifier is not None: + showIndent(outfile, level) + outfile.write('CustomDocumentIdentifier=%s,\n' % quote_python(self.CustomDocumentIdentifier).encode(ExternalEncoding)) + if self.DocTabContent is not None: + showIndent(outfile, level) + outfile.write('DocTabContent=model_.DocTabContent(\n') + self.DocTabContent.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Format': + obj_ = ShippingDocumentFormat.factory() + obj_.build(child_) + self.set_Format(obj_) + elif nodeName_ == 'LabelPrintingOrientation': + LabelPrintingOrientation_ = child_.text + LabelPrintingOrientation_ = self.gds_validate_string(LabelPrintingOrientation_, node, 'LabelPrintingOrientation') + self.LabelPrintingOrientation = LabelPrintingOrientation_ + self.validate_LabelPrintingOrientationType(self.LabelPrintingOrientation) # validate type LabelPrintingOrientationType + elif nodeName_ == 'LabelRotation': + LabelRotation_ = child_.text + LabelRotation_ = self.gds_validate_string(LabelRotation_, node, 'LabelRotation') + self.LabelRotation = LabelRotation_ + self.validate_LabelRotationType(self.LabelRotation) # validate type LabelRotationType + elif nodeName_ == 'SpecificationId': + SpecificationId_ = child_.text + SpecificationId_ = self.gds_validate_string(SpecificationId_, node, 'SpecificationId') + self.SpecificationId = SpecificationId_ + elif nodeName_ == 'CustomDocumentIdentifier': + CustomDocumentIdentifier_ = child_.text + CustomDocumentIdentifier_ = self.gds_validate_string(CustomDocumentIdentifier_, node, 'CustomDocumentIdentifier') + self.CustomDocumentIdentifier = CustomDocumentIdentifier_ + elif nodeName_ == 'DocTabContent': + obj_ = DocTabContent.factory() + obj_.build(child_) + self.set_DocTabContent(obj_) +# end class CustomDocumentDetail + + +class CustomLabelBarcodeEntry(GeneratedsSuper): + """Constructed string, based on format and zero or more data fields, + printed in specified barcode symbology.""" + subclass = None + superclass = None + def __init__(self, Position=None, Format=None, DataFields=None, BarHeight=None, ThinBarWidth=None, BarcodeSymbology=None): + self.Position = Position + self.Format = Format + if DataFields is None: + self.DataFields = [] + else: + self.DataFields = DataFields + self.BarHeight = BarHeight + self.ThinBarWidth = ThinBarWidth + self.BarcodeSymbology = BarcodeSymbology + def factory(*args_, **kwargs_): + if CustomLabelBarcodeEntry.subclass: + return CustomLabelBarcodeEntry.subclass(*args_, **kwargs_) + else: + return CustomLabelBarcodeEntry(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Position(self): return self.Position + def set_Position(self, Position): self.Position = Position + def get_Format(self): return self.Format + def set_Format(self, Format): self.Format = Format + def get_DataFields(self): return self.DataFields + def set_DataFields(self, DataFields): self.DataFields = DataFields + def add_DataFields(self, value): self.DataFields.append(value) + def insert_DataFields(self, index, value): self.DataFields[index] = value + def get_BarHeight(self): return self.BarHeight + def set_BarHeight(self, BarHeight): self.BarHeight = BarHeight + def get_ThinBarWidth(self): return self.ThinBarWidth + def set_ThinBarWidth(self, ThinBarWidth): self.ThinBarWidth = ThinBarWidth + def get_BarcodeSymbology(self): return self.BarcodeSymbology + def set_BarcodeSymbology(self, BarcodeSymbology): self.BarcodeSymbology = BarcodeSymbology + def validate_BarcodeSymbologyType(self, value): + # Validate type BarcodeSymbologyType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='CustomLabelBarcodeEntry', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CustomLabelBarcodeEntry') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CustomLabelBarcodeEntry'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CustomLabelBarcodeEntry', fromsubclass_=False): + if self.Position: + self.Position.export(outfile, level, namespace_, name_='Position', ) + if self.Format is not None: + showIndent(outfile, level) + outfile.write('<%sFormat>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Format).encode(ExternalEncoding), input_name='Format'), namespace_)) + for DataFields_ in self.DataFields: + showIndent(outfile, level) + outfile.write('<%sDataFields>%s\n' % (namespace_, self.gds_format_string(quote_xml(DataFields_).encode(ExternalEncoding), input_name='DataFields'), namespace_)) + if self.BarHeight is not None: + showIndent(outfile, level) + outfile.write('<%sBarHeight>%s\n' % (namespace_, self.gds_format_integer(self.BarHeight, input_name='BarHeight'), namespace_)) + if self.ThinBarWidth is not None: + showIndent(outfile, level) + outfile.write('<%sThinBarWidth>%s\n' % (namespace_, self.gds_format_integer(self.ThinBarWidth, input_name='ThinBarWidth'), namespace_)) + if self.BarcodeSymbology is not None: + showIndent(outfile, level) + outfile.write('<%sBarcodeSymbology>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.BarcodeSymbology).encode(ExternalEncoding), input_name='BarcodeSymbology'), namespace_)) + def hasContent_(self): + if ( + self.Position is not None or + self.Format is not None or + self.DataFields or + self.BarHeight is not None or + self.ThinBarWidth is not None or + self.BarcodeSymbology is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CustomLabelBarcodeEntry'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Position is not None: + showIndent(outfile, level) + outfile.write('Position=model_.CustomLabelPosition(\n') + self.Position.exportLiteral(outfile, level, name_='Position') + showIndent(outfile, level) + outfile.write('),\n') + if self.Format is not None: + showIndent(outfile, level) + outfile.write('Format=%s,\n' % quote_python(self.Format).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('DataFields=[\n') + level += 1 + for DataFields_ in self.DataFields: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(DataFields_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.BarHeight is not None: + showIndent(outfile, level) + outfile.write('BarHeight=%d,\n' % self.BarHeight) + if self.ThinBarWidth is not None: + showIndent(outfile, level) + outfile.write('ThinBarWidth=%d,\n' % self.ThinBarWidth) + if self.BarcodeSymbology is not None: + showIndent(outfile, level) + outfile.write('BarcodeSymbology=%s,\n' % quote_python(self.BarcodeSymbology).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Position': + obj_ = CustomLabelPosition.factory() + obj_.build(child_) + self.set_Position(obj_) + elif nodeName_ == 'Format': + Format_ = child_.text + Format_ = self.gds_validate_string(Format_, node, 'Format') + self.Format = Format_ + elif nodeName_ == 'DataFields': + DataFields_ = child_.text + DataFields_ = self.gds_validate_string(DataFields_, node, 'DataFields') + self.DataFields.append(DataFields_) + elif nodeName_ == 'BarHeight': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'BarHeight') + self.BarHeight = ival_ + elif nodeName_ == 'ThinBarWidth': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'ThinBarWidth') + self.ThinBarWidth = ival_ + elif nodeName_ == 'BarcodeSymbology': + BarcodeSymbology_ = child_.text + BarcodeSymbology_ = self.gds_validate_string(BarcodeSymbology_, node, 'BarcodeSymbology') + self.BarcodeSymbology = BarcodeSymbology_ + self.validate_BarcodeSymbologyType(self.BarcodeSymbology) # validate type BarcodeSymbologyType +# end class CustomLabelBarcodeEntry + + +class CustomLabelBoxEntry(GeneratedsSuper): + """Solid (filled) rectangular area on label.""" + subclass = None + superclass = None + def __init__(self, TopLeftCorner=None, BottomRightCorner=None): + self.TopLeftCorner = TopLeftCorner + self.BottomRightCorner = BottomRightCorner + def factory(*args_, **kwargs_): + if CustomLabelBoxEntry.subclass: + return CustomLabelBoxEntry.subclass(*args_, **kwargs_) + else: + return CustomLabelBoxEntry(*args_, **kwargs_) + factory = staticmethod(factory) + def get_TopLeftCorner(self): return self.TopLeftCorner + def set_TopLeftCorner(self, TopLeftCorner): self.TopLeftCorner = TopLeftCorner + def get_BottomRightCorner(self): return self.BottomRightCorner + def set_BottomRightCorner(self, BottomRightCorner): self.BottomRightCorner = BottomRightCorner + def export(self, outfile, level, namespace_='ns:', name_='CustomLabelBoxEntry', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CustomLabelBoxEntry') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CustomLabelBoxEntry'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CustomLabelBoxEntry', fromsubclass_=False): + if self.TopLeftCorner: + self.TopLeftCorner.export(outfile, level, namespace_, name_='TopLeftCorner', ) + if self.BottomRightCorner: + self.BottomRightCorner.export(outfile, level, namespace_, name_='BottomRightCorner', ) + def hasContent_(self): + if ( + self.TopLeftCorner is not None or + self.BottomRightCorner is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CustomLabelBoxEntry'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.TopLeftCorner is not None: + showIndent(outfile, level) + outfile.write('TopLeftCorner=model_.CustomLabelPosition(\n') + self.TopLeftCorner.exportLiteral(outfile, level, name_='TopLeftCorner') + showIndent(outfile, level) + outfile.write('),\n') + if self.BottomRightCorner is not None: + showIndent(outfile, level) + outfile.write('BottomRightCorner=model_.CustomLabelPosition(\n') + self.BottomRightCorner.exportLiteral(outfile, level, name_='BottomRightCorner') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'TopLeftCorner': + obj_ = CustomLabelPosition.factory() + obj_.build(child_) + self.set_TopLeftCorner(obj_) + elif nodeName_ == 'BottomRightCorner': + obj_ = CustomLabelPosition.factory() + obj_.build(child_) + self.set_BottomRightCorner(obj_) +# end class CustomLabelBoxEntry + + +class CustomLabelDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, CoordinateUnits=None, TextEntries=None, GraphicEntries=None, BoxEntries=None, BarcodeEntries=None): + self.CoordinateUnits = CoordinateUnits + if TextEntries is None: + self.TextEntries = [] + else: + self.TextEntries = TextEntries + if GraphicEntries is None: + self.GraphicEntries = [] + else: + self.GraphicEntries = GraphicEntries + if BoxEntries is None: + self.BoxEntries = [] + else: + self.BoxEntries = BoxEntries + if BarcodeEntries is None: + self.BarcodeEntries = [] + else: + self.BarcodeEntries = BarcodeEntries + def factory(*args_, **kwargs_): + if CustomLabelDetail.subclass: + return CustomLabelDetail.subclass(*args_, **kwargs_) + else: + return CustomLabelDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_CoordinateUnits(self): return self.CoordinateUnits + def set_CoordinateUnits(self, CoordinateUnits): self.CoordinateUnits = CoordinateUnits + def validate_CustomLabelCoordinateUnits(self, value): + # Validate type CustomLabelCoordinateUnits, a restriction on xs:string. + pass + def get_TextEntries(self): return self.TextEntries + def set_TextEntries(self, TextEntries): self.TextEntries = TextEntries + def add_TextEntries(self, value): self.TextEntries.append(value) + def insert_TextEntries(self, index, value): self.TextEntries[index] = value + def get_GraphicEntries(self): return self.GraphicEntries + def set_GraphicEntries(self, GraphicEntries): self.GraphicEntries = GraphicEntries + def add_GraphicEntries(self, value): self.GraphicEntries.append(value) + def insert_GraphicEntries(self, index, value): self.GraphicEntries[index] = value + def get_BoxEntries(self): return self.BoxEntries + def set_BoxEntries(self, BoxEntries): self.BoxEntries = BoxEntries + def add_BoxEntries(self, value): self.BoxEntries.append(value) + def insert_BoxEntries(self, index, value): self.BoxEntries[index] = value + def get_BarcodeEntries(self): return self.BarcodeEntries + def set_BarcodeEntries(self, BarcodeEntries): self.BarcodeEntries = BarcodeEntries + def add_BarcodeEntries(self, value): self.BarcodeEntries.append(value) + def insert_BarcodeEntries(self, index, value): self.BarcodeEntries[index] = value + def export(self, outfile, level, namespace_='ns:', name_='CustomLabelDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CustomLabelDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CustomLabelDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CustomLabelDetail', fromsubclass_=False): + if self.CoordinateUnits is not None: + showIndent(outfile, level) + outfile.write('<%sCoordinateUnits>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CoordinateUnits).encode(ExternalEncoding), input_name='CoordinateUnits'), namespace_)) + for TextEntries_ in self.TextEntries: + TextEntries_.export(outfile, level, namespace_, name_='TextEntries') + for GraphicEntries_ in self.GraphicEntries: + GraphicEntries_.export(outfile, level, namespace_, name_='GraphicEntries') + for BoxEntries_ in self.BoxEntries: + BoxEntries_.export(outfile, level, namespace_, name_='BoxEntries') + for BarcodeEntries_ in self.BarcodeEntries: + BarcodeEntries_.export(outfile, level, namespace_, name_='BarcodeEntries') + def hasContent_(self): + if ( + self.CoordinateUnits is not None or + self.TextEntries or + self.GraphicEntries or + self.BoxEntries or + self.BarcodeEntries + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CustomLabelDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.CoordinateUnits is not None: + showIndent(outfile, level) + outfile.write('CoordinateUnits=%s,\n' % quote_python(self.CoordinateUnits).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('TextEntries=[\n') + level += 1 + for TextEntries_ in self.TextEntries: + showIndent(outfile, level) + outfile.write('model_.CustomLabelTextEntry(\n') + TextEntries_.exportLiteral(outfile, level, name_='CustomLabelTextEntry') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('GraphicEntries=[\n') + level += 1 + for GraphicEntries_ in self.GraphicEntries: + showIndent(outfile, level) + outfile.write('model_.CustomLabelGraphicEntry(\n') + GraphicEntries_.exportLiteral(outfile, level, name_='CustomLabelGraphicEntry') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('BoxEntries=[\n') + level += 1 + for BoxEntries_ in self.BoxEntries: + showIndent(outfile, level) + outfile.write('model_.CustomLabelBoxEntry(\n') + BoxEntries_.exportLiteral(outfile, level, name_='CustomLabelBoxEntry') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('BarcodeEntries=[\n') + level += 1 + for BarcodeEntries_ in self.BarcodeEntries: + showIndent(outfile, level) + outfile.write('model_.CustomLabelBarcodeEntry(\n') + BarcodeEntries_.exportLiteral(outfile, level, name_='CustomLabelBarcodeEntry') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'CoordinateUnits': + CoordinateUnits_ = child_.text + CoordinateUnits_ = self.gds_validate_string(CoordinateUnits_, node, 'CoordinateUnits') + self.CoordinateUnits = CoordinateUnits_ + self.validate_CustomLabelCoordinateUnits(self.CoordinateUnits) # validate type CustomLabelCoordinateUnits + elif nodeName_ == 'TextEntries': + obj_ = CustomLabelTextEntry.factory() + obj_.build(child_) + self.TextEntries.append(obj_) + elif nodeName_ == 'GraphicEntries': + obj_ = CustomLabelGraphicEntry.factory() + obj_.build(child_) + self.GraphicEntries.append(obj_) + elif nodeName_ == 'BoxEntries': + obj_ = CustomLabelBoxEntry.factory() + obj_.build(child_) + self.BoxEntries.append(obj_) + elif nodeName_ == 'BarcodeEntries': + obj_ = CustomLabelBarcodeEntry.factory() + obj_.build(child_) + self.BarcodeEntries.append(obj_) +# end class CustomLabelDetail + + +class CustomLabelGraphicEntry(GeneratedsSuper): + """Image to be included from printer's memory, or from a local file for + offline clients.""" + subclass = None + superclass = None + def __init__(self, Position=None, PrinterGraphicId=None, FileGraphicFullName=None): + self.Position = Position + self.PrinterGraphicId = PrinterGraphicId + self.FileGraphicFullName = FileGraphicFullName + def factory(*args_, **kwargs_): + if CustomLabelGraphicEntry.subclass: + return CustomLabelGraphicEntry.subclass(*args_, **kwargs_) + else: + return CustomLabelGraphicEntry(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Position(self): return self.Position + def set_Position(self, Position): self.Position = Position + def get_PrinterGraphicId(self): return self.PrinterGraphicId + def set_PrinterGraphicId(self, PrinterGraphicId): self.PrinterGraphicId = PrinterGraphicId + def get_FileGraphicFullName(self): return self.FileGraphicFullName + def set_FileGraphicFullName(self, FileGraphicFullName): self.FileGraphicFullName = FileGraphicFullName + def export(self, outfile, level, namespace_='ns:', name_='CustomLabelGraphicEntry', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CustomLabelGraphicEntry') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CustomLabelGraphicEntry'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CustomLabelGraphicEntry', fromsubclass_=False): + if self.Position: + self.Position.export(outfile, level, namespace_, name_='Position') + if self.PrinterGraphicId is not None: + showIndent(outfile, level) + outfile.write('<%sPrinterGraphicId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PrinterGraphicId).encode(ExternalEncoding), input_name='PrinterGraphicId'), namespace_)) + if self.FileGraphicFullName is not None: + showIndent(outfile, level) + outfile.write('<%sFileGraphicFullName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.FileGraphicFullName).encode(ExternalEncoding), input_name='FileGraphicFullName'), namespace_)) + def hasContent_(self): + if ( + self.Position is not None or + self.PrinterGraphicId is not None or + self.FileGraphicFullName is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CustomLabelGraphicEntry'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Position is not None: + showIndent(outfile, level) + outfile.write('Position=model_.CustomLabelPosition(\n') + self.Position.exportLiteral(outfile, level, name_='Position') + showIndent(outfile, level) + outfile.write('),\n') + if self.PrinterGraphicId is not None: + showIndent(outfile, level) + outfile.write('PrinterGraphicId=%s,\n' % quote_python(self.PrinterGraphicId).encode(ExternalEncoding)) + if self.FileGraphicFullName is not None: + showIndent(outfile, level) + outfile.write('FileGraphicFullName=%s,\n' % quote_python(self.FileGraphicFullName).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Position': + obj_ = CustomLabelPosition.factory() + obj_.build(child_) + self.set_Position(obj_) + elif nodeName_ == 'PrinterGraphicId': + PrinterGraphicId_ = child_.text + PrinterGraphicId_ = self.gds_validate_string(PrinterGraphicId_, node, 'PrinterGraphicId') + self.PrinterGraphicId = PrinterGraphicId_ + elif nodeName_ == 'FileGraphicFullName': + FileGraphicFullName_ = child_.text + FileGraphicFullName_ = self.gds_validate_string(FileGraphicFullName_, node, 'FileGraphicFullName') + self.FileGraphicFullName = FileGraphicFullName_ +# end class CustomLabelGraphicEntry + + +class CustomLabelPosition(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, X=None, Y=None): + self.X = X + self.Y = Y + def factory(*args_, **kwargs_): + if CustomLabelPosition.subclass: + return CustomLabelPosition.subclass(*args_, **kwargs_) + else: + return CustomLabelPosition(*args_, **kwargs_) + factory = staticmethod(factory) + def get_X(self): return self.X + def set_X(self, X): self.X = X + def get_Y(self): return self.Y + def set_Y(self, Y): self.Y = Y + def export(self, outfile, level, namespace_='ns:', name_='CustomLabelPosition', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CustomLabelPosition') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CustomLabelPosition'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CustomLabelPosition', fromsubclass_=False): + if self.X is not None: + showIndent(outfile, level) + outfile.write('<%sX>%s\n' % (namespace_, self.gds_format_integer(self.X, input_name='X'), namespace_)) + if self.Y is not None: + showIndent(outfile, level) + outfile.write('<%sY>%s\n' % (namespace_, self.gds_format_integer(self.Y, input_name='Y'), namespace_)) + def hasContent_(self): + if ( + self.X is not None or + self.Y is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CustomLabelPosition'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.X is not None: + showIndent(outfile, level) + outfile.write('X=%d,\n' % self.X) + if self.Y is not None: + showIndent(outfile, level) + outfile.write('Y=%d,\n' % self.Y) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'X': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'X') + self.X = ival_ + elif nodeName_ == 'Y': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'Y') + self.Y = ival_ +# end class CustomLabelPosition + + +class CustomLabelTextEntry(GeneratedsSuper): + """Constructed string, based on format and zero or more data fields, + printed in specified printer font (for thermal labels) or + generic font/size (for plain paper labels).""" + subclass = None + superclass = None + def __init__(self, Position=None, Format=None, DataFields=None, ThermalFontId=None, FontName=None, FontSize=None): + self.Position = Position + self.Format = Format + if DataFields is None: + self.DataFields = [] + else: + self.DataFields = DataFields + self.ThermalFontId = ThermalFontId + self.FontName = FontName + self.FontSize = FontSize + def factory(*args_, **kwargs_): + if CustomLabelTextEntry.subclass: + return CustomLabelTextEntry.subclass(*args_, **kwargs_) + else: + return CustomLabelTextEntry(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Position(self): return self.Position + def set_Position(self, Position): self.Position = Position + def get_Format(self): return self.Format + def set_Format(self, Format): self.Format = Format + def get_DataFields(self): return self.DataFields + def set_DataFields(self, DataFields): self.DataFields = DataFields + def add_DataFields(self, value): self.DataFields.append(value) + def insert_DataFields(self, index, value): self.DataFields[index] = value + def get_ThermalFontId(self): return self.ThermalFontId + def set_ThermalFontId(self, ThermalFontId): self.ThermalFontId = ThermalFontId + def get_FontName(self): return self.FontName + def set_FontName(self, FontName): self.FontName = FontName + def get_FontSize(self): return self.FontSize + def set_FontSize(self, FontSize): self.FontSize = FontSize + def export(self, outfile, level, namespace_='ns:', name_='CustomLabelTextEntry', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CustomLabelTextEntry') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CustomLabelTextEntry'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CustomLabelTextEntry', fromsubclass_=False): + if self.Position: + self.Position.export(outfile, level, namespace_, name_='Position', ) + if self.Format is not None: + showIndent(outfile, level) + outfile.write('<%sFormat>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Format).encode(ExternalEncoding), input_name='Format'), namespace_)) + for DataFields_ in self.DataFields: + showIndent(outfile, level) + outfile.write('<%sDataFields>%s\n' % (namespace_, self.gds_format_string(quote_xml(DataFields_).encode(ExternalEncoding), input_name='DataFields'), namespace_)) + if self.ThermalFontId is not None: + showIndent(outfile, level) + outfile.write('<%sThermalFontId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ThermalFontId).encode(ExternalEncoding), input_name='ThermalFontId'), namespace_)) + if self.FontName is not None: + showIndent(outfile, level) + outfile.write('<%sFontName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.FontName).encode(ExternalEncoding), input_name='FontName'), namespace_)) + if self.FontSize is not None: + showIndent(outfile, level) + outfile.write('<%sFontSize>%s\n' % (namespace_, self.gds_format_integer(self.FontSize, input_name='FontSize'), namespace_)) + def hasContent_(self): + if ( + self.Position is not None or + self.Format is not None or + self.DataFields or + self.ThermalFontId is not None or + self.FontName is not None or + self.FontSize is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CustomLabelTextEntry'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Position is not None: + showIndent(outfile, level) + outfile.write('Position=model_.CustomLabelPosition(\n') + self.Position.exportLiteral(outfile, level, name_='Position') + showIndent(outfile, level) + outfile.write('),\n') + if self.Format is not None: + showIndent(outfile, level) + outfile.write('Format=%s,\n' % quote_python(self.Format).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('DataFields=[\n') + level += 1 + for DataFields_ in self.DataFields: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(DataFields_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.ThermalFontId is not None: + showIndent(outfile, level) + outfile.write('ThermalFontId=%s,\n' % quote_python(self.ThermalFontId).encode(ExternalEncoding)) + if self.FontName is not None: + showIndent(outfile, level) + outfile.write('FontName=%s,\n' % quote_python(self.FontName).encode(ExternalEncoding)) + if self.FontSize is not None: + showIndent(outfile, level) + outfile.write('FontSize=%d,\n' % self.FontSize) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Position': + obj_ = CustomLabelPosition.factory() + obj_.build(child_) + self.set_Position(obj_) + elif nodeName_ == 'Format': + Format_ = child_.text + Format_ = self.gds_validate_string(Format_, node, 'Format') + self.Format = Format_ + elif nodeName_ == 'DataFields': + DataFields_ = child_.text + DataFields_ = self.gds_validate_string(DataFields_, node, 'DataFields') + self.DataFields.append(DataFields_) + elif nodeName_ == 'ThermalFontId': + ThermalFontId_ = child_.text + ThermalFontId_ = self.gds_validate_string(ThermalFontId_, node, 'ThermalFontId') + self.ThermalFontId = ThermalFontId_ + elif nodeName_ == 'FontName': + FontName_ = child_.text + FontName_ = self.gds_validate_string(FontName_, node, 'FontName') + self.FontName = FontName_ + elif nodeName_ == 'FontSize': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ <= 0: + raise_parse_error(child_, 'requires positiveInteger') + ival_ = self.gds_validate_integer(ival_, node, 'FontSize') + self.FontSize = ival_ +# end class CustomLabelTextEntry + + +class CustomerImageUsage(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Type=None, Id=None): + self.Type = Type + self.Id = Id + def factory(*args_, **kwargs_): + if CustomerImageUsage.subclass: + return CustomerImageUsage.subclass(*args_, **kwargs_) + else: + return CustomerImageUsage(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Type(self): return self.Type + def set_Type(self, Type): self.Type = Type + def validate_CustomerImageUsageType(self, value): + # Validate type CustomerImageUsageType, a restriction on xs:string. + pass + def get_Id(self): return self.Id + def set_Id(self, Id): self.Id = Id + def validate_ImageId(self, value): + # Validate type ImageId, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='CustomerImageUsage', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CustomerImageUsage') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CustomerImageUsage'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CustomerImageUsage', fromsubclass_=False): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('<%sType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Type).encode(ExternalEncoding), input_name='Type'), namespace_)) + if self.Id is not None: + showIndent(outfile, level) + outfile.write('<%sId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Id).encode(ExternalEncoding), input_name='Id'), namespace_)) + def hasContent_(self): + if ( + self.Type is not None or + self.Id is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CustomerImageUsage'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('Type=%s,\n' % quote_python(self.Type).encode(ExternalEncoding)) + if self.Id is not None: + showIndent(outfile, level) + outfile.write('Id=%s,\n' % quote_python(self.Id).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Type': + Type_ = child_.text + Type_ = self.gds_validate_string(Type_, node, 'Type') + self.Type = Type_ + self.validate_CustomerImageUsageType(self.Type) # validate type CustomerImageUsageType + elif nodeName_ == 'Id': + Id_ = child_.text + Id_ = self.gds_validate_string(Id_, node, 'Id') + self.Id = Id_ + self.validate_ImageId(self.Id) # validate type ImageId +# end class CustomerImageUsage + + +class CustomerReference(GeneratedsSuper): + """Reference information to be associated with this package.""" + subclass = None + superclass = None + def __init__(self, CustomerReferenceType=None, Value=None): + self.CustomerReferenceType = CustomerReferenceType + self.Value = Value + def factory(*args_, **kwargs_): + if CustomerReference.subclass: + return CustomerReference.subclass(*args_, **kwargs_) + else: + return CustomerReference(*args_, **kwargs_) + factory = staticmethod(factory) + def get_CustomerReferenceType(self): return self.CustomerReferenceType + def set_CustomerReferenceType(self, CustomerReferenceType): self.CustomerReferenceType = CustomerReferenceType + def validate_CustomerReferenceType(self, value): + # Validate type CustomerReferenceType, a restriction on xs:string. + pass + def get_Value(self): return self.Value + def set_Value(self, Value): self.Value = Value + def export(self, outfile, level, namespace_='ns:', name_='CustomerReference', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CustomerReference') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CustomerReference'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CustomerReference', fromsubclass_=False): + if self.CustomerReferenceType is not None: + showIndent(outfile, level) + outfile.write('<%sCustomerReferenceType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CustomerReferenceType).encode(ExternalEncoding), input_name='CustomerReferenceType'), namespace_)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('<%sValue>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Value).encode(ExternalEncoding), input_name='Value'), namespace_)) + def hasContent_(self): + if ( + self.CustomerReferenceType is not None or + self.Value is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CustomerReference'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.CustomerReferenceType is not None: + showIndent(outfile, level) + outfile.write('CustomerReferenceType=%s,\n' % quote_python(self.CustomerReferenceType).encode(ExternalEncoding)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('Value=%s,\n' % quote_python(self.Value).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'CustomerReferenceType': + CustomerReferenceType_ = child_.text + CustomerReferenceType_ = self.gds_validate_string(CustomerReferenceType_, node, 'CustomerReferenceType') + self.CustomerReferenceType = CustomerReferenceType_ + self.validate_CustomerReferenceType(self.CustomerReferenceType) # validate type CustomerReferenceType + elif nodeName_ == 'Value': + Value_ = child_.text + Value_ = self.gds_validate_string(Value_, node, 'Value') + self.Value = Value_ +# end class CustomerReference + + +class CustomerSpecifiedLabelDetail(GeneratedsSuper): + """Allows customer-specified control of label content.""" + subclass = None + superclass = None + def __init__(self, DocTabContent=None, CustomContent=None, ConfigurableReferenceEntries=None, MaskedData=None, SecondaryBarcode=None, TermsAndConditionsLocalization=None, AdditionalLabels=None, AirWaybillSuppressionCount=None): + self.DocTabContent = DocTabContent + self.CustomContent = CustomContent + if ConfigurableReferenceEntries is None: + self.ConfigurableReferenceEntries = [] + else: + self.ConfigurableReferenceEntries = ConfigurableReferenceEntries + if MaskedData is None: + self.MaskedData = [] + else: + self.MaskedData = MaskedData + self.SecondaryBarcode = SecondaryBarcode + self.TermsAndConditionsLocalization = TermsAndConditionsLocalization + if AdditionalLabels is None: + self.AdditionalLabels = [] + else: + self.AdditionalLabels = AdditionalLabels + self.AirWaybillSuppressionCount = AirWaybillSuppressionCount + def factory(*args_, **kwargs_): + if CustomerSpecifiedLabelDetail.subclass: + return CustomerSpecifiedLabelDetail.subclass(*args_, **kwargs_) + else: + return CustomerSpecifiedLabelDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_DocTabContent(self): return self.DocTabContent + def set_DocTabContent(self, DocTabContent): self.DocTabContent = DocTabContent + def get_CustomContent(self): return self.CustomContent + def set_CustomContent(self, CustomContent): self.CustomContent = CustomContent + def get_ConfigurableReferenceEntries(self): return self.ConfigurableReferenceEntries + def set_ConfigurableReferenceEntries(self, ConfigurableReferenceEntries): self.ConfigurableReferenceEntries = ConfigurableReferenceEntries + def add_ConfigurableReferenceEntries(self, value): self.ConfigurableReferenceEntries.append(value) + def insert_ConfigurableReferenceEntries(self, index, value): self.ConfigurableReferenceEntries[index] = value + def get_MaskedData(self): return self.MaskedData + def set_MaskedData(self, MaskedData): self.MaskedData = MaskedData + def add_MaskedData(self, value): self.MaskedData.append(value) + def insert_MaskedData(self, index, value): self.MaskedData[index] = value + def validate_LabelMaskableDataType(self, value): + # Validate type LabelMaskableDataType, a restriction on xs:string. + pass + def get_SecondaryBarcode(self): return self.SecondaryBarcode + def set_SecondaryBarcode(self, SecondaryBarcode): self.SecondaryBarcode = SecondaryBarcode + def validate_SecondaryBarcodeType(self, value): + # Validate type SecondaryBarcodeType, a restriction on xs:string. + pass + def get_TermsAndConditionsLocalization(self): return self.TermsAndConditionsLocalization + def set_TermsAndConditionsLocalization(self, TermsAndConditionsLocalization): self.TermsAndConditionsLocalization = TermsAndConditionsLocalization + def get_AdditionalLabels(self): return self.AdditionalLabels + def set_AdditionalLabels(self, AdditionalLabels): self.AdditionalLabels = AdditionalLabels + def add_AdditionalLabels(self, value): self.AdditionalLabels.append(value) + def insert_AdditionalLabels(self, index, value): self.AdditionalLabels[index] = value + def get_AirWaybillSuppressionCount(self): return self.AirWaybillSuppressionCount + def set_AirWaybillSuppressionCount(self, AirWaybillSuppressionCount): self.AirWaybillSuppressionCount = AirWaybillSuppressionCount + def export(self, outfile, level, namespace_='ns:', name_='CustomerSpecifiedLabelDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CustomerSpecifiedLabelDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CustomerSpecifiedLabelDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CustomerSpecifiedLabelDetail', fromsubclass_=False): + if self.DocTabContent: + self.DocTabContent.export(outfile, level, namespace_, name_='DocTabContent') + if self.CustomContent: + self.CustomContent.export(outfile, level, namespace_, name_='CustomContent') + for ConfigurableReferenceEntries_ in self.ConfigurableReferenceEntries: + ConfigurableReferenceEntries_.export(outfile, level, namespace_, name_='ConfigurableReferenceEntries') + for MaskedData_ in self.MaskedData: + showIndent(outfile, level) + outfile.write('<%sMaskedData>%s\n' % (namespace_, self.gds_format_string(quote_xml(MaskedData_).encode(ExternalEncoding), input_name='MaskedData'), namespace_)) + if self.SecondaryBarcode is not None: + showIndent(outfile, level) + outfile.write('<%sSecondaryBarcode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.SecondaryBarcode).encode(ExternalEncoding), input_name='SecondaryBarcode'), namespace_)) + if self.TermsAndConditionsLocalization: + self.TermsAndConditionsLocalization.export(outfile, level, namespace_, name_='TermsAndConditionsLocalization') + for AdditionalLabels_ in self.AdditionalLabels: + AdditionalLabels_.export(outfile, level, namespace_, name_='AdditionalLabels') + if self.AirWaybillSuppressionCount is not None: + showIndent(outfile, level) + outfile.write('<%sAirWaybillSuppressionCount>%s\n' % (namespace_, self.gds_format_integer(self.AirWaybillSuppressionCount, input_name='AirWaybillSuppressionCount'), namespace_)) + def hasContent_(self): + if ( + self.DocTabContent is not None or + self.CustomContent is not None or + self.ConfigurableReferenceEntries or + self.MaskedData or + self.SecondaryBarcode is not None or + self.TermsAndConditionsLocalization is not None or + self.AdditionalLabels or + self.AirWaybillSuppressionCount is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CustomerSpecifiedLabelDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.DocTabContent is not None: + showIndent(outfile, level) + outfile.write('DocTabContent=model_.DocTabContent(\n') + self.DocTabContent.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.CustomContent is not None: + showIndent(outfile, level) + outfile.write('CustomContent=model_.CustomLabelDetail(\n') + self.CustomContent.exportLiteral(outfile, level, name_='CustomContent') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('ConfigurableReferenceEntries=[\n') + level += 1 + for ConfigurableReferenceEntries_ in self.ConfigurableReferenceEntries: + showIndent(outfile, level) + outfile.write('model_.ConfigurableLabelReferenceEntry(\n') + ConfigurableReferenceEntries_.exportLiteral(outfile, level, name_='ConfigurableLabelReferenceEntry') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('MaskedData=[\n') + level += 1 + for MaskedData_ in self.MaskedData: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(MaskedData_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.SecondaryBarcode is not None: + showIndent(outfile, level) + outfile.write('SecondaryBarcode=%s,\n' % quote_python(self.SecondaryBarcode).encode(ExternalEncoding)) + if self.TermsAndConditionsLocalization is not None: + showIndent(outfile, level) + outfile.write('TermsAndConditionsLocalization=model_.Localization(\n') + self.TermsAndConditionsLocalization.exportLiteral(outfile, level, name_='TermsAndConditionsLocalization') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('AdditionalLabels=[\n') + level += 1 + for AdditionalLabels_ in self.AdditionalLabels: + showIndent(outfile, level) + outfile.write('model_.AdditionalLabelsDetail(\n') + AdditionalLabels_.exportLiteral(outfile, level, name_='AdditionalLabelsDetail') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.AirWaybillSuppressionCount is not None: + showIndent(outfile, level) + outfile.write('AirWaybillSuppressionCount=%d,\n' % self.AirWaybillSuppressionCount) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'DocTabContent': + obj_ = DocTabContent.factory() + obj_.build(child_) + self.set_DocTabContent(obj_) + elif nodeName_ == 'CustomContent': + obj_ = CustomLabelDetail.factory() + obj_.build(child_) + self.set_CustomContent(obj_) + elif nodeName_ == 'ConfigurableReferenceEntries': + obj_ = ConfigurableLabelReferenceEntry.factory() + obj_.build(child_) + self.ConfigurableReferenceEntries.append(obj_) + elif nodeName_ == 'MaskedData': + MaskedData_ = child_.text + MaskedData_ = self.gds_validate_string(MaskedData_, node, 'MaskedData') + self.MaskedData.append(MaskedData_) + self.validate_LabelMaskableDataType(self.MaskedData) # validate type LabelMaskableDataType + elif nodeName_ == 'SecondaryBarcode': + SecondaryBarcode_ = child_.text + SecondaryBarcode_ = self.gds_validate_string(SecondaryBarcode_, node, 'SecondaryBarcode') + self.SecondaryBarcode = SecondaryBarcode_ + self.validate_SecondaryBarcodeType(self.SecondaryBarcode) # validate type SecondaryBarcodeType + elif nodeName_ == 'TermsAndConditionsLocalization': + obj_ = Localization.factory() + obj_.build(child_) + self.set_TermsAndConditionsLocalization(obj_) + elif nodeName_ == 'AdditionalLabels': + obj_ = AdditionalLabelsDetail.factory() + obj_.build(child_) + self.AdditionalLabels.append(obj_) + elif nodeName_ == 'AirWaybillSuppressionCount': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'AirWaybillSuppressionCount') + self.AirWaybillSuppressionCount = ival_ +# end class CustomerSpecifiedLabelDetail + + +class CustomsClearanceDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Broker=None, ClearanceBrokerage=None, ImporterOfRecord=None, RecipientCustomsId=None, DutiesPayment=None, DocumentContent=None, CustomsValue=None, FreightOnValue=None, InsuranceCharges=None, PartiesToTransactionAreRelated=None, CommercialInvoice=None, Commodities=None, ExportDetail=None, RegulatoryControls=None): + self.Broker = Broker + self.ClearanceBrokerage = ClearanceBrokerage + self.ImporterOfRecord = ImporterOfRecord + self.RecipientCustomsId = RecipientCustomsId + self.DutiesPayment = DutiesPayment + self.DocumentContent = DocumentContent + self.CustomsValue = CustomsValue + self.FreightOnValue = FreightOnValue + self.InsuranceCharges = InsuranceCharges + self.PartiesToTransactionAreRelated = PartiesToTransactionAreRelated + self.CommercialInvoice = CommercialInvoice + if Commodities is None: + self.Commodities = [] + else: + self.Commodities = Commodities + self.ExportDetail = ExportDetail + if RegulatoryControls is None: + self.RegulatoryControls = [] + else: + self.RegulatoryControls = RegulatoryControls + def factory(*args_, **kwargs_): + if CustomsClearanceDetail.subclass: + return CustomsClearanceDetail.subclass(*args_, **kwargs_) + else: + return CustomsClearanceDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Broker(self): return self.Broker + def set_Broker(self, Broker): self.Broker = Broker + def get_ClearanceBrokerage(self): return self.ClearanceBrokerage + def set_ClearanceBrokerage(self, ClearanceBrokerage): self.ClearanceBrokerage = ClearanceBrokerage + def validate_ClearanceBrokerageType(self, value): + # Validate type ClearanceBrokerageType, a restriction on xs:string. + pass + def get_ImporterOfRecord(self): return self.ImporterOfRecord + def set_ImporterOfRecord(self, ImporterOfRecord): self.ImporterOfRecord = ImporterOfRecord + def get_RecipientCustomsId(self): return self.RecipientCustomsId + def set_RecipientCustomsId(self, RecipientCustomsId): self.RecipientCustomsId = RecipientCustomsId + def get_DutiesPayment(self): return self.DutiesPayment + def set_DutiesPayment(self, DutiesPayment): self.DutiesPayment = DutiesPayment + def get_DocumentContent(self): return self.DocumentContent + def set_DocumentContent(self, DocumentContent): self.DocumentContent = DocumentContent + def validate_InternationalDocumentContentType(self, value): + # Validate type InternationalDocumentContentType, a restriction on xs:string. + pass + def get_CustomsValue(self): return self.CustomsValue + def set_CustomsValue(self, CustomsValue): self.CustomsValue = CustomsValue + def get_FreightOnValue(self): return self.FreightOnValue + def set_FreightOnValue(self, FreightOnValue): self.FreightOnValue = FreightOnValue + def validate_FreightOnValueType(self, value): + # Validate type FreightOnValueType, a restriction on xs:string. + pass + def get_InsuranceCharges(self): return self.InsuranceCharges + def set_InsuranceCharges(self, InsuranceCharges): self.InsuranceCharges = InsuranceCharges + def get_PartiesToTransactionAreRelated(self): return self.PartiesToTransactionAreRelated + def set_PartiesToTransactionAreRelated(self, PartiesToTransactionAreRelated): self.PartiesToTransactionAreRelated = PartiesToTransactionAreRelated + def get_CommercialInvoice(self): return self.CommercialInvoice + def set_CommercialInvoice(self, CommercialInvoice): self.CommercialInvoice = CommercialInvoice + def get_Commodities(self): return self.Commodities + def set_Commodities(self, Commodities): self.Commodities = Commodities + def add_Commodities(self, value): self.Commodities.append(value) + def insert_Commodities(self, index, value): self.Commodities[index] = value + def get_ExportDetail(self): return self.ExportDetail + def set_ExportDetail(self, ExportDetail): self.ExportDetail = ExportDetail + def get_RegulatoryControls(self): return self.RegulatoryControls + def set_RegulatoryControls(self, RegulatoryControls): self.RegulatoryControls = RegulatoryControls + def add_RegulatoryControls(self, value): self.RegulatoryControls.append(value) + def insert_RegulatoryControls(self, index, value): self.RegulatoryControls[index] = value + def validate_RegulatoryControlType(self, value): + # Validate type RegulatoryControlType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='CustomsClearanceDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='CustomsClearanceDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='CustomsClearanceDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='CustomsClearanceDetail', fromsubclass_=False): + if self.Broker: + self.Broker.export(outfile, level, namespace_, name_='Broker') + if self.ClearanceBrokerage is not None: + showIndent(outfile, level) + outfile.write('<%sClearanceBrokerage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ClearanceBrokerage).encode(ExternalEncoding), input_name='ClearanceBrokerage'), namespace_)) + if self.ImporterOfRecord: + self.ImporterOfRecord.export(outfile, level, namespace_, name_='ImporterOfRecord') + if self.RecipientCustomsId: + self.RecipientCustomsId.export(outfile, level, namespace_, name_='RecipientCustomsId') + if self.DutiesPayment: + self.DutiesPayment.export(outfile, level, namespace_, name_='DutiesPayment') + if self.DocumentContent is not None: + showIndent(outfile, level) + outfile.write('<%sDocumentContent>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DocumentContent).encode(ExternalEncoding), input_name='DocumentContent'), namespace_)) + if self.CustomsValue: + self.CustomsValue.export(outfile, level, namespace_, name_='CustomsValue') + if self.FreightOnValue is not None: + showIndent(outfile, level) + outfile.write('<%sFreightOnValue>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.FreightOnValue).encode(ExternalEncoding), input_name='FreightOnValue'), namespace_)) + if self.InsuranceCharges: + self.InsuranceCharges.export(outfile, level, namespace_, name_='InsuranceCharges') + if self.PartiesToTransactionAreRelated is not None: + showIndent(outfile, level) + outfile.write('<%sPartiesToTransactionAreRelated>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.PartiesToTransactionAreRelated)), input_name='PartiesToTransactionAreRelated'), namespace_)) + if self.CommercialInvoice: + self.CommercialInvoice.export(outfile, level, namespace_, name_='CommercialInvoice') + for Commodities_ in self.Commodities: + Commodities_.export(outfile, level, namespace_, name_='Commodities') + if self.ExportDetail: + self.ExportDetail.export(outfile, level, namespace_, name_='ExportDetail') + for RegulatoryControls_ in self.RegulatoryControls: + showIndent(outfile, level) + outfile.write('<%sRegulatoryControls>%s\n' % (namespace_, self.gds_format_string(quote_xml(RegulatoryControls_).encode(ExternalEncoding), input_name='RegulatoryControls'), namespace_)) + def hasContent_(self): + if ( + self.Broker is not None or + self.ClearanceBrokerage is not None or + self.ImporterOfRecord is not None or + self.RecipientCustomsId is not None or + self.DutiesPayment is not None or + self.DocumentContent is not None or + self.CustomsValue is not None or + self.FreightOnValue is not None or + self.InsuranceCharges is not None or + self.PartiesToTransactionAreRelated is not None or + self.CommercialInvoice is not None or + self.Commodities or + self.ExportDetail is not None or + self.RegulatoryControls + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='CustomsClearanceDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Broker is not None: + showIndent(outfile, level) + outfile.write('Broker=model_.Party(\n') + self.Broker.exportLiteral(outfile, level, name_='Broker') + showIndent(outfile, level) + outfile.write('),\n') + if self.ClearanceBrokerage is not None: + showIndent(outfile, level) + outfile.write('ClearanceBrokerage=%s,\n' % quote_python(self.ClearanceBrokerage).encode(ExternalEncoding)) + if self.ImporterOfRecord is not None: + showIndent(outfile, level) + outfile.write('ImporterOfRecord=model_.Party(\n') + self.ImporterOfRecord.exportLiteral(outfile, level, name_='ImporterOfRecord') + showIndent(outfile, level) + outfile.write('),\n') + if self.RecipientCustomsId is not None: + showIndent(outfile, level) + outfile.write('RecipientCustomsId=model_.RecipientCustomsId(\n') + self.RecipientCustomsId.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.DutiesPayment is not None: + showIndent(outfile, level) + outfile.write('DutiesPayment=model_.Payment(\n') + self.DutiesPayment.exportLiteral(outfile, level, name_='DutiesPayment') + showIndent(outfile, level) + outfile.write('),\n') + if self.DocumentContent is not None: + showIndent(outfile, level) + outfile.write('DocumentContent=%s,\n' % quote_python(self.DocumentContent).encode(ExternalEncoding)) + if self.CustomsValue is not None: + showIndent(outfile, level) + outfile.write('CustomsValue=model_.Money(\n') + self.CustomsValue.exportLiteral(outfile, level, name_='CustomsValue') + showIndent(outfile, level) + outfile.write('),\n') + if self.FreightOnValue is not None: + showIndent(outfile, level) + outfile.write('FreightOnValue=%s,\n' % quote_python(self.FreightOnValue).encode(ExternalEncoding)) + if self.InsuranceCharges is not None: + showIndent(outfile, level) + outfile.write('InsuranceCharges=model_.Money(\n') + self.InsuranceCharges.exportLiteral(outfile, level, name_='InsuranceCharges') + showIndent(outfile, level) + outfile.write('),\n') + if self.PartiesToTransactionAreRelated is not None: + showIndent(outfile, level) + outfile.write('PartiesToTransactionAreRelated=%s,\n' % self.PartiesToTransactionAreRelated) + if self.CommercialInvoice is not None: + showIndent(outfile, level) + outfile.write('CommercialInvoice=model_.CommercialInvoice(\n') + self.CommercialInvoice.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('Commodities=[\n') + level += 1 + for Commodities_ in self.Commodities: + showIndent(outfile, level) + outfile.write('model_.Commodity(\n') + Commodities_.exportLiteral(outfile, level, name_='Commodity') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.ExportDetail is not None: + showIndent(outfile, level) + outfile.write('ExportDetail=model_.ExportDetail(\n') + self.ExportDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('RegulatoryControls=[\n') + level += 1 + for RegulatoryControls_ in self.RegulatoryControls: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(RegulatoryControls_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Broker': + obj_ = Party.factory() + obj_.build(child_) + self.set_Broker(obj_) + elif nodeName_ == 'ClearanceBrokerage': + ClearanceBrokerage_ = child_.text + ClearanceBrokerage_ = self.gds_validate_string(ClearanceBrokerage_, node, 'ClearanceBrokerage') + self.ClearanceBrokerage = ClearanceBrokerage_ + self.validate_ClearanceBrokerageType(self.ClearanceBrokerage) # validate type ClearanceBrokerageType + elif nodeName_ == 'ImporterOfRecord': + obj_ = Party.factory() + obj_.build(child_) + self.set_ImporterOfRecord(obj_) + elif nodeName_ == 'RecipientCustomsId': + obj_ = RecipientCustomsId.factory() + obj_.build(child_) + self.set_RecipientCustomsId(obj_) + elif nodeName_ == 'DutiesPayment': + obj_ = Payment.factory() + obj_.build(child_) + self.set_DutiesPayment(obj_) + elif nodeName_ == 'DocumentContent': + DocumentContent_ = child_.text + DocumentContent_ = self.gds_validate_string(DocumentContent_, node, 'DocumentContent') + self.DocumentContent = DocumentContent_ + self.validate_InternationalDocumentContentType(self.DocumentContent) # validate type InternationalDocumentContentType + elif nodeName_ == 'CustomsValue': + obj_ = Money.factory() + obj_.build(child_) + self.set_CustomsValue(obj_) + elif nodeName_ == 'FreightOnValue': + FreightOnValue_ = child_.text + FreightOnValue_ = self.gds_validate_string(FreightOnValue_, node, 'FreightOnValue') + self.FreightOnValue = FreightOnValue_ + self.validate_FreightOnValueType(self.FreightOnValue) # validate type FreightOnValueType + elif nodeName_ == 'InsuranceCharges': + obj_ = Money.factory() + obj_.build(child_) + self.set_InsuranceCharges(obj_) + elif nodeName_ == 'PartiesToTransactionAreRelated': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'PartiesToTransactionAreRelated') + self.PartiesToTransactionAreRelated = ival_ + elif nodeName_ == 'CommercialInvoice': + obj_ = CommercialInvoice.factory() + obj_.build(child_) + self.set_CommercialInvoice(obj_) + elif nodeName_ == 'Commodities': + obj_ = Commodity.factory() + obj_.build(child_) + self.Commodities.append(obj_) + elif nodeName_ == 'ExportDetail': + obj_ = ExportDetail.factory() + obj_.build(child_) + self.set_ExportDetail(obj_) + elif nodeName_ == 'RegulatoryControls': + RegulatoryControls_ = child_.text + RegulatoryControls_ = self.gds_validate_string(RegulatoryControls_, node, 'RegulatoryControls') + self.RegulatoryControls.append(RegulatoryControls_) + self.validate_RegulatoryControlType(self.RegulatoryControls) # validate type RegulatoryControlType +# end class CustomsClearanceDetail + + +class DangerousGoodsDetail(GeneratedsSuper): + """The descriptive data required for a FedEx shipment containing + dangerous goods (hazardous materials).""" + subclass = None + superclass = None + def __init__(self, Accessibility=None, CargoAircraftOnly=None, Options=None, HazardousCommodities=None, Packaging=None, EmergencyContactNumber=None, Offeror=None): + self.Accessibility = Accessibility + self.CargoAircraftOnly = CargoAircraftOnly + if Options is None: + self.Options = [] + else: + self.Options = Options + if HazardousCommodities is None: + self.HazardousCommodities = [] + else: + self.HazardousCommodities = HazardousCommodities + self.Packaging = Packaging + self.EmergencyContactNumber = EmergencyContactNumber + self.Offeror = Offeror + def factory(*args_, **kwargs_): + if DangerousGoodsDetail.subclass: + return DangerousGoodsDetail.subclass(*args_, **kwargs_) + else: + return DangerousGoodsDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Accessibility(self): return self.Accessibility + def set_Accessibility(self, Accessibility): self.Accessibility = Accessibility + def validate_DangerousGoodsAccessibilityType(self, value): + # Validate type DangerousGoodsAccessibilityType, a restriction on xs:string. + pass + def get_CargoAircraftOnly(self): return self.CargoAircraftOnly + def set_CargoAircraftOnly(self, CargoAircraftOnly): self.CargoAircraftOnly = CargoAircraftOnly + def get_Options(self): return self.Options + def set_Options(self, Options): self.Options = Options + def add_Options(self, value): self.Options.append(value) + def insert_Options(self, index, value): self.Options[index] = value + def validate_HazardousCommodityOptionType(self, value): + # Validate type HazardousCommodityOptionType, a restriction on xs:string. + pass + def get_HazardousCommodities(self): return self.HazardousCommodities + def set_HazardousCommodities(self, HazardousCommodities): self.HazardousCommodities = HazardousCommodities + def add_HazardousCommodities(self, value): self.HazardousCommodities.append(value) + def insert_HazardousCommodities(self, index, value): self.HazardousCommodities[index] = value + def get_Packaging(self): return self.Packaging + def set_Packaging(self, Packaging): self.Packaging = Packaging + def get_EmergencyContactNumber(self): return self.EmergencyContactNumber + def set_EmergencyContactNumber(self, EmergencyContactNumber): self.EmergencyContactNumber = EmergencyContactNumber + def get_Offeror(self): return self.Offeror + def set_Offeror(self, Offeror): self.Offeror = Offeror + def export(self, outfile, level, namespace_='ns:', name_='DangerousGoodsDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='DangerousGoodsDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='DangerousGoodsDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='DangerousGoodsDetail', fromsubclass_=False): + if self.Accessibility is not None: + showIndent(outfile, level) + outfile.write('<%sAccessibility>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Accessibility).encode(ExternalEncoding), input_name='Accessibility'), namespace_)) + if self.CargoAircraftOnly is not None: + showIndent(outfile, level) + outfile.write('<%sCargoAircraftOnly>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.CargoAircraftOnly)), input_name='CargoAircraftOnly'), namespace_)) + for Options_ in self.Options: + showIndent(outfile, level) + outfile.write('<%sOptions>%s\n' % (namespace_, self.gds_format_string(quote_xml(Options_).encode(ExternalEncoding), input_name='Options'), namespace_)) + for HazardousCommodities_ in self.HazardousCommodities: + HazardousCommodities_.export(outfile, level, namespace_, name_='HazardousCommodities') + if self.Packaging: + self.Packaging.export(outfile, level, namespace_, name_='Packaging') + if self.EmergencyContactNumber is not None: + showIndent(outfile, level) + outfile.write('<%sEmergencyContactNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.EmergencyContactNumber).encode(ExternalEncoding), input_name='EmergencyContactNumber'), namespace_)) + if self.Offeror is not None: + showIndent(outfile, level) + outfile.write('<%sOfferor>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Offeror).encode(ExternalEncoding), input_name='Offeror'), namespace_)) + def hasContent_(self): + if ( + self.Accessibility is not None or + self.CargoAircraftOnly is not None or + self.Options or + self.HazardousCommodities or + self.Packaging is not None or + self.EmergencyContactNumber is not None or + self.Offeror is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='DangerousGoodsDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Accessibility is not None: + showIndent(outfile, level) + outfile.write('Accessibility=%s,\n' % quote_python(self.Accessibility).encode(ExternalEncoding)) + if self.CargoAircraftOnly is not None: + showIndent(outfile, level) + outfile.write('CargoAircraftOnly=%s,\n' % self.CargoAircraftOnly) + showIndent(outfile, level) + outfile.write('Options=[\n') + level += 1 + for Options_ in self.Options: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(Options_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('HazardousCommodities=[\n') + level += 1 + for HazardousCommodities_ in self.HazardousCommodities: + showIndent(outfile, level) + outfile.write('model_.HazardousCommodityContent(\n') + HazardousCommodities_.exportLiteral(outfile, level, name_='HazardousCommodityContent') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.Packaging is not None: + showIndent(outfile, level) + outfile.write('Packaging=model_.HazardousCommodityPackagingDetail(\n') + self.Packaging.exportLiteral(outfile, level, name_='Packaging') + showIndent(outfile, level) + outfile.write('),\n') + if self.EmergencyContactNumber is not None: + showIndent(outfile, level) + outfile.write('EmergencyContactNumber=%s,\n' % quote_python(self.EmergencyContactNumber).encode(ExternalEncoding)) + if self.Offeror is not None: + showIndent(outfile, level) + outfile.write('Offeror=%s,\n' % quote_python(self.Offeror).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Accessibility': + Accessibility_ = child_.text + Accessibility_ = self.gds_validate_string(Accessibility_, node, 'Accessibility') + self.Accessibility = Accessibility_ + self.validate_DangerousGoodsAccessibilityType(self.Accessibility) # validate type DangerousGoodsAccessibilityType + elif nodeName_ == 'CargoAircraftOnly': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'CargoAircraftOnly') + self.CargoAircraftOnly = ival_ + elif nodeName_ == 'Options': + Options_ = child_.text + Options_ = self.gds_validate_string(Options_, node, 'Options') + self.Options.append(Options_) + self.validate_HazardousCommodityOptionType(self.Options) # validate type HazardousCommodityOptionType + elif nodeName_ == 'HazardousCommodities': + obj_ = HazardousCommodityContent.factory() + obj_.build(child_) + self.HazardousCommodities.append(obj_) + elif nodeName_ == 'Packaging': + obj_ = HazardousCommodityPackagingDetail.factory() + obj_.build(child_) + self.set_Packaging(obj_) + elif nodeName_ == 'EmergencyContactNumber': + EmergencyContactNumber_ = child_.text + EmergencyContactNumber_ = self.gds_validate_string(EmergencyContactNumber_, node, 'EmergencyContactNumber') + self.EmergencyContactNumber = EmergencyContactNumber_ + elif nodeName_ == 'Offeror': + Offeror_ = child_.text + Offeror_ = self.gds_validate_string(Offeror_, node, 'Offeror') + self.Offeror = Offeror_ +# end class DangerousGoodsDetail + + +class DateRange(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Begins=None, Ends=None): + self.Begins = Begins + self.Ends = Ends + def factory(*args_, **kwargs_): + if DateRange.subclass: + return DateRange.subclass(*args_, **kwargs_) + else: + return DateRange(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Begins(self): return self.Begins + def set_Begins(self, Begins): self.Begins = Begins + def get_Ends(self): return self.Ends + def set_Ends(self, Ends): self.Ends = Ends + def export(self, outfile, level, namespace_='ns:', name_='DateRange', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='DateRange') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='DateRange'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='DateRange', fromsubclass_=False): + if self.Begins is not None: + showIndent(outfile, level) + outfile.write('<%sBegins>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Begins).encode(ExternalEncoding), input_name='Begins'), namespace_)) + if self.Ends is not None: + showIndent(outfile, level) + outfile.write('<%sEnds>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Ends).encode(ExternalEncoding), input_name='Ends'), namespace_)) + def hasContent_(self): + if ( + self.Begins is not None or + self.Ends is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='DateRange'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Begins is not None: + showIndent(outfile, level) + outfile.write('Begins=%s,\n' % quote_python(self.Begins).encode(ExternalEncoding)) + if self.Ends is not None: + showIndent(outfile, level) + outfile.write('Ends=%s,\n' % quote_python(self.Ends).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Begins': + Begins_ = child_.text + Begins_ = self.gds_validate_string(Begins_, node, 'Begins') + self.Begins = Begins_ + elif nodeName_ == 'Ends': + Ends_ = child_.text + Ends_ = self.gds_validate_string(Ends_, node, 'Ends') + self.Ends = Ends_ +# end class DateRange + + +class DeleteShipmentRequest(GeneratedsSuper): + """Descriptive data sent to FedEx by a customer in order to delete a + package.""" + subclass = None + superclass = None + def __init__(self, WebAuthenticationDetail=None, ClientDetail=None, TransactionDetail=None, Version=None, ShipTimestamp=None, TrackingId=None, DeletionControl=None): + self.WebAuthenticationDetail = WebAuthenticationDetail + self.ClientDetail = ClientDetail + self.TransactionDetail = TransactionDetail + self.Version = Version + self.ShipTimestamp = ShipTimestamp + self.TrackingId = TrackingId + self.DeletionControl = DeletionControl + def factory(*args_, **kwargs_): + if DeleteShipmentRequest.subclass: + return DeleteShipmentRequest.subclass(*args_, **kwargs_) + else: + return DeleteShipmentRequest(*args_, **kwargs_) + factory = staticmethod(factory) + def get_WebAuthenticationDetail(self): return self.WebAuthenticationDetail + def set_WebAuthenticationDetail(self, WebAuthenticationDetail): self.WebAuthenticationDetail = WebAuthenticationDetail + def get_ClientDetail(self): return self.ClientDetail + def set_ClientDetail(self, ClientDetail): self.ClientDetail = ClientDetail + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_ShipTimestamp(self): return self.ShipTimestamp + def set_ShipTimestamp(self, ShipTimestamp): self.ShipTimestamp = ShipTimestamp + def get_TrackingId(self): return self.TrackingId + def set_TrackingId(self, TrackingId): self.TrackingId = TrackingId + def get_DeletionControl(self): return self.DeletionControl + def set_DeletionControl(self, DeletionControl): self.DeletionControl = DeletionControl + def validate_DeletionControlType(self, value): + # Validate type DeletionControlType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='DeleteShipmentRequest', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='DeleteShipmentRequest') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='DeleteShipmentRequest'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='DeleteShipmentRequest', fromsubclass_=False): + if self.WebAuthenticationDetail: + self.WebAuthenticationDetail.export(outfile, level, namespace_, name_='WebAuthenticationDetail', ) + if self.ClientDetail: + self.ClientDetail.export(outfile, level, namespace_, name_='ClientDetail', ) + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.ShipTimestamp is not None: + showIndent(outfile, level) + outfile.write('<%sShipTimestamp>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ShipTimestamp).encode(ExternalEncoding), input_name='ShipTimestamp'), namespace_)) + if self.TrackingId: + self.TrackingId.export(outfile, level, namespace_, name_='TrackingId') + if self.DeletionControl is not None: + showIndent(outfile, level) + outfile.write('<%sDeletionControl>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DeletionControl).encode(ExternalEncoding), input_name='DeletionControl'), namespace_)) + def hasContent_(self): + if ( + self.WebAuthenticationDetail is not None or + self.ClientDetail is not None or + self.TransactionDetail is not None or + self.Version is not None or + self.ShipTimestamp is not None or + self.TrackingId is not None or + self.DeletionControl is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='DeleteShipmentRequest'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.WebAuthenticationDetail is not None: + showIndent(outfile, level) + outfile.write('WebAuthenticationDetail=model_.WebAuthenticationDetail(\n') + self.WebAuthenticationDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ClientDetail is not None: + showIndent(outfile, level) + outfile.write('ClientDetail=model_.ClientDetail(\n') + self.ClientDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.ShipTimestamp is not None: + showIndent(outfile, level) + outfile.write('ShipTimestamp=%s,\n' % quote_python(self.ShipTimestamp).encode(ExternalEncoding)) + if self.TrackingId is not None: + showIndent(outfile, level) + outfile.write('TrackingId=model_.TrackingId(\n') + self.TrackingId.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.DeletionControl is not None: + showIndent(outfile, level) + outfile.write('DeletionControl=%s,\n' % quote_python(self.DeletionControl).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'WebAuthenticationDetail': + obj_ = WebAuthenticationDetail.factory() + obj_.build(child_) + self.set_WebAuthenticationDetail(obj_) + elif nodeName_ == 'ClientDetail': + obj_ = ClientDetail.factory() + obj_.build(child_) + self.set_ClientDetail(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'ShipTimestamp': + ShipTimestamp_ = child_.text + ShipTimestamp_ = self.gds_validate_string(ShipTimestamp_, node, 'ShipTimestamp') + self.ShipTimestamp = ShipTimestamp_ + elif nodeName_ == 'TrackingId': + obj_ = TrackingId.factory() + obj_.build(child_) + self.set_TrackingId(obj_) + elif nodeName_ == 'DeletionControl': + DeletionControl_ = child_.text + DeletionControl_ = self.gds_validate_string(DeletionControl_, node, 'DeletionControl') + self.DeletionControl = DeletionControl_ + self.validate_DeletionControlType(self.DeletionControl) # validate type DeletionControlType +# end class DeleteShipmentRequest + + +class DeleteTagRequest(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, WebAuthenticationDetail=None, ClientDetail=None, TransactionDetail=None, Version=None, DispatchLocationId=None, DispatchDate=None, Payment=None, ConfirmationNumber=None): + self.WebAuthenticationDetail = WebAuthenticationDetail + self.ClientDetail = ClientDetail + self.TransactionDetail = TransactionDetail + self.Version = Version + self.DispatchLocationId = DispatchLocationId + self.DispatchDate = DispatchDate + self.Payment = Payment + self.ConfirmationNumber = ConfirmationNumber + def factory(*args_, **kwargs_): + if DeleteTagRequest.subclass: + return DeleteTagRequest.subclass(*args_, **kwargs_) + else: + return DeleteTagRequest(*args_, **kwargs_) + factory = staticmethod(factory) + def get_WebAuthenticationDetail(self): return self.WebAuthenticationDetail + def set_WebAuthenticationDetail(self, WebAuthenticationDetail): self.WebAuthenticationDetail = WebAuthenticationDetail + def get_ClientDetail(self): return self.ClientDetail + def set_ClientDetail(self, ClientDetail): self.ClientDetail = ClientDetail + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_DispatchLocationId(self): return self.DispatchLocationId + def set_DispatchLocationId(self, DispatchLocationId): self.DispatchLocationId = DispatchLocationId + def get_DispatchDate(self): return self.DispatchDate + def set_DispatchDate(self, DispatchDate): self.DispatchDate = DispatchDate + def get_Payment(self): return self.Payment + def set_Payment(self, Payment): self.Payment = Payment + def get_ConfirmationNumber(self): return self.ConfirmationNumber + def set_ConfirmationNumber(self, ConfirmationNumber): self.ConfirmationNumber = ConfirmationNumber + def export(self, outfile, level, namespace_='ns:', name_='DeleteTagRequest', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='DeleteTagRequest') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='DeleteTagRequest'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='DeleteTagRequest', fromsubclass_=False): + if self.WebAuthenticationDetail: + self.WebAuthenticationDetail.export(outfile, level, namespace_, name_='WebAuthenticationDetail', ) + if self.ClientDetail: + self.ClientDetail.export(outfile, level, namespace_, name_='ClientDetail', ) + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.DispatchLocationId is not None: + showIndent(outfile, level) + outfile.write('<%sDispatchLocationId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DispatchLocationId).encode(ExternalEncoding), input_name='DispatchLocationId'), namespace_)) + if self.DispatchDate is not None: + showIndent(outfile, level) + outfile.write('<%sDispatchDate>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DispatchDate).encode(ExternalEncoding), input_name='DispatchDate'), namespace_)) + if self.Payment: + self.Payment.export(outfile, level, namespace_, name_='Payment', ) + if self.ConfirmationNumber is not None: + showIndent(outfile, level) + outfile.write('<%sConfirmationNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ConfirmationNumber).encode(ExternalEncoding), input_name='ConfirmationNumber'), namespace_)) + def hasContent_(self): + if ( + self.WebAuthenticationDetail is not None or + self.ClientDetail is not None or + self.TransactionDetail is not None or + self.Version is not None or + self.DispatchLocationId is not None or + self.DispatchDate is not None or + self.Payment is not None or + self.ConfirmationNumber is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='DeleteTagRequest'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.WebAuthenticationDetail is not None: + showIndent(outfile, level) + outfile.write('WebAuthenticationDetail=model_.WebAuthenticationDetail(\n') + self.WebAuthenticationDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ClientDetail is not None: + showIndent(outfile, level) + outfile.write('ClientDetail=model_.ClientDetail(\n') + self.ClientDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.DispatchLocationId is not None: + showIndent(outfile, level) + outfile.write('DispatchLocationId=%s,\n' % quote_python(self.DispatchLocationId).encode(ExternalEncoding)) + if self.DispatchDate is not None: + showIndent(outfile, level) + outfile.write('DispatchDate=%s,\n' % quote_python(self.DispatchDate).encode(ExternalEncoding)) + if self.Payment is not None: + showIndent(outfile, level) + outfile.write('Payment=model_.Payment(\n') + self.Payment.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ConfirmationNumber is not None: + showIndent(outfile, level) + outfile.write('ConfirmationNumber=%s,\n' % quote_python(self.ConfirmationNumber).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'WebAuthenticationDetail': + obj_ = WebAuthenticationDetail.factory() + obj_.build(child_) + self.set_WebAuthenticationDetail(obj_) + elif nodeName_ == 'ClientDetail': + obj_ = ClientDetail.factory() + obj_.build(child_) + self.set_ClientDetail(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'DispatchLocationId': + DispatchLocationId_ = child_.text + DispatchLocationId_ = self.gds_validate_string(DispatchLocationId_, node, 'DispatchLocationId') + self.DispatchLocationId = DispatchLocationId_ + elif nodeName_ == 'DispatchDate': + DispatchDate_ = child_.text + DispatchDate_ = self.gds_validate_string(DispatchDate_, node, 'DispatchDate') + self.DispatchDate = DispatchDate_ + elif nodeName_ == 'Payment': + obj_ = Payment.factory() + obj_.build(child_) + self.set_Payment(obj_) + elif nodeName_ == 'ConfirmationNumber': + ConfirmationNumber_ = child_.text + ConfirmationNumber_ = self.gds_validate_string(ConfirmationNumber_, node, 'ConfirmationNumber') + self.ConfirmationNumber = ConfirmationNumber_ +# end class DeleteTagRequest + + +class DestinationControlDetail(GeneratedsSuper): + """Data required to complete the Destionation Control Statement for US + exports.""" + subclass = None + superclass = None + def __init__(self, StatementTypes=None, DestinationCountries=None, EndUser=None): + if StatementTypes is None: + self.StatementTypes = [] + else: + self.StatementTypes = StatementTypes + self.DestinationCountries = DestinationCountries + self.EndUser = EndUser + def factory(*args_, **kwargs_): + if DestinationControlDetail.subclass: + return DestinationControlDetail.subclass(*args_, **kwargs_) + else: + return DestinationControlDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_StatementTypes(self): return self.StatementTypes + def set_StatementTypes(self, StatementTypes): self.StatementTypes = StatementTypes + def add_StatementTypes(self, value): self.StatementTypes.append(value) + def insert_StatementTypes(self, index, value): self.StatementTypes[index] = value + def validate_DestinationControlStatementType(self, value): + # Validate type DestinationControlStatementType, a restriction on xs:string. + pass + def get_DestinationCountries(self): return self.DestinationCountries + def set_DestinationCountries(self, DestinationCountries): self.DestinationCountries = DestinationCountries + def get_EndUser(self): return self.EndUser + def set_EndUser(self, EndUser): self.EndUser = EndUser + def export(self, outfile, level, namespace_='ns:', name_='DestinationControlDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='DestinationControlDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='DestinationControlDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='DestinationControlDetail', fromsubclass_=False): + for StatementTypes_ in self.StatementTypes: + showIndent(outfile, level) + outfile.write('<%sStatementTypes>%s\n' % (namespace_, self.gds_format_string(quote_xml(StatementTypes_).encode(ExternalEncoding), input_name='StatementTypes'), namespace_)) + if self.DestinationCountries is not None: + showIndent(outfile, level) + outfile.write('<%sDestinationCountries>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DestinationCountries).encode(ExternalEncoding), input_name='DestinationCountries'), namespace_)) + if self.EndUser is not None: + showIndent(outfile, level) + outfile.write('<%sEndUser>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.EndUser).encode(ExternalEncoding), input_name='EndUser'), namespace_)) + def hasContent_(self): + if ( + self.StatementTypes or + self.DestinationCountries is not None or + self.EndUser is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='DestinationControlDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('StatementTypes=[\n') + level += 1 + for StatementTypes_ in self.StatementTypes: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(StatementTypes_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.DestinationCountries is not None: + showIndent(outfile, level) + outfile.write('DestinationCountries=%s,\n' % quote_python(self.DestinationCountries).encode(ExternalEncoding)) + if self.EndUser is not None: + showIndent(outfile, level) + outfile.write('EndUser=%s,\n' % quote_python(self.EndUser).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'StatementTypes': + StatementTypes_ = child_.text + StatementTypes_ = self.gds_validate_string(StatementTypes_, node, 'StatementTypes') + self.StatementTypes.append(StatementTypes_) + self.validate_DestinationControlStatementType(self.StatementTypes) # validate type DestinationControlStatementType + elif nodeName_ == 'DestinationCountries': + DestinationCountries_ = child_.text + DestinationCountries_ = self.gds_validate_string(DestinationCountries_, node, 'DestinationCountries') + self.DestinationCountries = DestinationCountries_ + elif nodeName_ == 'EndUser': + EndUser_ = child_.text + EndUser_ = self.gds_validate_string(EndUser_, node, 'EndUser') + self.EndUser = EndUser_ +# end class DestinationControlDetail + + +class Dimensions(GeneratedsSuper): + """The dimensions of this package and the unit type used for the + measurements.""" + subclass = None + superclass = None + def __init__(self, Length=None, Width=None, Height=None, Units=None): + self.Length = Length + self.Width = Width + self.Height = Height + self.Units = Units + def factory(*args_, **kwargs_): + if Dimensions.subclass: + return Dimensions.subclass(*args_, **kwargs_) + else: + return Dimensions(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Length(self): return self.Length + def set_Length(self, Length): self.Length = Length + def get_Width(self): return self.Width + def set_Width(self, Width): self.Width = Width + def get_Height(self): return self.Height + def set_Height(self, Height): self.Height = Height + def get_Units(self): return self.Units + def set_Units(self, Units): self.Units = Units + def validate_LinearUnits(self, value): + # Validate type LinearUnits, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='Dimensions', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Dimensions') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Dimensions'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Dimensions', fromsubclass_=False): + if self.Length is not None: + showIndent(outfile, level) + outfile.write('<%sLength>%s\n' % (namespace_, self.gds_format_integer(self.Length, input_name='Length'), namespace_)) + if self.Width is not None: + showIndent(outfile, level) + outfile.write('<%sWidth>%s\n' % (namespace_, self.gds_format_integer(self.Width, input_name='Width'), namespace_)) + if self.Height is not None: + showIndent(outfile, level) + outfile.write('<%sHeight>%s\n' % (namespace_, self.gds_format_integer(self.Height, input_name='Height'), namespace_)) + if self.Units is not None: + showIndent(outfile, level) + outfile.write('<%sUnits>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Units).encode(ExternalEncoding), input_name='Units'), namespace_)) + def hasContent_(self): + if ( + self.Length is not None or + self.Width is not None or + self.Height is not None or + self.Units is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Dimensions'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Length is not None: + showIndent(outfile, level) + outfile.write('Length=%d,\n' % self.Length) + if self.Width is not None: + showIndent(outfile, level) + outfile.write('Width=%d,\n' % self.Width) + if self.Height is not None: + showIndent(outfile, level) + outfile.write('Height=%d,\n' % self.Height) + if self.Units is not None: + showIndent(outfile, level) + outfile.write('Units=%s,\n' % quote_python(self.Units).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Length': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'Length') + self.Length = ival_ + elif nodeName_ == 'Width': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'Width') + self.Width = ival_ + elif nodeName_ == 'Height': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'Height') + self.Height = ival_ + elif nodeName_ == 'Units': + Units_ = child_.text + Units_ = self.gds_validate_string(Units_, node, 'Units') + self.Units = Units_ + self.validate_LinearUnits(self.Units) # validate type LinearUnits +# end class Dimensions + + +class DocTabContent(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, DocTabContentType=None, Zone001=None, Barcoded=None): + self.DocTabContentType = DocTabContentType + self.Zone001 = Zone001 + self.Barcoded = Barcoded + def factory(*args_, **kwargs_): + if DocTabContent.subclass: + return DocTabContent.subclass(*args_, **kwargs_) + else: + return DocTabContent(*args_, **kwargs_) + factory = staticmethod(factory) + def get_DocTabContentType(self): return self.DocTabContentType + def set_DocTabContentType(self, DocTabContentType): self.DocTabContentType = DocTabContentType + def validate_DocTabContentType(self, value): + # Validate type DocTabContentType, a restriction on xs:string. + pass + def get_Zone001(self): return self.Zone001 + def set_Zone001(self, Zone001): self.Zone001 = Zone001 + def get_Barcoded(self): return self.Barcoded + def set_Barcoded(self, Barcoded): self.Barcoded = Barcoded + def export(self, outfile, level, namespace_='ns:', name_='DocTabContent', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='DocTabContent') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='DocTabContent'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='DocTabContent', fromsubclass_=False): + if self.DocTabContentType is not None: + showIndent(outfile, level) + outfile.write('<%sDocTabContentType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DocTabContentType).encode(ExternalEncoding), input_name='DocTabContentType'), namespace_)) + if self.Zone001: + self.Zone001.export(outfile, level, namespace_, name_='Zone001') + if self.Barcoded: + self.Barcoded.export(outfile, level, namespace_, name_='Barcoded') + def hasContent_(self): + if ( + self.DocTabContentType is not None or + self.Zone001 is not None or + self.Barcoded is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='DocTabContent'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.DocTabContentType is not None: + showIndent(outfile, level) + outfile.write('DocTabContentType=%s,\n' % quote_python(self.DocTabContentType).encode(ExternalEncoding)) + if self.Zone001 is not None: + showIndent(outfile, level) + outfile.write('Zone001=model_.DocTabContentZone001(\n') + self.Zone001.exportLiteral(outfile, level, name_='Zone001') + showIndent(outfile, level) + outfile.write('),\n') + if self.Barcoded is not None: + showIndent(outfile, level) + outfile.write('Barcoded=model_.DocTabContentBarcoded(\n') + self.Barcoded.exportLiteral(outfile, level, name_='Barcoded') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'DocTabContentType': + DocTabContentType_ = child_.text + DocTabContentType_ = self.gds_validate_string(DocTabContentType_, node, 'DocTabContentType') + self.DocTabContentType = DocTabContentType_ + self.validate_DocTabContentType(self.DocTabContentType) # validate type DocTabContentType + elif nodeName_ == 'Zone001': + obj_ = DocTabContentZone001.factory() + obj_.build(child_) + self.set_Zone001(obj_) + elif nodeName_ == 'Barcoded': + obj_ = DocTabContentBarcoded.factory() + obj_.build(child_) + self.set_Barcoded(obj_) +# end class DocTabContent + + +class DocTabContentBarcoded(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Symbology=None, Specification=None): + self.Symbology = Symbology + self.Specification = Specification + def factory(*args_, **kwargs_): + if DocTabContentBarcoded.subclass: + return DocTabContentBarcoded.subclass(*args_, **kwargs_) + else: + return DocTabContentBarcoded(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Symbology(self): return self.Symbology + def set_Symbology(self, Symbology): self.Symbology = Symbology + def validate_BarcodeSymbologyType(self, value): + # Validate type BarcodeSymbologyType, a restriction on xs:string. + pass + def get_Specification(self): return self.Specification + def set_Specification(self, Specification): self.Specification = Specification + def export(self, outfile, level, namespace_='ns:', name_='DocTabContentBarcoded', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='DocTabContentBarcoded') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='DocTabContentBarcoded'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='DocTabContentBarcoded', fromsubclass_=False): + if self.Symbology is not None: + showIndent(outfile, level) + outfile.write('<%sSymbology>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Symbology).encode(ExternalEncoding), input_name='Symbology'), namespace_)) + if self.Specification: + self.Specification.export(outfile, level, namespace_, name_='Specification', ) + def hasContent_(self): + if ( + self.Symbology is not None or + self.Specification is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='DocTabContentBarcoded'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Symbology is not None: + showIndent(outfile, level) + outfile.write('Symbology=%s,\n' % quote_python(self.Symbology).encode(ExternalEncoding)) + if self.Specification is not None: + showIndent(outfile, level) + outfile.write('Specification=model_.DocTabZoneSpecification(\n') + self.Specification.exportLiteral(outfile, level, name_='Specification') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Symbology': + Symbology_ = child_.text + Symbology_ = self.gds_validate_string(Symbology_, node, 'Symbology') + self.Symbology = Symbology_ + self.validate_BarcodeSymbologyType(self.Symbology) # validate type BarcodeSymbologyType + elif nodeName_ == 'Specification': + obj_ = DocTabZoneSpecification.factory() + obj_.build(child_) + self.set_Specification(obj_) +# end class DocTabContentBarcoded + + +class DocTabContentZone001(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, DocTabZoneSpecifications=None): + if DocTabZoneSpecifications is None: + self.DocTabZoneSpecifications = [] + else: + self.DocTabZoneSpecifications = DocTabZoneSpecifications + def factory(*args_, **kwargs_): + if DocTabContentZone001.subclass: + return DocTabContentZone001.subclass(*args_, **kwargs_) + else: + return DocTabContentZone001(*args_, **kwargs_) + factory = staticmethod(factory) + def get_DocTabZoneSpecifications(self): return self.DocTabZoneSpecifications + def set_DocTabZoneSpecifications(self, DocTabZoneSpecifications): self.DocTabZoneSpecifications = DocTabZoneSpecifications + def add_DocTabZoneSpecifications(self, value): self.DocTabZoneSpecifications.append(value) + def insert_DocTabZoneSpecifications(self, index, value): self.DocTabZoneSpecifications[index] = value + def export(self, outfile, level, namespace_='ns:', name_='DocTabContentZone001', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='DocTabContentZone001') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='DocTabContentZone001'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='DocTabContentZone001', fromsubclass_=False): + for DocTabZoneSpecifications_ in self.DocTabZoneSpecifications: + DocTabZoneSpecifications_.export(outfile, level, namespace_, name_='DocTabZoneSpecifications') + def hasContent_(self): + if ( + self.DocTabZoneSpecifications + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='DocTabContentZone001'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('DocTabZoneSpecifications=[\n') + level += 1 + for DocTabZoneSpecifications_ in self.DocTabZoneSpecifications: + showIndent(outfile, level) + outfile.write('model_.DocTabZoneSpecification(\n') + DocTabZoneSpecifications_.exportLiteral(outfile, level, name_='DocTabZoneSpecification') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'DocTabZoneSpecifications': + obj_ = DocTabZoneSpecification.factory() + obj_.build(child_) + self.DocTabZoneSpecifications.append(obj_) +# end class DocTabContentZone001 + + +class DocTabZoneSpecification(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, ZoneNumber=None, Header=None, DataField=None, LiteralValue=None, Justification=None): + self.ZoneNumber = ZoneNumber + self.Header = Header + self.DataField = DataField + self.LiteralValue = LiteralValue + self.Justification = Justification + def factory(*args_, **kwargs_): + if DocTabZoneSpecification.subclass: + return DocTabZoneSpecification.subclass(*args_, **kwargs_) + else: + return DocTabZoneSpecification(*args_, **kwargs_) + factory = staticmethod(factory) + def get_ZoneNumber(self): return self.ZoneNumber + def set_ZoneNumber(self, ZoneNumber): self.ZoneNumber = ZoneNumber + def get_Header(self): return self.Header + def set_Header(self, Header): self.Header = Header + def get_DataField(self): return self.DataField + def set_DataField(self, DataField): self.DataField = DataField + def get_LiteralValue(self): return self.LiteralValue + def set_LiteralValue(self, LiteralValue): self.LiteralValue = LiteralValue + def get_Justification(self): return self.Justification + def set_Justification(self, Justification): self.Justification = Justification + def validate_DocTabZoneJustificationType(self, value): + # Validate type DocTabZoneJustificationType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='DocTabZoneSpecification', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='DocTabZoneSpecification') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='DocTabZoneSpecification'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='DocTabZoneSpecification', fromsubclass_=False): + if self.ZoneNumber is not None: + showIndent(outfile, level) + outfile.write('<%sZoneNumber>%s\n' % (namespace_, self.gds_format_integer(self.ZoneNumber, input_name='ZoneNumber'), namespace_)) + if self.Header is not None: + showIndent(outfile, level) + outfile.write('<%sHeader>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Header).encode(ExternalEncoding), input_name='Header'), namespace_)) + if self.DataField is not None: + showIndent(outfile, level) + outfile.write('<%sDataField>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DataField).encode(ExternalEncoding), input_name='DataField'), namespace_)) + if self.LiteralValue is not None: + showIndent(outfile, level) + outfile.write('<%sLiteralValue>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LiteralValue).encode(ExternalEncoding), input_name='LiteralValue'), namespace_)) + if self.Justification is not None: + showIndent(outfile, level) + outfile.write('<%sJustification>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Justification).encode(ExternalEncoding), input_name='Justification'), namespace_)) + def hasContent_(self): + if ( + self.ZoneNumber is not None or + self.Header is not None or + self.DataField is not None or + self.LiteralValue is not None or + self.Justification is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='DocTabZoneSpecification'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.ZoneNumber is not None: + showIndent(outfile, level) + outfile.write('ZoneNumber=%d,\n' % self.ZoneNumber) + if self.Header is not None: + showIndent(outfile, level) + outfile.write('Header=%s,\n' % quote_python(self.Header).encode(ExternalEncoding)) + if self.DataField is not None: + showIndent(outfile, level) + outfile.write('DataField=%s,\n' % quote_python(self.DataField).encode(ExternalEncoding)) + if self.LiteralValue is not None: + showIndent(outfile, level) + outfile.write('LiteralValue=%s,\n' % quote_python(self.LiteralValue).encode(ExternalEncoding)) + if self.Justification is not None: + showIndent(outfile, level) + outfile.write('Justification=%s,\n' % quote_python(self.Justification).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'ZoneNumber': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ <= 0: + raise_parse_error(child_, 'requires positiveInteger') + ival_ = self.gds_validate_integer(ival_, node, 'ZoneNumber') + self.ZoneNumber = ival_ + elif nodeName_ == 'Header': + Header_ = child_.text + Header_ = self.gds_validate_string(Header_, node, 'Header') + self.Header = Header_ + elif nodeName_ == 'DataField': + DataField_ = child_.text + DataField_ = self.gds_validate_string(DataField_, node, 'DataField') + self.DataField = DataField_ + elif nodeName_ == 'LiteralValue': + LiteralValue_ = child_.text + LiteralValue_ = self.gds_validate_string(LiteralValue_, node, 'LiteralValue') + self.LiteralValue = LiteralValue_ + elif nodeName_ == 'Justification': + Justification_ = child_.text + Justification_ = self.gds_validate_string(Justification_, node, 'Justification') + self.Justification = Justification_ + self.validate_DocTabZoneJustificationType(self.Justification) # validate type DocTabZoneJustificationType +# end class DocTabZoneSpecification + + +class EMailLabelDetail(GeneratedsSuper): + """Describes specific information about the email label shipment.""" + subclass = None + superclass = None + def __init__(self, NotificationEMailAddress=None, NotificationMessage=None): + self.NotificationEMailAddress = NotificationEMailAddress + self.NotificationMessage = NotificationMessage + def factory(*args_, **kwargs_): + if EMailLabelDetail.subclass: + return EMailLabelDetail.subclass(*args_, **kwargs_) + else: + return EMailLabelDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_NotificationEMailAddress(self): return self.NotificationEMailAddress + def set_NotificationEMailAddress(self, NotificationEMailAddress): self.NotificationEMailAddress = NotificationEMailAddress + def get_NotificationMessage(self): return self.NotificationMessage + def set_NotificationMessage(self, NotificationMessage): self.NotificationMessage = NotificationMessage + def export(self, outfile, level, namespace_='ns:', name_='EMailLabelDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='EMailLabelDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='EMailLabelDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='EMailLabelDetail', fromsubclass_=False): + if self.NotificationEMailAddress is not None: + showIndent(outfile, level) + outfile.write('<%sNotificationEMailAddress>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.NotificationEMailAddress).encode(ExternalEncoding), input_name='NotificationEMailAddress'), namespace_)) + if self.NotificationMessage is not None: + showIndent(outfile, level) + outfile.write('<%sNotificationMessage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.NotificationMessage).encode(ExternalEncoding), input_name='NotificationMessage'), namespace_)) + def hasContent_(self): + if ( + self.NotificationEMailAddress is not None or + self.NotificationMessage is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='EMailLabelDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.NotificationEMailAddress is not None: + showIndent(outfile, level) + outfile.write('NotificationEMailAddress=%s,\n' % quote_python(self.NotificationEMailAddress).encode(ExternalEncoding)) + if self.NotificationMessage is not None: + showIndent(outfile, level) + outfile.write('NotificationMessage=%s,\n' % quote_python(self.NotificationMessage).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'NotificationEMailAddress': + NotificationEMailAddress_ = child_.text + NotificationEMailAddress_ = self.gds_validate_string(NotificationEMailAddress_, node, 'NotificationEMailAddress') + self.NotificationEMailAddress = NotificationEMailAddress_ + elif nodeName_ == 'NotificationMessage': + NotificationMessage_ = child_.text + NotificationMessage_ = self.gds_validate_string(NotificationMessage_, node, 'NotificationMessage') + self.NotificationMessage = NotificationMessage_ +# end class EMailLabelDetail + + +class EMailNotificationDetail(GeneratedsSuper): + """Information describing email notifications that will be sent in + relation to events that occur during package movement""" + subclass = None + superclass = None + def __init__(self, AggregationType=None, PersonalMessage=None, Recipients=None): + self.AggregationType = AggregationType + self.PersonalMessage = PersonalMessage + if Recipients is None: + self.Recipients = [] + else: + self.Recipients = Recipients + def factory(*args_, **kwargs_): + if EMailNotificationDetail.subclass: + return EMailNotificationDetail.subclass(*args_, **kwargs_) + else: + return EMailNotificationDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_AggregationType(self): return self.AggregationType + def set_AggregationType(self, AggregationType): self.AggregationType = AggregationType + def validate_EMailNotificationAggregationType(self, value): + # Validate type EMailNotificationAggregationType, a restriction on xs:string. + pass + def get_PersonalMessage(self): return self.PersonalMessage + def set_PersonalMessage(self, PersonalMessage): self.PersonalMessage = PersonalMessage + def get_Recipients(self): return self.Recipients + def set_Recipients(self, Recipients): self.Recipients = Recipients + def add_Recipients(self, value): self.Recipients.append(value) + def insert_Recipients(self, index, value): self.Recipients[index] = value + def export(self, outfile, level, namespace_='ns:', name_='EMailNotificationDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='EMailNotificationDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='EMailNotificationDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='EMailNotificationDetail', fromsubclass_=False): + if self.AggregationType is not None: + showIndent(outfile, level) + outfile.write('<%sAggregationType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AggregationType).encode(ExternalEncoding), input_name='AggregationType'), namespace_)) + if self.PersonalMessage is not None: + showIndent(outfile, level) + outfile.write('<%sPersonalMessage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PersonalMessage).encode(ExternalEncoding), input_name='PersonalMessage'), namespace_)) + for Recipients_ in self.Recipients: + Recipients_.export(outfile, level, namespace_, name_='Recipients') + def hasContent_(self): + if ( + self.AggregationType is not None or + self.PersonalMessage is not None or + self.Recipients + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='EMailNotificationDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.AggregationType is not None: + showIndent(outfile, level) + outfile.write('AggregationType=%s,\n' % quote_python(self.AggregationType).encode(ExternalEncoding)) + if self.PersonalMessage is not None: + showIndent(outfile, level) + outfile.write('PersonalMessage=%s,\n' % quote_python(self.PersonalMessage).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Recipients=[\n') + level += 1 + for Recipients_ in self.Recipients: + showIndent(outfile, level) + outfile.write('model_.EMailNotificationRecipient(\n') + Recipients_.exportLiteral(outfile, level, name_='EMailNotificationRecipient') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'AggregationType': + AggregationType_ = child_.text + AggregationType_ = self.gds_validate_string(AggregationType_, node, 'AggregationType') + self.AggregationType = AggregationType_ + self.validate_EMailNotificationAggregationType(self.AggregationType) # validate type EMailNotificationAggregationType + elif nodeName_ == 'PersonalMessage': + PersonalMessage_ = child_.text + PersonalMessage_ = self.gds_validate_string(PersonalMessage_, node, 'PersonalMessage') + self.PersonalMessage = PersonalMessage_ + elif nodeName_ == 'Recipients': + obj_ = EMailNotificationRecipient.factory() + obj_.build(child_) + self.Recipients.append(obj_) +# end class EMailNotificationDetail + + +class EMailNotificationRecipient(GeneratedsSuper): + """The descriptive data for a FedEx email notification recipient.""" + subclass = None + superclass = None + def __init__(self, EMailNotificationRecipientType=None, EMailAddress=None, NotificationEventsRequested=None, Format=None, Localization=None): + self.EMailNotificationRecipientType = EMailNotificationRecipientType + self.EMailAddress = EMailAddress + if NotificationEventsRequested is None: + self.NotificationEventsRequested = [] + else: + self.NotificationEventsRequested = NotificationEventsRequested + self.Format = Format + self.Localization = Localization + def factory(*args_, **kwargs_): + if EMailNotificationRecipient.subclass: + return EMailNotificationRecipient.subclass(*args_, **kwargs_) + else: + return EMailNotificationRecipient(*args_, **kwargs_) + factory = staticmethod(factory) + def get_EMailNotificationRecipientType(self): return self.EMailNotificationRecipientType + def set_EMailNotificationRecipientType(self, EMailNotificationRecipientType): self.EMailNotificationRecipientType = EMailNotificationRecipientType + def validate_EMailNotificationRecipientType(self, value): + # Validate type EMailNotificationRecipientType, a restriction on xs:string. + pass + def get_EMailAddress(self): return self.EMailAddress + def set_EMailAddress(self, EMailAddress): self.EMailAddress = EMailAddress + def get_NotificationEventsRequested(self): return self.NotificationEventsRequested + def set_NotificationEventsRequested(self, NotificationEventsRequested): self.NotificationEventsRequested = NotificationEventsRequested + def add_NotificationEventsRequested(self, value): self.NotificationEventsRequested.append(value) + def insert_NotificationEventsRequested(self, index, value): self.NotificationEventsRequested[index] = value + def validate_EMailNotificationEventType(self, value): + # Validate type EMailNotificationEventType, a restriction on xs:string. + pass + def get_Format(self): return self.Format + def set_Format(self, Format): self.Format = Format + def validate_EMailNotificationFormatType(self, value): + # Validate type EMailNotificationFormatType, a restriction on xs:string. + pass + def get_Localization(self): return self.Localization + def set_Localization(self, Localization): self.Localization = Localization + def export(self, outfile, level, namespace_='ns:', name_='EMailNotificationRecipient', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='EMailNotificationRecipient') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='EMailNotificationRecipient'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='EMailNotificationRecipient', fromsubclass_=False): + if self.EMailNotificationRecipientType is not None: + showIndent(outfile, level) + outfile.write('<%sEMailNotificationRecipientType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.EMailNotificationRecipientType).encode(ExternalEncoding), input_name='EMailNotificationRecipientType'), namespace_)) + if self.EMailAddress is not None: + showIndent(outfile, level) + outfile.write('<%sEMailAddress>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.EMailAddress).encode(ExternalEncoding), input_name='EMailAddress'), namespace_)) + for NotificationEventsRequested_ in self.NotificationEventsRequested: + showIndent(outfile, level) + outfile.write('<%sNotificationEventsRequested>%s\n' % (namespace_, self.gds_format_string(quote_xml(NotificationEventsRequested_).encode(ExternalEncoding), input_name='NotificationEventsRequested'), namespace_)) + if self.Format is not None: + showIndent(outfile, level) + outfile.write('<%sFormat>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Format).encode(ExternalEncoding), input_name='Format'), namespace_)) + if self.Localization: + self.Localization.export(outfile, level, namespace_, name_='Localization', ) + def hasContent_(self): + if ( + self.EMailNotificationRecipientType is not None or + self.EMailAddress is not None or + self.NotificationEventsRequested or + self.Format is not None or + self.Localization is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='EMailNotificationRecipient'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.EMailNotificationRecipientType is not None: + showIndent(outfile, level) + outfile.write('EMailNotificationRecipientType=%s,\n' % quote_python(self.EMailNotificationRecipientType).encode(ExternalEncoding)) + if self.EMailAddress is not None: + showIndent(outfile, level) + outfile.write('EMailAddress=%s,\n' % quote_python(self.EMailAddress).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('NotificationEventsRequested=[\n') + level += 1 + for NotificationEventsRequested_ in self.NotificationEventsRequested: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(NotificationEventsRequested_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.Format is not None: + showIndent(outfile, level) + outfile.write('Format=%s,\n' % quote_python(self.Format).encode(ExternalEncoding)) + if self.Localization is not None: + showIndent(outfile, level) + outfile.write('Localization=model_.Localization(\n') + self.Localization.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'EMailNotificationRecipientType': + EMailNotificationRecipientType_ = child_.text + EMailNotificationRecipientType_ = self.gds_validate_string(EMailNotificationRecipientType_, node, 'EMailNotificationRecipientType') + self.EMailNotificationRecipientType = EMailNotificationRecipientType_ + self.validate_EMailNotificationRecipientType(self.EMailNotificationRecipientType) # validate type EMailNotificationRecipientType + elif nodeName_ == 'EMailAddress': + EMailAddress_ = child_.text + EMailAddress_ = self.gds_validate_string(EMailAddress_, node, 'EMailAddress') + self.EMailAddress = EMailAddress_ + elif nodeName_ == 'NotificationEventsRequested': + NotificationEventsRequested_ = child_.text + NotificationEventsRequested_ = self.gds_validate_string(NotificationEventsRequested_, node, 'NotificationEventsRequested') + self.NotificationEventsRequested.append(NotificationEventsRequested_) + self.validate_EMailNotificationEventType(self.NotificationEventsRequested) # validate type EMailNotificationEventType + elif nodeName_ == 'Format': + Format_ = child_.text + Format_ = self.gds_validate_string(Format_, node, 'Format') + self.Format = Format_ + self.validate_EMailNotificationFormatType(self.Format) # validate type EMailNotificationFormatType + elif nodeName_ == 'Localization': + obj_ = Localization.factory() + obj_.build(child_) + self.set_Localization(obj_) +# end class EMailNotificationRecipient + + +class EdtCommodityTax(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, HarmonizedCode=None, Taxes=None): + self.HarmonizedCode = HarmonizedCode + if Taxes is None: + self.Taxes = [] + else: + self.Taxes = Taxes + def factory(*args_, **kwargs_): + if EdtCommodityTax.subclass: + return EdtCommodityTax.subclass(*args_, **kwargs_) + else: + return EdtCommodityTax(*args_, **kwargs_) + factory = staticmethod(factory) + def get_HarmonizedCode(self): return self.HarmonizedCode + def set_HarmonizedCode(self, HarmonizedCode): self.HarmonizedCode = HarmonizedCode + def get_Taxes(self): return self.Taxes + def set_Taxes(self, Taxes): self.Taxes = Taxes + def add_Taxes(self, value): self.Taxes.append(value) + def insert_Taxes(self, index, value): self.Taxes[index] = value + def export(self, outfile, level, namespace_='ns:', name_='EdtCommodityTax', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='EdtCommodityTax') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='EdtCommodityTax'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='EdtCommodityTax', fromsubclass_=False): + if self.HarmonizedCode is not None: + showIndent(outfile, level) + outfile.write('<%sHarmonizedCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HarmonizedCode).encode(ExternalEncoding), input_name='HarmonizedCode'), namespace_)) + for Taxes_ in self.Taxes: + Taxes_.export(outfile, level, namespace_, name_='Taxes') + def hasContent_(self): + if ( + self.HarmonizedCode is not None or + self.Taxes + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='EdtCommodityTax'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.HarmonizedCode is not None: + showIndent(outfile, level) + outfile.write('HarmonizedCode=%s,\n' % quote_python(self.HarmonizedCode).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Taxes=[\n') + level += 1 + for Taxes_ in self.Taxes: + showIndent(outfile, level) + outfile.write('model_.EdtTaxDetail(\n') + Taxes_.exportLiteral(outfile, level, name_='EdtTaxDetail') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'HarmonizedCode': + HarmonizedCode_ = child_.text + HarmonizedCode_ = self.gds_validate_string(HarmonizedCode_, node, 'HarmonizedCode') + self.HarmonizedCode = HarmonizedCode_ + elif nodeName_ == 'Taxes': + obj_ = EdtTaxDetail.factory() + obj_.build(child_) + self.Taxes.append(obj_) +# end class EdtCommodityTax + + +class EdtExciseCondition(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Category=None, Value=None): + self.Category = Category + self.Value = Value + def factory(*args_, **kwargs_): + if EdtExciseCondition.subclass: + return EdtExciseCondition.subclass(*args_, **kwargs_) + else: + return EdtExciseCondition(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Category(self): return self.Category + def set_Category(self, Category): self.Category = Category + def get_Value(self): return self.Value + def set_Value(self, Value): self.Value = Value + def export(self, outfile, level, namespace_='ns:', name_='EdtExciseCondition', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='EdtExciseCondition') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='EdtExciseCondition'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='EdtExciseCondition', fromsubclass_=False): + if self.Category is not None: + showIndent(outfile, level) + outfile.write('<%sCategory>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Category).encode(ExternalEncoding), input_name='Category'), namespace_)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('<%sValue>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Value).encode(ExternalEncoding), input_name='Value'), namespace_)) + def hasContent_(self): + if ( + self.Category is not None or + self.Value is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='EdtExciseCondition'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Category is not None: + showIndent(outfile, level) + outfile.write('Category=%s,\n' % quote_python(self.Category).encode(ExternalEncoding)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('Value=%s,\n' % quote_python(self.Value).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Category': + Category_ = child_.text + Category_ = self.gds_validate_string(Category_, node, 'Category') + self.Category = Category_ + elif nodeName_ == 'Value': + Value_ = child_.text + Value_ = self.gds_validate_string(Value_, node, 'Value') + self.Value = Value_ +# end class EdtExciseCondition + + +class EdtTaxDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, TaxType=None, EffectiveDate=None, Name=None, TaxableValue=None, Description=None, Formula=None, Amount=None): + self.TaxType = TaxType + self.EffectiveDate = EffectiveDate + self.Name = Name + self.TaxableValue = TaxableValue + self.Description = Description + self.Formula = Formula + self.Amount = Amount + def factory(*args_, **kwargs_): + if EdtTaxDetail.subclass: + return EdtTaxDetail.subclass(*args_, **kwargs_) + else: + return EdtTaxDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_TaxType(self): return self.TaxType + def set_TaxType(self, TaxType): self.TaxType = TaxType + def validate_EdtTaxType(self, value): + # Validate type EdtTaxType, a restriction on xs:string. + pass + def get_EffectiveDate(self): return self.EffectiveDate + def set_EffectiveDate(self, EffectiveDate): self.EffectiveDate = EffectiveDate + def get_Name(self): return self.Name + def set_Name(self, Name): self.Name = Name + def get_TaxableValue(self): return self.TaxableValue + def set_TaxableValue(self, TaxableValue): self.TaxableValue = TaxableValue + def get_Description(self): return self.Description + def set_Description(self, Description): self.Description = Description + def get_Formula(self): return self.Formula + def set_Formula(self, Formula): self.Formula = Formula + def get_Amount(self): return self.Amount + def set_Amount(self, Amount): self.Amount = Amount + def export(self, outfile, level, namespace_='ns:', name_='EdtTaxDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='EdtTaxDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='EdtTaxDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='EdtTaxDetail', fromsubclass_=False): + if self.TaxType is not None: + showIndent(outfile, level) + outfile.write('<%sTaxType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.TaxType).encode(ExternalEncoding), input_name='TaxType'), namespace_)) + if self.EffectiveDate is not None: + showIndent(outfile, level) + outfile.write('<%sEffectiveDate>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.EffectiveDate).encode(ExternalEncoding), input_name='EffectiveDate'), namespace_)) + if self.Name is not None: + showIndent(outfile, level) + outfile.write('<%sName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Name).encode(ExternalEncoding), input_name='Name'), namespace_)) + if self.TaxableValue: + self.TaxableValue.export(outfile, level, namespace_, name_='TaxableValue') + if self.Description is not None: + showIndent(outfile, level) + outfile.write('<%sDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Description).encode(ExternalEncoding), input_name='Description'), namespace_)) + if self.Formula is not None: + showIndent(outfile, level) + outfile.write('<%sFormula>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Formula).encode(ExternalEncoding), input_name='Formula'), namespace_)) + if self.Amount: + self.Amount.export(outfile, level, namespace_, name_='Amount') + def hasContent_(self): + if ( + self.TaxType is not None or + self.EffectiveDate is not None or + self.Name is not None or + self.TaxableValue is not None or + self.Description is not None or + self.Formula is not None or + self.Amount is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='EdtTaxDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.TaxType is not None: + showIndent(outfile, level) + outfile.write('TaxType=%s,\n' % quote_python(self.TaxType).encode(ExternalEncoding)) + if self.EffectiveDate is not None: + showIndent(outfile, level) + outfile.write('EffectiveDate=%s,\n' % quote_python(self.EffectiveDate).encode(ExternalEncoding)) + if self.Name is not None: + showIndent(outfile, level) + outfile.write('Name=%s,\n' % quote_python(self.Name).encode(ExternalEncoding)) + if self.TaxableValue is not None: + showIndent(outfile, level) + outfile.write('TaxableValue=model_.Money(\n') + self.TaxableValue.exportLiteral(outfile, level, name_='TaxableValue') + showIndent(outfile, level) + outfile.write('),\n') + if self.Description is not None: + showIndent(outfile, level) + outfile.write('Description=%s,\n' % quote_python(self.Description).encode(ExternalEncoding)) + if self.Formula is not None: + showIndent(outfile, level) + outfile.write('Formula=%s,\n' % quote_python(self.Formula).encode(ExternalEncoding)) + if self.Amount is not None: + showIndent(outfile, level) + outfile.write('Amount=model_.Money(\n') + self.Amount.exportLiteral(outfile, level, name_='Amount') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'TaxType': + TaxType_ = child_.text + TaxType_ = self.gds_validate_string(TaxType_, node, 'TaxType') + self.TaxType = TaxType_ + self.validate_EdtTaxType(self.TaxType) # validate type EdtTaxType + elif nodeName_ == 'EffectiveDate': + EffectiveDate_ = child_.text + EffectiveDate_ = self.gds_validate_string(EffectiveDate_, node, 'EffectiveDate') + self.EffectiveDate = EffectiveDate_ + elif nodeName_ == 'Name': + Name_ = child_.text + Name_ = self.gds_validate_string(Name_, node, 'Name') + self.Name = Name_ + elif nodeName_ == 'TaxableValue': + obj_ = Money.factory() + obj_.build(child_) + self.set_TaxableValue(obj_) + elif nodeName_ == 'Description': + Description_ = child_.text + Description_ = self.gds_validate_string(Description_, node, 'Description') + self.Description = Description_ + elif nodeName_ == 'Formula': + Formula_ = child_.text + Formula_ = self.gds_validate_string(Formula_, node, 'Formula') + self.Formula = Formula_ + elif nodeName_ == 'Amount': + obj_ = Money.factory() + obj_.build(child_) + self.set_Amount(obj_) +# end class EdtTaxDetail + + +class EtdDetail(GeneratedsSuper): + """Electronic Trade document references used with the ETD special + service.""" + subclass = None + superclass = None + def __init__(self, RequestedDocumentCopies=None, DocumentReferences=None): + if RequestedDocumentCopies is None: + self.RequestedDocumentCopies = [] + else: + self.RequestedDocumentCopies = RequestedDocumentCopies + if DocumentReferences is None: + self.DocumentReferences = [] + else: + self.DocumentReferences = DocumentReferences + def factory(*args_, **kwargs_): + if EtdDetail.subclass: + return EtdDetail.subclass(*args_, **kwargs_) + else: + return EtdDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_RequestedDocumentCopies(self): return self.RequestedDocumentCopies + def set_RequestedDocumentCopies(self, RequestedDocumentCopies): self.RequestedDocumentCopies = RequestedDocumentCopies + def add_RequestedDocumentCopies(self, value): self.RequestedDocumentCopies.append(value) + def insert_RequestedDocumentCopies(self, index, value): self.RequestedDocumentCopies[index] = value + def validate_RequestedShippingDocumentType(self, value): + # Validate type RequestedShippingDocumentType, a restriction on xs:string. + pass + def get_DocumentReferences(self): return self.DocumentReferences + def set_DocumentReferences(self, DocumentReferences): self.DocumentReferences = DocumentReferences + def add_DocumentReferences(self, value): self.DocumentReferences.append(value) + def insert_DocumentReferences(self, index, value): self.DocumentReferences[index] = value + def export(self, outfile, level, namespace_='ns:', name_='EtdDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='EtdDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='EtdDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='EtdDetail', fromsubclass_=False): + for RequestedDocumentCopies_ in self.RequestedDocumentCopies: + showIndent(outfile, level) + outfile.write('<%sRequestedDocumentCopies>%s\n' % (namespace_, self.gds_format_string(quote_xml(RequestedDocumentCopies_).encode(ExternalEncoding), input_name='RequestedDocumentCopies'), namespace_)) + for DocumentReferences_ in self.DocumentReferences: + DocumentReferences_.export(outfile, level, namespace_, name_='DocumentReferences') + def hasContent_(self): + if ( + self.RequestedDocumentCopies or + self.DocumentReferences + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='EtdDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('RequestedDocumentCopies=[\n') + level += 1 + for RequestedDocumentCopies_ in self.RequestedDocumentCopies: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(RequestedDocumentCopies_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('DocumentReferences=[\n') + level += 1 + for DocumentReferences_ in self.DocumentReferences: + showIndent(outfile, level) + outfile.write('model_.UploadDocumentReferenceDetail(\n') + DocumentReferences_.exportLiteral(outfile, level, name_='UploadDocumentReferenceDetail') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'RequestedDocumentCopies': + RequestedDocumentCopies_ = child_.text + RequestedDocumentCopies_ = self.gds_validate_string(RequestedDocumentCopies_, node, 'RequestedDocumentCopies') + self.RequestedDocumentCopies.append(RequestedDocumentCopies_) + self.validate_RequestedShippingDocumentType(self.RequestedDocumentCopies) # validate type RequestedShippingDocumentType + elif nodeName_ == 'DocumentReferences': + obj_ = UploadDocumentReferenceDetail.factory() + obj_.build(child_) + self.DocumentReferences.append(obj_) +# end class EtdDetail + + +class ExportDetail(GeneratedsSuper): + """Country specific details of an International shipment.""" + subclass = None + superclass = None + def __init__(self, B13AFilingOption=None, ExportComplianceStatement=None, PermitNumber=None, DestinationControlDetail=None): + self.B13AFilingOption = B13AFilingOption + self.ExportComplianceStatement = ExportComplianceStatement + self.PermitNumber = PermitNumber + self.DestinationControlDetail = DestinationControlDetail + def factory(*args_, **kwargs_): + if ExportDetail.subclass: + return ExportDetail.subclass(*args_, **kwargs_) + else: + return ExportDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_B13AFilingOption(self): return self.B13AFilingOption + def set_B13AFilingOption(self, B13AFilingOption): self.B13AFilingOption = B13AFilingOption + def validate_B13AFilingOptionType(self, value): + # Validate type B13AFilingOptionType, a restriction on xs:string. + pass + def get_ExportComplianceStatement(self): return self.ExportComplianceStatement + def set_ExportComplianceStatement(self, ExportComplianceStatement): self.ExportComplianceStatement = ExportComplianceStatement + def get_PermitNumber(self): return self.PermitNumber + def set_PermitNumber(self, PermitNumber): self.PermitNumber = PermitNumber + def get_DestinationControlDetail(self): return self.DestinationControlDetail + def set_DestinationControlDetail(self, DestinationControlDetail): self.DestinationControlDetail = DestinationControlDetail + def export(self, outfile, level, namespace_='ns:', name_='ExportDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ExportDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ExportDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ExportDetail', fromsubclass_=False): + if self.B13AFilingOption is not None: + showIndent(outfile, level) + outfile.write('<%sB13AFilingOption>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.B13AFilingOption).encode(ExternalEncoding), input_name='B13AFilingOption'), namespace_)) + if self.ExportComplianceStatement is not None: + showIndent(outfile, level) + outfile.write('<%sExportComplianceStatement>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ExportComplianceStatement).encode(ExternalEncoding), input_name='ExportComplianceStatement'), namespace_)) + if self.PermitNumber is not None: + showIndent(outfile, level) + outfile.write('<%sPermitNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PermitNumber).encode(ExternalEncoding), input_name='PermitNumber'), namespace_)) + if self.DestinationControlDetail: + self.DestinationControlDetail.export(outfile, level, namespace_, name_='DestinationControlDetail') + def hasContent_(self): + if ( + self.B13AFilingOption is not None or + self.ExportComplianceStatement is not None or + self.PermitNumber is not None or + self.DestinationControlDetail is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ExportDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.B13AFilingOption is not None: + showIndent(outfile, level) + outfile.write('B13AFilingOption=%s,\n' % quote_python(self.B13AFilingOption).encode(ExternalEncoding)) + if self.ExportComplianceStatement is not None: + showIndent(outfile, level) + outfile.write('ExportComplianceStatement=%s,\n' % quote_python(self.ExportComplianceStatement).encode(ExternalEncoding)) + if self.PermitNumber is not None: + showIndent(outfile, level) + outfile.write('PermitNumber=%s,\n' % quote_python(self.PermitNumber).encode(ExternalEncoding)) + if self.DestinationControlDetail is not None: + showIndent(outfile, level) + outfile.write('DestinationControlDetail=model_.DestinationControlDetail(\n') + self.DestinationControlDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'B13AFilingOption': + B13AFilingOption_ = child_.text + B13AFilingOption_ = self.gds_validate_string(B13AFilingOption_, node, 'B13AFilingOption') + self.B13AFilingOption = B13AFilingOption_ + self.validate_B13AFilingOptionType(self.B13AFilingOption) # validate type B13AFilingOptionType + elif nodeName_ == 'ExportComplianceStatement': + ExportComplianceStatement_ = child_.text + ExportComplianceStatement_ = self.gds_validate_string(ExportComplianceStatement_, node, 'ExportComplianceStatement') + self.ExportComplianceStatement = ExportComplianceStatement_ + elif nodeName_ == 'PermitNumber': + PermitNumber_ = child_.text + PermitNumber_ = self.gds_validate_string(PermitNumber_, node, 'PermitNumber') + self.PermitNumber = PermitNumber_ + elif nodeName_ == 'DestinationControlDetail': + obj_ = DestinationControlDetail.factory() + obj_.build(child_) + self.set_DestinationControlDetail(obj_) +# end class ExportDetail + + +class ExpressFreightDetail(GeneratedsSuper): + """Details specific to an Express freight shipment.""" + subclass = None + superclass = None + def __init__(self, PackingListEnclosed=None, ShippersLoadAndCount=None, BookingConfirmationNumber=None): + self.PackingListEnclosed = PackingListEnclosed + self.ShippersLoadAndCount = ShippersLoadAndCount + self.BookingConfirmationNumber = BookingConfirmationNumber + def factory(*args_, **kwargs_): + if ExpressFreightDetail.subclass: + return ExpressFreightDetail.subclass(*args_, **kwargs_) + else: + return ExpressFreightDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_PackingListEnclosed(self): return self.PackingListEnclosed + def set_PackingListEnclosed(self, PackingListEnclosed): self.PackingListEnclosed = PackingListEnclosed + def get_ShippersLoadAndCount(self): return self.ShippersLoadAndCount + def set_ShippersLoadAndCount(self, ShippersLoadAndCount): self.ShippersLoadAndCount = ShippersLoadAndCount + def get_BookingConfirmationNumber(self): return self.BookingConfirmationNumber + def set_BookingConfirmationNumber(self, BookingConfirmationNumber): self.BookingConfirmationNumber = BookingConfirmationNumber + def export(self, outfile, level, namespace_='ns:', name_='ExpressFreightDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ExpressFreightDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ExpressFreightDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ExpressFreightDetail', fromsubclass_=False): + if self.PackingListEnclosed is not None: + showIndent(outfile, level) + outfile.write('<%sPackingListEnclosed>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.PackingListEnclosed)), input_name='PackingListEnclosed'), namespace_)) + if self.ShippersLoadAndCount is not None: + showIndent(outfile, level) + outfile.write('<%sShippersLoadAndCount>%s\n' % (namespace_, self.gds_format_integer(self.ShippersLoadAndCount, input_name='ShippersLoadAndCount'), namespace_)) + if self.BookingConfirmationNumber is not None: + showIndent(outfile, level) + outfile.write('<%sBookingConfirmationNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.BookingConfirmationNumber).encode(ExternalEncoding), input_name='BookingConfirmationNumber'), namespace_)) + def hasContent_(self): + if ( + self.PackingListEnclosed is not None or + self.ShippersLoadAndCount is not None or + self.BookingConfirmationNumber is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ExpressFreightDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.PackingListEnclosed is not None: + showIndent(outfile, level) + outfile.write('PackingListEnclosed=%s,\n' % self.PackingListEnclosed) + if self.ShippersLoadAndCount is not None: + showIndent(outfile, level) + outfile.write('ShippersLoadAndCount=%d,\n' % self.ShippersLoadAndCount) + if self.BookingConfirmationNumber is not None: + showIndent(outfile, level) + outfile.write('BookingConfirmationNumber=%s,\n' % quote_python(self.BookingConfirmationNumber).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'PackingListEnclosed': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'PackingListEnclosed') + self.PackingListEnclosed = ival_ + elif nodeName_ == 'ShippersLoadAndCount': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ <= 0: + raise_parse_error(child_, 'requires positiveInteger') + ival_ = self.gds_validate_integer(ival_, node, 'ShippersLoadAndCount') + self.ShippersLoadAndCount = ival_ + elif nodeName_ == 'BookingConfirmationNumber': + BookingConfirmationNumber_ = child_.text + BookingConfirmationNumber_ = self.gds_validate_string(BookingConfirmationNumber_, node, 'BookingConfirmationNumber') + self.BookingConfirmationNumber = BookingConfirmationNumber_ +# end class ExpressFreightDetail + + +class FreightAddressLabelDetail(GeneratedsSuper): + """Data required to produce the Freight handling-unit-level address + labels. Note that the number of UNIQUE labels (the N as in 1 of + N, 2 of N, etc.) is determined by total handling units.""" + subclass = None + superclass = None + def __init__(self, Format=None, Copies=None, DocTabContent=None): + self.Format = Format + self.Copies = Copies + self.DocTabContent = DocTabContent + def factory(*args_, **kwargs_): + if FreightAddressLabelDetail.subclass: + return FreightAddressLabelDetail.subclass(*args_, **kwargs_) + else: + return FreightAddressLabelDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Format(self): return self.Format + def set_Format(self, Format): self.Format = Format + def get_Copies(self): return self.Copies + def set_Copies(self, Copies): self.Copies = Copies + def get_DocTabContent(self): return self.DocTabContent + def set_DocTabContent(self, DocTabContent): self.DocTabContent = DocTabContent + def export(self, outfile, level, namespace_='ns:', name_='FreightAddressLabelDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='FreightAddressLabelDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='FreightAddressLabelDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='FreightAddressLabelDetail', fromsubclass_=False): + if self.Format: + self.Format.export(outfile, level, namespace_, name_='Format') + if self.Copies is not None: + showIndent(outfile, level) + outfile.write('<%sCopies>%s\n' % (namespace_, self.gds_format_integer(self.Copies, input_name='Copies'), namespace_)) + if self.DocTabContent: + self.DocTabContent.export(outfile, level, namespace_, name_='DocTabContent') + def hasContent_(self): + if ( + self.Format is not None or + self.Copies is not None or + self.DocTabContent is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='FreightAddressLabelDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Format is not None: + showIndent(outfile, level) + outfile.write('Format=model_.ShippingDocumentFormat(\n') + self.Format.exportLiteral(outfile, level, name_='Format') + showIndent(outfile, level) + outfile.write('),\n') + if self.Copies is not None: + showIndent(outfile, level) + outfile.write('Copies=%d,\n' % self.Copies) + if self.DocTabContent is not None: + showIndent(outfile, level) + outfile.write('DocTabContent=model_.DocTabContent(\n') + self.DocTabContent.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Format': + obj_ = ShippingDocumentFormat.factory() + obj_.build(child_) + self.set_Format(obj_) + elif nodeName_ == 'Copies': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'Copies') + self.Copies = ival_ + elif nodeName_ == 'DocTabContent': + obj_ = DocTabContent.factory() + obj_.build(child_) + self.set_DocTabContent(obj_) +# end class FreightAddressLabelDetail + + +class FreightBaseCharge(GeneratedsSuper): + """Individual charge which contributes to the total base charge for the + shipment.""" + subclass = None + superclass = None + def __init__(self, FreightClass=None, RatedAsClass=None, NmfcCode=None, Description=None, Weight=None, ChargeRate=None, ChargeBasis=None, ExtendedAmount=None): + self.FreightClass = FreightClass + self.RatedAsClass = RatedAsClass + self.NmfcCode = NmfcCode + self.Description = Description + self.Weight = Weight + self.ChargeRate = ChargeRate + self.ChargeBasis = ChargeBasis + self.ExtendedAmount = ExtendedAmount + def factory(*args_, **kwargs_): + if FreightBaseCharge.subclass: + return FreightBaseCharge.subclass(*args_, **kwargs_) + else: + return FreightBaseCharge(*args_, **kwargs_) + factory = staticmethod(factory) + def get_FreightClass(self): return self.FreightClass + def set_FreightClass(self, FreightClass): self.FreightClass = FreightClass + def validate_FreightClassType(self, value): + # Validate type FreightClassType, a restriction on xs:string. + pass + def get_RatedAsClass(self): return self.RatedAsClass + def set_RatedAsClass(self, RatedAsClass): self.RatedAsClass = RatedAsClass + def get_NmfcCode(self): return self.NmfcCode + def set_NmfcCode(self, NmfcCode): self.NmfcCode = NmfcCode + def get_Description(self): return self.Description + def set_Description(self, Description): self.Description = Description + def get_Weight(self): return self.Weight + def set_Weight(self, Weight): self.Weight = Weight + def get_ChargeRate(self): return self.ChargeRate + def set_ChargeRate(self, ChargeRate): self.ChargeRate = ChargeRate + def get_ChargeBasis(self): return self.ChargeBasis + def set_ChargeBasis(self, ChargeBasis): self.ChargeBasis = ChargeBasis + def validate_FreightChargeBasisType(self, value): + # Validate type FreightChargeBasisType, a restriction on xs:string. + pass + def get_ExtendedAmount(self): return self.ExtendedAmount + def set_ExtendedAmount(self, ExtendedAmount): self.ExtendedAmount = ExtendedAmount + def export(self, outfile, level, namespace_='ns:', name_='FreightBaseCharge', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='FreightBaseCharge') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='FreightBaseCharge'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='FreightBaseCharge', fromsubclass_=False): + if self.FreightClass is not None: + showIndent(outfile, level) + outfile.write('<%sFreightClass>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.FreightClass).encode(ExternalEncoding), input_name='FreightClass'), namespace_)) + if self.RatedAsClass is not None: + showIndent(outfile, level) + outfile.write('<%sRatedAsClass>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RatedAsClass).encode(ExternalEncoding), input_name='RatedAsClass'), namespace_)) + if self.NmfcCode is not None: + showIndent(outfile, level) + outfile.write('<%sNmfcCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.NmfcCode).encode(ExternalEncoding), input_name='NmfcCode'), namespace_)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('<%sDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Description).encode(ExternalEncoding), input_name='Description'), namespace_)) + if self.Weight: + self.Weight.export(outfile, level, namespace_, name_='Weight') + if self.ChargeRate: + self.ChargeRate.export(outfile, level, namespace_, name_='ChargeRate') + if self.ChargeBasis is not None: + showIndent(outfile, level) + outfile.write('<%sChargeBasis>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ChargeBasis).encode(ExternalEncoding), input_name='ChargeBasis'), namespace_)) + if self.ExtendedAmount: + self.ExtendedAmount.export(outfile, level, namespace_, name_='ExtendedAmount') + def hasContent_(self): + if ( + self.FreightClass is not None or + self.RatedAsClass is not None or + self.NmfcCode is not None or + self.Description is not None or + self.Weight is not None or + self.ChargeRate is not None or + self.ChargeBasis is not None or + self.ExtendedAmount is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='FreightBaseCharge'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.FreightClass is not None: + showIndent(outfile, level) + outfile.write('FreightClass=%s,\n' % quote_python(self.FreightClass).encode(ExternalEncoding)) + if self.RatedAsClass is not None: + showIndent(outfile, level) + outfile.write('RatedAsClass=%s,\n' % quote_python(self.RatedAsClass).encode(ExternalEncoding)) + if self.NmfcCode is not None: + showIndent(outfile, level) + outfile.write('NmfcCode=%s,\n' % quote_python(self.NmfcCode).encode(ExternalEncoding)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('Description=%s,\n' % quote_python(self.Description).encode(ExternalEncoding)) + if self.Weight is not None: + showIndent(outfile, level) + outfile.write('Weight=model_.Weight(\n') + self.Weight.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ChargeRate is not None: + showIndent(outfile, level) + outfile.write('ChargeRate=model_.Money(\n') + self.ChargeRate.exportLiteral(outfile, level, name_='ChargeRate') + showIndent(outfile, level) + outfile.write('),\n') + if self.ChargeBasis is not None: + showIndent(outfile, level) + outfile.write('ChargeBasis=%s,\n' % quote_python(self.ChargeBasis).encode(ExternalEncoding)) + if self.ExtendedAmount is not None: + showIndent(outfile, level) + outfile.write('ExtendedAmount=model_.Money(\n') + self.ExtendedAmount.exportLiteral(outfile, level, name_='ExtendedAmount') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'FreightClass': + FreightClass_ = child_.text + FreightClass_ = self.gds_validate_string(FreightClass_, node, 'FreightClass') + self.FreightClass = FreightClass_ + self.validate_FreightClassType(self.FreightClass) # validate type FreightClassType + elif nodeName_ == 'RatedAsClass': + RatedAsClass_ = child_.text + RatedAsClass_ = self.gds_validate_string(RatedAsClass_, node, 'RatedAsClass') + self.RatedAsClass = RatedAsClass_ + self.validate_FreightClassType(self.RatedAsClass) # validate type FreightClassType + elif nodeName_ == 'NmfcCode': + NmfcCode_ = child_.text + NmfcCode_ = self.gds_validate_string(NmfcCode_, node, 'NmfcCode') + self.NmfcCode = NmfcCode_ + elif nodeName_ == 'Description': + Description_ = child_.text + Description_ = self.gds_validate_string(Description_, node, 'Description') + self.Description = Description_ + elif nodeName_ == 'Weight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_Weight(obj_) + elif nodeName_ == 'ChargeRate': + obj_ = Money.factory() + obj_.build(child_) + self.set_ChargeRate(obj_) + elif nodeName_ == 'ChargeBasis': + ChargeBasis_ = child_.text + ChargeBasis_ = self.gds_validate_string(ChargeBasis_, node, 'ChargeBasis') + self.ChargeBasis = ChargeBasis_ + self.validate_FreightChargeBasisType(self.ChargeBasis) # validate type FreightChargeBasisType + elif nodeName_ == 'ExtendedAmount': + obj_ = Money.factory() + obj_.build(child_) + self.set_ExtendedAmount(obj_) +# end class FreightBaseCharge + + +class FreightGuaranteeDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Type=None, Date=None): + self.Type = Type + self.Date = Date + def factory(*args_, **kwargs_): + if FreightGuaranteeDetail.subclass: + return FreightGuaranteeDetail.subclass(*args_, **kwargs_) + else: + return FreightGuaranteeDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Type(self): return self.Type + def set_Type(self, Type): self.Type = Type + def validate_FreightGuaranteeType(self, value): + # Validate type FreightGuaranteeType, a restriction on xs:string. + pass + def get_Date(self): return self.Date + def set_Date(self, Date): self.Date = Date + def export(self, outfile, level, namespace_='ns:', name_='FreightGuaranteeDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='FreightGuaranteeDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='FreightGuaranteeDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='FreightGuaranteeDetail', fromsubclass_=False): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('<%sType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Type).encode(ExternalEncoding), input_name='Type'), namespace_)) + if self.Date is not None: + showIndent(outfile, level) + outfile.write('<%sDate>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Date).encode(ExternalEncoding), input_name='Date'), namespace_)) + def hasContent_(self): + if ( + self.Type is not None or + self.Date is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='FreightGuaranteeDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('Type=%s,\n' % quote_python(self.Type).encode(ExternalEncoding)) + if self.Date is not None: + showIndent(outfile, level) + outfile.write('Date=%s,\n' % quote_python(self.Date).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Type': + Type_ = child_.text + Type_ = self.gds_validate_string(Type_, node, 'Type') + self.Type = Type_ + self.validate_FreightGuaranteeType(self.Type) # validate type FreightGuaranteeType + elif nodeName_ == 'Date': + Date_ = child_.text + Date_ = self.gds_validate_string(Date_, node, 'Date') + self.Date = Date_ +# end class FreightGuaranteeDetail + + +class FreightRateDetail(GeneratedsSuper): + """Rate data specific to FedEx Freight or FedEx National Freight + services.""" + subclass = None + superclass = None + def __init__(self, QuoteNumber=None, BaseChargeCalculation=None, BaseCharges=None, Notations=None): + self.QuoteNumber = QuoteNumber + self.BaseChargeCalculation = BaseChargeCalculation + if BaseCharges is None: + self.BaseCharges = [] + else: + self.BaseCharges = BaseCharges + if Notations is None: + self.Notations = [] + else: + self.Notations = Notations + def factory(*args_, **kwargs_): + if FreightRateDetail.subclass: + return FreightRateDetail.subclass(*args_, **kwargs_) + else: + return FreightRateDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_QuoteNumber(self): return self.QuoteNumber + def set_QuoteNumber(self, QuoteNumber): self.QuoteNumber = QuoteNumber + def get_BaseChargeCalculation(self): return self.BaseChargeCalculation + def set_BaseChargeCalculation(self, BaseChargeCalculation): self.BaseChargeCalculation = BaseChargeCalculation + def validate_FreightBaseChargeCalculationType(self, value): + # Validate type FreightBaseChargeCalculationType, a restriction on xs:string. + pass + def get_BaseCharges(self): return self.BaseCharges + def set_BaseCharges(self, BaseCharges): self.BaseCharges = BaseCharges + def add_BaseCharges(self, value): self.BaseCharges.append(value) + def insert_BaseCharges(self, index, value): self.BaseCharges[index] = value + def get_Notations(self): return self.Notations + def set_Notations(self, Notations): self.Notations = Notations + def add_Notations(self, value): self.Notations.append(value) + def insert_Notations(self, index, value): self.Notations[index] = value + def export(self, outfile, level, namespace_='ns:', name_='FreightRateDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='FreightRateDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='FreightRateDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='FreightRateDetail', fromsubclass_=False): + if self.QuoteNumber is not None: + showIndent(outfile, level) + outfile.write('<%sQuoteNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.QuoteNumber).encode(ExternalEncoding), input_name='QuoteNumber'), namespace_)) + if self.BaseChargeCalculation is not None: + showIndent(outfile, level) + outfile.write('<%sBaseChargeCalculation>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.BaseChargeCalculation).encode(ExternalEncoding), input_name='BaseChargeCalculation'), namespace_)) + for BaseCharges_ in self.BaseCharges: + BaseCharges_.export(outfile, level, namespace_, name_='BaseCharges') + for Notations_ in self.Notations: + Notations_.export(outfile, level, namespace_, name_='Notations') + def hasContent_(self): + if ( + self.QuoteNumber is not None or + self.BaseChargeCalculation is not None or + self.BaseCharges or + self.Notations + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='FreightRateDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.QuoteNumber is not None: + showIndent(outfile, level) + outfile.write('QuoteNumber=%s,\n' % quote_python(self.QuoteNumber).encode(ExternalEncoding)) + if self.BaseChargeCalculation is not None: + showIndent(outfile, level) + outfile.write('BaseChargeCalculation=%s,\n' % quote_python(self.BaseChargeCalculation).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('BaseCharges=[\n') + level += 1 + for BaseCharges_ in self.BaseCharges: + showIndent(outfile, level) + outfile.write('model_.FreightBaseCharge(\n') + BaseCharges_.exportLiteral(outfile, level, name_='FreightBaseCharge') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('Notations=[\n') + level += 1 + for Notations_ in self.Notations: + showIndent(outfile, level) + outfile.write('model_.FreightRateNotation(\n') + Notations_.exportLiteral(outfile, level, name_='FreightRateNotation') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'QuoteNumber': + QuoteNumber_ = child_.text + QuoteNumber_ = self.gds_validate_string(QuoteNumber_, node, 'QuoteNumber') + self.QuoteNumber = QuoteNumber_ + elif nodeName_ == 'BaseChargeCalculation': + BaseChargeCalculation_ = child_.text + BaseChargeCalculation_ = self.gds_validate_string(BaseChargeCalculation_, node, 'BaseChargeCalculation') + self.BaseChargeCalculation = BaseChargeCalculation_ + self.validate_FreightBaseChargeCalculationType(self.BaseChargeCalculation) # validate type FreightBaseChargeCalculationType + elif nodeName_ == 'BaseCharges': + obj_ = FreightBaseCharge.factory() + obj_.build(child_) + self.BaseCharges.append(obj_) + elif nodeName_ == 'Notations': + obj_ = FreightRateNotation.factory() + obj_.build(child_) + self.Notations.append(obj_) +# end class FreightRateDetail + + +class FreightRateNotation(GeneratedsSuper): + """Additional non-monetary data returned with Freight rates.""" + subclass = None + superclass = None + def __init__(self, Code=None, Description=None): + self.Code = Code + self.Description = Description + def factory(*args_, **kwargs_): + if FreightRateNotation.subclass: + return FreightRateNotation.subclass(*args_, **kwargs_) + else: + return FreightRateNotation(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Code(self): return self.Code + def set_Code(self, Code): self.Code = Code + def get_Description(self): return self.Description + def set_Description(self, Description): self.Description = Description + def export(self, outfile, level, namespace_='ns:', name_='FreightRateNotation', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='FreightRateNotation') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='FreightRateNotation'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='FreightRateNotation', fromsubclass_=False): + if self.Code is not None: + showIndent(outfile, level) + outfile.write('<%sCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Code).encode(ExternalEncoding), input_name='Code'), namespace_)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('<%sDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Description).encode(ExternalEncoding), input_name='Description'), namespace_)) + def hasContent_(self): + if ( + self.Code is not None or + self.Description is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='FreightRateNotation'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Code is not None: + showIndent(outfile, level) + outfile.write('Code=%s,\n' % quote_python(self.Code).encode(ExternalEncoding)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('Description=%s,\n' % quote_python(self.Description).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Code': + Code_ = child_.text + Code_ = self.gds_validate_string(Code_, node, 'Code') + self.Code = Code_ + elif nodeName_ == 'Description': + Description_ = child_.text + Description_ = self.gds_validate_string(Description_, node, 'Description') + self.Description = Description_ +# end class FreightRateNotation + + +class FreightShipmentDetail(GeneratedsSuper): + """Data applicable to shipments using FEDEX_FREIGHT and + FEDEX_NATIONAL_FREIGHT services.""" + subclass = None + superclass = None + def __init__(self, FedExFreightAccountNumber=None, FedExFreightBillingContactAndAddress=None, PrintedReferences=None, Role=None, PaymentType=None, CollectTermsType=None, DeclaredValuePerUnit=None, DeclaredValueUnits=None, LiabilityCoverageDetail=None, Coupons=None, TotalHandlingUnits=None, ClientDiscountPercent=None, PalletWeight=None, ShipmentDimensions=None, Comment=None, SpecialServicePayments=None, HazardousMaterialsEmergencyContactNumber=None, LineItems=None): + self.FedExFreightAccountNumber = FedExFreightAccountNumber + self.FedExFreightBillingContactAndAddress = FedExFreightBillingContactAndAddress + if PrintedReferences is None: + self.PrintedReferences = [] + else: + self.PrintedReferences = PrintedReferences + self.Role = Role + self.PaymentType = PaymentType + self.CollectTermsType = CollectTermsType + self.DeclaredValuePerUnit = DeclaredValuePerUnit + self.DeclaredValueUnits = DeclaredValueUnits + self.LiabilityCoverageDetail = LiabilityCoverageDetail + if Coupons is None: + self.Coupons = [] + else: + self.Coupons = Coupons + self.TotalHandlingUnits = TotalHandlingUnits + self.ClientDiscountPercent = ClientDiscountPercent + self.PalletWeight = PalletWeight + self.ShipmentDimensions = ShipmentDimensions + self.Comment = Comment + if SpecialServicePayments is None: + self.SpecialServicePayments = [] + else: + self.SpecialServicePayments = SpecialServicePayments + self.HazardousMaterialsEmergencyContactNumber = HazardousMaterialsEmergencyContactNumber + if LineItems is None: + self.LineItems = [] + else: + self.LineItems = LineItems + def factory(*args_, **kwargs_): + if FreightShipmentDetail.subclass: + return FreightShipmentDetail.subclass(*args_, **kwargs_) + else: + return FreightShipmentDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_FedExFreightAccountNumber(self): return self.FedExFreightAccountNumber + def set_FedExFreightAccountNumber(self, FedExFreightAccountNumber): self.FedExFreightAccountNumber = FedExFreightAccountNumber + def get_FedExFreightBillingContactAndAddress(self): return self.FedExFreightBillingContactAndAddress + def set_FedExFreightBillingContactAndAddress(self, FedExFreightBillingContactAndAddress): self.FedExFreightBillingContactAndAddress = FedExFreightBillingContactAndAddress + def get_PrintedReferences(self): return self.PrintedReferences + def set_PrintedReferences(self, PrintedReferences): self.PrintedReferences = PrintedReferences + def add_PrintedReferences(self, value): self.PrintedReferences.append(value) + def insert_PrintedReferences(self, index, value): self.PrintedReferences[index] = value + def get_Role(self): return self.Role + def set_Role(self, Role): self.Role = Role + def validate_FreightShipmentRoleType(self, value): + # Validate type FreightShipmentRoleType, a restriction on xs:string. + pass + def get_PaymentType(self): return self.PaymentType + def set_PaymentType(self, PaymentType): self.PaymentType = PaymentType + def validate_FreightAccountPaymentType(self, value): + # Validate type FreightAccountPaymentType, a restriction on xs:string. + pass + def get_CollectTermsType(self): return self.CollectTermsType + def set_CollectTermsType(self, CollectTermsType): self.CollectTermsType = CollectTermsType + def validate_FreightCollectTermsType(self, value): + # Validate type FreightCollectTermsType, a restriction on xs:string. + pass + def get_DeclaredValuePerUnit(self): return self.DeclaredValuePerUnit + def set_DeclaredValuePerUnit(self, DeclaredValuePerUnit): self.DeclaredValuePerUnit = DeclaredValuePerUnit + def get_DeclaredValueUnits(self): return self.DeclaredValueUnits + def set_DeclaredValueUnits(self, DeclaredValueUnits): self.DeclaredValueUnits = DeclaredValueUnits + def get_LiabilityCoverageDetail(self): return self.LiabilityCoverageDetail + def set_LiabilityCoverageDetail(self, LiabilityCoverageDetail): self.LiabilityCoverageDetail = LiabilityCoverageDetail + def get_Coupons(self): return self.Coupons + def set_Coupons(self, Coupons): self.Coupons = Coupons + def add_Coupons(self, value): self.Coupons.append(value) + def insert_Coupons(self, index, value): self.Coupons[index] = value + def get_TotalHandlingUnits(self): return self.TotalHandlingUnits + def set_TotalHandlingUnits(self, TotalHandlingUnits): self.TotalHandlingUnits = TotalHandlingUnits + def get_ClientDiscountPercent(self): return self.ClientDiscountPercent + def set_ClientDiscountPercent(self, ClientDiscountPercent): self.ClientDiscountPercent = ClientDiscountPercent + def get_PalletWeight(self): return self.PalletWeight + def set_PalletWeight(self, PalletWeight): self.PalletWeight = PalletWeight + def get_ShipmentDimensions(self): return self.ShipmentDimensions + def set_ShipmentDimensions(self, ShipmentDimensions): self.ShipmentDimensions = ShipmentDimensions + def get_Comment(self): return self.Comment + def set_Comment(self, Comment): self.Comment = Comment + def get_SpecialServicePayments(self): return self.SpecialServicePayments + def set_SpecialServicePayments(self, SpecialServicePayments): self.SpecialServicePayments = SpecialServicePayments + def add_SpecialServicePayments(self, value): self.SpecialServicePayments.append(value) + def insert_SpecialServicePayments(self, index, value): self.SpecialServicePayments[index] = value + def get_HazardousMaterialsEmergencyContactNumber(self): return self.HazardousMaterialsEmergencyContactNumber + def set_HazardousMaterialsEmergencyContactNumber(self, HazardousMaterialsEmergencyContactNumber): self.HazardousMaterialsEmergencyContactNumber = HazardousMaterialsEmergencyContactNumber + def get_LineItems(self): return self.LineItems + def set_LineItems(self, LineItems): self.LineItems = LineItems + def add_LineItems(self, value): self.LineItems.append(value) + def insert_LineItems(self, index, value): self.LineItems[index] = value + def export(self, outfile, level, namespace_='ns:', name_='FreightShipmentDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='FreightShipmentDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='FreightShipmentDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='FreightShipmentDetail', fromsubclass_=False): + if self.FedExFreightAccountNumber is not None: + showIndent(outfile, level) + outfile.write('<%sFedExFreightAccountNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.FedExFreightAccountNumber).encode(ExternalEncoding), input_name='FedExFreightAccountNumber'), namespace_)) + if self.FedExFreightBillingContactAndAddress: + self.FedExFreightBillingContactAndAddress.export(outfile, level, namespace_, name_='FedExFreightBillingContactAndAddress') + for PrintedReferences_ in self.PrintedReferences: + PrintedReferences_.export(outfile, level, namespace_, name_='PrintedReferences') + if self.Role is not None: + showIndent(outfile, level) + outfile.write('<%sRole>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Role).encode(ExternalEncoding), input_name='Role'), namespace_)) + if self.PaymentType is not None: + showIndent(outfile, level) + outfile.write('<%sPaymentType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PaymentType).encode(ExternalEncoding), input_name='PaymentType'), namespace_)) + if self.CollectTermsType is not None: + showIndent(outfile, level) + outfile.write('<%sCollectTermsType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CollectTermsType).encode(ExternalEncoding), input_name='CollectTermsType'), namespace_)) + if self.DeclaredValuePerUnit: + self.DeclaredValuePerUnit.export(outfile, level, namespace_, name_='DeclaredValuePerUnit') + if self.DeclaredValueUnits is not None: + showIndent(outfile, level) + outfile.write('<%sDeclaredValueUnits>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DeclaredValueUnits).encode(ExternalEncoding), input_name='DeclaredValueUnits'), namespace_)) + if self.LiabilityCoverageDetail: + self.LiabilityCoverageDetail.export(outfile, level, namespace_, name_='LiabilityCoverageDetail') + for Coupons_ in self.Coupons: + showIndent(outfile, level) + outfile.write('<%sCoupons>%s\n' % (namespace_, self.gds_format_string(quote_xml(Coupons_).encode(ExternalEncoding), input_name='Coupons'), namespace_)) + if self.TotalHandlingUnits is not None: + showIndent(outfile, level) + outfile.write('<%sTotalHandlingUnits>%s\n' % (namespace_, self.gds_format_integer(self.TotalHandlingUnits, input_name='TotalHandlingUnits'), namespace_)) + if self.ClientDiscountPercent is not None: + showIndent(outfile, level) + outfile.write('<%sClientDiscountPercent>%s\n' % (namespace_, self.gds_format_float(self.ClientDiscountPercent, input_name='ClientDiscountPercent'), namespace_)) + if self.PalletWeight: + self.PalletWeight.export(outfile, level, namespace_, name_='PalletWeight') + if self.ShipmentDimensions: + self.ShipmentDimensions.export(outfile, level, namespace_, name_='ShipmentDimensions') + if self.Comment is not None: + showIndent(outfile, level) + outfile.write('<%sComment>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Comment).encode(ExternalEncoding), input_name='Comment'), namespace_)) + for SpecialServicePayments_ in self.SpecialServicePayments: + SpecialServicePayments_.export(outfile, level, namespace_, name_='SpecialServicePayments') + if self.HazardousMaterialsEmergencyContactNumber is not None: + showIndent(outfile, level) + outfile.write('<%sHazardousMaterialsEmergencyContactNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HazardousMaterialsEmergencyContactNumber).encode(ExternalEncoding), input_name='HazardousMaterialsEmergencyContactNumber'), namespace_)) + for LineItems_ in self.LineItems: + LineItems_.export(outfile, level, namespace_, name_='LineItems') + def hasContent_(self): + if ( + self.FedExFreightAccountNumber is not None or + self.FedExFreightBillingContactAndAddress is not None or + self.PrintedReferences or + self.Role is not None or + self.PaymentType is not None or + self.CollectTermsType is not None or + self.DeclaredValuePerUnit is not None or + self.DeclaredValueUnits is not None or + self.LiabilityCoverageDetail is not None or + self.Coupons or + self.TotalHandlingUnits is not None or + self.ClientDiscountPercent is not None or + self.PalletWeight is not None or + self.ShipmentDimensions is not None or + self.Comment is not None or + self.SpecialServicePayments or + self.HazardousMaterialsEmergencyContactNumber is not None or + self.LineItems + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='FreightShipmentDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.FedExFreightAccountNumber is not None: + showIndent(outfile, level) + outfile.write('FedExFreightAccountNumber=%s,\n' % quote_python(self.FedExFreightAccountNumber).encode(ExternalEncoding)) + if self.FedExFreightBillingContactAndAddress is not None: + showIndent(outfile, level) + outfile.write('FedExFreightBillingContactAndAddress=model_.ContactAndAddress(\n') + self.FedExFreightBillingContactAndAddress.exportLiteral(outfile, level, name_='FedExFreightBillingContactAndAddress') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('PrintedReferences=[\n') + level += 1 + for PrintedReferences_ in self.PrintedReferences: + showIndent(outfile, level) + outfile.write('model_.PrintedReference(\n') + PrintedReferences_.exportLiteral(outfile, level, name_='PrintedReference') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.Role is not None: + showIndent(outfile, level) + outfile.write('Role=%s,\n' % quote_python(self.Role).encode(ExternalEncoding)) + if self.PaymentType is not None: + showIndent(outfile, level) + outfile.write('PaymentType=%s,\n' % quote_python(self.PaymentType).encode(ExternalEncoding)) + if self.CollectTermsType is not None: + showIndent(outfile, level) + outfile.write('CollectTermsType=%s,\n' % quote_python(self.CollectTermsType).encode(ExternalEncoding)) + if self.DeclaredValuePerUnit is not None: + showIndent(outfile, level) + outfile.write('DeclaredValuePerUnit=model_.Money(\n') + self.DeclaredValuePerUnit.exportLiteral(outfile, level, name_='DeclaredValuePerUnit') + showIndent(outfile, level) + outfile.write('),\n') + if self.DeclaredValueUnits is not None: + showIndent(outfile, level) + outfile.write('DeclaredValueUnits=%s,\n' % quote_python(self.DeclaredValueUnits).encode(ExternalEncoding)) + if self.LiabilityCoverageDetail is not None: + showIndent(outfile, level) + outfile.write('LiabilityCoverageDetail=model_.LiabilityCoverageDetail(\n') + self.LiabilityCoverageDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('Coupons=[\n') + level += 1 + for Coupons_ in self.Coupons: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(Coupons_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.TotalHandlingUnits is not None: + showIndent(outfile, level) + outfile.write('TotalHandlingUnits=%d,\n' % self.TotalHandlingUnits) + if self.ClientDiscountPercent is not None: + showIndent(outfile, level) + outfile.write('ClientDiscountPercent=%f,\n' % self.ClientDiscountPercent) + if self.PalletWeight is not None: + showIndent(outfile, level) + outfile.write('PalletWeight=model_.Weight(\n') + self.PalletWeight.exportLiteral(outfile, level, name_='PalletWeight') + showIndent(outfile, level) + outfile.write('),\n') + if self.ShipmentDimensions is not None: + showIndent(outfile, level) + outfile.write('ShipmentDimensions=model_.Dimensions(\n') + self.ShipmentDimensions.exportLiteral(outfile, level, name_='ShipmentDimensions') + showIndent(outfile, level) + outfile.write('),\n') + if self.Comment is not None: + showIndent(outfile, level) + outfile.write('Comment=%s,\n' % quote_python(self.Comment).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('SpecialServicePayments=[\n') + level += 1 + for SpecialServicePayments_ in self.SpecialServicePayments: + showIndent(outfile, level) + outfile.write('model_.FreightSpecialServicePayment(\n') + SpecialServicePayments_.exportLiteral(outfile, level, name_='FreightSpecialServicePayment') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.HazardousMaterialsEmergencyContactNumber is not None: + showIndent(outfile, level) + outfile.write('HazardousMaterialsEmergencyContactNumber=%s,\n' % quote_python(self.HazardousMaterialsEmergencyContactNumber).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('LineItems=[\n') + level += 1 + for LineItems_ in self.LineItems: + showIndent(outfile, level) + outfile.write('model_.FreightShipmentLineItem(\n') + LineItems_.exportLiteral(outfile, level, name_='FreightShipmentLineItem') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'FedExFreightAccountNumber': + FedExFreightAccountNumber_ = child_.text + FedExFreightAccountNumber_ = self.gds_validate_string(FedExFreightAccountNumber_, node, 'FedExFreightAccountNumber') + self.FedExFreightAccountNumber = FedExFreightAccountNumber_ + elif nodeName_ == 'FedExFreightBillingContactAndAddress': + obj_ = ContactAndAddress.factory() + obj_.build(child_) + self.set_FedExFreightBillingContactAndAddress(obj_) + elif nodeName_ == 'PrintedReferences': + obj_ = PrintedReference.factory() + obj_.build(child_) + self.PrintedReferences.append(obj_) + elif nodeName_ == 'Role': + Role_ = child_.text + Role_ = self.gds_validate_string(Role_, node, 'Role') + self.Role = Role_ + self.validate_FreightShipmentRoleType(self.Role) # validate type FreightShipmentRoleType + elif nodeName_ == 'PaymentType': + PaymentType_ = child_.text + PaymentType_ = self.gds_validate_string(PaymentType_, node, 'PaymentType') + self.PaymentType = PaymentType_ + self.validate_FreightAccountPaymentType(self.PaymentType) # validate type FreightAccountPaymentType + elif nodeName_ == 'CollectTermsType': + CollectTermsType_ = child_.text + CollectTermsType_ = self.gds_validate_string(CollectTermsType_, node, 'CollectTermsType') + self.CollectTermsType = CollectTermsType_ + self.validate_FreightCollectTermsType(self.CollectTermsType) # validate type FreightCollectTermsType + elif nodeName_ == 'DeclaredValuePerUnit': + obj_ = Money.factory() + obj_.build(child_) + self.set_DeclaredValuePerUnit(obj_) + elif nodeName_ == 'DeclaredValueUnits': + DeclaredValueUnits_ = child_.text + DeclaredValueUnits_ = self.gds_validate_string(DeclaredValueUnits_, node, 'DeclaredValueUnits') + self.DeclaredValueUnits = DeclaredValueUnits_ + elif nodeName_ == 'LiabilityCoverageDetail': + obj_ = LiabilityCoverageDetail.factory() + obj_.build(child_) + self.set_LiabilityCoverageDetail(obj_) + elif nodeName_ == 'Coupons': + Coupons_ = child_.text + Coupons_ = self.gds_validate_string(Coupons_, node, 'Coupons') + self.Coupons.append(Coupons_) + elif nodeName_ == 'TotalHandlingUnits': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'TotalHandlingUnits') + self.TotalHandlingUnits = ival_ + elif nodeName_ == 'ClientDiscountPercent': + sval_ = child_.text + try: + fval_ = float(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires float or double: %s' % exp) + fval_ = self.gds_validate_float(fval_, node, 'ClientDiscountPercent') + self.ClientDiscountPercent = fval_ + elif nodeName_ == 'PalletWeight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_PalletWeight(obj_) + elif nodeName_ == 'ShipmentDimensions': + obj_ = Dimensions.factory() + obj_.build(child_) + self.set_ShipmentDimensions(obj_) + elif nodeName_ == 'Comment': + Comment_ = child_.text + Comment_ = self.gds_validate_string(Comment_, node, 'Comment') + self.Comment = Comment_ + elif nodeName_ == 'SpecialServicePayments': + obj_ = FreightSpecialServicePayment.factory() + obj_.build(child_) + self.SpecialServicePayments.append(obj_) + elif nodeName_ == 'HazardousMaterialsEmergencyContactNumber': + HazardousMaterialsEmergencyContactNumber_ = child_.text + HazardousMaterialsEmergencyContactNumber_ = self.gds_validate_string(HazardousMaterialsEmergencyContactNumber_, node, 'HazardousMaterialsEmergencyContactNumber') + self.HazardousMaterialsEmergencyContactNumber = HazardousMaterialsEmergencyContactNumber_ + elif nodeName_ == 'LineItems': + obj_ = FreightShipmentLineItem.factory() + obj_.build(child_) + self.LineItems.append(obj_) +# end class FreightShipmentDetail + + +class FreightShipmentLineItem(GeneratedsSuper): + """Description of an individual commodity or class of content in a + shipment.""" + subclass = None + superclass = None + def __init__(self, FreightClass=None, ClassProvidedByCustomer=None, HandlingUnits=None, Packaging=None, Pieces=None, NmfcCode=None, HazardousMaterials=None, BillOfLadingNumber=None, PurchaseOrderNumber=None, Description=None, Weight=None, Dimensions=None, Volume=None): + self.FreightClass = FreightClass + self.ClassProvidedByCustomer = ClassProvidedByCustomer + self.HandlingUnits = HandlingUnits + self.Packaging = Packaging + self.Pieces = Pieces + self.NmfcCode = NmfcCode + self.HazardousMaterials = HazardousMaterials + self.BillOfLadingNumber = BillOfLadingNumber + self.PurchaseOrderNumber = PurchaseOrderNumber + self.Description = Description + self.Weight = Weight + self.Dimensions = Dimensions + self.Volume = Volume + def factory(*args_, **kwargs_): + if FreightShipmentLineItem.subclass: + return FreightShipmentLineItem.subclass(*args_, **kwargs_) + else: + return FreightShipmentLineItem(*args_, **kwargs_) + factory = staticmethod(factory) + def get_FreightClass(self): return self.FreightClass + def set_FreightClass(self, FreightClass): self.FreightClass = FreightClass + def validate_FreightClassType(self, value): + # Validate type FreightClassType, a restriction on xs:string. + pass + def get_ClassProvidedByCustomer(self): return self.ClassProvidedByCustomer + def set_ClassProvidedByCustomer(self, ClassProvidedByCustomer): self.ClassProvidedByCustomer = ClassProvidedByCustomer + def get_HandlingUnits(self): return self.HandlingUnits + def set_HandlingUnits(self, HandlingUnits): self.HandlingUnits = HandlingUnits + def get_Packaging(self): return self.Packaging + def set_Packaging(self, Packaging): self.Packaging = Packaging + def validate_PhysicalPackagingType(self, value): + # Validate type PhysicalPackagingType, a restriction on xs:string. + pass + def get_Pieces(self): return self.Pieces + def set_Pieces(self, Pieces): self.Pieces = Pieces + def get_NmfcCode(self): return self.NmfcCode + def set_NmfcCode(self, NmfcCode): self.NmfcCode = NmfcCode + def get_HazardousMaterials(self): return self.HazardousMaterials + def set_HazardousMaterials(self, HazardousMaterials): self.HazardousMaterials = HazardousMaterials + def validate_HazardousCommodityOptionType(self, value): + # Validate type HazardousCommodityOptionType, a restriction on xs:string. + pass + def get_BillOfLadingNumber(self): return self.BillOfLadingNumber + def set_BillOfLadingNumber(self, BillOfLadingNumber): self.BillOfLadingNumber = BillOfLadingNumber + def get_PurchaseOrderNumber(self): return self.PurchaseOrderNumber + def set_PurchaseOrderNumber(self, PurchaseOrderNumber): self.PurchaseOrderNumber = PurchaseOrderNumber + def get_Description(self): return self.Description + def set_Description(self, Description): self.Description = Description + def get_Weight(self): return self.Weight + def set_Weight(self, Weight): self.Weight = Weight + def get_Dimensions(self): return self.Dimensions + def set_Dimensions(self, Dimensions): self.Dimensions = Dimensions + def get_Volume(self): return self.Volume + def set_Volume(self, Volume): self.Volume = Volume + def export(self, outfile, level, namespace_='ns:', name_='FreightShipmentLineItem', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='FreightShipmentLineItem') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='FreightShipmentLineItem'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='FreightShipmentLineItem', fromsubclass_=False): + if self.FreightClass is not None: + showIndent(outfile, level) + outfile.write('<%sFreightClass>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.FreightClass).encode(ExternalEncoding), input_name='FreightClass'), namespace_)) + if self.ClassProvidedByCustomer is not None: + showIndent(outfile, level) + outfile.write('<%sClassProvidedByCustomer>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.ClassProvidedByCustomer)), input_name='ClassProvidedByCustomer'), namespace_)) + if self.HandlingUnits is not None: + showIndent(outfile, level) + outfile.write('<%sHandlingUnits>%s\n' % (namespace_, self.gds_format_integer(self.HandlingUnits, input_name='HandlingUnits'), namespace_)) + if self.Packaging is not None: + showIndent(outfile, level) + outfile.write('<%sPackaging>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Packaging).encode(ExternalEncoding), input_name='Packaging'), namespace_)) + if self.Pieces is not None: + showIndent(outfile, level) + outfile.write('<%sPieces>%s\n' % (namespace_, self.gds_format_integer(self.Pieces, input_name='Pieces'), namespace_)) + if self.NmfcCode is not None: + showIndent(outfile, level) + outfile.write('<%sNmfcCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.NmfcCode).encode(ExternalEncoding), input_name='NmfcCode'), namespace_)) + if self.HazardousMaterials is not None: + showIndent(outfile, level) + outfile.write('<%sHazardousMaterials>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HazardousMaterials).encode(ExternalEncoding), input_name='HazardousMaterials'), namespace_)) + if self.BillOfLadingNumber is not None: + showIndent(outfile, level) + outfile.write('<%sBillOfLadingNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.BillOfLadingNumber).encode(ExternalEncoding), input_name='BillOfLadingNumber'), namespace_)) + if self.PurchaseOrderNumber is not None: + showIndent(outfile, level) + outfile.write('<%sPurchaseOrderNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PurchaseOrderNumber).encode(ExternalEncoding), input_name='PurchaseOrderNumber'), namespace_)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('<%sDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Description).encode(ExternalEncoding), input_name='Description'), namespace_)) + if self.Weight: + self.Weight.export(outfile, level, namespace_, name_='Weight') + if self.Dimensions: + self.Dimensions.export(outfile, level, namespace_, name_='Dimensions') + if self.Volume: + self.Volume.export(outfile, level, namespace_, name_='Volume') + def hasContent_(self): + if ( + self.FreightClass is not None or + self.ClassProvidedByCustomer is not None or + self.HandlingUnits is not None or + self.Packaging is not None or + self.Pieces is not None or + self.NmfcCode is not None or + self.HazardousMaterials is not None or + self.BillOfLadingNumber is not None or + self.PurchaseOrderNumber is not None or + self.Description is not None or + self.Weight is not None or + self.Dimensions is not None or + self.Volume is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='FreightShipmentLineItem'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.FreightClass is not None: + showIndent(outfile, level) + outfile.write('FreightClass=%s,\n' % quote_python(self.FreightClass).encode(ExternalEncoding)) + if self.ClassProvidedByCustomer is not None: + showIndent(outfile, level) + outfile.write('ClassProvidedByCustomer=%s,\n' % self.ClassProvidedByCustomer) + if self.HandlingUnits is not None: + showIndent(outfile, level) + outfile.write('HandlingUnits=%d,\n' % self.HandlingUnits) + if self.Packaging is not None: + showIndent(outfile, level) + outfile.write('Packaging=%s,\n' % quote_python(self.Packaging).encode(ExternalEncoding)) + if self.Pieces is not None: + showIndent(outfile, level) + outfile.write('Pieces=%d,\n' % self.Pieces) + if self.NmfcCode is not None: + showIndent(outfile, level) + outfile.write('NmfcCode=%s,\n' % quote_python(self.NmfcCode).encode(ExternalEncoding)) + if self.HazardousMaterials is not None: + showIndent(outfile, level) + outfile.write('HazardousMaterials=%s,\n' % quote_python(self.HazardousMaterials).encode(ExternalEncoding)) + if self.BillOfLadingNumber is not None: + showIndent(outfile, level) + outfile.write('BillOfLadingNumber=%s,\n' % quote_python(self.BillOfLadingNumber).encode(ExternalEncoding)) + if self.PurchaseOrderNumber is not None: + showIndent(outfile, level) + outfile.write('PurchaseOrderNumber=%s,\n' % quote_python(self.PurchaseOrderNumber).encode(ExternalEncoding)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('Description=%s,\n' % quote_python(self.Description).encode(ExternalEncoding)) + if self.Weight is not None: + showIndent(outfile, level) + outfile.write('Weight=model_.Weight(\n') + self.Weight.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Dimensions is not None: + showIndent(outfile, level) + outfile.write('Dimensions=model_.Dimensions(\n') + self.Dimensions.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Volume is not None: + showIndent(outfile, level) + outfile.write('Volume=model_.Volume(\n') + self.Volume.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'FreightClass': + FreightClass_ = child_.text + FreightClass_ = self.gds_validate_string(FreightClass_, node, 'FreightClass') + self.FreightClass = FreightClass_ + self.validate_FreightClassType(self.FreightClass) # validate type FreightClassType + elif nodeName_ == 'ClassProvidedByCustomer': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'ClassProvidedByCustomer') + self.ClassProvidedByCustomer = ival_ + elif nodeName_ == 'HandlingUnits': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'HandlingUnits') + self.HandlingUnits = ival_ + elif nodeName_ == 'Packaging': + Packaging_ = child_.text + Packaging_ = self.gds_validate_string(Packaging_, node, 'Packaging') + self.Packaging = Packaging_ + self.validate_PhysicalPackagingType(self.Packaging) # validate type PhysicalPackagingType + elif nodeName_ == 'Pieces': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'Pieces') + self.Pieces = ival_ + elif nodeName_ == 'NmfcCode': + NmfcCode_ = child_.text + NmfcCode_ = self.gds_validate_string(NmfcCode_, node, 'NmfcCode') + self.NmfcCode = NmfcCode_ + elif nodeName_ == 'HazardousMaterials': + HazardousMaterials_ = child_.text + HazardousMaterials_ = self.gds_validate_string(HazardousMaterials_, node, 'HazardousMaterials') + self.HazardousMaterials = HazardousMaterials_ + self.validate_HazardousCommodityOptionType(self.HazardousMaterials) # validate type HazardousCommodityOptionType + elif nodeName_ == 'BillOfLadingNumber': + BillOfLadingNumber_ = child_.text + BillOfLadingNumber_ = self.gds_validate_string(BillOfLadingNumber_, node, 'BillOfLadingNumber') + self.BillOfLadingNumber = BillOfLadingNumber_ + elif nodeName_ == 'PurchaseOrderNumber': + PurchaseOrderNumber_ = child_.text + PurchaseOrderNumber_ = self.gds_validate_string(PurchaseOrderNumber_, node, 'PurchaseOrderNumber') + self.PurchaseOrderNumber = PurchaseOrderNumber_ + elif nodeName_ == 'Description': + Description_ = child_.text + Description_ = self.gds_validate_string(Description_, node, 'Description') + self.Description = Description_ + elif nodeName_ == 'Weight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_Weight(obj_) + elif nodeName_ == 'Dimensions': + obj_ = Dimensions.factory() + obj_.build(child_) + self.set_Dimensions(obj_) + elif nodeName_ == 'Volume': + obj_ = Volume.factory() + obj_.build(child_) + self.set_Volume(obj_) +# end class FreightShipmentLineItem + + +class FreightSpecialServicePayment(GeneratedsSuper): + """Specifies which party will be responsible for payment of any + surcharges for Freight special services for which split billing + is allowed.""" + subclass = None + superclass = None + def __init__(self, SpecialService=None, PaymentType=None): + self.SpecialService = SpecialService + self.PaymentType = PaymentType + def factory(*args_, **kwargs_): + if FreightSpecialServicePayment.subclass: + return FreightSpecialServicePayment.subclass(*args_, **kwargs_) + else: + return FreightSpecialServicePayment(*args_, **kwargs_) + factory = staticmethod(factory) + def get_SpecialService(self): return self.SpecialService + def set_SpecialService(self, SpecialService): self.SpecialService = SpecialService + def validate_ShipmentSpecialServiceType(self, value): + # Validate type ShipmentSpecialServiceType, a restriction on xs:string. + pass + def get_PaymentType(self): return self.PaymentType + def set_PaymentType(self, PaymentType): self.PaymentType = PaymentType + def validate_FreightAccountPaymentType(self, value): + # Validate type FreightAccountPaymentType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='FreightSpecialServicePayment', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='FreightSpecialServicePayment') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='FreightSpecialServicePayment'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='FreightSpecialServicePayment', fromsubclass_=False): + if self.SpecialService is not None: + showIndent(outfile, level) + outfile.write('<%sSpecialService>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.SpecialService).encode(ExternalEncoding), input_name='SpecialService'), namespace_)) + if self.PaymentType is not None: + showIndent(outfile, level) + outfile.write('<%sPaymentType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PaymentType).encode(ExternalEncoding), input_name='PaymentType'), namespace_)) + def hasContent_(self): + if ( + self.SpecialService is not None or + self.PaymentType is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='FreightSpecialServicePayment'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.SpecialService is not None: + showIndent(outfile, level) + outfile.write('SpecialService=%s,\n' % quote_python(self.SpecialService).encode(ExternalEncoding)) + if self.PaymentType is not None: + showIndent(outfile, level) + outfile.write('PaymentType=%s,\n' % quote_python(self.PaymentType).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'SpecialService': + SpecialService_ = child_.text + SpecialService_ = self.gds_validate_string(SpecialService_, node, 'SpecialService') + self.SpecialService = SpecialService_ + self.validate_ShipmentSpecialServiceType(self.SpecialService) # validate type ShipmentSpecialServiceType + elif nodeName_ == 'PaymentType': + PaymentType_ = child_.text + PaymentType_ = self.gds_validate_string(PaymentType_, node, 'PaymentType') + self.PaymentType = PaymentType_ + self.validate_FreightAccountPaymentType(self.PaymentType) # validate type FreightAccountPaymentType +# end class FreightSpecialServicePayment + + +class GeneralAgencyAgreementDetail(GeneratedsSuper): + """Data required to produce a General Agency Agreement document. + Remaining content (business data) to be defined once + requirements have been completed.""" + subclass = None + superclass = None + def __init__(self, Format=None): + self.Format = Format + def factory(*args_, **kwargs_): + if GeneralAgencyAgreementDetail.subclass: + return GeneralAgencyAgreementDetail.subclass(*args_, **kwargs_) + else: + return GeneralAgencyAgreementDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Format(self): return self.Format + def set_Format(self, Format): self.Format = Format + def export(self, outfile, level, namespace_='ns:', name_='GeneralAgencyAgreementDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='GeneralAgencyAgreementDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='GeneralAgencyAgreementDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='GeneralAgencyAgreementDetail', fromsubclass_=False): + if self.Format: + self.Format.export(outfile, level, namespace_, name_='Format', ) + def hasContent_(self): + if ( + self.Format is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='GeneralAgencyAgreementDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Format is not None: + showIndent(outfile, level) + outfile.write('Format=model_.ShippingDocumentFormat(\n') + self.Format.exportLiteral(outfile, level, name_='Format') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Format': + obj_ = ShippingDocumentFormat.factory() + obj_.build(child_) + self.set_Format(obj_) +# end class GeneralAgencyAgreementDetail + + +class HazardousCommodityContent(GeneratedsSuper): + """Documents the kind and quantity of an individual hazardous commodity + in a package.""" + subclass = None + superclass = None + def __init__(self, Description=None, Quantity=None, Options=None): + self.Description = Description + self.Quantity = Quantity + self.Options = Options + def factory(*args_, **kwargs_): + if HazardousCommodityContent.subclass: + return HazardousCommodityContent.subclass(*args_, **kwargs_) + else: + return HazardousCommodityContent(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Description(self): return self.Description + def set_Description(self, Description): self.Description = Description + def get_Quantity(self): return self.Quantity + def set_Quantity(self, Quantity): self.Quantity = Quantity + def get_Options(self): return self.Options + def set_Options(self, Options): self.Options = Options + def export(self, outfile, level, namespace_='ns:', name_='HazardousCommodityContent', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='HazardousCommodityContent') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='HazardousCommodityContent'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='HazardousCommodityContent', fromsubclass_=False): + if self.Description: + self.Description.export(outfile, level, namespace_, name_='Description') + if self.Quantity: + self.Quantity.export(outfile, level, namespace_, name_='Quantity') + if self.Options: + self.Options.export(outfile, level, namespace_, name_='Options') + def hasContent_(self): + if ( + self.Description is not None or + self.Quantity is not None or + self.Options is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='HazardousCommodityContent'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Description is not None: + showIndent(outfile, level) + outfile.write('Description=model_.HazardousCommodityDescription(\n') + self.Description.exportLiteral(outfile, level, name_='Description') + showIndent(outfile, level) + outfile.write('),\n') + if self.Quantity is not None: + showIndent(outfile, level) + outfile.write('Quantity=model_.HazardousCommodityQuantityDetail(\n') + self.Quantity.exportLiteral(outfile, level, name_='Quantity') + showIndent(outfile, level) + outfile.write('),\n') + if self.Options is not None: + showIndent(outfile, level) + outfile.write('Options=model_.HazardousCommodityOptionDetail(\n') + self.Options.exportLiteral(outfile, level, name_='Options') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Description': + obj_ = HazardousCommodityDescription.factory() + obj_.build(child_) + self.set_Description(obj_) + elif nodeName_ == 'Quantity': + obj_ = HazardousCommodityQuantityDetail.factory() + obj_.build(child_) + self.set_Quantity(obj_) + elif nodeName_ == 'Options': + obj_ = HazardousCommodityOptionDetail.factory() + obj_.build(child_) + self.set_Options(obj_) +# end class HazardousCommodityContent + + +class HazardousCommodityDescription(GeneratedsSuper): + """Identifies and describes an individual hazardous commodity. For + 201001 load, this is based on data from the FedEx Ground + Hazardous Materials Shipping Guide.""" + subclass = None + superclass = None + def __init__(self, Id=None, PackingGroup=None, ProperShippingName=None, TechnicalName=None, HazardClass=None, SubsidiaryClasses=None, LabelText=None): + self.Id = Id + self.PackingGroup = PackingGroup + self.ProperShippingName = ProperShippingName + self.TechnicalName = TechnicalName + self.HazardClass = HazardClass + if SubsidiaryClasses is None: + self.SubsidiaryClasses = [] + else: + self.SubsidiaryClasses = SubsidiaryClasses + self.LabelText = LabelText + def factory(*args_, **kwargs_): + if HazardousCommodityDescription.subclass: + return HazardousCommodityDescription.subclass(*args_, **kwargs_) + else: + return HazardousCommodityDescription(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Id(self): return self.Id + def set_Id(self, Id): self.Id = Id + def get_PackingGroup(self): return self.PackingGroup + def set_PackingGroup(self, PackingGroup): self.PackingGroup = PackingGroup + def validate_HazardousCommodityPackingGroupType(self, value): + # Validate type HazardousCommodityPackingGroupType, a restriction on xs:string. + pass + def get_ProperShippingName(self): return self.ProperShippingName + def set_ProperShippingName(self, ProperShippingName): self.ProperShippingName = ProperShippingName + def get_TechnicalName(self): return self.TechnicalName + def set_TechnicalName(self, TechnicalName): self.TechnicalName = TechnicalName + def get_HazardClass(self): return self.HazardClass + def set_HazardClass(self, HazardClass): self.HazardClass = HazardClass + def get_SubsidiaryClasses(self): return self.SubsidiaryClasses + def set_SubsidiaryClasses(self, SubsidiaryClasses): self.SubsidiaryClasses = SubsidiaryClasses + def add_SubsidiaryClasses(self, value): self.SubsidiaryClasses.append(value) + def insert_SubsidiaryClasses(self, index, value): self.SubsidiaryClasses[index] = value + def get_LabelText(self): return self.LabelText + def set_LabelText(self, LabelText): self.LabelText = LabelText + def export(self, outfile, level, namespace_='ns:', name_='HazardousCommodityDescription', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='HazardousCommodityDescription') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='HazardousCommodityDescription'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='HazardousCommodityDescription', fromsubclass_=False): + if self.Id is not None: + showIndent(outfile, level) + outfile.write('<%sId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Id).encode(ExternalEncoding), input_name='Id'), namespace_)) + if self.PackingGroup is not None: + showIndent(outfile, level) + outfile.write('<%sPackingGroup>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PackingGroup).encode(ExternalEncoding), input_name='PackingGroup'), namespace_)) + if self.ProperShippingName is not None: + showIndent(outfile, level) + outfile.write('<%sProperShippingName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ProperShippingName).encode(ExternalEncoding), input_name='ProperShippingName'), namespace_)) + if self.TechnicalName is not None: + showIndent(outfile, level) + outfile.write('<%sTechnicalName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.TechnicalName).encode(ExternalEncoding), input_name='TechnicalName'), namespace_)) + if self.HazardClass is not None: + showIndent(outfile, level) + outfile.write('<%sHazardClass>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HazardClass).encode(ExternalEncoding), input_name='HazardClass'), namespace_)) + for SubsidiaryClasses_ in self.SubsidiaryClasses: + showIndent(outfile, level) + outfile.write('<%sSubsidiaryClasses>%s\n' % (namespace_, self.gds_format_string(quote_xml(SubsidiaryClasses_).encode(ExternalEncoding), input_name='SubsidiaryClasses'), namespace_)) + if self.LabelText is not None: + showIndent(outfile, level) + outfile.write('<%sLabelText>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LabelText).encode(ExternalEncoding), input_name='LabelText'), namespace_)) + def hasContent_(self): + if ( + self.Id is not None or + self.PackingGroup is not None or + self.ProperShippingName is not None or + self.TechnicalName is not None or + self.HazardClass is not None or + self.SubsidiaryClasses or + self.LabelText is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='HazardousCommodityDescription'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Id is not None: + showIndent(outfile, level) + outfile.write('Id=%s,\n' % quote_python(self.Id).encode(ExternalEncoding)) + if self.PackingGroup is not None: + showIndent(outfile, level) + outfile.write('PackingGroup=%s,\n' % quote_python(self.PackingGroup).encode(ExternalEncoding)) + if self.ProperShippingName is not None: + showIndent(outfile, level) + outfile.write('ProperShippingName=%s,\n' % quote_python(self.ProperShippingName).encode(ExternalEncoding)) + if self.TechnicalName is not None: + showIndent(outfile, level) + outfile.write('TechnicalName=%s,\n' % quote_python(self.TechnicalName).encode(ExternalEncoding)) + if self.HazardClass is not None: + showIndent(outfile, level) + outfile.write('HazardClass=%s,\n' % quote_python(self.HazardClass).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('SubsidiaryClasses=[\n') + level += 1 + for SubsidiaryClasses_ in self.SubsidiaryClasses: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(SubsidiaryClasses_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.LabelText is not None: + showIndent(outfile, level) + outfile.write('LabelText=%s,\n' % quote_python(self.LabelText).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Id': + Id_ = child_.text + Id_ = self.gds_validate_string(Id_, node, 'Id') + self.Id = Id_ + elif nodeName_ == 'PackingGroup': + PackingGroup_ = child_.text + PackingGroup_ = self.gds_validate_string(PackingGroup_, node, 'PackingGroup') + self.PackingGroup = PackingGroup_ + self.validate_HazardousCommodityPackingGroupType(self.PackingGroup) # validate type HazardousCommodityPackingGroupType + elif nodeName_ == 'ProperShippingName': + ProperShippingName_ = child_.text + ProperShippingName_ = self.gds_validate_string(ProperShippingName_, node, 'ProperShippingName') + self.ProperShippingName = ProperShippingName_ + elif nodeName_ == 'TechnicalName': + TechnicalName_ = child_.text + TechnicalName_ = self.gds_validate_string(TechnicalName_, node, 'TechnicalName') + self.TechnicalName = TechnicalName_ + elif nodeName_ == 'HazardClass': + HazardClass_ = child_.text + HazardClass_ = self.gds_validate_string(HazardClass_, node, 'HazardClass') + self.HazardClass = HazardClass_ + elif nodeName_ == 'SubsidiaryClasses': + SubsidiaryClasses_ = child_.text + SubsidiaryClasses_ = self.gds_validate_string(SubsidiaryClasses_, node, 'SubsidiaryClasses') + self.SubsidiaryClasses.append(SubsidiaryClasses_) + elif nodeName_ == 'LabelText': + LabelText_ = child_.text + LabelText_ = self.gds_validate_string(LabelText_, node, 'LabelText') + self.LabelText = LabelText_ +# end class HazardousCommodityDescription + + +class HazardousCommodityOptionDetail(GeneratedsSuper): + """Customer-provided specifications for handling individual + commodities.""" + subclass = None + superclass = None + def __init__(self, LabelTextOption=None, CustomerSuppliedLabelText=None): + self.LabelTextOption = LabelTextOption + self.CustomerSuppliedLabelText = CustomerSuppliedLabelText + def factory(*args_, **kwargs_): + if HazardousCommodityOptionDetail.subclass: + return HazardousCommodityOptionDetail.subclass(*args_, **kwargs_) + else: + return HazardousCommodityOptionDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_LabelTextOption(self): return self.LabelTextOption + def set_LabelTextOption(self, LabelTextOption): self.LabelTextOption = LabelTextOption + def validate_HazardousCommodityLabelTextOptionType(self, value): + # Validate type HazardousCommodityLabelTextOptionType, a restriction on xs:string. + pass + def get_CustomerSuppliedLabelText(self): return self.CustomerSuppliedLabelText + def set_CustomerSuppliedLabelText(self, CustomerSuppliedLabelText): self.CustomerSuppliedLabelText = CustomerSuppliedLabelText + def export(self, outfile, level, namespace_='ns:', name_='HazardousCommodityOptionDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='HazardousCommodityOptionDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='HazardousCommodityOptionDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='HazardousCommodityOptionDetail', fromsubclass_=False): + if self.LabelTextOption is not None: + showIndent(outfile, level) + outfile.write('<%sLabelTextOption>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LabelTextOption).encode(ExternalEncoding), input_name='LabelTextOption'), namespace_)) + if self.CustomerSuppliedLabelText is not None: + showIndent(outfile, level) + outfile.write('<%sCustomerSuppliedLabelText>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CustomerSuppliedLabelText).encode(ExternalEncoding), input_name='CustomerSuppliedLabelText'), namespace_)) + def hasContent_(self): + if ( + self.LabelTextOption is not None or + self.CustomerSuppliedLabelText is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='HazardousCommodityOptionDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.LabelTextOption is not None: + showIndent(outfile, level) + outfile.write('LabelTextOption=%s,\n' % quote_python(self.LabelTextOption).encode(ExternalEncoding)) + if self.CustomerSuppliedLabelText is not None: + showIndent(outfile, level) + outfile.write('CustomerSuppliedLabelText=%s,\n' % quote_python(self.CustomerSuppliedLabelText).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'LabelTextOption': + LabelTextOption_ = child_.text + LabelTextOption_ = self.gds_validate_string(LabelTextOption_, node, 'LabelTextOption') + self.LabelTextOption = LabelTextOption_ + self.validate_HazardousCommodityLabelTextOptionType(self.LabelTextOption) # validate type HazardousCommodityLabelTextOptionType + elif nodeName_ == 'CustomerSuppliedLabelText': + CustomerSuppliedLabelText_ = child_.text + CustomerSuppliedLabelText_ = self.gds_validate_string(CustomerSuppliedLabelText_, node, 'CustomerSuppliedLabelText') + self.CustomerSuppliedLabelText = CustomerSuppliedLabelText_ +# end class HazardousCommodityOptionDetail + + +class HazardousCommodityPackagingDetail(GeneratedsSuper): + """Identifies number and type of packaging units for hazardous + commodities.""" + subclass = None + superclass = None + def __init__(self, Count=None, Units=None): + self.Count = Count + self.Units = Units + def factory(*args_, **kwargs_): + if HazardousCommodityPackagingDetail.subclass: + return HazardousCommodityPackagingDetail.subclass(*args_, **kwargs_) + else: + return HazardousCommodityPackagingDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Count(self): return self.Count + def set_Count(self, Count): self.Count = Count + def get_Units(self): return self.Units + def set_Units(self, Units): self.Units = Units + def export(self, outfile, level, namespace_='ns:', name_='HazardousCommodityPackagingDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='HazardousCommodityPackagingDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='HazardousCommodityPackagingDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='HazardousCommodityPackagingDetail', fromsubclass_=False): + if self.Count is not None: + showIndent(outfile, level) + outfile.write('<%sCount>%s\n' % (namespace_, self.gds_format_integer(self.Count, input_name='Count'), namespace_)) + if self.Units is not None: + showIndent(outfile, level) + outfile.write('<%sUnits>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Units).encode(ExternalEncoding), input_name='Units'), namespace_)) + def hasContent_(self): + if ( + self.Count is not None or + self.Units is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='HazardousCommodityPackagingDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Count is not None: + showIndent(outfile, level) + outfile.write('Count=%d,\n' % self.Count) + if self.Units is not None: + showIndent(outfile, level) + outfile.write('Units=%s,\n' % quote_python(self.Units).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Count': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'Count') + self.Count = ival_ + elif nodeName_ == 'Units': + Units_ = child_.text + Units_ = self.gds_validate_string(Units_, node, 'Units') + self.Units = Units_ +# end class HazardousCommodityPackagingDetail + + +class HazardousCommodityQuantityDetail(GeneratedsSuper): + """Identifies amount and units for quantity of hazardous commodities.""" + subclass = None + superclass = None + def __init__(self, Amount=None, Units=None): + self.Amount = Amount + self.Units = Units + def factory(*args_, **kwargs_): + if HazardousCommodityQuantityDetail.subclass: + return HazardousCommodityQuantityDetail.subclass(*args_, **kwargs_) + else: + return HazardousCommodityQuantityDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Amount(self): return self.Amount + def set_Amount(self, Amount): self.Amount = Amount + def get_Units(self): return self.Units + def set_Units(self, Units): self.Units = Units + def export(self, outfile, level, namespace_='ns:', name_='HazardousCommodityQuantityDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='HazardousCommodityQuantityDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='HazardousCommodityQuantityDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='HazardousCommodityQuantityDetail', fromsubclass_=False): + if self.Amount is not None: + showIndent(outfile, level) + outfile.write('<%sAmount>%s\n' % (namespace_, self.gds_format_float(self.Amount, input_name='Amount'), namespace_)) + if self.Units is not None: + showIndent(outfile, level) + outfile.write('<%sUnits>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Units).encode(ExternalEncoding), input_name='Units'), namespace_)) + def hasContent_(self): + if ( + self.Amount is not None or + self.Units is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='HazardousCommodityQuantityDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Amount is not None: + showIndent(outfile, level) + outfile.write('Amount=%f,\n' % self.Amount) + if self.Units is not None: + showIndent(outfile, level) + outfile.write('Units=%s,\n' % quote_python(self.Units).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Amount': + sval_ = child_.text + try: + fval_ = float(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires float or double: %s' % exp) + fval_ = self.gds_validate_float(fval_, node, 'Amount') + self.Amount = fval_ + elif nodeName_ == 'Units': + Units_ = child_.text + Units_ = self.gds_validate_string(Units_, node, 'Units') + self.Units = Units_ +# end class HazardousCommodityQuantityDetail + + +class HoldAtLocationDetail(GeneratedsSuper): + """Descriptive data required for a FedEx shipment that is to be held at + the destination FedEx location for pickup by the recipient.""" + subclass = None + superclass = None + def __init__(self, PhoneNumber=None, LocationContactAndAddress=None, LocationType=None): + self.PhoneNumber = PhoneNumber + self.LocationContactAndAddress = LocationContactAndAddress + self.LocationType = LocationType + def factory(*args_, **kwargs_): + if HoldAtLocationDetail.subclass: + return HoldAtLocationDetail.subclass(*args_, **kwargs_) + else: + return HoldAtLocationDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_PhoneNumber(self): return self.PhoneNumber + def set_PhoneNumber(self, PhoneNumber): self.PhoneNumber = PhoneNumber + def get_LocationContactAndAddress(self): return self.LocationContactAndAddress + def set_LocationContactAndAddress(self, LocationContactAndAddress): self.LocationContactAndAddress = LocationContactAndAddress + def get_LocationType(self): return self.LocationType + def set_LocationType(self, LocationType): self.LocationType = LocationType + def validate_FedExLocationType(self, value): + # Validate type FedExLocationType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='HoldAtLocationDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='HoldAtLocationDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='HoldAtLocationDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='HoldAtLocationDetail', fromsubclass_=False): + if self.PhoneNumber is not None: + showIndent(outfile, level) + outfile.write('<%sPhoneNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PhoneNumber).encode(ExternalEncoding), input_name='PhoneNumber'), namespace_)) + if self.LocationContactAndAddress: + self.LocationContactAndAddress.export(outfile, level, namespace_, name_='LocationContactAndAddress') + if self.LocationType is not None: + showIndent(outfile, level) + outfile.write('<%sLocationType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LocationType).encode(ExternalEncoding), input_name='LocationType'), namespace_)) + def hasContent_(self): + if ( + self.PhoneNumber is not None or + self.LocationContactAndAddress is not None or + self.LocationType is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='HoldAtLocationDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.PhoneNumber is not None: + showIndent(outfile, level) + outfile.write('PhoneNumber=%s,\n' % quote_python(self.PhoneNumber).encode(ExternalEncoding)) + if self.LocationContactAndAddress is not None: + showIndent(outfile, level) + outfile.write('LocationContactAndAddress=model_.ContactAndAddress(\n') + self.LocationContactAndAddress.exportLiteral(outfile, level, name_='LocationContactAndAddress') + showIndent(outfile, level) + outfile.write('),\n') + if self.LocationType is not None: + showIndent(outfile, level) + outfile.write('LocationType=%s,\n' % quote_python(self.LocationType).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'PhoneNumber': + PhoneNumber_ = child_.text + PhoneNumber_ = self.gds_validate_string(PhoneNumber_, node, 'PhoneNumber') + self.PhoneNumber = PhoneNumber_ + elif nodeName_ == 'LocationContactAndAddress': + obj_ = ContactAndAddress.factory() + obj_.build(child_) + self.set_LocationContactAndAddress(obj_) + elif nodeName_ == 'LocationType': + LocationType_ = child_.text + LocationType_ = self.gds_validate_string(LocationType_, node, 'LocationType') + self.LocationType = LocationType_ + self.validate_FedExLocationType(self.LocationType) # validate type FedExLocationType +# end class HoldAtLocationDetail + + +class HomeDeliveryPremiumDetail(GeneratedsSuper): + """The descriptive data required by FedEx for home delivery services.""" + subclass = None + superclass = None + def __init__(self, HomeDeliveryPremiumType=None, Date=None, PhoneNumber=None): + self.HomeDeliveryPremiumType = HomeDeliveryPremiumType + self.Date = Date + self.PhoneNumber = PhoneNumber + def factory(*args_, **kwargs_): + if HomeDeliveryPremiumDetail.subclass: + return HomeDeliveryPremiumDetail.subclass(*args_, **kwargs_) + else: + return HomeDeliveryPremiumDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_HomeDeliveryPremiumType(self): return self.HomeDeliveryPremiumType + def set_HomeDeliveryPremiumType(self, HomeDeliveryPremiumType): self.HomeDeliveryPremiumType = HomeDeliveryPremiumType + def validate_HomeDeliveryPremiumType(self, value): + # Validate type HomeDeliveryPremiumType, a restriction on xs:string. + pass + def get_Date(self): return self.Date + def set_Date(self, Date): self.Date = Date + def get_PhoneNumber(self): return self.PhoneNumber + def set_PhoneNumber(self, PhoneNumber): self.PhoneNumber = PhoneNumber + def export(self, outfile, level, namespace_='ns:', name_='HomeDeliveryPremiumDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='HomeDeliveryPremiumDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='HomeDeliveryPremiumDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='HomeDeliveryPremiumDetail', fromsubclass_=False): + if self.HomeDeliveryPremiumType is not None: + showIndent(outfile, level) + outfile.write('<%sHomeDeliveryPremiumType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HomeDeliveryPremiumType).encode(ExternalEncoding), input_name='HomeDeliveryPremiumType'), namespace_)) + if self.Date is not None: + showIndent(outfile, level) + outfile.write('<%sDate>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Date).encode(ExternalEncoding), input_name='Date'), namespace_)) + if self.PhoneNumber is not None: + showIndent(outfile, level) + outfile.write('<%sPhoneNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PhoneNumber).encode(ExternalEncoding), input_name='PhoneNumber'), namespace_)) + def hasContent_(self): + if ( + self.HomeDeliveryPremiumType is not None or + self.Date is not None or + self.PhoneNumber is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='HomeDeliveryPremiumDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.HomeDeliveryPremiumType is not None: + showIndent(outfile, level) + outfile.write('HomeDeliveryPremiumType=%s,\n' % quote_python(self.HomeDeliveryPremiumType).encode(ExternalEncoding)) + if self.Date is not None: + showIndent(outfile, level) + outfile.write('Date=%s,\n' % quote_python(self.Date).encode(ExternalEncoding)) + if self.PhoneNumber is not None: + showIndent(outfile, level) + outfile.write('PhoneNumber=%s,\n' % quote_python(self.PhoneNumber).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'HomeDeliveryPremiumType': + HomeDeliveryPremiumType_ = child_.text + HomeDeliveryPremiumType_ = self.gds_validate_string(HomeDeliveryPremiumType_, node, 'HomeDeliveryPremiumType') + self.HomeDeliveryPremiumType = HomeDeliveryPremiumType_ + self.validate_HomeDeliveryPremiumType(self.HomeDeliveryPremiumType) # validate type HomeDeliveryPremiumType + elif nodeName_ == 'Date': + Date_ = child_.text + Date_ = self.gds_validate_string(Date_, node, 'Date') + self.Date = Date_ + elif nodeName_ == 'PhoneNumber': + PhoneNumber_ = child_.text + PhoneNumber_ = self.gds_validate_string(PhoneNumber_, node, 'PhoneNumber') + self.PhoneNumber = PhoneNumber_ +# end class HomeDeliveryPremiumDetail + + +class LabelSpecification(GeneratedsSuper): + """Description of shipping label to be returned in the reply""" + subclass = None + superclass = None + def __init__(self, Dispositions=None, LabelFormatType=None, ImageType=None, LabelStockType=None, LabelPrintingOrientation=None, PrintedLabelOrigin=None, CustomerSpecifiedDetail=None): + if Dispositions is None: + self.Dispositions = [] + else: + self.Dispositions = Dispositions + self.LabelFormatType = LabelFormatType + self.ImageType = ImageType + self.LabelStockType = LabelStockType + self.LabelPrintingOrientation = LabelPrintingOrientation + self.PrintedLabelOrigin = PrintedLabelOrigin + self.CustomerSpecifiedDetail = CustomerSpecifiedDetail + def factory(*args_, **kwargs_): + if LabelSpecification.subclass: + return LabelSpecification.subclass(*args_, **kwargs_) + else: + return LabelSpecification(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Dispositions(self): return self.Dispositions + def set_Dispositions(self, Dispositions): self.Dispositions = Dispositions + def add_Dispositions(self, value): self.Dispositions.append(value) + def insert_Dispositions(self, index, value): self.Dispositions[index] = value + def get_LabelFormatType(self): return self.LabelFormatType + def set_LabelFormatType(self, LabelFormatType): self.LabelFormatType = LabelFormatType + def validate_LabelFormatType(self, value): + # Validate type LabelFormatType, a restriction on xs:string. + pass + def get_ImageType(self): return self.ImageType + def set_ImageType(self, ImageType): self.ImageType = ImageType + def validate_ShippingDocumentImageType(self, value): + # Validate type ShippingDocumentImageType, a restriction on xs:string. + pass + def get_LabelStockType(self): return self.LabelStockType + def set_LabelStockType(self, LabelStockType): self.LabelStockType = LabelStockType + def validate_LabelStockType(self, value): + # Validate type LabelStockType, a restriction on xs:string. + pass + def get_LabelPrintingOrientation(self): return self.LabelPrintingOrientation + def set_LabelPrintingOrientation(self, LabelPrintingOrientation): self.LabelPrintingOrientation = LabelPrintingOrientation + def validate_LabelPrintingOrientationType(self, value): + # Validate type LabelPrintingOrientationType, a restriction on xs:string. + pass + def get_PrintedLabelOrigin(self): return self.PrintedLabelOrigin + def set_PrintedLabelOrigin(self, PrintedLabelOrigin): self.PrintedLabelOrigin = PrintedLabelOrigin + def get_CustomerSpecifiedDetail(self): return self.CustomerSpecifiedDetail + def set_CustomerSpecifiedDetail(self, CustomerSpecifiedDetail): self.CustomerSpecifiedDetail = CustomerSpecifiedDetail + def export(self, outfile, level, namespace_='ns:', name_='LabelSpecification', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='LabelSpecification') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='LabelSpecification'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='LabelSpecification', fromsubclass_=False): + for Dispositions_ in self.Dispositions: + Dispositions_.export(outfile, level, namespace_, name_='Dispositions') + if self.LabelFormatType is not None: + showIndent(outfile, level) + outfile.write('<%sLabelFormatType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LabelFormatType).encode(ExternalEncoding), input_name='LabelFormatType'), namespace_)) + if self.ImageType is not None: + showIndent(outfile, level) + outfile.write('<%sImageType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ImageType).encode(ExternalEncoding), input_name='ImageType'), namespace_)) + if self.LabelStockType is not None: + showIndent(outfile, level) + outfile.write('<%sLabelStockType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LabelStockType).encode(ExternalEncoding), input_name='LabelStockType'), namespace_)) + if self.LabelPrintingOrientation is not None: + showIndent(outfile, level) + outfile.write('<%sLabelPrintingOrientation>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LabelPrintingOrientation).encode(ExternalEncoding), input_name='LabelPrintingOrientation'), namespace_)) + if self.PrintedLabelOrigin: + self.PrintedLabelOrigin.export(outfile, level, namespace_, name_='PrintedLabelOrigin') + if self.CustomerSpecifiedDetail: + self.CustomerSpecifiedDetail.export(outfile, level, namespace_, name_='CustomerSpecifiedDetail') + def hasContent_(self): + if ( + self.Dispositions or + self.LabelFormatType is not None or + self.ImageType is not None or + self.LabelStockType is not None or + self.LabelPrintingOrientation is not None or + self.PrintedLabelOrigin is not None or + self.CustomerSpecifiedDetail is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='LabelSpecification'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('Dispositions=[\n') + level += 1 + for Dispositions_ in self.Dispositions: + showIndent(outfile, level) + outfile.write('model_.ShippingDocumentDispositionDetail(\n') + Dispositions_.exportLiteral(outfile, level, name_='ShippingDocumentDispositionDetail') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.LabelFormatType is not None: + showIndent(outfile, level) + outfile.write('LabelFormatType=%s,\n' % quote_python(self.LabelFormatType).encode(ExternalEncoding)) + if self.ImageType is not None: + showIndent(outfile, level) + outfile.write('ImageType=%s,\n' % quote_python(self.ImageType).encode(ExternalEncoding)) + if self.LabelStockType is not None: + showIndent(outfile, level) + outfile.write('LabelStockType=%s,\n' % quote_python(self.LabelStockType).encode(ExternalEncoding)) + if self.LabelPrintingOrientation is not None: + showIndent(outfile, level) + outfile.write('LabelPrintingOrientation=%s,\n' % quote_python(self.LabelPrintingOrientation).encode(ExternalEncoding)) + if self.PrintedLabelOrigin is not None: + showIndent(outfile, level) + outfile.write('PrintedLabelOrigin=model_.ContactAndAddress(\n') + self.PrintedLabelOrigin.exportLiteral(outfile, level, name_='PrintedLabelOrigin') + showIndent(outfile, level) + outfile.write('),\n') + if self.CustomerSpecifiedDetail is not None: + showIndent(outfile, level) + outfile.write('CustomerSpecifiedDetail=model_.CustomerSpecifiedLabelDetail(\n') + self.CustomerSpecifiedDetail.exportLiteral(outfile, level, name_='CustomerSpecifiedDetail') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Dispositions': + obj_ = ShippingDocumentDispositionDetail.factory() + obj_.build(child_) + self.Dispositions.append(obj_) + elif nodeName_ == 'LabelFormatType': + LabelFormatType_ = child_.text + LabelFormatType_ = self.gds_validate_string(LabelFormatType_, node, 'LabelFormatType') + self.LabelFormatType = LabelFormatType_ + self.validate_LabelFormatType(self.LabelFormatType) # validate type LabelFormatType + elif nodeName_ == 'ImageType': + ImageType_ = child_.text + ImageType_ = self.gds_validate_string(ImageType_, node, 'ImageType') + self.ImageType = ImageType_ + self.validate_ShippingDocumentImageType(self.ImageType) # validate type ShippingDocumentImageType + elif nodeName_ == 'LabelStockType': + LabelStockType_ = child_.text + LabelStockType_ = self.gds_validate_string(LabelStockType_, node, 'LabelStockType') + self.LabelStockType = LabelStockType_ + self.validate_LabelStockType(self.LabelStockType) # validate type LabelStockType + elif nodeName_ == 'LabelPrintingOrientation': + LabelPrintingOrientation_ = child_.text + LabelPrintingOrientation_ = self.gds_validate_string(LabelPrintingOrientation_, node, 'LabelPrintingOrientation') + self.LabelPrintingOrientation = LabelPrintingOrientation_ + self.validate_LabelPrintingOrientationType(self.LabelPrintingOrientation) # validate type LabelPrintingOrientationType + elif nodeName_ == 'PrintedLabelOrigin': + obj_ = ContactAndAddress.factory() + obj_.build(child_) + self.set_PrintedLabelOrigin(obj_) + elif nodeName_ == 'CustomerSpecifiedDetail': + obj_ = CustomerSpecifiedLabelDetail.factory() + obj_.build(child_) + self.set_CustomerSpecifiedDetail(obj_) +# end class LabelSpecification + + +class LiabilityCoverageDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, CoverageType=None, CoverageAmount=None): + self.CoverageType = CoverageType + self.CoverageAmount = CoverageAmount + def factory(*args_, **kwargs_): + if LiabilityCoverageDetail.subclass: + return LiabilityCoverageDetail.subclass(*args_, **kwargs_) + else: + return LiabilityCoverageDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_CoverageType(self): return self.CoverageType + def set_CoverageType(self, CoverageType): self.CoverageType = CoverageType + def validate_LiabilityCoverageType(self, value): + # Validate type LiabilityCoverageType, a restriction on xs:string. + pass + def get_CoverageAmount(self): return self.CoverageAmount + def set_CoverageAmount(self, CoverageAmount): self.CoverageAmount = CoverageAmount + def export(self, outfile, level, namespace_='ns:', name_='LiabilityCoverageDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='LiabilityCoverageDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='LiabilityCoverageDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='LiabilityCoverageDetail', fromsubclass_=False): + if self.CoverageType is not None: + showIndent(outfile, level) + outfile.write('<%sCoverageType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CoverageType).encode(ExternalEncoding), input_name='CoverageType'), namespace_)) + if self.CoverageAmount: + self.CoverageAmount.export(outfile, level, namespace_, name_='CoverageAmount') + def hasContent_(self): + if ( + self.CoverageType is not None or + self.CoverageAmount is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='LiabilityCoverageDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.CoverageType is not None: + showIndent(outfile, level) + outfile.write('CoverageType=%s,\n' % quote_python(self.CoverageType).encode(ExternalEncoding)) + if self.CoverageAmount is not None: + showIndent(outfile, level) + outfile.write('CoverageAmount=model_.Money(\n') + self.CoverageAmount.exportLiteral(outfile, level, name_='CoverageAmount') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'CoverageType': + CoverageType_ = child_.text + CoverageType_ = self.gds_validate_string(CoverageType_, node, 'CoverageType') + self.CoverageType = CoverageType_ + self.validate_LiabilityCoverageType(self.CoverageType) # validate type LiabilityCoverageType + elif nodeName_ == 'CoverageAmount': + obj_ = Money.factory() + obj_.build(child_) + self.set_CoverageAmount(obj_) +# end class LiabilityCoverageDetail + + +class LinearMeasure(GeneratedsSuper): + """Represents a one-dimensional measurement in small units (e.g. + suitable for measuring a package or document), contrasted with + Distance, which represents a large one-dimensional measurement + (e.g. distance between cities).""" + subclass = None + superclass = None + def __init__(self, Value=None, Units=None): + self.Value = Value + self.Units = Units + def factory(*args_, **kwargs_): + if LinearMeasure.subclass: + return LinearMeasure.subclass(*args_, **kwargs_) + else: + return LinearMeasure(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Value(self): return self.Value + def set_Value(self, Value): self.Value = Value + def get_Units(self): return self.Units + def set_Units(self, Units): self.Units = Units + def validate_LinearUnits(self, value): + # Validate type LinearUnits, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='LinearMeasure', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='LinearMeasure') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='LinearMeasure'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='LinearMeasure', fromsubclass_=False): + if self.Value is not None: + showIndent(outfile, level) + outfile.write('<%sValue>%s\n' % (namespace_, self.gds_format_float(self.Value, input_name='Value'), namespace_)) + if self.Units is not None: + showIndent(outfile, level) + outfile.write('<%sUnits>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Units).encode(ExternalEncoding), input_name='Units'), namespace_)) + def hasContent_(self): + if ( + self.Value is not None or + self.Units is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='LinearMeasure'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Value is not None: + showIndent(outfile, level) + outfile.write('Value=%f,\n' % self.Value) + if self.Units is not None: + showIndent(outfile, level) + outfile.write('Units=%s,\n' % quote_python(self.Units).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Value': + sval_ = child_.text + try: + fval_ = float(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires float or double: %s' % exp) + fval_ = self.gds_validate_float(fval_, node, 'Value') + self.Value = fval_ + elif nodeName_ == 'Units': + Units_ = child_.text + Units_ = self.gds_validate_string(Units_, node, 'Units') + self.Units = Units_ + self.validate_LinearUnits(self.Units) # validate type LinearUnits +# end class LinearMeasure + + +class Localization(GeneratedsSuper): + """Identifies the representation of human-readable text.""" + subclass = None + superclass = None + def __init__(self, LanguageCode=None, LocaleCode=None): + self.LanguageCode = LanguageCode + self.LocaleCode = LocaleCode + def factory(*args_, **kwargs_): + if Localization.subclass: + return Localization.subclass(*args_, **kwargs_) + else: + return Localization(*args_, **kwargs_) + factory = staticmethod(factory) + def get_LanguageCode(self): return self.LanguageCode + def set_LanguageCode(self, LanguageCode): self.LanguageCode = LanguageCode + def get_LocaleCode(self): return self.LocaleCode + def set_LocaleCode(self, LocaleCode): self.LocaleCode = LocaleCode + def export(self, outfile, level, namespace_='ns:', name_='Localization', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Localization') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Localization'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Localization', fromsubclass_=False): + if self.LanguageCode is not None: + showIndent(outfile, level) + outfile.write('<%sLanguageCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LanguageCode).encode(ExternalEncoding), input_name='LanguageCode'), namespace_)) + if self.LocaleCode is not None: + showIndent(outfile, level) + outfile.write('<%sLocaleCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LocaleCode).encode(ExternalEncoding), input_name='LocaleCode'), namespace_)) + def hasContent_(self): + if ( + self.LanguageCode is not None or + self.LocaleCode is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Localization'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.LanguageCode is not None: + showIndent(outfile, level) + outfile.write('LanguageCode=%s,\n' % quote_python(self.LanguageCode).encode(ExternalEncoding)) + if self.LocaleCode is not None: + showIndent(outfile, level) + outfile.write('LocaleCode=%s,\n' % quote_python(self.LocaleCode).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'LanguageCode': + LanguageCode_ = child_.text + LanguageCode_ = self.gds_validate_string(LanguageCode_, node, 'LanguageCode') + self.LanguageCode = LanguageCode_ + elif nodeName_ == 'LocaleCode': + LocaleCode_ = child_.text + LocaleCode_ = self.gds_validate_string(LocaleCode_, node, 'LocaleCode') + self.LocaleCode = LocaleCode_ +# end class Localization + + +class Measure(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Quantity=None, Units=None): + self.Quantity = Quantity + self.Units = Units + def factory(*args_, **kwargs_): + if Measure.subclass: + return Measure.subclass(*args_, **kwargs_) + else: + return Measure(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Quantity(self): return self.Quantity + def set_Quantity(self, Quantity): self.Quantity = Quantity + def get_Units(self): return self.Units + def set_Units(self, Units): self.Units = Units + def export(self, outfile, level, namespace_='ns:', name_='Measure', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Measure') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Measure'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Measure', fromsubclass_=False): + if self.Quantity is not None: + showIndent(outfile, level) + outfile.write('<%sQuantity>%s\n' % (namespace_, self.gds_format_float(self.Quantity, input_name='Quantity'), namespace_)) + if self.Units is not None: + showIndent(outfile, level) + outfile.write('<%sUnits>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Units).encode(ExternalEncoding), input_name='Units'), namespace_)) + def hasContent_(self): + if ( + self.Quantity is not None or + self.Units is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Measure'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Quantity is not None: + showIndent(outfile, level) + outfile.write('Quantity=%f,\n' % self.Quantity) + if self.Units is not None: + showIndent(outfile, level) + outfile.write('Units=%s,\n' % quote_python(self.Units).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Quantity': + sval_ = child_.text + try: + fval_ = float(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires float or double: %s' % exp) + fval_ = self.gds_validate_float(fval_, node, 'Quantity') + self.Quantity = fval_ + elif nodeName_ == 'Units': + Units_ = child_.text + Units_ = self.gds_validate_string(Units_, node, 'Units') + self.Units = Units_ +# end class Measure + + +class Money(GeneratedsSuper): + """The descriptive data for the medium of exchange for FedEx services.""" + subclass = None + superclass = None + def __init__(self, Currency=None, Amount=None): + self.Currency = Currency + self.Amount = Amount + def factory(*args_, **kwargs_): + if Money.subclass: + return Money.subclass(*args_, **kwargs_) + else: + return Money(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Currency(self): return self.Currency + def set_Currency(self, Currency): self.Currency = Currency + def get_Amount(self): return self.Amount + def set_Amount(self, Amount): self.Amount = Amount + def export(self, outfile, level, namespace_='ns:', name_='Money', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Money') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Money'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Money', fromsubclass_=False): + if self.Currency is not None: + showIndent(outfile, level) + outfile.write('<%sCurrency>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Currency).encode(ExternalEncoding), input_name='Currency'), namespace_)) + if self.Amount is not None: + showIndent(outfile, level) + outfile.write('<%sAmount>%s\n' % (namespace_, self.gds_format_float(self.Amount, input_name='Amount'), namespace_)) + def hasContent_(self): + if ( + self.Currency is not None or + self.Amount is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Money'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Currency is not None: + showIndent(outfile, level) + outfile.write('Currency=%s,\n' % quote_python(self.Currency).encode(ExternalEncoding)) + if self.Amount is not None: + showIndent(outfile, level) + outfile.write('Amount=%f,\n' % self.Amount) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Currency': + Currency_ = child_.text + Currency_ = self.gds_validate_string(Currency_, node, 'Currency') + self.Currency = Currency_ + elif nodeName_ == 'Amount': + sval_ = child_.text + try: + fval_ = float(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires float or double: %s' % exp) + fval_ = self.gds_validate_float(fval_, node, 'Amount') + self.Amount = fval_ +# end class Money + + +class NaftaCertificateOfOriginDetail(GeneratedsSuper): + """Data required to produce a Certificate of Origin document. Remaining + content (business data) to be defined once requirements have + been completed.""" + subclass = None + superclass = None + def __init__(self, Format=None, BlanketPeriod=None, ImporterSpecification=None, SignatureContact=None, ProducerSpecification=None, Producers=None, CustomerImageUsages=None): + self.Format = Format + self.BlanketPeriod = BlanketPeriod + self.ImporterSpecification = ImporterSpecification + self.SignatureContact = SignatureContact + self.ProducerSpecification = ProducerSpecification + if Producers is None: + self.Producers = [] + else: + self.Producers = Producers + if CustomerImageUsages is None: + self.CustomerImageUsages = [] + else: + self.CustomerImageUsages = CustomerImageUsages + def factory(*args_, **kwargs_): + if NaftaCertificateOfOriginDetail.subclass: + return NaftaCertificateOfOriginDetail.subclass(*args_, **kwargs_) + else: + return NaftaCertificateOfOriginDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Format(self): return self.Format + def set_Format(self, Format): self.Format = Format + def get_BlanketPeriod(self): return self.BlanketPeriod + def set_BlanketPeriod(self, BlanketPeriod): self.BlanketPeriod = BlanketPeriod + def get_ImporterSpecification(self): return self.ImporterSpecification + def set_ImporterSpecification(self, ImporterSpecification): self.ImporterSpecification = ImporterSpecification + def validate_NaftaImporterSpecificationType(self, value): + # Validate type NaftaImporterSpecificationType, a restriction on xs:string. + pass + def get_SignatureContact(self): return self.SignatureContact + def set_SignatureContact(self, SignatureContact): self.SignatureContact = SignatureContact + def get_ProducerSpecification(self): return self.ProducerSpecification + def set_ProducerSpecification(self, ProducerSpecification): self.ProducerSpecification = ProducerSpecification + def validate_NaftaProducerSpecificationType(self, value): + # Validate type NaftaProducerSpecificationType, a restriction on xs:string. + pass + def get_Producers(self): return self.Producers + def set_Producers(self, Producers): self.Producers = Producers + def add_Producers(self, value): self.Producers.append(value) + def insert_Producers(self, index, value): self.Producers[index] = value + def get_CustomerImageUsages(self): return self.CustomerImageUsages + def set_CustomerImageUsages(self, CustomerImageUsages): self.CustomerImageUsages = CustomerImageUsages + def add_CustomerImageUsages(self, value): self.CustomerImageUsages.append(value) + def insert_CustomerImageUsages(self, index, value): self.CustomerImageUsages[index] = value + def export(self, outfile, level, namespace_='ns:', name_='NaftaCertificateOfOriginDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='NaftaCertificateOfOriginDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='NaftaCertificateOfOriginDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='NaftaCertificateOfOriginDetail', fromsubclass_=False): + if self.Format: + self.Format.export(outfile, level, namespace_, name_='Format') + if self.BlanketPeriod: + self.BlanketPeriod.export(outfile, level, namespace_, name_='BlanketPeriod') + if self.ImporterSpecification is not None: + showIndent(outfile, level) + outfile.write('<%sImporterSpecification>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ImporterSpecification).encode(ExternalEncoding), input_name='ImporterSpecification'), namespace_)) + if self.SignatureContact: + self.SignatureContact.export(outfile, level, namespace_, name_='SignatureContact') + if self.ProducerSpecification is not None: + showIndent(outfile, level) + outfile.write('<%sProducerSpecification>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ProducerSpecification).encode(ExternalEncoding), input_name='ProducerSpecification'), namespace_)) + for Producers_ in self.Producers: + Producers_.export(outfile, level, namespace_, name_='Producers') + for CustomerImageUsages_ in self.CustomerImageUsages: + CustomerImageUsages_.export(outfile, level, namespace_, name_='CustomerImageUsages') + def hasContent_(self): + if ( + self.Format is not None or + self.BlanketPeriod is not None or + self.ImporterSpecification is not None or + self.SignatureContact is not None or + self.ProducerSpecification is not None or + self.Producers or + self.CustomerImageUsages + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='NaftaCertificateOfOriginDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Format is not None: + showIndent(outfile, level) + outfile.write('Format=model_.ShippingDocumentFormat(\n') + self.Format.exportLiteral(outfile, level, name_='Format') + showIndent(outfile, level) + outfile.write('),\n') + if self.BlanketPeriod is not None: + showIndent(outfile, level) + outfile.write('BlanketPeriod=model_.DateRange(\n') + self.BlanketPeriod.exportLiteral(outfile, level, name_='BlanketPeriod') + showIndent(outfile, level) + outfile.write('),\n') + if self.ImporterSpecification is not None: + showIndent(outfile, level) + outfile.write('ImporterSpecification=%s,\n' % quote_python(self.ImporterSpecification).encode(ExternalEncoding)) + if self.SignatureContact is not None: + showIndent(outfile, level) + outfile.write('SignatureContact=model_.Contact(\n') + self.SignatureContact.exportLiteral(outfile, level, name_='SignatureContact') + showIndent(outfile, level) + outfile.write('),\n') + if self.ProducerSpecification is not None: + showIndent(outfile, level) + outfile.write('ProducerSpecification=%s,\n' % quote_python(self.ProducerSpecification).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Producers=[\n') + level += 1 + for Producers_ in self.Producers: + showIndent(outfile, level) + outfile.write('model_.NaftaProducer(\n') + Producers_.exportLiteral(outfile, level, name_='NaftaProducer') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('CustomerImageUsages=[\n') + level += 1 + for CustomerImageUsages_ in self.CustomerImageUsages: + showIndent(outfile, level) + outfile.write('model_.CustomerImageUsage(\n') + CustomerImageUsages_.exportLiteral(outfile, level, name_='CustomerImageUsage') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Format': + obj_ = ShippingDocumentFormat.factory() + obj_.build(child_) + self.set_Format(obj_) + elif nodeName_ == 'BlanketPeriod': + obj_ = DateRange.factory() + obj_.build(child_) + self.set_BlanketPeriod(obj_) + elif nodeName_ == 'ImporterSpecification': + ImporterSpecification_ = child_.text + ImporterSpecification_ = self.gds_validate_string(ImporterSpecification_, node, 'ImporterSpecification') + self.ImporterSpecification = ImporterSpecification_ + self.validate_NaftaImporterSpecificationType(self.ImporterSpecification) # validate type NaftaImporterSpecificationType + elif nodeName_ == 'SignatureContact': + obj_ = Contact.factory() + obj_.build(child_) + self.set_SignatureContact(obj_) + elif nodeName_ == 'ProducerSpecification': + ProducerSpecification_ = child_.text + ProducerSpecification_ = self.gds_validate_string(ProducerSpecification_, node, 'ProducerSpecification') + self.ProducerSpecification = ProducerSpecification_ + self.validate_NaftaProducerSpecificationType(self.ProducerSpecification) # validate type NaftaProducerSpecificationType + elif nodeName_ == 'Producers': + obj_ = NaftaProducer.factory() + obj_.build(child_) + self.Producers.append(obj_) + elif nodeName_ == 'CustomerImageUsages': + obj_ = CustomerImageUsage.factory() + obj_.build(child_) + self.CustomerImageUsages.append(obj_) +# end class NaftaCertificateOfOriginDetail + + +class NaftaCommodityDetail(GeneratedsSuper): + """This element is currently not supported and is for the future use.""" + subclass = None + superclass = None + def __init__(self, PreferenceCriterion=None, ProducerDetermination=None, ProducerId=None, NetCostMethod=None, NetCostDateRange=None): + self.PreferenceCriterion = PreferenceCriterion + self.ProducerDetermination = ProducerDetermination + self.ProducerId = ProducerId + self.NetCostMethod = NetCostMethod + self.NetCostDateRange = NetCostDateRange + def factory(*args_, **kwargs_): + if NaftaCommodityDetail.subclass: + return NaftaCommodityDetail.subclass(*args_, **kwargs_) + else: + return NaftaCommodityDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_PreferenceCriterion(self): return self.PreferenceCriterion + def set_PreferenceCriterion(self, PreferenceCriterion): self.PreferenceCriterion = PreferenceCriterion + def validate_NaftaPreferenceCriterionCode(self, value): + # Validate type NaftaPreferenceCriterionCode, a restriction on xs:string. + pass + def get_ProducerDetermination(self): return self.ProducerDetermination + def set_ProducerDetermination(self, ProducerDetermination): self.ProducerDetermination = ProducerDetermination + def validate_NaftaProducerDeterminationCode(self, value): + # Validate type NaftaProducerDeterminationCode, a restriction on xs:string. + pass + def get_ProducerId(self): return self.ProducerId + def set_ProducerId(self, ProducerId): self.ProducerId = ProducerId + def get_NetCostMethod(self): return self.NetCostMethod + def set_NetCostMethod(self, NetCostMethod): self.NetCostMethod = NetCostMethod + def validate_NaftaNetCostMethodCode(self, value): + # Validate type NaftaNetCostMethodCode, a restriction on xs:string. + pass + def get_NetCostDateRange(self): return self.NetCostDateRange + def set_NetCostDateRange(self, NetCostDateRange): self.NetCostDateRange = NetCostDateRange + def export(self, outfile, level, namespace_='ns:', name_='NaftaCommodityDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='NaftaCommodityDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='NaftaCommodityDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='NaftaCommodityDetail', fromsubclass_=False): + if self.PreferenceCriterion is not None: + showIndent(outfile, level) + outfile.write('<%sPreferenceCriterion>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PreferenceCriterion).encode(ExternalEncoding), input_name='PreferenceCriterion'), namespace_)) + if self.ProducerDetermination is not None: + showIndent(outfile, level) + outfile.write('<%sProducerDetermination>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ProducerDetermination).encode(ExternalEncoding), input_name='ProducerDetermination'), namespace_)) + if self.ProducerId is not None: + showIndent(outfile, level) + outfile.write('<%sProducerId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ProducerId).encode(ExternalEncoding), input_name='ProducerId'), namespace_)) + if self.NetCostMethod is not None: + showIndent(outfile, level) + outfile.write('<%sNetCostMethod>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.NetCostMethod).encode(ExternalEncoding), input_name='NetCostMethod'), namespace_)) + if self.NetCostDateRange: + self.NetCostDateRange.export(outfile, level, namespace_, name_='NetCostDateRange') + def hasContent_(self): + if ( + self.PreferenceCriterion is not None or + self.ProducerDetermination is not None or + self.ProducerId is not None or + self.NetCostMethod is not None or + self.NetCostDateRange is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='NaftaCommodityDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.PreferenceCriterion is not None: + showIndent(outfile, level) + outfile.write('PreferenceCriterion=%s,\n' % quote_python(self.PreferenceCriterion).encode(ExternalEncoding)) + if self.ProducerDetermination is not None: + showIndent(outfile, level) + outfile.write('ProducerDetermination=%s,\n' % quote_python(self.ProducerDetermination).encode(ExternalEncoding)) + if self.ProducerId is not None: + showIndent(outfile, level) + outfile.write('ProducerId=%s,\n' % quote_python(self.ProducerId).encode(ExternalEncoding)) + if self.NetCostMethod is not None: + showIndent(outfile, level) + outfile.write('NetCostMethod=%s,\n' % quote_python(self.NetCostMethod).encode(ExternalEncoding)) + if self.NetCostDateRange is not None: + showIndent(outfile, level) + outfile.write('NetCostDateRange=model_.DateRange(\n') + self.NetCostDateRange.exportLiteral(outfile, level, name_='NetCostDateRange') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'PreferenceCriterion': + PreferenceCriterion_ = child_.text + PreferenceCriterion_ = self.gds_validate_string(PreferenceCriterion_, node, 'PreferenceCriterion') + self.PreferenceCriterion = PreferenceCriterion_ + self.validate_NaftaPreferenceCriterionCode(self.PreferenceCriterion) # validate type NaftaPreferenceCriterionCode + elif nodeName_ == 'ProducerDetermination': + ProducerDetermination_ = child_.text + ProducerDetermination_ = self.gds_validate_string(ProducerDetermination_, node, 'ProducerDetermination') + self.ProducerDetermination = ProducerDetermination_ + self.validate_NaftaProducerDeterminationCode(self.ProducerDetermination) # validate type NaftaProducerDeterminationCode + elif nodeName_ == 'ProducerId': + ProducerId_ = child_.text + ProducerId_ = self.gds_validate_string(ProducerId_, node, 'ProducerId') + self.ProducerId = ProducerId_ + elif nodeName_ == 'NetCostMethod': + NetCostMethod_ = child_.text + NetCostMethod_ = self.gds_validate_string(NetCostMethod_, node, 'NetCostMethod') + self.NetCostMethod = NetCostMethod_ + self.validate_NaftaNetCostMethodCode(self.NetCostMethod) # validate type NaftaNetCostMethodCode + elif nodeName_ == 'NetCostDateRange': + obj_ = DateRange.factory() + obj_.build(child_) + self.set_NetCostDateRange(obj_) +# end class NaftaCommodityDetail + + +class NaftaProducer(GeneratedsSuper): + """This element is currently not supported and is for the future use.""" + subclass = None + superclass = None + def __init__(self, Id=None, Producer=None): + self.Id = Id + self.Producer = Producer + def factory(*args_, **kwargs_): + if NaftaProducer.subclass: + return NaftaProducer.subclass(*args_, **kwargs_) + else: + return NaftaProducer(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Id(self): return self.Id + def set_Id(self, Id): self.Id = Id + def get_Producer(self): return self.Producer + def set_Producer(self, Producer): self.Producer = Producer + def export(self, outfile, level, namespace_='ns:', name_='NaftaProducer', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='NaftaProducer') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='NaftaProducer'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='NaftaProducer', fromsubclass_=False): + if self.Id is not None: + showIndent(outfile, level) + outfile.write('<%sId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Id).encode(ExternalEncoding), input_name='Id'), namespace_)) + if self.Producer: + self.Producer.export(outfile, level, namespace_, name_='Producer') + def hasContent_(self): + if ( + self.Id is not None or + self.Producer is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='NaftaProducer'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Id is not None: + showIndent(outfile, level) + outfile.write('Id=%s,\n' % quote_python(self.Id).encode(ExternalEncoding)) + if self.Producer is not None: + showIndent(outfile, level) + outfile.write('Producer=model_.Party(\n') + self.Producer.exportLiteral(outfile, level, name_='Producer') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Id': + Id_ = child_.text + Id_ = self.gds_validate_string(Id_, node, 'Id') + self.Id = Id_ + elif nodeName_ == 'Producer': + obj_ = Party.factory() + obj_.build(child_) + self.set_Producer(obj_) +# end class NaftaProducer + + +class Notification(GeneratedsSuper): + """The descriptive data regarding the result of the submitted + transaction.""" + subclass = None + superclass = None + def __init__(self, Severity=None, Source=None, Code=None, Message=None, LocalizedMessage=None, MessageParameters=None): + self.Severity = Severity + self.Source = Source + self.Code = Code + self.Message = Message + self.LocalizedMessage = LocalizedMessage + if MessageParameters is None: + self.MessageParameters = [] + else: + self.MessageParameters = MessageParameters + def factory(*args_, **kwargs_): + if Notification.subclass: + return Notification.subclass(*args_, **kwargs_) + else: + return Notification(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Severity(self): return self.Severity + def set_Severity(self, Severity): self.Severity = Severity + def validate_NotificationSeverityType(self, value): + # Validate type NotificationSeverityType, a restriction on xs:string. + pass + def get_Source(self): return self.Source + def set_Source(self, Source): self.Source = Source + def get_Code(self): return self.Code + def set_Code(self, Code): self.Code = Code + def get_Message(self): return self.Message + def set_Message(self, Message): self.Message = Message + def get_LocalizedMessage(self): return self.LocalizedMessage + def set_LocalizedMessage(self, LocalizedMessage): self.LocalizedMessage = LocalizedMessage + def get_MessageParameters(self): return self.MessageParameters + def set_MessageParameters(self, MessageParameters): self.MessageParameters = MessageParameters + def add_MessageParameters(self, value): self.MessageParameters.append(value) + def insert_MessageParameters(self, index, value): self.MessageParameters[index] = value + def export(self, outfile, level, namespace_='ns:', name_='Notification', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Notification') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Notification'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Notification', fromsubclass_=False): + if self.Severity is not None: + showIndent(outfile, level) + outfile.write('<%sSeverity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Severity).encode(ExternalEncoding), input_name='Severity'), namespace_)) + if self.Source is not None: + showIndent(outfile, level) + outfile.write('<%sSource>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Source).encode(ExternalEncoding), input_name='Source'), namespace_)) + if self.Code is not None: + showIndent(outfile, level) + outfile.write('<%sCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Code).encode(ExternalEncoding), input_name='Code'), namespace_)) + if self.Message is not None: + showIndent(outfile, level) + outfile.write('<%sMessage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Message).encode(ExternalEncoding), input_name='Message'), namespace_)) + if self.LocalizedMessage is not None: + showIndent(outfile, level) + outfile.write('<%sLocalizedMessage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LocalizedMessage).encode(ExternalEncoding), input_name='LocalizedMessage'), namespace_)) + for MessageParameters_ in self.MessageParameters: + MessageParameters_.export(outfile, level, namespace_, name_='MessageParameters') + def hasContent_(self): + if ( + self.Severity is not None or + self.Source is not None or + self.Code is not None or + self.Message is not None or + self.LocalizedMessage is not None or + self.MessageParameters + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Notification'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Severity is not None: + showIndent(outfile, level) + outfile.write('Severity=%s,\n' % quote_python(self.Severity).encode(ExternalEncoding)) + if self.Source is not None: + showIndent(outfile, level) + outfile.write('Source=%s,\n' % quote_python(self.Source).encode(ExternalEncoding)) + if self.Code is not None: + showIndent(outfile, level) + outfile.write('Code=%s,\n' % quote_python(self.Code).encode(ExternalEncoding)) + if self.Message is not None: + showIndent(outfile, level) + outfile.write('Message=%s,\n' % quote_python(self.Message).encode(ExternalEncoding)) + if self.LocalizedMessage is not None: + showIndent(outfile, level) + outfile.write('LocalizedMessage=%s,\n' % quote_python(self.LocalizedMessage).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('MessageParameters=[\n') + level += 1 + for MessageParameters_ in self.MessageParameters: + showIndent(outfile, level) + outfile.write('model_.NotificationParameter(\n') + MessageParameters_.exportLiteral(outfile, level, name_='NotificationParameter') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Severity': + Severity_ = child_.text + Severity_ = self.gds_validate_string(Severity_, node, 'Severity') + self.Severity = Severity_ + self.validate_NotificationSeverityType(self.Severity) # validate type NotificationSeverityType + elif nodeName_ == 'Source': + Source_ = child_.text + Source_ = self.gds_validate_string(Source_, node, 'Source') + self.Source = Source_ + elif nodeName_ == 'Code': + Code_ = child_.text + Code_ = self.gds_validate_string(Code_, node, 'Code') + self.Code = Code_ + elif nodeName_ == 'Message': + Message_ = child_.text + Message_ = self.gds_validate_string(Message_, node, 'Message') + self.Message = Message_ + elif nodeName_ == 'LocalizedMessage': + LocalizedMessage_ = child_.text + LocalizedMessage_ = self.gds_validate_string(LocalizedMessage_, node, 'LocalizedMessage') + self.LocalizedMessage = LocalizedMessage_ + elif nodeName_ == 'MessageParameters': + obj_ = NotificationParameter.factory() + obj_.build(child_) + self.MessageParameters.append(obj_) +# end class Notification + + +class NotificationParameter(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Id=None, Value=None): + self.Id = Id + self.Value = Value + def factory(*args_, **kwargs_): + if NotificationParameter.subclass: + return NotificationParameter.subclass(*args_, **kwargs_) + else: + return NotificationParameter(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Id(self): return self.Id + def set_Id(self, Id): self.Id = Id + def get_Value(self): return self.Value + def set_Value(self, Value): self.Value = Value + def export(self, outfile, level, namespace_='ns:', name_='NotificationParameter', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='NotificationParameter') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='NotificationParameter'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='NotificationParameter', fromsubclass_=False): + if self.Id is not None: + showIndent(outfile, level) + outfile.write('<%sId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Id).encode(ExternalEncoding), input_name='Id'), namespace_)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('<%sValue>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Value).encode(ExternalEncoding), input_name='Value'), namespace_)) + def hasContent_(self): + if ( + self.Id is not None or + self.Value is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='NotificationParameter'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Id is not None: + showIndent(outfile, level) + outfile.write('Id=%s,\n' % quote_python(self.Id).encode(ExternalEncoding)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('Value=%s,\n' % quote_python(self.Value).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Id': + Id_ = child_.text + Id_ = self.gds_validate_string(Id_, node, 'Id') + self.Id = Id_ + elif nodeName_ == 'Value': + Value_ = child_.text + Value_ = self.gds_validate_string(Value_, node, 'Value') + self.Value = Value_ +# end class NotificationParameter + + +class Op900Detail(GeneratedsSuper): + """The instructions indicating how to print the OP-900 form for + hazardous materials packages.""" + subclass = None + superclass = None + def __init__(self, Format=None, Reference=None, CustomerImageUsages=None, SignatureName=None): + self.Format = Format + self.Reference = Reference + if CustomerImageUsages is None: + self.CustomerImageUsages = [] + else: + self.CustomerImageUsages = CustomerImageUsages + self.SignatureName = SignatureName + def factory(*args_, **kwargs_): + if Op900Detail.subclass: + return Op900Detail.subclass(*args_, **kwargs_) + else: + return Op900Detail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Format(self): return self.Format + def set_Format(self, Format): self.Format = Format + def get_Reference(self): return self.Reference + def set_Reference(self, Reference): self.Reference = Reference + def validate_CustomerReferenceType(self, value): + # Validate type CustomerReferenceType, a restriction on xs:string. + pass + def get_CustomerImageUsages(self): return self.CustomerImageUsages + def set_CustomerImageUsages(self, CustomerImageUsages): self.CustomerImageUsages = CustomerImageUsages + def add_CustomerImageUsages(self, value): self.CustomerImageUsages.append(value) + def insert_CustomerImageUsages(self, index, value): self.CustomerImageUsages[index] = value + def get_SignatureName(self): return self.SignatureName + def set_SignatureName(self, SignatureName): self.SignatureName = SignatureName + def export(self, outfile, level, namespace_='ns:', name_='Op900Detail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Op900Detail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Op900Detail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Op900Detail', fromsubclass_=False): + if self.Format: + self.Format.export(outfile, level, namespace_, name_='Format') + if self.Reference is not None: + showIndent(outfile, level) + outfile.write('<%sReference>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Reference).encode(ExternalEncoding), input_name='Reference'), namespace_)) + for CustomerImageUsages_ in self.CustomerImageUsages: + CustomerImageUsages_.export(outfile, level, namespace_, name_='CustomerImageUsages') + if self.SignatureName is not None: + showIndent(outfile, level) + outfile.write('<%sSignatureName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.SignatureName).encode(ExternalEncoding), input_name='SignatureName'), namespace_)) + def hasContent_(self): + if ( + self.Format is not None or + self.Reference is not None or + self.CustomerImageUsages or + self.SignatureName is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Op900Detail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Format is not None: + showIndent(outfile, level) + outfile.write('Format=model_.ShippingDocumentFormat(\n') + self.Format.exportLiteral(outfile, level, name_='Format') + showIndent(outfile, level) + outfile.write('),\n') + if self.Reference is not None: + showIndent(outfile, level) + outfile.write('Reference=%s,\n' % quote_python(self.Reference).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('CustomerImageUsages=[\n') + level += 1 + for CustomerImageUsages_ in self.CustomerImageUsages: + showIndent(outfile, level) + outfile.write('model_.CustomerImageUsage(\n') + CustomerImageUsages_.exportLiteral(outfile, level, name_='CustomerImageUsage') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.SignatureName is not None: + showIndent(outfile, level) + outfile.write('SignatureName=%s,\n' % quote_python(self.SignatureName).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Format': + obj_ = ShippingDocumentFormat.factory() + obj_.build(child_) + self.set_Format(obj_) + elif nodeName_ == 'Reference': + Reference_ = child_.text + Reference_ = self.gds_validate_string(Reference_, node, 'Reference') + self.Reference = Reference_ + self.validate_CustomerReferenceType(self.Reference) # validate type CustomerReferenceType + elif nodeName_ == 'CustomerImageUsages': + obj_ = CustomerImageUsage.factory() + obj_.build(child_) + self.CustomerImageUsages.append(obj_) + elif nodeName_ == 'SignatureName': + SignatureName_ = child_.text + SignatureName_ = self.gds_validate_string(SignatureName_, node, 'SignatureName') + self.SignatureName = SignatureName_ +# end class Op900Detail + + +class OperationalInstruction(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Number=None, Content=None): + self.Number = Number + self.Content = Content + def factory(*args_, **kwargs_): + if OperationalInstruction.subclass: + return OperationalInstruction.subclass(*args_, **kwargs_) + else: + return OperationalInstruction(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Number(self): return self.Number + def set_Number(self, Number): self.Number = Number + def get_Content(self): return self.Content + def set_Content(self, Content): self.Content = Content + def export(self, outfile, level, namespace_='ns:', name_='OperationalInstruction', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='OperationalInstruction') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='OperationalInstruction'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='OperationalInstruction', fromsubclass_=False): + if self.Number is not None: + showIndent(outfile, level) + outfile.write('<%sNumber>%s\n' % (namespace_, self.gds_format_integer(self.Number, input_name='Number'), namespace_)) + if self.Content is not None: + showIndent(outfile, level) + outfile.write('<%sContent>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Content).encode(ExternalEncoding), input_name='Content'), namespace_)) + def hasContent_(self): + if ( + self.Number is not None or + self.Content is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='OperationalInstruction'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Number is not None: + showIndent(outfile, level) + outfile.write('Number=%d,\n' % self.Number) + if self.Content is not None: + showIndent(outfile, level) + outfile.write('Content=%s,\n' % quote_python(self.Content).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Number': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'Number') + self.Number = ival_ + elif nodeName_ == 'Content': + Content_ = child_.text + Content_ = self.gds_validate_string(Content_, node, 'Content') + self.Content = Content_ +# end class OperationalInstruction + + +class PackageBarcodes(GeneratedsSuper): + """Each instance of this data type represents the set of barcodes (of + all types) which are associated with a specific package.""" + subclass = None + superclass = None + def __init__(self, BinaryBarcodes=None, StringBarcodes=None): + if BinaryBarcodes is None: + self.BinaryBarcodes = [] + else: + self.BinaryBarcodes = BinaryBarcodes + if StringBarcodes is None: + self.StringBarcodes = [] + else: + self.StringBarcodes = StringBarcodes + def factory(*args_, **kwargs_): + if PackageBarcodes.subclass: + return PackageBarcodes.subclass(*args_, **kwargs_) + else: + return PackageBarcodes(*args_, **kwargs_) + factory = staticmethod(factory) + def get_BinaryBarcodes(self): return self.BinaryBarcodes + def set_BinaryBarcodes(self, BinaryBarcodes): self.BinaryBarcodes = BinaryBarcodes + def add_BinaryBarcodes(self, value): self.BinaryBarcodes.append(value) + def insert_BinaryBarcodes(self, index, value): self.BinaryBarcodes[index] = value + def get_StringBarcodes(self): return self.StringBarcodes + def set_StringBarcodes(self, StringBarcodes): self.StringBarcodes = StringBarcodes + def add_StringBarcodes(self, value): self.StringBarcodes.append(value) + def insert_StringBarcodes(self, index, value): self.StringBarcodes[index] = value + def export(self, outfile, level, namespace_='ns:', name_='PackageBarcodes', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='PackageBarcodes') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='PackageBarcodes'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='PackageBarcodes', fromsubclass_=False): + for BinaryBarcodes_ in self.BinaryBarcodes: + BinaryBarcodes_.export(outfile, level, namespace_, name_='BinaryBarcodes') + for StringBarcodes_ in self.StringBarcodes: + StringBarcodes_.export(outfile, level, namespace_, name_='StringBarcodes') + def hasContent_(self): + if ( + self.BinaryBarcodes or + self.StringBarcodes + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='PackageBarcodes'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('BinaryBarcodes=[\n') + level += 1 + for BinaryBarcodes_ in self.BinaryBarcodes: + showIndent(outfile, level) + outfile.write('model_.BinaryBarcode(\n') + BinaryBarcodes_.exportLiteral(outfile, level, name_='BinaryBarcode') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('StringBarcodes=[\n') + level += 1 + for StringBarcodes_ in self.StringBarcodes: + showIndent(outfile, level) + outfile.write('model_.StringBarcode(\n') + StringBarcodes_.exportLiteral(outfile, level, name_='StringBarcode') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'BinaryBarcodes': + obj_ = BinaryBarcode.factory() + obj_.build(child_) + self.BinaryBarcodes.append(obj_) + elif nodeName_ == 'StringBarcodes': + obj_ = StringBarcode.factory() + obj_.build(child_) + self.StringBarcodes.append(obj_) +# end class PackageBarcodes + + +class PackageOperationalDetail(GeneratedsSuper): + """Package-level data required for labeling and/or movement.""" + subclass = None + superclass = None + def __init__(self, AstraHandlingText=None, OperationalInstructions=None, Barcodes=None, GroundServiceCode=None): + self.AstraHandlingText = AstraHandlingText + if OperationalInstructions is None: + self.OperationalInstructions = [] + else: + self.OperationalInstructions = OperationalInstructions + self.Barcodes = Barcodes + self.GroundServiceCode = GroundServiceCode + def factory(*args_, **kwargs_): + if PackageOperationalDetail.subclass: + return PackageOperationalDetail.subclass(*args_, **kwargs_) + else: + return PackageOperationalDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_AstraHandlingText(self): return self.AstraHandlingText + def set_AstraHandlingText(self, AstraHandlingText): self.AstraHandlingText = AstraHandlingText + def get_OperationalInstructions(self): return self.OperationalInstructions + def set_OperationalInstructions(self, OperationalInstructions): self.OperationalInstructions = OperationalInstructions + def add_OperationalInstructions(self, value): self.OperationalInstructions.append(value) + def insert_OperationalInstructions(self, index, value): self.OperationalInstructions[index] = value + def get_Barcodes(self): return self.Barcodes + def set_Barcodes(self, Barcodes): self.Barcodes = Barcodes + def get_GroundServiceCode(self): return self.GroundServiceCode + def set_GroundServiceCode(self, GroundServiceCode): self.GroundServiceCode = GroundServiceCode + def export(self, outfile, level, namespace_='ns:', name_='PackageOperationalDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='PackageOperationalDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='PackageOperationalDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='PackageOperationalDetail', fromsubclass_=False): + if self.AstraHandlingText is not None: + showIndent(outfile, level) + outfile.write('<%sAstraHandlingText>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AstraHandlingText).encode(ExternalEncoding), input_name='AstraHandlingText'), namespace_)) + for OperationalInstructions_ in self.OperationalInstructions: + OperationalInstructions_.export(outfile, level, namespace_, name_='OperationalInstructions') + if self.Barcodes: + self.Barcodes.export(outfile, level, namespace_, name_='Barcodes') + if self.GroundServiceCode is not None: + showIndent(outfile, level) + outfile.write('<%sGroundServiceCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.GroundServiceCode).encode(ExternalEncoding), input_name='GroundServiceCode'), namespace_)) + def hasContent_(self): + if ( + self.AstraHandlingText is not None or + self.OperationalInstructions or + self.Barcodes is not None or + self.GroundServiceCode is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='PackageOperationalDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.AstraHandlingText is not None: + showIndent(outfile, level) + outfile.write('AstraHandlingText=%s,\n' % quote_python(self.AstraHandlingText).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('OperationalInstructions=[\n') + level += 1 + for OperationalInstructions_ in self.OperationalInstructions: + showIndent(outfile, level) + outfile.write('model_.OperationalInstruction(\n') + OperationalInstructions_.exportLiteral(outfile, level, name_='OperationalInstruction') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.Barcodes is not None: + showIndent(outfile, level) + outfile.write('Barcodes=model_.PackageBarcodes(\n') + self.Barcodes.exportLiteral(outfile, level, name_='Barcodes') + showIndent(outfile, level) + outfile.write('),\n') + if self.GroundServiceCode is not None: + showIndent(outfile, level) + outfile.write('GroundServiceCode=%s,\n' % quote_python(self.GroundServiceCode).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'AstraHandlingText': + AstraHandlingText_ = child_.text + AstraHandlingText_ = self.gds_validate_string(AstraHandlingText_, node, 'AstraHandlingText') + self.AstraHandlingText = AstraHandlingText_ + elif nodeName_ == 'OperationalInstructions': + obj_ = OperationalInstruction.factory() + obj_.build(child_) + self.OperationalInstructions.append(obj_) + elif nodeName_ == 'Barcodes': + obj_ = PackageBarcodes.factory() + obj_.build(child_) + self.set_Barcodes(obj_) + elif nodeName_ == 'GroundServiceCode': + GroundServiceCode_ = child_.text + GroundServiceCode_ = self.gds_validate_string(GroundServiceCode_, node, 'GroundServiceCode') + self.GroundServiceCode = GroundServiceCode_ +# end class PackageOperationalDetail + + +class PackageRateDetail(GeneratedsSuper): + """Data for a package's rates, as calculated per a specific rate type.""" + subclass = None + superclass = None + def __init__(self, RateType=None, RatedWeightMethod=None, MinimumChargeType=None, BillingWeight=None, DimWeight=None, OversizeWeight=None, BaseCharge=None, TotalFreightDiscounts=None, NetFreight=None, TotalSurcharges=None, NetFedExCharge=None, TotalTaxes=None, NetCharge=None, TotalRebates=None, FreightDiscounts=None, Rebates=None, Surcharges=None, Taxes=None, VariableHandlingCharges=None): + self.RateType = RateType + self.RatedWeightMethod = RatedWeightMethod + self.MinimumChargeType = MinimumChargeType + self.BillingWeight = BillingWeight + self.DimWeight = DimWeight + self.OversizeWeight = OversizeWeight + self.BaseCharge = BaseCharge + self.TotalFreightDiscounts = TotalFreightDiscounts + self.NetFreight = NetFreight + self.TotalSurcharges = TotalSurcharges + self.NetFedExCharge = NetFedExCharge + self.TotalTaxes = TotalTaxes + self.NetCharge = NetCharge + self.TotalRebates = TotalRebates + if FreightDiscounts is None: + self.FreightDiscounts = [] + else: + self.FreightDiscounts = FreightDiscounts + if Rebates is None: + self.Rebates = [] + else: + self.Rebates = Rebates + if Surcharges is None: + self.Surcharges = [] + else: + self.Surcharges = Surcharges + if Taxes is None: + self.Taxes = [] + else: + self.Taxes = Taxes + self.VariableHandlingCharges = VariableHandlingCharges + def factory(*args_, **kwargs_): + if PackageRateDetail.subclass: + return PackageRateDetail.subclass(*args_, **kwargs_) + else: + return PackageRateDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_RateType(self): return self.RateType + def set_RateType(self, RateType): self.RateType = RateType + def validate_ReturnedRateType(self, value): + # Validate type ReturnedRateType, a restriction on xs:string. + pass + def get_RatedWeightMethod(self): return self.RatedWeightMethod + def set_RatedWeightMethod(self, RatedWeightMethod): self.RatedWeightMethod = RatedWeightMethod + def validate_RatedWeightMethod(self, value): + # Validate type RatedWeightMethod, a restriction on xs:string. + pass + def get_MinimumChargeType(self): return self.MinimumChargeType + def set_MinimumChargeType(self, MinimumChargeType): self.MinimumChargeType = MinimumChargeType + def validate_MinimumChargeType(self, value): + # Validate type MinimumChargeType, a restriction on xs:string. + pass + def get_BillingWeight(self): return self.BillingWeight + def set_BillingWeight(self, BillingWeight): self.BillingWeight = BillingWeight + def get_DimWeight(self): return self.DimWeight + def set_DimWeight(self, DimWeight): self.DimWeight = DimWeight + def get_OversizeWeight(self): return self.OversizeWeight + def set_OversizeWeight(self, OversizeWeight): self.OversizeWeight = OversizeWeight + def get_BaseCharge(self): return self.BaseCharge + def set_BaseCharge(self, BaseCharge): self.BaseCharge = BaseCharge + def get_TotalFreightDiscounts(self): return self.TotalFreightDiscounts + def set_TotalFreightDiscounts(self, TotalFreightDiscounts): self.TotalFreightDiscounts = TotalFreightDiscounts + def get_NetFreight(self): return self.NetFreight + def set_NetFreight(self, NetFreight): self.NetFreight = NetFreight + def get_TotalSurcharges(self): return self.TotalSurcharges + def set_TotalSurcharges(self, TotalSurcharges): self.TotalSurcharges = TotalSurcharges + def get_NetFedExCharge(self): return self.NetFedExCharge + def set_NetFedExCharge(self, NetFedExCharge): self.NetFedExCharge = NetFedExCharge + def get_TotalTaxes(self): return self.TotalTaxes + def set_TotalTaxes(self, TotalTaxes): self.TotalTaxes = TotalTaxes + def get_NetCharge(self): return self.NetCharge + def set_NetCharge(self, NetCharge): self.NetCharge = NetCharge + def get_TotalRebates(self): return self.TotalRebates + def set_TotalRebates(self, TotalRebates): self.TotalRebates = TotalRebates + def get_FreightDiscounts(self): return self.FreightDiscounts + def set_FreightDiscounts(self, FreightDiscounts): self.FreightDiscounts = FreightDiscounts + def add_FreightDiscounts(self, value): self.FreightDiscounts.append(value) + def insert_FreightDiscounts(self, index, value): self.FreightDiscounts[index] = value + def get_Rebates(self): return self.Rebates + def set_Rebates(self, Rebates): self.Rebates = Rebates + def add_Rebates(self, value): self.Rebates.append(value) + def insert_Rebates(self, index, value): self.Rebates[index] = value + def get_Surcharges(self): return self.Surcharges + def set_Surcharges(self, Surcharges): self.Surcharges = Surcharges + def add_Surcharges(self, value): self.Surcharges.append(value) + def insert_Surcharges(self, index, value): self.Surcharges[index] = value + def get_Taxes(self): return self.Taxes + def set_Taxes(self, Taxes): self.Taxes = Taxes + def add_Taxes(self, value): self.Taxes.append(value) + def insert_Taxes(self, index, value): self.Taxes[index] = value + def get_VariableHandlingCharges(self): return self.VariableHandlingCharges + def set_VariableHandlingCharges(self, VariableHandlingCharges): self.VariableHandlingCharges = VariableHandlingCharges + def export(self, outfile, level, namespace_='ns:', name_='PackageRateDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='PackageRateDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='PackageRateDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='PackageRateDetail', fromsubclass_=False): + if self.RateType is not None: + showIndent(outfile, level) + outfile.write('<%sRateType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RateType).encode(ExternalEncoding), input_name='RateType'), namespace_)) + if self.RatedWeightMethod is not None: + showIndent(outfile, level) + outfile.write('<%sRatedWeightMethod>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RatedWeightMethod).encode(ExternalEncoding), input_name='RatedWeightMethod'), namespace_)) + if self.MinimumChargeType is not None: + showIndent(outfile, level) + outfile.write('<%sMinimumChargeType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.MinimumChargeType).encode(ExternalEncoding), input_name='MinimumChargeType'), namespace_)) + if self.BillingWeight: + self.BillingWeight.export(outfile, level, namespace_, name_='BillingWeight') + if self.DimWeight: + self.DimWeight.export(outfile, level, namespace_, name_='DimWeight') + if self.OversizeWeight: + self.OversizeWeight.export(outfile, level, namespace_, name_='OversizeWeight') + if self.BaseCharge: + self.BaseCharge.export(outfile, level, namespace_, name_='BaseCharge') + if self.TotalFreightDiscounts: + self.TotalFreightDiscounts.export(outfile, level, namespace_, name_='TotalFreightDiscounts') + if self.NetFreight: + self.NetFreight.export(outfile, level, namespace_, name_='NetFreight') + if self.TotalSurcharges: + self.TotalSurcharges.export(outfile, level, namespace_, name_='TotalSurcharges') + if self.NetFedExCharge: + self.NetFedExCharge.export(outfile, level, namespace_, name_='NetFedExCharge') + if self.TotalTaxes: + self.TotalTaxes.export(outfile, level, namespace_, name_='TotalTaxes') + if self.NetCharge: + self.NetCharge.export(outfile, level, namespace_, name_='NetCharge') + if self.TotalRebates: + self.TotalRebates.export(outfile, level, namespace_, name_='TotalRebates') + for FreightDiscounts_ in self.FreightDiscounts: + FreightDiscounts_.export(outfile, level, namespace_, name_='FreightDiscounts') + for Rebates_ in self.Rebates: + Rebates_.export(outfile, level, namespace_, name_='Rebates') + for Surcharges_ in self.Surcharges: + Surcharges_.export(outfile, level, namespace_, name_='Surcharges') + for Taxes_ in self.Taxes: + Taxes_.export(outfile, level, namespace_, name_='Taxes') + if self.VariableHandlingCharges: + self.VariableHandlingCharges.export(outfile, level, namespace_, name_='VariableHandlingCharges') + def hasContent_(self): + if ( + self.RateType is not None or + self.RatedWeightMethod is not None or + self.MinimumChargeType is not None or + self.BillingWeight is not None or + self.DimWeight is not None or + self.OversizeWeight is not None or + self.BaseCharge is not None or + self.TotalFreightDiscounts is not None or + self.NetFreight is not None or + self.TotalSurcharges is not None or + self.NetFedExCharge is not None or + self.TotalTaxes is not None or + self.NetCharge is not None or + self.TotalRebates is not None or + self.FreightDiscounts or + self.Rebates or + self.Surcharges or + self.Taxes or + self.VariableHandlingCharges is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='PackageRateDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.RateType is not None: + showIndent(outfile, level) + outfile.write('RateType=%s,\n' % quote_python(self.RateType).encode(ExternalEncoding)) + if self.RatedWeightMethod is not None: + showIndent(outfile, level) + outfile.write('RatedWeightMethod=%s,\n' % quote_python(self.RatedWeightMethod).encode(ExternalEncoding)) + if self.MinimumChargeType is not None: + showIndent(outfile, level) + outfile.write('MinimumChargeType=%s,\n' % quote_python(self.MinimumChargeType).encode(ExternalEncoding)) + if self.BillingWeight is not None: + showIndent(outfile, level) + outfile.write('BillingWeight=model_.Weight(\n') + self.BillingWeight.exportLiteral(outfile, level, name_='BillingWeight') + showIndent(outfile, level) + outfile.write('),\n') + if self.DimWeight is not None: + showIndent(outfile, level) + outfile.write('DimWeight=model_.Weight(\n') + self.DimWeight.exportLiteral(outfile, level, name_='DimWeight') + showIndent(outfile, level) + outfile.write('),\n') + if self.OversizeWeight is not None: + showIndent(outfile, level) + outfile.write('OversizeWeight=model_.Weight(\n') + self.OversizeWeight.exportLiteral(outfile, level, name_='OversizeWeight') + showIndent(outfile, level) + outfile.write('),\n') + if self.BaseCharge is not None: + showIndent(outfile, level) + outfile.write('BaseCharge=model_.Money(\n') + self.BaseCharge.exportLiteral(outfile, level, name_='BaseCharge') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalFreightDiscounts is not None: + showIndent(outfile, level) + outfile.write('TotalFreightDiscounts=model_.Money(\n') + self.TotalFreightDiscounts.exportLiteral(outfile, level, name_='TotalFreightDiscounts') + showIndent(outfile, level) + outfile.write('),\n') + if self.NetFreight is not None: + showIndent(outfile, level) + outfile.write('NetFreight=model_.Money(\n') + self.NetFreight.exportLiteral(outfile, level, name_='NetFreight') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalSurcharges is not None: + showIndent(outfile, level) + outfile.write('TotalSurcharges=model_.Money(\n') + self.TotalSurcharges.exportLiteral(outfile, level, name_='TotalSurcharges') + showIndent(outfile, level) + outfile.write('),\n') + if self.NetFedExCharge is not None: + showIndent(outfile, level) + outfile.write('NetFedExCharge=model_.Money(\n') + self.NetFedExCharge.exportLiteral(outfile, level, name_='NetFedExCharge') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalTaxes is not None: + showIndent(outfile, level) + outfile.write('TotalTaxes=model_.Money(\n') + self.TotalTaxes.exportLiteral(outfile, level, name_='TotalTaxes') + showIndent(outfile, level) + outfile.write('),\n') + if self.NetCharge is not None: + showIndent(outfile, level) + outfile.write('NetCharge=model_.Money(\n') + self.NetCharge.exportLiteral(outfile, level, name_='NetCharge') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalRebates is not None: + showIndent(outfile, level) + outfile.write('TotalRebates=model_.Money(\n') + self.TotalRebates.exportLiteral(outfile, level, name_='TotalRebates') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('FreightDiscounts=[\n') + level += 1 + for FreightDiscounts_ in self.FreightDiscounts: + showIndent(outfile, level) + outfile.write('model_.RateDiscount(\n') + FreightDiscounts_.exportLiteral(outfile, level, name_='RateDiscount') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('Rebates=[\n') + level += 1 + for Rebates_ in self.Rebates: + showIndent(outfile, level) + outfile.write('model_.Rebate(\n') + Rebates_.exportLiteral(outfile, level, name_='Rebate') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('Surcharges=[\n') + level += 1 + for Surcharges_ in self.Surcharges: + showIndent(outfile, level) + outfile.write('model_.Surcharge(\n') + Surcharges_.exportLiteral(outfile, level, name_='Surcharge') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('Taxes=[\n') + level += 1 + for Taxes_ in self.Taxes: + showIndent(outfile, level) + outfile.write('model_.Tax(\n') + Taxes_.exportLiteral(outfile, level, name_='Tax') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.VariableHandlingCharges is not None: + showIndent(outfile, level) + outfile.write('VariableHandlingCharges=model_.VariableHandlingCharges(\n') + self.VariableHandlingCharges.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'RateType': + RateType_ = child_.text + RateType_ = self.gds_validate_string(RateType_, node, 'RateType') + self.RateType = RateType_ + self.validate_ReturnedRateType(self.RateType) # validate type ReturnedRateType + elif nodeName_ == 'RatedWeightMethod': + RatedWeightMethod_ = child_.text + RatedWeightMethod_ = self.gds_validate_string(RatedWeightMethod_, node, 'RatedWeightMethod') + self.RatedWeightMethod = RatedWeightMethod_ + self.validate_RatedWeightMethod(self.RatedWeightMethod) # validate type RatedWeightMethod + elif nodeName_ == 'MinimumChargeType': + MinimumChargeType_ = child_.text + MinimumChargeType_ = self.gds_validate_string(MinimumChargeType_, node, 'MinimumChargeType') + self.MinimumChargeType = MinimumChargeType_ + self.validate_MinimumChargeType(self.MinimumChargeType) # validate type MinimumChargeType + elif nodeName_ == 'BillingWeight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_BillingWeight(obj_) + elif nodeName_ == 'DimWeight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_DimWeight(obj_) + elif nodeName_ == 'OversizeWeight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_OversizeWeight(obj_) + elif nodeName_ == 'BaseCharge': + obj_ = Money.factory() + obj_.build(child_) + self.set_BaseCharge(obj_) + elif nodeName_ == 'TotalFreightDiscounts': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalFreightDiscounts(obj_) + elif nodeName_ == 'NetFreight': + obj_ = Money.factory() + obj_.build(child_) + self.set_NetFreight(obj_) + elif nodeName_ == 'TotalSurcharges': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalSurcharges(obj_) + elif nodeName_ == 'NetFedExCharge': + obj_ = Money.factory() + obj_.build(child_) + self.set_NetFedExCharge(obj_) + elif nodeName_ == 'TotalTaxes': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalTaxes(obj_) + elif nodeName_ == 'NetCharge': + obj_ = Money.factory() + obj_.build(child_) + self.set_NetCharge(obj_) + elif nodeName_ == 'TotalRebates': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalRebates(obj_) + elif nodeName_ == 'FreightDiscounts': + obj_ = RateDiscount.factory() + obj_.build(child_) + self.FreightDiscounts.append(obj_) + elif nodeName_ == 'Rebates': + obj_ = Rebate.factory() + obj_.build(child_) + self.Rebates.append(obj_) + elif nodeName_ == 'Surcharges': + obj_ = Surcharge.factory() + obj_.build(child_) + self.Surcharges.append(obj_) + elif nodeName_ == 'Taxes': + obj_ = Tax.factory() + obj_.build(child_) + self.Taxes.append(obj_) + elif nodeName_ == 'VariableHandlingCharges': + obj_ = VariableHandlingCharges.factory() + obj_.build(child_) + self.set_VariableHandlingCharges(obj_) +# end class PackageRateDetail + + +class PackageRating(GeneratedsSuper): + """This class groups together for a single package all package-level + rate data (across all rate types) as part of the response to a + shipping request, which groups shipment-level data together and + groups package-level data by package.""" + subclass = None + superclass = None + def __init__(self, ActualRateType=None, EffectiveNetDiscount=None, PackageRateDetails=None): + self.ActualRateType = ActualRateType + self.EffectiveNetDiscount = EffectiveNetDiscount + if PackageRateDetails is None: + self.PackageRateDetails = [] + else: + self.PackageRateDetails = PackageRateDetails + def factory(*args_, **kwargs_): + if PackageRating.subclass: + return PackageRating.subclass(*args_, **kwargs_) + else: + return PackageRating(*args_, **kwargs_) + factory = staticmethod(factory) + def get_ActualRateType(self): return self.ActualRateType + def set_ActualRateType(self, ActualRateType): self.ActualRateType = ActualRateType + def validate_ReturnedRateType(self, value): + # Validate type ReturnedRateType, a restriction on xs:string. + pass + def get_EffectiveNetDiscount(self): return self.EffectiveNetDiscount + def set_EffectiveNetDiscount(self, EffectiveNetDiscount): self.EffectiveNetDiscount = EffectiveNetDiscount + def get_PackageRateDetails(self): return self.PackageRateDetails + def set_PackageRateDetails(self, PackageRateDetails): self.PackageRateDetails = PackageRateDetails + def add_PackageRateDetails(self, value): self.PackageRateDetails.append(value) + def insert_PackageRateDetails(self, index, value): self.PackageRateDetails[index] = value + def export(self, outfile, level, namespace_='ns:', name_='PackageRating', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='PackageRating') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='PackageRating'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='PackageRating', fromsubclass_=False): + if self.ActualRateType is not None: + showIndent(outfile, level) + outfile.write('<%sActualRateType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ActualRateType).encode(ExternalEncoding), input_name='ActualRateType'), namespace_)) + if self.EffectiveNetDiscount: + self.EffectiveNetDiscount.export(outfile, level, namespace_, name_='EffectiveNetDiscount') + for PackageRateDetails_ in self.PackageRateDetails: + PackageRateDetails_.export(outfile, level, namespace_, name_='PackageRateDetails') + def hasContent_(self): + if ( + self.ActualRateType is not None or + self.EffectiveNetDiscount is not None or + self.PackageRateDetails + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='PackageRating'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.ActualRateType is not None: + showIndent(outfile, level) + outfile.write('ActualRateType=%s,\n' % quote_python(self.ActualRateType).encode(ExternalEncoding)) + if self.EffectiveNetDiscount is not None: + showIndent(outfile, level) + outfile.write('EffectiveNetDiscount=model_.Money(\n') + self.EffectiveNetDiscount.exportLiteral(outfile, level, name_='EffectiveNetDiscount') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('PackageRateDetails=[\n') + level += 1 + for PackageRateDetails_ in self.PackageRateDetails: + showIndent(outfile, level) + outfile.write('model_.PackageRateDetail(\n') + PackageRateDetails_.exportLiteral(outfile, level, name_='PackageRateDetail') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'ActualRateType': + ActualRateType_ = child_.text + ActualRateType_ = self.gds_validate_string(ActualRateType_, node, 'ActualRateType') + self.ActualRateType = ActualRateType_ + self.validate_ReturnedRateType(self.ActualRateType) # validate type ReturnedRateType + elif nodeName_ == 'EffectiveNetDiscount': + obj_ = Money.factory() + obj_.build(child_) + self.set_EffectiveNetDiscount(obj_) + elif nodeName_ == 'PackageRateDetails': + obj_ = PackageRateDetail.factory() + obj_.build(child_) + self.PackageRateDetails.append(obj_) +# end class PackageRating + + +class PackageSpecialServicesRequested(GeneratedsSuper): + """These special services are available at the package level for some + or all service types. If the shipper is requesting a special + service which requires additional data, the package special + service type must be present in the specialServiceTypes + collection, and the supporting detail must be provided in the + appropriate sub-object below.""" + subclass = None + superclass = None + def __init__(self, SpecialServiceTypes=None, CodDetail=None, DangerousGoodsDetail=None, DryIceWeight=None, SignatureOptionDetail=None, PriorityAlertDetail=None): + if SpecialServiceTypes is None: + self.SpecialServiceTypes = [] + else: + self.SpecialServiceTypes = SpecialServiceTypes + self.CodDetail = CodDetail + self.DangerousGoodsDetail = DangerousGoodsDetail + self.DryIceWeight = DryIceWeight + self.SignatureOptionDetail = SignatureOptionDetail + self.PriorityAlertDetail = PriorityAlertDetail + def factory(*args_, **kwargs_): + if PackageSpecialServicesRequested.subclass: + return PackageSpecialServicesRequested.subclass(*args_, **kwargs_) + else: + return PackageSpecialServicesRequested(*args_, **kwargs_) + factory = staticmethod(factory) + def get_SpecialServiceTypes(self): return self.SpecialServiceTypes + def set_SpecialServiceTypes(self, SpecialServiceTypes): self.SpecialServiceTypes = SpecialServiceTypes + def add_SpecialServiceTypes(self, value): self.SpecialServiceTypes.append(value) + def insert_SpecialServiceTypes(self, index, value): self.SpecialServiceTypes[index] = value + def validate_PackageSpecialServiceType(self, value): + # Validate type PackageSpecialServiceType, a restriction on xs:string. + pass + def get_CodDetail(self): return self.CodDetail + def set_CodDetail(self, CodDetail): self.CodDetail = CodDetail + def get_DangerousGoodsDetail(self): return self.DangerousGoodsDetail + def set_DangerousGoodsDetail(self, DangerousGoodsDetail): self.DangerousGoodsDetail = DangerousGoodsDetail + def get_DryIceWeight(self): return self.DryIceWeight + def set_DryIceWeight(self, DryIceWeight): self.DryIceWeight = DryIceWeight + def get_SignatureOptionDetail(self): return self.SignatureOptionDetail + def set_SignatureOptionDetail(self, SignatureOptionDetail): self.SignatureOptionDetail = SignatureOptionDetail + def get_PriorityAlertDetail(self): return self.PriorityAlertDetail + def set_PriorityAlertDetail(self, PriorityAlertDetail): self.PriorityAlertDetail = PriorityAlertDetail + def export(self, outfile, level, namespace_='ns:', name_='PackageSpecialServicesRequested', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='PackageSpecialServicesRequested') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='PackageSpecialServicesRequested'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='PackageSpecialServicesRequested', fromsubclass_=False): + for SpecialServiceTypes_ in self.SpecialServiceTypes: + showIndent(outfile, level) + outfile.write('<%sSpecialServiceTypes>%s\n' % (namespace_, self.gds_format_string(quote_xml(SpecialServiceTypes_).encode(ExternalEncoding), input_name='SpecialServiceTypes'), namespace_)) + if self.CodDetail: + self.CodDetail.export(outfile, level, namespace_, name_='CodDetail') + if self.DangerousGoodsDetail: + self.DangerousGoodsDetail.export(outfile, level, namespace_, name_='DangerousGoodsDetail') + if self.DryIceWeight: + self.DryIceWeight.export(outfile, level, namespace_, name_='DryIceWeight') + if self.SignatureOptionDetail: + self.SignatureOptionDetail.export(outfile, level, namespace_, name_='SignatureOptionDetail') + if self.PriorityAlertDetail: + self.PriorityAlertDetail.export(outfile, level, namespace_, name_='PriorityAlertDetail') + def hasContent_(self): + if ( + self.SpecialServiceTypes or + self.CodDetail is not None or + self.DangerousGoodsDetail is not None or + self.DryIceWeight is not None or + self.SignatureOptionDetail is not None or + self.PriorityAlertDetail is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='PackageSpecialServicesRequested'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('SpecialServiceTypes=[\n') + level += 1 + for SpecialServiceTypes_ in self.SpecialServiceTypes: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(SpecialServiceTypes_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.CodDetail is not None: + showIndent(outfile, level) + outfile.write('CodDetail=model_.CodDetail(\n') + self.CodDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.DangerousGoodsDetail is not None: + showIndent(outfile, level) + outfile.write('DangerousGoodsDetail=model_.DangerousGoodsDetail(\n') + self.DangerousGoodsDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.DryIceWeight is not None: + showIndent(outfile, level) + outfile.write('DryIceWeight=model_.Weight(\n') + self.DryIceWeight.exportLiteral(outfile, level, name_='DryIceWeight') + showIndent(outfile, level) + outfile.write('),\n') + if self.SignatureOptionDetail is not None: + showIndent(outfile, level) + outfile.write('SignatureOptionDetail=model_.SignatureOptionDetail(\n') + self.SignatureOptionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.PriorityAlertDetail is not None: + showIndent(outfile, level) + outfile.write('PriorityAlertDetail=model_.PriorityAlertDetail(\n') + self.PriorityAlertDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'SpecialServiceTypes': + SpecialServiceTypes_ = child_.text + SpecialServiceTypes_ = self.gds_validate_string(SpecialServiceTypes_, node, 'SpecialServiceTypes') + self.SpecialServiceTypes.append(SpecialServiceTypes_) + self.validate_PackageSpecialServiceType(self.SpecialServiceTypes) # validate type PackageSpecialServiceType + elif nodeName_ == 'CodDetail': + obj_ = CodDetail.factory() + obj_.build(child_) + self.set_CodDetail(obj_) + elif nodeName_ == 'DangerousGoodsDetail': + obj_ = DangerousGoodsDetail.factory() + obj_.build(child_) + self.set_DangerousGoodsDetail(obj_) + elif nodeName_ == 'DryIceWeight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_DryIceWeight(obj_) + elif nodeName_ == 'SignatureOptionDetail': + obj_ = SignatureOptionDetail.factory() + obj_.build(child_) + self.set_SignatureOptionDetail(obj_) + elif nodeName_ == 'PriorityAlertDetail': + obj_ = PriorityAlertDetail.factory() + obj_.build(child_) + self.set_PriorityAlertDetail(obj_) +# end class PackageSpecialServicesRequested + + +class Party(GeneratedsSuper): + """The descriptive data for a person or company entitiy doing business + with FedEx.""" + subclass = None + superclass = None + def __init__(self, AccountNumber=None, Tins=None, Contact=None, Address=None): + self.AccountNumber = AccountNumber + if Tins is None: + self.Tins = [] + else: + self.Tins = Tins + self.Contact = Contact + self.Address = Address + def factory(*args_, **kwargs_): + if Party.subclass: + return Party.subclass(*args_, **kwargs_) + else: + return Party(*args_, **kwargs_) + factory = staticmethod(factory) + def get_AccountNumber(self): return self.AccountNumber + def set_AccountNumber(self, AccountNumber): self.AccountNumber = AccountNumber + def get_Tins(self): return self.Tins + def set_Tins(self, Tins): self.Tins = Tins + def add_Tins(self, value): self.Tins.append(value) + def insert_Tins(self, index, value): self.Tins[index] = value + def get_Contact(self): return self.Contact + def set_Contact(self, Contact): self.Contact = Contact + def get_Address(self): return self.Address + def set_Address(self, Address): self.Address = Address + def export(self, outfile, level, namespace_='ns:', name_='Party', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Party') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Party'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Party', fromsubclass_=False): + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('<%sAccountNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AccountNumber).encode(ExternalEncoding), input_name='AccountNumber'), namespace_)) + for Tins_ in self.Tins: + Tins_.export(outfile, level, namespace_, name_='Tins') + if self.Contact: + self.Contact.export(outfile, level, namespace_, name_='Contact', ) + if self.Address: + self.Address.export(outfile, level, namespace_, name_='Address') + def hasContent_(self): + if ( + self.AccountNumber is not None or + self.Tins or + self.Contact is not None or + self.Address is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Party'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('AccountNumber=%s,\n' % quote_python(self.AccountNumber).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Tins=[\n') + level += 1 + for Tins_ in self.Tins: + showIndent(outfile, level) + outfile.write('model_.TaxpayerIdentification(\n') + Tins_.exportLiteral(outfile, level, name_='TaxpayerIdentification') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.Contact is not None: + showIndent(outfile, level) + outfile.write('Contact=model_.Contact(\n') + self.Contact.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Address is not None: + showIndent(outfile, level) + outfile.write('Address=model_.Address(\n') + self.Address.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'AccountNumber': + AccountNumber_ = child_.text + AccountNumber_ = self.gds_validate_string(AccountNumber_, node, 'AccountNumber') + self.AccountNumber = AccountNumber_ + elif nodeName_ == 'Tins': + obj_ = TaxpayerIdentification.factory() + obj_.build(child_) + self.Tins.append(obj_) + elif nodeName_ == 'Contact': + obj_ = Contact.factory() + obj_.build(child_) + self.set_Contact(obj_) + elif nodeName_ == 'Address': + obj_ = Address.factory() + obj_.build(child_) + self.set_Address(obj_) +# end class Party + + +class Payment(GeneratedsSuper): + """The descriptive data for the monetary compensation given to FedEx + for services rendered to the customer.""" + subclass = None + superclass = None + def __init__(self, PaymentType=None, Payor=None): + self.PaymentType = PaymentType + self.Payor = Payor + def factory(*args_, **kwargs_): + if Payment.subclass: + return Payment.subclass(*args_, **kwargs_) + else: + return Payment(*args_, **kwargs_) + factory = staticmethod(factory) + def get_PaymentType(self): return self.PaymentType + def set_PaymentType(self, PaymentType): self.PaymentType = PaymentType + def validate_PaymentType(self, value): + # Validate type PaymentType, a restriction on xs:string. + pass + def get_Payor(self): return self.Payor + def set_Payor(self, Payor): self.Payor = Payor + def export(self, outfile, level, namespace_='ns:', name_='Payment', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Payment') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Payment'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Payment', fromsubclass_=False): + if self.PaymentType is not None: + showIndent(outfile, level) + outfile.write('<%sPaymentType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PaymentType).encode(ExternalEncoding), input_name='PaymentType'), namespace_)) + if self.Payor: + self.Payor.export(outfile, level, namespace_, name_='Payor') + def hasContent_(self): + if ( + self.PaymentType is not None or + self.Payor is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Payment'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.PaymentType is not None: + showIndent(outfile, level) + outfile.write('PaymentType=%s,\n' % quote_python(self.PaymentType).encode(ExternalEncoding)) + if self.Payor is not None: + showIndent(outfile, level) + outfile.write('Payor=model_.Payor(\n') + self.Payor.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'PaymentType': + PaymentType_ = child_.text + PaymentType_ = self.gds_validate_string(PaymentType_, node, 'PaymentType') + self.PaymentType = PaymentType_ + self.validate_PaymentType(self.PaymentType) # validate type PaymentType + elif nodeName_ == 'Payor': + obj_ = Payor.factory() + obj_.build(child_) + self.set_Payor(obj_) +# end class Payment + + +class Payor(GeneratedsSuper): + """The descriptive data identifying the party responsible for payment + for a service.""" + subclass = None + superclass = None + def __init__(self, AccountNumber=None, CountryCode=None): + self.AccountNumber = AccountNumber + self.CountryCode = CountryCode + def factory(*args_, **kwargs_): + if Payor.subclass: + return Payor.subclass(*args_, **kwargs_) + else: + return Payor(*args_, **kwargs_) + factory = staticmethod(factory) + def get_AccountNumber(self): return self.AccountNumber + def set_AccountNumber(self, AccountNumber): self.AccountNumber = AccountNumber + def get_CountryCode(self): return self.CountryCode + def set_CountryCode(self, CountryCode): self.CountryCode = CountryCode + def export(self, outfile, level, namespace_='ns:', name_='Payor', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Payor') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Payor'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Payor', fromsubclass_=False): + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('<%sAccountNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AccountNumber).encode(ExternalEncoding), input_name='AccountNumber'), namespace_)) + if self.CountryCode is not None: + showIndent(outfile, level) + outfile.write('<%sCountryCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CountryCode).encode(ExternalEncoding), input_name='CountryCode'), namespace_)) + def hasContent_(self): + if ( + self.AccountNumber is not None or + self.CountryCode is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Payor'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('AccountNumber=%s,\n' % quote_python(self.AccountNumber).encode(ExternalEncoding)) + if self.CountryCode is not None: + showIndent(outfile, level) + outfile.write('CountryCode=%s,\n' % quote_python(self.CountryCode).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'AccountNumber': + AccountNumber_ = child_.text + AccountNumber_ = self.gds_validate_string(AccountNumber_, node, 'AccountNumber') + self.AccountNumber = AccountNumber_ + elif nodeName_ == 'CountryCode': + CountryCode_ = child_.text + CountryCode_ = self.gds_validate_string(CountryCode_, node, 'CountryCode') + self.CountryCode = CountryCode_ +# end class Payor + + +class PendingShipmentAccessDetail(GeneratedsSuper): + """This information describes how and when a pending shipment may be + accessed for completion.""" + subclass = None + superclass = None + def __init__(self, EmailLabelUrl=None, UserId=None, Password=None, ExpirationTimestamp=None): + self.EmailLabelUrl = EmailLabelUrl + self.UserId = UserId + self.Password = Password + self.ExpirationTimestamp = ExpirationTimestamp + def factory(*args_, **kwargs_): + if PendingShipmentAccessDetail.subclass: + return PendingShipmentAccessDetail.subclass(*args_, **kwargs_) + else: + return PendingShipmentAccessDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_EmailLabelUrl(self): return self.EmailLabelUrl + def set_EmailLabelUrl(self, EmailLabelUrl): self.EmailLabelUrl = EmailLabelUrl + def get_UserId(self): return self.UserId + def set_UserId(self, UserId): self.UserId = UserId + def get_Password(self): return self.Password + def set_Password(self, Password): self.Password = Password + def get_ExpirationTimestamp(self): return self.ExpirationTimestamp + def set_ExpirationTimestamp(self, ExpirationTimestamp): self.ExpirationTimestamp = ExpirationTimestamp + def export(self, outfile, level, namespace_='ns:', name_='PendingShipmentAccessDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='PendingShipmentAccessDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='PendingShipmentAccessDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='PendingShipmentAccessDetail', fromsubclass_=False): + if self.EmailLabelUrl is not None: + showIndent(outfile, level) + outfile.write('<%sEmailLabelUrl>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.EmailLabelUrl).encode(ExternalEncoding), input_name='EmailLabelUrl'), namespace_)) + if self.UserId is not None: + showIndent(outfile, level) + outfile.write('<%sUserId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.UserId).encode(ExternalEncoding), input_name='UserId'), namespace_)) + if self.Password is not None: + showIndent(outfile, level) + outfile.write('<%sPassword>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Password).encode(ExternalEncoding), input_name='Password'), namespace_)) + if self.ExpirationTimestamp is not None: + showIndent(outfile, level) + outfile.write('<%sExpirationTimestamp>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ExpirationTimestamp).encode(ExternalEncoding), input_name='ExpirationTimestamp'), namespace_)) + def hasContent_(self): + if ( + self.EmailLabelUrl is not None or + self.UserId is not None or + self.Password is not None or + self.ExpirationTimestamp is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='PendingShipmentAccessDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.EmailLabelUrl is not None: + showIndent(outfile, level) + outfile.write('EmailLabelUrl=%s,\n' % quote_python(self.EmailLabelUrl).encode(ExternalEncoding)) + if self.UserId is not None: + showIndent(outfile, level) + outfile.write('UserId=%s,\n' % quote_python(self.UserId).encode(ExternalEncoding)) + if self.Password is not None: + showIndent(outfile, level) + outfile.write('Password=%s,\n' % quote_python(self.Password).encode(ExternalEncoding)) + if self.ExpirationTimestamp is not None: + showIndent(outfile, level) + outfile.write('ExpirationTimestamp=%s,\n' % quote_python(self.ExpirationTimestamp).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'EmailLabelUrl': + EmailLabelUrl_ = child_.text + EmailLabelUrl_ = self.gds_validate_string(EmailLabelUrl_, node, 'EmailLabelUrl') + self.EmailLabelUrl = EmailLabelUrl_ + elif nodeName_ == 'UserId': + UserId_ = child_.text + UserId_ = self.gds_validate_string(UserId_, node, 'UserId') + self.UserId = UserId_ + elif nodeName_ == 'Password': + Password_ = child_.text + Password_ = self.gds_validate_string(Password_, node, 'Password') + self.Password = Password_ + elif nodeName_ == 'ExpirationTimestamp': + ExpirationTimestamp_ = child_.text + ExpirationTimestamp_ = self.gds_validate_string(ExpirationTimestamp_, node, 'ExpirationTimestamp') + self.ExpirationTimestamp = ExpirationTimestamp_ +# end class PendingShipmentAccessDetail + + +class PendingShipmentDetail(GeneratedsSuper): + """This information describes the kind of pending shipment being + requested.""" + subclass = None + superclass = None + def __init__(self, Type=None, ExpirationDate=None, EmailLabelDetail=None): + self.Type = Type + self.ExpirationDate = ExpirationDate + self.EmailLabelDetail = EmailLabelDetail + def factory(*args_, **kwargs_): + if PendingShipmentDetail.subclass: + return PendingShipmentDetail.subclass(*args_, **kwargs_) + else: + return PendingShipmentDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Type(self): return self.Type + def set_Type(self, Type): self.Type = Type + def validate_PendingShipmentType(self, value): + # Validate type PendingShipmentType, a restriction on xs:string. + pass + def get_ExpirationDate(self): return self.ExpirationDate + def set_ExpirationDate(self, ExpirationDate): self.ExpirationDate = ExpirationDate + def get_EmailLabelDetail(self): return self.EmailLabelDetail + def set_EmailLabelDetail(self, EmailLabelDetail): self.EmailLabelDetail = EmailLabelDetail + def export(self, outfile, level, namespace_='ns:', name_='PendingShipmentDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='PendingShipmentDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='PendingShipmentDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='PendingShipmentDetail', fromsubclass_=False): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('<%sType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Type).encode(ExternalEncoding), input_name='Type'), namespace_)) + if self.ExpirationDate is not None: + showIndent(outfile, level) + outfile.write('<%sExpirationDate>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ExpirationDate).encode(ExternalEncoding), input_name='ExpirationDate'), namespace_)) + if self.EmailLabelDetail: + self.EmailLabelDetail.export(outfile, level, namespace_, name_='EmailLabelDetail') + def hasContent_(self): + if ( + self.Type is not None or + self.ExpirationDate is not None or + self.EmailLabelDetail is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='PendingShipmentDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('Type=%s,\n' % quote_python(self.Type).encode(ExternalEncoding)) + if self.ExpirationDate is not None: + showIndent(outfile, level) + outfile.write('ExpirationDate=%s,\n' % quote_python(self.ExpirationDate).encode(ExternalEncoding)) + if self.EmailLabelDetail is not None: + showIndent(outfile, level) + outfile.write('EmailLabelDetail=model_.EMailLabelDetail(\n') + self.EmailLabelDetail.exportLiteral(outfile, level, name_='EmailLabelDetail') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Type': + Type_ = child_.text + Type_ = self.gds_validate_string(Type_, node, 'Type') + self.Type = Type_ + self.validate_PendingShipmentType(self.Type) # validate type PendingShipmentType + elif nodeName_ == 'ExpirationDate': + ExpirationDate_ = child_.text + ExpirationDate_ = self.gds_validate_string(ExpirationDate_, node, 'ExpirationDate') + self.ExpirationDate = ExpirationDate_ + elif nodeName_ == 'EmailLabelDetail': + obj_ = EMailLabelDetail.factory() + obj_.build(child_) + self.set_EmailLabelDetail(obj_) +# end class PendingShipmentDetail + + +class PickupDetail(GeneratedsSuper): + """This class describes the pickup characteristics of a shipment (e.g. + for use in a tag request).""" + subclass = None + superclass = None + def __init__(self, ReadyDateTime=None, LatestPickupDateTime=None, CourierInstructions=None, RequestType=None, RequestSource=None): + self.ReadyDateTime = ReadyDateTime + self.LatestPickupDateTime = LatestPickupDateTime + self.CourierInstructions = CourierInstructions + self.RequestType = RequestType + self.RequestSource = RequestSource + def factory(*args_, **kwargs_): + if PickupDetail.subclass: + return PickupDetail.subclass(*args_, **kwargs_) + else: + return PickupDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_ReadyDateTime(self): return self.ReadyDateTime + def set_ReadyDateTime(self, ReadyDateTime): self.ReadyDateTime = ReadyDateTime + def get_LatestPickupDateTime(self): return self.LatestPickupDateTime + def set_LatestPickupDateTime(self, LatestPickupDateTime): self.LatestPickupDateTime = LatestPickupDateTime + def get_CourierInstructions(self): return self.CourierInstructions + def set_CourierInstructions(self, CourierInstructions): self.CourierInstructions = CourierInstructions + def get_RequestType(self): return self.RequestType + def set_RequestType(self, RequestType): self.RequestType = RequestType + def validate_PickupRequestType(self, value): + # Validate type PickupRequestType, a restriction on xs:string. + pass + def get_RequestSource(self): return self.RequestSource + def set_RequestSource(self, RequestSource): self.RequestSource = RequestSource + def validate_PickupRequestSourceType(self, value): + # Validate type PickupRequestSourceType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='PickupDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='PickupDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='PickupDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='PickupDetail', fromsubclass_=False): + if self.ReadyDateTime is not None: + showIndent(outfile, level) + outfile.write('<%sReadyDateTime>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ReadyDateTime).encode(ExternalEncoding), input_name='ReadyDateTime'), namespace_)) + if self.LatestPickupDateTime is not None: + showIndent(outfile, level) + outfile.write('<%sLatestPickupDateTime>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LatestPickupDateTime).encode(ExternalEncoding), input_name='LatestPickupDateTime'), namespace_)) + if self.CourierInstructions is not None: + showIndent(outfile, level) + outfile.write('<%sCourierInstructions>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CourierInstructions).encode(ExternalEncoding), input_name='CourierInstructions'), namespace_)) + if self.RequestType is not None: + showIndent(outfile, level) + outfile.write('<%sRequestType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RequestType).encode(ExternalEncoding), input_name='RequestType'), namespace_)) + if self.RequestSource is not None: + showIndent(outfile, level) + outfile.write('<%sRequestSource>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RequestSource).encode(ExternalEncoding), input_name='RequestSource'), namespace_)) + def hasContent_(self): + if ( + self.ReadyDateTime is not None or + self.LatestPickupDateTime is not None or + self.CourierInstructions is not None or + self.RequestType is not None or + self.RequestSource is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='PickupDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.ReadyDateTime is not None: + showIndent(outfile, level) + outfile.write('ReadyDateTime=%s,\n' % quote_python(self.ReadyDateTime).encode(ExternalEncoding)) + if self.LatestPickupDateTime is not None: + showIndent(outfile, level) + outfile.write('LatestPickupDateTime=%s,\n' % quote_python(self.LatestPickupDateTime).encode(ExternalEncoding)) + if self.CourierInstructions is not None: + showIndent(outfile, level) + outfile.write('CourierInstructions=%s,\n' % quote_python(self.CourierInstructions).encode(ExternalEncoding)) + if self.RequestType is not None: + showIndent(outfile, level) + outfile.write('RequestType=%s,\n' % quote_python(self.RequestType).encode(ExternalEncoding)) + if self.RequestSource is not None: + showIndent(outfile, level) + outfile.write('RequestSource=%s,\n' % quote_python(self.RequestSource).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'ReadyDateTime': + ReadyDateTime_ = child_.text + ReadyDateTime_ = self.gds_validate_string(ReadyDateTime_, node, 'ReadyDateTime') + self.ReadyDateTime = ReadyDateTime_ + elif nodeName_ == 'LatestPickupDateTime': + LatestPickupDateTime_ = child_.text + LatestPickupDateTime_ = self.gds_validate_string(LatestPickupDateTime_, node, 'LatestPickupDateTime') + self.LatestPickupDateTime = LatestPickupDateTime_ + elif nodeName_ == 'CourierInstructions': + CourierInstructions_ = child_.text + CourierInstructions_ = self.gds_validate_string(CourierInstructions_, node, 'CourierInstructions') + self.CourierInstructions = CourierInstructions_ + elif nodeName_ == 'RequestType': + RequestType_ = child_.text + RequestType_ = self.gds_validate_string(RequestType_, node, 'RequestType') + self.RequestType = RequestType_ + self.validate_PickupRequestType(self.RequestType) # validate type PickupRequestType + elif nodeName_ == 'RequestSource': + RequestSource_ = child_.text + RequestSource_ = self.gds_validate_string(RequestSource_, node, 'RequestSource') + self.RequestSource = RequestSource_ + self.validate_PickupRequestSourceType(self.RequestSource) # validate type PickupRequestSourceType +# end class PickupDetail + + +class PrintedReference(GeneratedsSuper): + """Represents a reference identifier printed on Freight bills of lading""" + subclass = None + superclass = None + def __init__(self, Type=None, Value=None): + self.Type = Type + self.Value = Value + def factory(*args_, **kwargs_): + if PrintedReference.subclass: + return PrintedReference.subclass(*args_, **kwargs_) + else: + return PrintedReference(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Type(self): return self.Type + def set_Type(self, Type): self.Type = Type + def validate_PrintedReferenceType(self, value): + # Validate type PrintedReferenceType, a restriction on xs:string. + pass + def get_Value(self): return self.Value + def set_Value(self, Value): self.Value = Value + def export(self, outfile, level, namespace_='ns:', name_='PrintedReference', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='PrintedReference') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='PrintedReference'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='PrintedReference', fromsubclass_=False): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('<%sType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Type).encode(ExternalEncoding), input_name='Type'), namespace_)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('<%sValue>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Value).encode(ExternalEncoding), input_name='Value'), namespace_)) + def hasContent_(self): + if ( + self.Type is not None or + self.Value is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='PrintedReference'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('Type=%s,\n' % quote_python(self.Type).encode(ExternalEncoding)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('Value=%s,\n' % quote_python(self.Value).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Type': + Type_ = child_.text + Type_ = self.gds_validate_string(Type_, node, 'Type') + self.Type = Type_ + self.validate_PrintedReferenceType(self.Type) # validate type PrintedReferenceType + elif nodeName_ == 'Value': + Value_ = child_.text + Value_ = self.gds_validate_string(Value_, node, 'Value') + self.Value = Value_ +# end class PrintedReference + + +class PriorityAlertDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Content=None): + if Content is None: + self.Content = [] + else: + self.Content = Content + def factory(*args_, **kwargs_): + if PriorityAlertDetail.subclass: + return PriorityAlertDetail.subclass(*args_, **kwargs_) + else: + return PriorityAlertDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Content(self): return self.Content + def set_Content(self, Content): self.Content = Content + def add_Content(self, value): self.Content.append(value) + def insert_Content(self, index, value): self.Content[index] = value + def export(self, outfile, level, namespace_='ns:', name_='PriorityAlertDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='PriorityAlertDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='PriorityAlertDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='PriorityAlertDetail', fromsubclass_=False): + for Content_ in self.Content: + showIndent(outfile, level) + outfile.write('<%sContent>%s\n' % (namespace_, self.gds_format_string(quote_xml(Content_).encode(ExternalEncoding), input_name='Content'), namespace_)) + def hasContent_(self): + if ( + self.Content + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='PriorityAlertDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('Content=[\n') + level += 1 + for Content_ in self.Content: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(Content_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Content': + Content_ = child_.text + Content_ = self.gds_validate_string(Content_, node, 'Content') + self.Content.append(Content_) +# end class PriorityAlertDetail + + +class ProcessShipmentReply(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, HighestSeverity=None, Notifications=None, TransactionDetail=None, Version=None, CompletedShipmentDetail=None, ErrorLabels=None): + self.HighestSeverity = HighestSeverity + if Notifications is None: + self.Notifications = [] + else: + self.Notifications = Notifications + self.TransactionDetail = TransactionDetail + self.Version = Version + self.CompletedShipmentDetail = CompletedShipmentDetail + if ErrorLabels is None: + self.ErrorLabels = [] + else: + self.ErrorLabels = ErrorLabels + def factory(*args_, **kwargs_): + if ProcessShipmentReply.subclass: + return ProcessShipmentReply.subclass(*args_, **kwargs_) + else: + return ProcessShipmentReply(*args_, **kwargs_) + factory = staticmethod(factory) + def get_HighestSeverity(self): return self.HighestSeverity + def set_HighestSeverity(self, HighestSeverity): self.HighestSeverity = HighestSeverity + def validate_NotificationSeverityType(self, value): + # Validate type NotificationSeverityType, a restriction on xs:string. + pass + def get_Notifications(self): return self.Notifications + def set_Notifications(self, Notifications): self.Notifications = Notifications + def add_Notifications(self, value): self.Notifications.append(value) + def insert_Notifications(self, index, value): self.Notifications[index] = value + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_CompletedShipmentDetail(self): return self.CompletedShipmentDetail + def set_CompletedShipmentDetail(self, CompletedShipmentDetail): self.CompletedShipmentDetail = CompletedShipmentDetail + def get_ErrorLabels(self): return self.ErrorLabels + def set_ErrorLabels(self, ErrorLabels): self.ErrorLabels = ErrorLabels + def add_ErrorLabels(self, value): self.ErrorLabels.append(value) + def insert_ErrorLabels(self, index, value): self.ErrorLabels[index] = value + def export(self, outfile, level, namespace_='ns:', name_='ProcessShipmentReply', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ProcessShipmentReply') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ProcessShipmentReply'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ProcessShipmentReply', fromsubclass_=False): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('<%sHighestSeverity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HighestSeverity).encode(ExternalEncoding), input_name='HighestSeverity'), namespace_)) + for Notifications_ in self.Notifications: + Notifications_.export(outfile, level, namespace_, name_='Notifications') + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.CompletedShipmentDetail: + self.CompletedShipmentDetail.export(outfile, level, namespace_, name_='CompletedShipmentDetail') + for ErrorLabels_ in self.ErrorLabels: + ErrorLabels_.export(outfile, level, namespace_, name_='ErrorLabels') + def hasContent_(self): + if ( + self.HighestSeverity is not None or + self.Notifications or + self.TransactionDetail is not None or + self.Version is not None or + self.CompletedShipmentDetail is not None or + self.ErrorLabels + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ProcessShipmentReply'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('HighestSeverity=%s,\n' % quote_python(self.HighestSeverity).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Notifications=[\n') + level += 1 + for Notifications_ in self.Notifications: + showIndent(outfile, level) + outfile.write('model_.Notification(\n') + Notifications_.exportLiteral(outfile, level, name_='Notification') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.CompletedShipmentDetail is not None: + showIndent(outfile, level) + outfile.write('CompletedShipmentDetail=model_.CompletedShipmentDetail(\n') + self.CompletedShipmentDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('ErrorLabels=[\n') + level += 1 + for ErrorLabels_ in self.ErrorLabels: + showIndent(outfile, level) + outfile.write('model_.ShippingDocument(\n') + ErrorLabels_.exportLiteral(outfile, level, name_='ShippingDocument') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'HighestSeverity': + HighestSeverity_ = child_.text + HighestSeverity_ = self.gds_validate_string(HighestSeverity_, node, 'HighestSeverity') + self.HighestSeverity = HighestSeverity_ + self.validate_NotificationSeverityType(self.HighestSeverity) # validate type NotificationSeverityType + elif nodeName_ == 'Notifications': + obj_ = Notification.factory() + obj_.build(child_) + self.Notifications.append(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'CompletedShipmentDetail': + obj_ = CompletedShipmentDetail.factory() + obj_.build(child_) + self.set_CompletedShipmentDetail(obj_) + elif nodeName_ == 'ErrorLabels': + obj_ = ShippingDocument.factory() + obj_.build(child_) + self.ErrorLabels.append(obj_) +# end class ProcessShipmentReply + + +class ProcessShipmentRequest(GeneratedsSuper): + """Descriptive data sent to FedEx by a customer in order to ship a + package.""" + subclass = None + superclass = None + def __init__(self, WebAuthenticationDetail=None, ClientDetail=None, TransactionDetail=None, Version=None, RequestedShipment=None): + self.WebAuthenticationDetail = WebAuthenticationDetail + self.ClientDetail = ClientDetail + self.TransactionDetail = TransactionDetail + self.Version = Version + self.RequestedShipment = RequestedShipment + def factory(*args_, **kwargs_): + if ProcessShipmentRequest.subclass: + return ProcessShipmentRequest.subclass(*args_, **kwargs_) + else: + return ProcessShipmentRequest(*args_, **kwargs_) + factory = staticmethod(factory) + def get_WebAuthenticationDetail(self): return self.WebAuthenticationDetail + def set_WebAuthenticationDetail(self, WebAuthenticationDetail): self.WebAuthenticationDetail = WebAuthenticationDetail + def get_ClientDetail(self): return self.ClientDetail + def set_ClientDetail(self, ClientDetail): self.ClientDetail = ClientDetail + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_RequestedShipment(self): return self.RequestedShipment + def set_RequestedShipment(self, RequestedShipment): self.RequestedShipment = RequestedShipment + def export(self, outfile, level, namespace_='ns:', name_='ProcessShipmentRequest', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ProcessShipmentRequest') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ProcessShipmentRequest'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ProcessShipmentRequest', fromsubclass_=False): + if self.WebAuthenticationDetail: + self.WebAuthenticationDetail.export(outfile, level, namespace_, name_='WebAuthenticationDetail', ) + if self.ClientDetail: + self.ClientDetail.export(outfile, level, namespace_, name_='ClientDetail', ) + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.RequestedShipment: + self.RequestedShipment.export(outfile, level, namespace_, name_='RequestedShipment', ) + def hasContent_(self): + if ( + self.WebAuthenticationDetail is not None or + self.ClientDetail is not None or + self.TransactionDetail is not None or + self.Version is not None or + self.RequestedShipment is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ProcessShipmentRequest'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.WebAuthenticationDetail is not None: + showIndent(outfile, level) + outfile.write('WebAuthenticationDetail=model_.WebAuthenticationDetail(\n') + self.WebAuthenticationDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ClientDetail is not None: + showIndent(outfile, level) + outfile.write('ClientDetail=model_.ClientDetail(\n') + self.ClientDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.RequestedShipment is not None: + showIndent(outfile, level) + outfile.write('RequestedShipment=model_.RequestedShipment(\n') + self.RequestedShipment.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'WebAuthenticationDetail': + obj_ = WebAuthenticationDetail.factory() + obj_.build(child_) + self.set_WebAuthenticationDetail(obj_) + elif nodeName_ == 'ClientDetail': + obj_ = ClientDetail.factory() + obj_.build(child_) + self.set_ClientDetail(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'RequestedShipment': + obj_ = RequestedShipment.factory() + obj_.build(child_) + self.set_RequestedShipment(obj_) +# end class ProcessShipmentRequest + + +class ProcessTagReply(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, HighestSeverity=None, Notifications=None, TransactionDetail=None, Version=None, CompletedShipmentDetail=None): + self.HighestSeverity = HighestSeverity + if Notifications is None: + self.Notifications = [] + else: + self.Notifications = Notifications + self.TransactionDetail = TransactionDetail + self.Version = Version + self.CompletedShipmentDetail = CompletedShipmentDetail + def factory(*args_, **kwargs_): + if ProcessTagReply.subclass: + return ProcessTagReply.subclass(*args_, **kwargs_) + else: + return ProcessTagReply(*args_, **kwargs_) + factory = staticmethod(factory) + def get_HighestSeverity(self): return self.HighestSeverity + def set_HighestSeverity(self, HighestSeverity): self.HighestSeverity = HighestSeverity + def validate_NotificationSeverityType(self, value): + # Validate type NotificationSeverityType, a restriction on xs:string. + pass + def get_Notifications(self): return self.Notifications + def set_Notifications(self, Notifications): self.Notifications = Notifications + def add_Notifications(self, value): self.Notifications.append(value) + def insert_Notifications(self, index, value): self.Notifications[index] = value + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_CompletedShipmentDetail(self): return self.CompletedShipmentDetail + def set_CompletedShipmentDetail(self, CompletedShipmentDetail): self.CompletedShipmentDetail = CompletedShipmentDetail + def export(self, outfile, level, namespace_='ns:', name_='ProcessTagReply', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ProcessTagReply') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ProcessTagReply'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ProcessTagReply', fromsubclass_=False): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('<%sHighestSeverity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HighestSeverity).encode(ExternalEncoding), input_name='HighestSeverity'), namespace_)) + for Notifications_ in self.Notifications: + Notifications_.export(outfile, level, namespace_, name_='Notifications') + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.CompletedShipmentDetail: + self.CompletedShipmentDetail.export(outfile, level, namespace_, name_='CompletedShipmentDetail') + def hasContent_(self): + if ( + self.HighestSeverity is not None or + self.Notifications or + self.TransactionDetail is not None or + self.Version is not None or + self.CompletedShipmentDetail is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ProcessTagReply'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('HighestSeverity=%s,\n' % quote_python(self.HighestSeverity).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Notifications=[\n') + level += 1 + for Notifications_ in self.Notifications: + showIndent(outfile, level) + outfile.write('model_.Notification(\n') + Notifications_.exportLiteral(outfile, level, name_='Notification') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.CompletedShipmentDetail is not None: + showIndent(outfile, level) + outfile.write('CompletedShipmentDetail=model_.CompletedShipmentDetail(\n') + self.CompletedShipmentDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'HighestSeverity': + HighestSeverity_ = child_.text + HighestSeverity_ = self.gds_validate_string(HighestSeverity_, node, 'HighestSeverity') + self.HighestSeverity = HighestSeverity_ + self.validate_NotificationSeverityType(self.HighestSeverity) # validate type NotificationSeverityType + elif nodeName_ == 'Notifications': + obj_ = Notification.factory() + obj_.build(child_) + self.Notifications.append(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'CompletedShipmentDetail': + obj_ = CompletedShipmentDetail.factory() + obj_.build(child_) + self.set_CompletedShipmentDetail(obj_) +# end class ProcessTagReply + + +class ProcessTagRequest(GeneratedsSuper): + """Descriptive data sent to FedEx by a customer in order to ship a + package.""" + subclass = None + superclass = None + def __init__(self, WebAuthenticationDetail=None, ClientDetail=None, TransactionDetail=None, Version=None, RequestedShipment=None): + self.WebAuthenticationDetail = WebAuthenticationDetail + self.ClientDetail = ClientDetail + self.TransactionDetail = TransactionDetail + self.Version = Version + self.RequestedShipment = RequestedShipment + def factory(*args_, **kwargs_): + if ProcessTagRequest.subclass: + return ProcessTagRequest.subclass(*args_, **kwargs_) + else: + return ProcessTagRequest(*args_, **kwargs_) + factory = staticmethod(factory) + def get_WebAuthenticationDetail(self): return self.WebAuthenticationDetail + def set_WebAuthenticationDetail(self, WebAuthenticationDetail): self.WebAuthenticationDetail = WebAuthenticationDetail + def get_ClientDetail(self): return self.ClientDetail + def set_ClientDetail(self, ClientDetail): self.ClientDetail = ClientDetail + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_RequestedShipment(self): return self.RequestedShipment + def set_RequestedShipment(self, RequestedShipment): self.RequestedShipment = RequestedShipment + def export(self, outfile, level, namespace_='ns:', name_='ProcessTagRequest', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ProcessTagRequest') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ProcessTagRequest'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ProcessTagRequest', fromsubclass_=False): + if self.WebAuthenticationDetail: + self.WebAuthenticationDetail.export(outfile, level, namespace_, name_='WebAuthenticationDetail', ) + if self.ClientDetail: + self.ClientDetail.export(outfile, level, namespace_, name_='ClientDetail', ) + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.RequestedShipment: + self.RequestedShipment.export(outfile, level, namespace_, name_='RequestedShipment', ) + def hasContent_(self): + if ( + self.WebAuthenticationDetail is not None or + self.ClientDetail is not None or + self.TransactionDetail is not None or + self.Version is not None or + self.RequestedShipment is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ProcessTagRequest'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.WebAuthenticationDetail is not None: + showIndent(outfile, level) + outfile.write('WebAuthenticationDetail=model_.WebAuthenticationDetail(\n') + self.WebAuthenticationDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ClientDetail is not None: + showIndent(outfile, level) + outfile.write('ClientDetail=model_.ClientDetail(\n') + self.ClientDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.RequestedShipment is not None: + showIndent(outfile, level) + outfile.write('RequestedShipment=model_.RequestedShipment(\n') + self.RequestedShipment.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'WebAuthenticationDetail': + obj_ = WebAuthenticationDetail.factory() + obj_.build(child_) + self.set_WebAuthenticationDetail(obj_) + elif nodeName_ == 'ClientDetail': + obj_ = ClientDetail.factory() + obj_.build(child_) + self.set_ClientDetail(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'RequestedShipment': + obj_ = RequestedShipment.factory() + obj_.build(child_) + self.set_RequestedShipment(obj_) +# end class ProcessTagRequest + + +class RateDiscount(GeneratedsSuper): + """Identifies a discount applied to the shipment.""" + subclass = None + superclass = None + def __init__(self, RateDiscountType=None, Description=None, Amount=None, Percent=None): + self.RateDiscountType = RateDiscountType + self.Description = Description + self.Amount = Amount + self.Percent = Percent + def factory(*args_, **kwargs_): + if RateDiscount.subclass: + return RateDiscount.subclass(*args_, **kwargs_) + else: + return RateDiscount(*args_, **kwargs_) + factory = staticmethod(factory) + def get_RateDiscountType(self): return self.RateDiscountType + def set_RateDiscountType(self, RateDiscountType): self.RateDiscountType = RateDiscountType + def validate_RateDiscountType(self, value): + # Validate type RateDiscountType, a restriction on xs:string. + pass + def get_Description(self): return self.Description + def set_Description(self, Description): self.Description = Description + def get_Amount(self): return self.Amount + def set_Amount(self, Amount): self.Amount = Amount + def get_Percent(self): return self.Percent + def set_Percent(self, Percent): self.Percent = Percent + def export(self, outfile, level, namespace_='ns:', name_='RateDiscount', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='RateDiscount') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='RateDiscount'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='RateDiscount', fromsubclass_=False): + if self.RateDiscountType is not None: + showIndent(outfile, level) + outfile.write('<%sRateDiscountType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RateDiscountType).encode(ExternalEncoding), input_name='RateDiscountType'), namespace_)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('<%sDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Description).encode(ExternalEncoding), input_name='Description'), namespace_)) + if self.Amount: + self.Amount.export(outfile, level, namespace_, name_='Amount') + if self.Percent is not None: + showIndent(outfile, level) + outfile.write('<%sPercent>%s\n' % (namespace_, self.gds_format_float(self.Percent, input_name='Percent'), namespace_)) + def hasContent_(self): + if ( + self.RateDiscountType is not None or + self.Description is not None or + self.Amount is not None or + self.Percent is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='RateDiscount'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.RateDiscountType is not None: + showIndent(outfile, level) + outfile.write('RateDiscountType=%s,\n' % quote_python(self.RateDiscountType).encode(ExternalEncoding)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('Description=%s,\n' % quote_python(self.Description).encode(ExternalEncoding)) + if self.Amount is not None: + showIndent(outfile, level) + outfile.write('Amount=model_.Money(\n') + self.Amount.exportLiteral(outfile, level, name_='Amount') + showIndent(outfile, level) + outfile.write('),\n') + if self.Percent is not None: + showIndent(outfile, level) + outfile.write('Percent=%f,\n' % self.Percent) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'RateDiscountType': + RateDiscountType_ = child_.text + RateDiscountType_ = self.gds_validate_string(RateDiscountType_, node, 'RateDiscountType') + self.RateDiscountType = RateDiscountType_ + self.validate_RateDiscountType(self.RateDiscountType) # validate type RateDiscountType + elif nodeName_ == 'Description': + Description_ = child_.text + Description_ = self.gds_validate_string(Description_, node, 'Description') + self.Description = Description_ + elif nodeName_ == 'Amount': + obj_ = Money.factory() + obj_.build(child_) + self.set_Amount(obj_) + elif nodeName_ == 'Percent': + sval_ = child_.text + try: + fval_ = float(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires float or double: %s' % exp) + fval_ = self.gds_validate_float(fval_, node, 'Percent') + self.Percent = fval_ +# end class RateDiscount + + +class Rebate(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, RebateType=None, Description=None, Amount=None, Percent=None): + self.RebateType = RebateType + self.Description = Description + self.Amount = Amount + self.Percent = Percent + def factory(*args_, **kwargs_): + if Rebate.subclass: + return Rebate.subclass(*args_, **kwargs_) + else: + return Rebate(*args_, **kwargs_) + factory = staticmethod(factory) + def get_RebateType(self): return self.RebateType + def set_RebateType(self, RebateType): self.RebateType = RebateType + def validate_RebateType(self, value): + # Validate type RebateType, a restriction on xs:string. + pass + def get_Description(self): return self.Description + def set_Description(self, Description): self.Description = Description + def get_Amount(self): return self.Amount + def set_Amount(self, Amount): self.Amount = Amount + def get_Percent(self): return self.Percent + def set_Percent(self, Percent): self.Percent = Percent + def export(self, outfile, level, namespace_='ns:', name_='Rebate', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Rebate') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Rebate'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Rebate', fromsubclass_=False): + if self.RebateType is not None: + showIndent(outfile, level) + outfile.write('<%sRebateType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RebateType).encode(ExternalEncoding), input_name='RebateType'), namespace_)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('<%sDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Description).encode(ExternalEncoding), input_name='Description'), namespace_)) + if self.Amount: + self.Amount.export(outfile, level, namespace_, name_='Amount') + if self.Percent is not None: + showIndent(outfile, level) + outfile.write('<%sPercent>%s\n' % (namespace_, self.gds_format_float(self.Percent, input_name='Percent'), namespace_)) + def hasContent_(self): + if ( + self.RebateType is not None or + self.Description is not None or + self.Amount is not None or + self.Percent is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Rebate'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.RebateType is not None: + showIndent(outfile, level) + outfile.write('RebateType=%s,\n' % quote_python(self.RebateType).encode(ExternalEncoding)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('Description=%s,\n' % quote_python(self.Description).encode(ExternalEncoding)) + if self.Amount is not None: + showIndent(outfile, level) + outfile.write('Amount=model_.Money(\n') + self.Amount.exportLiteral(outfile, level, name_='Amount') + showIndent(outfile, level) + outfile.write('),\n') + if self.Percent is not None: + showIndent(outfile, level) + outfile.write('Percent=%f,\n' % self.Percent) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'RebateType': + RebateType_ = child_.text + RebateType_ = self.gds_validate_string(RebateType_, node, 'RebateType') + self.RebateType = RebateType_ + self.validate_RebateType(self.RebateType) # validate type RebateType + elif nodeName_ == 'Description': + Description_ = child_.text + Description_ = self.gds_validate_string(Description_, node, 'Description') + self.Description = Description_ + elif nodeName_ == 'Amount': + obj_ = Money.factory() + obj_.build(child_) + self.set_Amount(obj_) + elif nodeName_ == 'Percent': + sval_ = child_.text + try: + fval_ = float(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires float or double: %s' % exp) + fval_ = self.gds_validate_float(fval_, node, 'Percent') + self.Percent = fval_ +# end class Rebate + + +class RecipientCustomsId(GeneratedsSuper): + """Specifies how the recipient is identified for customs purposes; the + requirements on this information vary with destination country.""" + subclass = None + superclass = None + def __init__(self, Type=None, Value=None): + self.Type = Type + self.Value = Value + def factory(*args_, **kwargs_): + if RecipientCustomsId.subclass: + return RecipientCustomsId.subclass(*args_, **kwargs_) + else: + return RecipientCustomsId(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Type(self): return self.Type + def set_Type(self, Type): self.Type = Type + def validate_RecipientCustomsIdType(self, value): + # Validate type RecipientCustomsIdType, a restriction on xs:string. + pass + def get_Value(self): return self.Value + def set_Value(self, Value): self.Value = Value + def export(self, outfile, level, namespace_='ns:', name_='RecipientCustomsId', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='RecipientCustomsId') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='RecipientCustomsId'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='RecipientCustomsId', fromsubclass_=False): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('<%sType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Type).encode(ExternalEncoding), input_name='Type'), namespace_)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('<%sValue>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Value).encode(ExternalEncoding), input_name='Value'), namespace_)) + def hasContent_(self): + if ( + self.Type is not None or + self.Value is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='RecipientCustomsId'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('Type=%s,\n' % quote_python(self.Type).encode(ExternalEncoding)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('Value=%s,\n' % quote_python(self.Value).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Type': + Type_ = child_.text + Type_ = self.gds_validate_string(Type_, node, 'Type') + self.Type = Type_ + self.validate_RecipientCustomsIdType(self.Type) # validate type RecipientCustomsIdType + elif nodeName_ == 'Value': + Value_ = child_.text + Value_ = self.gds_validate_string(Value_, node, 'Value') + self.Value = Value_ +# end class RecipientCustomsId + + +class RequestedPackageLineItem(GeneratedsSuper): + """This class rationalizes RequestedPackage and RequestedPackageSummary + from previous interfaces. The way in which it is uses within a + RequestedShipment depends on the RequestedPackageDetailType + value specified for that shipment.""" + subclass = None + superclass = None + def __init__(self, SequenceNumber=None, GroupNumber=None, GroupPackageCount=None, VariableHandlingChargeDetail=None, InsuredValue=None, Weight=None, Dimensions=None, PhysicalPackaging=None, ItemDescription=None, CustomerReferences=None, SpecialServicesRequested=None, ContentRecords=None): + self.SequenceNumber = SequenceNumber + self.GroupNumber = GroupNumber + self.GroupPackageCount = GroupPackageCount + self.VariableHandlingChargeDetail = VariableHandlingChargeDetail + self.InsuredValue = InsuredValue + self.Weight = Weight + self.Dimensions = Dimensions + self.PhysicalPackaging = PhysicalPackaging + self.ItemDescription = ItemDescription + if CustomerReferences is None: + self.CustomerReferences = [] + else: + self.CustomerReferences = CustomerReferences + self.SpecialServicesRequested = SpecialServicesRequested + if ContentRecords is None: + self.ContentRecords = [] + else: + self.ContentRecords = ContentRecords + def factory(*args_, **kwargs_): + if RequestedPackageLineItem.subclass: + return RequestedPackageLineItem.subclass(*args_, **kwargs_) + else: + return RequestedPackageLineItem(*args_, **kwargs_) + factory = staticmethod(factory) + def get_SequenceNumber(self): return self.SequenceNumber + def set_SequenceNumber(self, SequenceNumber): self.SequenceNumber = SequenceNumber + def get_GroupNumber(self): return self.GroupNumber + def set_GroupNumber(self, GroupNumber): self.GroupNumber = GroupNumber + def get_GroupPackageCount(self): return self.GroupPackageCount + def set_GroupPackageCount(self, GroupPackageCount): self.GroupPackageCount = GroupPackageCount + def get_VariableHandlingChargeDetail(self): return self.VariableHandlingChargeDetail + def set_VariableHandlingChargeDetail(self, VariableHandlingChargeDetail): self.VariableHandlingChargeDetail = VariableHandlingChargeDetail + def get_InsuredValue(self): return self.InsuredValue + def set_InsuredValue(self, InsuredValue): self.InsuredValue = InsuredValue + def get_Weight(self): return self.Weight + def set_Weight(self, Weight): self.Weight = Weight + def get_Dimensions(self): return self.Dimensions + def set_Dimensions(self, Dimensions): self.Dimensions = Dimensions + def get_PhysicalPackaging(self): return self.PhysicalPackaging + def set_PhysicalPackaging(self, PhysicalPackaging): self.PhysicalPackaging = PhysicalPackaging + def validate_PhysicalPackagingType(self, value): + # Validate type PhysicalPackagingType, a restriction on xs:string. + pass + def get_ItemDescription(self): return self.ItemDescription + def set_ItemDescription(self, ItemDescription): self.ItemDescription = ItemDescription + def get_CustomerReferences(self): return self.CustomerReferences + def set_CustomerReferences(self, CustomerReferences): self.CustomerReferences = CustomerReferences + def add_CustomerReferences(self, value): self.CustomerReferences.append(value) + def insert_CustomerReferences(self, index, value): self.CustomerReferences[index] = value + def get_SpecialServicesRequested(self): return self.SpecialServicesRequested + def set_SpecialServicesRequested(self, SpecialServicesRequested): self.SpecialServicesRequested = SpecialServicesRequested + def get_ContentRecords(self): return self.ContentRecords + def set_ContentRecords(self, ContentRecords): self.ContentRecords = ContentRecords + def add_ContentRecords(self, value): self.ContentRecords.append(value) + def insert_ContentRecords(self, index, value): self.ContentRecords[index] = value + def export(self, outfile, level, namespace_='ns:', name_='RequestedPackageLineItem', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='RequestedPackageLineItem') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='RequestedPackageLineItem'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='RequestedPackageLineItem', fromsubclass_=False): + if self.SequenceNumber is not None: + showIndent(outfile, level) + outfile.write('<%sSequenceNumber>%s\n' % (namespace_, self.gds_format_integer(self.SequenceNumber, input_name='SequenceNumber'), namespace_)) + if self.GroupNumber is not None: + showIndent(outfile, level) + outfile.write('<%sGroupNumber>%s\n' % (namespace_, self.gds_format_integer(self.GroupNumber, input_name='GroupNumber'), namespace_)) + if self.GroupPackageCount is not None: + showIndent(outfile, level) + outfile.write('<%sGroupPackageCount>%s\n' % (namespace_, self.gds_format_integer(self.GroupPackageCount, input_name='GroupPackageCount'), namespace_)) + if self.VariableHandlingChargeDetail: + self.VariableHandlingChargeDetail.export(outfile, level, namespace_, name_='VariableHandlingChargeDetail') + if self.InsuredValue: + self.InsuredValue.export(outfile, level, namespace_, name_='InsuredValue') + if self.Weight: + self.Weight.export(outfile, level, namespace_, name_='Weight') + if self.Dimensions: + self.Dimensions.export(outfile, level, namespace_, name_='Dimensions') + if self.PhysicalPackaging is not None: + showIndent(outfile, level) + outfile.write('<%sPhysicalPackaging>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PhysicalPackaging).encode(ExternalEncoding), input_name='PhysicalPackaging'), namespace_)) + if self.ItemDescription is not None: + showIndent(outfile, level) + outfile.write('<%sItemDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ItemDescription).encode(ExternalEncoding), input_name='ItemDescription'), namespace_)) + for CustomerReferences_ in self.CustomerReferences: + CustomerReferences_.export(outfile, level, namespace_, name_='CustomerReferences') + if self.SpecialServicesRequested: + self.SpecialServicesRequested.export(outfile, level, namespace_, name_='SpecialServicesRequested') + for ContentRecords_ in self.ContentRecords: + ContentRecords_.export(outfile, level, namespace_, name_='ContentRecords') + def hasContent_(self): + if ( + self.SequenceNumber is not None or + self.GroupNumber is not None or + self.GroupPackageCount is not None or + self.VariableHandlingChargeDetail is not None or + self.InsuredValue is not None or + self.Weight is not None or + self.Dimensions is not None or + self.PhysicalPackaging is not None or + self.ItemDescription is not None or + self.CustomerReferences or + self.SpecialServicesRequested is not None or + self.ContentRecords + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='RequestedPackageLineItem'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.SequenceNumber is not None: + showIndent(outfile, level) + outfile.write('SequenceNumber=%d,\n' % self.SequenceNumber) + if self.GroupNumber is not None: + showIndent(outfile, level) + outfile.write('GroupNumber=%d,\n' % self.GroupNumber) + if self.GroupPackageCount is not None: + showIndent(outfile, level) + outfile.write('GroupPackageCount=%d,\n' % self.GroupPackageCount) + if self.VariableHandlingChargeDetail is not None: + showIndent(outfile, level) + outfile.write('VariableHandlingChargeDetail=model_.VariableHandlingChargeDetail(\n') + self.VariableHandlingChargeDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.InsuredValue is not None: + showIndent(outfile, level) + outfile.write('InsuredValue=model_.Money(\n') + self.InsuredValue.exportLiteral(outfile, level, name_='InsuredValue') + showIndent(outfile, level) + outfile.write('),\n') + if self.Weight is not None: + showIndent(outfile, level) + outfile.write('Weight=model_.Weight(\n') + self.Weight.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Dimensions is not None: + showIndent(outfile, level) + outfile.write('Dimensions=model_.Dimensions(\n') + self.Dimensions.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.PhysicalPackaging is not None: + showIndent(outfile, level) + outfile.write('PhysicalPackaging=%s,\n' % quote_python(self.PhysicalPackaging).encode(ExternalEncoding)) + if self.ItemDescription is not None: + showIndent(outfile, level) + outfile.write('ItemDescription=%s,\n' % quote_python(self.ItemDescription).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('CustomerReferences=[\n') + level += 1 + for CustomerReferences_ in self.CustomerReferences: + showIndent(outfile, level) + outfile.write('model_.CustomerReference(\n') + CustomerReferences_.exportLiteral(outfile, level, name_='CustomerReference') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.SpecialServicesRequested is not None: + showIndent(outfile, level) + outfile.write('SpecialServicesRequested=model_.PackageSpecialServicesRequested(\n') + self.SpecialServicesRequested.exportLiteral(outfile, level, name_='SpecialServicesRequested') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('ContentRecords=[\n') + level += 1 + for ContentRecords_ in self.ContentRecords: + showIndent(outfile, level) + outfile.write('model_.ContentRecord(\n') + ContentRecords_.exportLiteral(outfile, level, name_='ContentRecord') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'SequenceNumber': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ <= 0: + raise_parse_error(child_, 'requires positiveInteger') + ival_ = self.gds_validate_integer(ival_, node, 'SequenceNumber') + self.SequenceNumber = ival_ + elif nodeName_ == 'GroupNumber': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'GroupNumber') + self.GroupNumber = ival_ + elif nodeName_ == 'GroupPackageCount': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'GroupPackageCount') + self.GroupPackageCount = ival_ + elif nodeName_ == 'VariableHandlingChargeDetail': + obj_ = VariableHandlingChargeDetail.factory() + obj_.build(child_) + self.set_VariableHandlingChargeDetail(obj_) + elif nodeName_ == 'InsuredValue': + obj_ = Money.factory() + obj_.build(child_) + self.set_InsuredValue(obj_) + elif nodeName_ == 'Weight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_Weight(obj_) + elif nodeName_ == 'Dimensions': + obj_ = Dimensions.factory() + obj_.build(child_) + self.set_Dimensions(obj_) + elif nodeName_ == 'PhysicalPackaging': + PhysicalPackaging_ = child_.text + PhysicalPackaging_ = self.gds_validate_string(PhysicalPackaging_, node, 'PhysicalPackaging') + self.PhysicalPackaging = PhysicalPackaging_ + self.validate_PhysicalPackagingType(self.PhysicalPackaging) # validate type PhysicalPackagingType + elif nodeName_ == 'ItemDescription': + ItemDescription_ = child_.text + ItemDescription_ = self.gds_validate_string(ItemDescription_, node, 'ItemDescription') + self.ItemDescription = ItemDescription_ + elif nodeName_ == 'CustomerReferences': + obj_ = CustomerReference.factory() + obj_.build(child_) + self.CustomerReferences.append(obj_) + elif nodeName_ == 'SpecialServicesRequested': + obj_ = PackageSpecialServicesRequested.factory() + obj_.build(child_) + self.set_SpecialServicesRequested(obj_) + elif nodeName_ == 'ContentRecords': + obj_ = ContentRecord.factory() + obj_.build(child_) + self.ContentRecords.append(obj_) +# end class RequestedPackageLineItem + + +class RequestedShipment(GeneratedsSuper): + """The descriptive data for the shipment being tendered to FedEx.""" + subclass = None + superclass = None + def __init__(self, ShipTimestamp=None, DropoffType=None, ServiceType=None, PackagingType=None, TotalWeight=None, TotalInsuredValue=None, PreferredCurrency=None, Shipper=None, Recipient=None, RecipientLocationNumber=None, Origin=None, ShippingChargesPayment=None, SpecialServicesRequested=None, ExpressFreightDetail=None, FreightShipmentDetail=None, DeliveryInstructions=None, VariableHandlingChargeDetail=None, CustomsClearanceDetail=None, PickupDetail=None, SmartPostDetail=None, BlockInsightVisibility=None, ErrorLabelBehavior=None, LabelSpecification=None, ShippingDocumentSpecification=None, RateRequestTypes=None, EdtRequestType=None, MasterTrackingId=None, CodReturnTrackingId=None, PackageCount=None, RequestedPackageLineItems=None): + self.ShipTimestamp = ShipTimestamp + self.DropoffType = DropoffType + self.ServiceType = ServiceType + self.PackagingType = PackagingType + self.TotalWeight = TotalWeight + self.TotalInsuredValue = TotalInsuredValue + self.PreferredCurrency = PreferredCurrency + self.Shipper = Shipper + self.Recipient = Recipient + self.RecipientLocationNumber = RecipientLocationNumber + self.Origin = Origin + self.ShippingChargesPayment = ShippingChargesPayment + self.SpecialServicesRequested = SpecialServicesRequested + self.ExpressFreightDetail = ExpressFreightDetail + self.FreightShipmentDetail = FreightShipmentDetail + self.DeliveryInstructions = DeliveryInstructions + self.VariableHandlingChargeDetail = VariableHandlingChargeDetail + self.CustomsClearanceDetail = CustomsClearanceDetail + self.PickupDetail = PickupDetail + self.SmartPostDetail = SmartPostDetail + self.BlockInsightVisibility = BlockInsightVisibility + self.ErrorLabelBehavior = ErrorLabelBehavior + self.LabelSpecification = LabelSpecification + self.ShippingDocumentSpecification = ShippingDocumentSpecification + if RateRequestTypes is None: + self.RateRequestTypes = [] + else: + self.RateRequestTypes = RateRequestTypes + self.EdtRequestType = EdtRequestType + self.MasterTrackingId = MasterTrackingId + self.CodReturnTrackingId = CodReturnTrackingId + self.PackageCount = PackageCount + if RequestedPackageLineItems is None: + self.RequestedPackageLineItems = [] + else: + self.RequestedPackageLineItems = RequestedPackageLineItems + def factory(*args_, **kwargs_): + if RequestedShipment.subclass: + return RequestedShipment.subclass(*args_, **kwargs_) + else: + return RequestedShipment(*args_, **kwargs_) + factory = staticmethod(factory) + def get_ShipTimestamp(self): return self.ShipTimestamp + def set_ShipTimestamp(self, ShipTimestamp): self.ShipTimestamp = ShipTimestamp + def get_DropoffType(self): return self.DropoffType + def set_DropoffType(self, DropoffType): self.DropoffType = DropoffType + def validate_DropoffType(self, value): + # Validate type DropoffType, a restriction on xs:string. + pass + def get_ServiceType(self): return self.ServiceType + def set_ServiceType(self, ServiceType): self.ServiceType = ServiceType + def validate_ServiceType(self, value): + # Validate type ServiceType, a restriction on xs:string. + pass + def get_PackagingType(self): return self.PackagingType + def set_PackagingType(self, PackagingType): self.PackagingType = PackagingType + def validate_PackagingType(self, value): + # Validate type PackagingType, a restriction on xs:string. + pass + def get_TotalWeight(self): return self.TotalWeight + def set_TotalWeight(self, TotalWeight): self.TotalWeight = TotalWeight + def get_TotalInsuredValue(self): return self.TotalInsuredValue + def set_TotalInsuredValue(self, TotalInsuredValue): self.TotalInsuredValue = TotalInsuredValue + def get_PreferredCurrency(self): return self.PreferredCurrency + def set_PreferredCurrency(self, PreferredCurrency): self.PreferredCurrency = PreferredCurrency + def get_Shipper(self): return self.Shipper + def set_Shipper(self, Shipper): self.Shipper = Shipper + def get_Recipient(self): return self.Recipient + def set_Recipient(self, Recipient): self.Recipient = Recipient + def get_RecipientLocationNumber(self): return self.RecipientLocationNumber + def set_RecipientLocationNumber(self, RecipientLocationNumber): self.RecipientLocationNumber = RecipientLocationNumber + def get_Origin(self): return self.Origin + def set_Origin(self, Origin): self.Origin = Origin + def get_ShippingChargesPayment(self): return self.ShippingChargesPayment + def set_ShippingChargesPayment(self, ShippingChargesPayment): self.ShippingChargesPayment = ShippingChargesPayment + def get_SpecialServicesRequested(self): return self.SpecialServicesRequested + def set_SpecialServicesRequested(self, SpecialServicesRequested): self.SpecialServicesRequested = SpecialServicesRequested + def get_ExpressFreightDetail(self): return self.ExpressFreightDetail + def set_ExpressFreightDetail(self, ExpressFreightDetail): self.ExpressFreightDetail = ExpressFreightDetail + def get_FreightShipmentDetail(self): return self.FreightShipmentDetail + def set_FreightShipmentDetail(self, FreightShipmentDetail): self.FreightShipmentDetail = FreightShipmentDetail + def get_DeliveryInstructions(self): return self.DeliveryInstructions + def set_DeliveryInstructions(self, DeliveryInstructions): self.DeliveryInstructions = DeliveryInstructions + def get_VariableHandlingChargeDetail(self): return self.VariableHandlingChargeDetail + def set_VariableHandlingChargeDetail(self, VariableHandlingChargeDetail): self.VariableHandlingChargeDetail = VariableHandlingChargeDetail + def get_CustomsClearanceDetail(self): return self.CustomsClearanceDetail + def set_CustomsClearanceDetail(self, CustomsClearanceDetail): self.CustomsClearanceDetail = CustomsClearanceDetail + def get_PickupDetail(self): return self.PickupDetail + def set_PickupDetail(self, PickupDetail): self.PickupDetail = PickupDetail + def get_SmartPostDetail(self): return self.SmartPostDetail + def set_SmartPostDetail(self, SmartPostDetail): self.SmartPostDetail = SmartPostDetail + def get_BlockInsightVisibility(self): return self.BlockInsightVisibility + def set_BlockInsightVisibility(self, BlockInsightVisibility): self.BlockInsightVisibility = BlockInsightVisibility + def get_ErrorLabelBehavior(self): return self.ErrorLabelBehavior + def set_ErrorLabelBehavior(self, ErrorLabelBehavior): self.ErrorLabelBehavior = ErrorLabelBehavior + def validate_ErrorLabelBehaviorType(self, value): + # Validate type ErrorLabelBehaviorType, a restriction on xs:string. + pass + def get_LabelSpecification(self): return self.LabelSpecification + def set_LabelSpecification(self, LabelSpecification): self.LabelSpecification = LabelSpecification + def get_ShippingDocumentSpecification(self): return self.ShippingDocumentSpecification + def set_ShippingDocumentSpecification(self, ShippingDocumentSpecification): self.ShippingDocumentSpecification = ShippingDocumentSpecification + def get_RateRequestTypes(self): return self.RateRequestTypes + def set_RateRequestTypes(self, RateRequestTypes): self.RateRequestTypes = RateRequestTypes + def add_RateRequestTypes(self, value): self.RateRequestTypes.append(value) + def insert_RateRequestTypes(self, index, value): self.RateRequestTypes[index] = value + def validate_RateRequestType(self, value): + # Validate type RateRequestType, a restriction on xs:string. + pass + def get_EdtRequestType(self): return self.EdtRequestType + def set_EdtRequestType(self, EdtRequestType): self.EdtRequestType = EdtRequestType + def validate_EdtRequestType(self, value): + # Validate type EdtRequestType, a restriction on xs:string. + pass + def get_MasterTrackingId(self): return self.MasterTrackingId + def set_MasterTrackingId(self, MasterTrackingId): self.MasterTrackingId = MasterTrackingId + def get_CodReturnTrackingId(self): return self.CodReturnTrackingId + def set_CodReturnTrackingId(self, CodReturnTrackingId): self.CodReturnTrackingId = CodReturnTrackingId + def get_PackageCount(self): return self.PackageCount + def set_PackageCount(self, PackageCount): self.PackageCount = PackageCount + def get_RequestedPackageLineItems(self): return self.RequestedPackageLineItems + def set_RequestedPackageLineItems(self, RequestedPackageLineItems): self.RequestedPackageLineItems = RequestedPackageLineItems + def add_RequestedPackageLineItems(self, value): self.RequestedPackageLineItems.append(value) + def insert_RequestedPackageLineItems(self, index, value): self.RequestedPackageLineItems[index] = value + def export(self, outfile, level, namespace_='ns:', name_='RequestedShipment', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='RequestedShipment') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='RequestedShipment'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='RequestedShipment', fromsubclass_=False): + if self.ShipTimestamp is not None: + showIndent(outfile, level) + outfile.write('<%sShipTimestamp>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ShipTimestamp).encode(ExternalEncoding), input_name='ShipTimestamp'), namespace_)) + if self.DropoffType is not None: + showIndent(outfile, level) + outfile.write('<%sDropoffType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DropoffType).encode(ExternalEncoding), input_name='DropoffType'), namespace_)) + if self.ServiceType is not None: + showIndent(outfile, level) + outfile.write('<%sServiceType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ServiceType).encode(ExternalEncoding), input_name='ServiceType'), namespace_)) + if self.PackagingType is not None: + showIndent(outfile, level) + outfile.write('<%sPackagingType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PackagingType).encode(ExternalEncoding), input_name='PackagingType'), namespace_)) + if self.TotalWeight: + self.TotalWeight.export(outfile, level, namespace_, name_='TotalWeight') + if self.TotalInsuredValue: + self.TotalInsuredValue.export(outfile, level, namespace_, name_='TotalInsuredValue') + if self.PreferredCurrency is not None: + showIndent(outfile, level) + outfile.write('<%sPreferredCurrency>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PreferredCurrency).encode(ExternalEncoding), input_name='PreferredCurrency'), namespace_)) + if self.Shipper: + self.Shipper.export(outfile, level, namespace_, name_='Shipper', ) + if self.Recipient: + self.Recipient.export(outfile, level, namespace_, name_='Recipient', ) + if self.RecipientLocationNumber is not None: + showIndent(outfile, level) + outfile.write('<%sRecipientLocationNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RecipientLocationNumber).encode(ExternalEncoding), input_name='RecipientLocationNumber'), namespace_)) + if self.Origin: + self.Origin.export(outfile, level, namespace_, name_='Origin') + if self.ShippingChargesPayment: + self.ShippingChargesPayment.export(outfile, level, namespace_, name_='ShippingChargesPayment') + if self.SpecialServicesRequested: + self.SpecialServicesRequested.export(outfile, level, namespace_, name_='SpecialServicesRequested') + if self.ExpressFreightDetail: + self.ExpressFreightDetail.export(outfile, level, namespace_, name_='ExpressFreightDetail') + if self.FreightShipmentDetail: + self.FreightShipmentDetail.export(outfile, level, namespace_, name_='FreightShipmentDetail') + if self.DeliveryInstructions is not None: + showIndent(outfile, level) + outfile.write('<%sDeliveryInstructions>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DeliveryInstructions).encode(ExternalEncoding), input_name='DeliveryInstructions'), namespace_)) + if self.VariableHandlingChargeDetail: + self.VariableHandlingChargeDetail.export(outfile, level, namespace_, name_='VariableHandlingChargeDetail') + if self.CustomsClearanceDetail: + self.CustomsClearanceDetail.export(outfile, level, namespace_, name_='CustomsClearanceDetail') + if self.PickupDetail: + self.PickupDetail.export(outfile, level, namespace_, name_='PickupDetail') + if self.SmartPostDetail: + self.SmartPostDetail.export(outfile, level, namespace_, name_='SmartPostDetail') + if self.BlockInsightVisibility is not None: + showIndent(outfile, level) + outfile.write('<%sBlockInsightVisibility>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.BlockInsightVisibility)), input_name='BlockInsightVisibility'), namespace_)) + if self.ErrorLabelBehavior is not None: + showIndent(outfile, level) + outfile.write('<%sErrorLabelBehavior>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ErrorLabelBehavior).encode(ExternalEncoding), input_name='ErrorLabelBehavior'), namespace_)) + if self.LabelSpecification: + self.LabelSpecification.export(outfile, level, namespace_, name_='LabelSpecification', ) + if self.ShippingDocumentSpecification: + self.ShippingDocumentSpecification.export(outfile, level, namespace_, name_='ShippingDocumentSpecification') + for RateRequestTypes_ in self.RateRequestTypes: + showIndent(outfile, level) + outfile.write('<%sRateRequestTypes>%s\n' % (namespace_, self.gds_format_string(quote_xml(RateRequestTypes_).encode(ExternalEncoding), input_name='RateRequestTypes'), namespace_)) + if self.EdtRequestType is not None: + showIndent(outfile, level) + outfile.write('<%sEdtRequestType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.EdtRequestType).encode(ExternalEncoding), input_name='EdtRequestType'), namespace_)) + if self.MasterTrackingId: + self.MasterTrackingId.export(outfile, level, namespace_, name_='MasterTrackingId') + if self.CodReturnTrackingId: + self.CodReturnTrackingId.export(outfile, level, namespace_, name_='CodReturnTrackingId') + if self.PackageCount is not None: + showIndent(outfile, level) + outfile.write('<%sPackageCount>%s\n' % (namespace_, self.gds_format_integer(self.PackageCount, input_name='PackageCount'), namespace_)) + for RequestedPackageLineItems_ in self.RequestedPackageLineItems: + RequestedPackageLineItems_.export(outfile, level, namespace_, name_='RequestedPackageLineItems') + def hasContent_(self): + if ( + self.ShipTimestamp is not None or + self.DropoffType is not None or + self.ServiceType is not None or + self.PackagingType is not None or + self.TotalWeight is not None or + self.TotalInsuredValue is not None or + self.PreferredCurrency is not None or + self.Shipper is not None or + self.Recipient is not None or + self.RecipientLocationNumber is not None or + self.Origin is not None or + self.ShippingChargesPayment is not None or + self.SpecialServicesRequested is not None or + self.ExpressFreightDetail is not None or + self.FreightShipmentDetail is not None or + self.DeliveryInstructions is not None or + self.VariableHandlingChargeDetail is not None or + self.CustomsClearanceDetail is not None or + self.PickupDetail is not None or + self.SmartPostDetail is not None or + self.BlockInsightVisibility is not None or + self.ErrorLabelBehavior is not None or + self.LabelSpecification is not None or + self.ShippingDocumentSpecification is not None or + self.RateRequestTypes or + self.EdtRequestType is not None or + self.MasterTrackingId is not None or + self.CodReturnTrackingId is not None or + self.PackageCount is not None or + self.RequestedPackageLineItems + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='RequestedShipment'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.ShipTimestamp is not None: + showIndent(outfile, level) + outfile.write('ShipTimestamp=%s,\n' % quote_python(self.ShipTimestamp).encode(ExternalEncoding)) + if self.DropoffType is not None: + showIndent(outfile, level) + outfile.write('DropoffType=%s,\n' % quote_python(self.DropoffType).encode(ExternalEncoding)) + if self.ServiceType is not None: + showIndent(outfile, level) + outfile.write('ServiceType=%s,\n' % quote_python(self.ServiceType).encode(ExternalEncoding)) + if self.PackagingType is not None: + showIndent(outfile, level) + outfile.write('PackagingType=%s,\n' % quote_python(self.PackagingType).encode(ExternalEncoding)) + if self.TotalWeight is not None: + showIndent(outfile, level) + outfile.write('TotalWeight=model_.Weight(\n') + self.TotalWeight.exportLiteral(outfile, level, name_='TotalWeight') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalInsuredValue is not None: + showIndent(outfile, level) + outfile.write('TotalInsuredValue=model_.Money(\n') + self.TotalInsuredValue.exportLiteral(outfile, level, name_='TotalInsuredValue') + showIndent(outfile, level) + outfile.write('),\n') + if self.PreferredCurrency is not None: + showIndent(outfile, level) + outfile.write('PreferredCurrency=%s,\n' % quote_python(self.PreferredCurrency).encode(ExternalEncoding)) + if self.Shipper is not None: + showIndent(outfile, level) + outfile.write('Shipper=model_.Party(\n') + self.Shipper.exportLiteral(outfile, level, name_='Shipper') + showIndent(outfile, level) + outfile.write('),\n') + if self.Recipient is not None: + showIndent(outfile, level) + outfile.write('Recipient=model_.Party(\n') + self.Recipient.exportLiteral(outfile, level, name_='Recipient') + showIndent(outfile, level) + outfile.write('),\n') + if self.RecipientLocationNumber is not None: + showIndent(outfile, level) + outfile.write('RecipientLocationNumber=%s,\n' % quote_python(self.RecipientLocationNumber).encode(ExternalEncoding)) + if self.Origin is not None: + showIndent(outfile, level) + outfile.write('Origin=model_.ContactAndAddress(\n') + self.Origin.exportLiteral(outfile, level, name_='Origin') + showIndent(outfile, level) + outfile.write('),\n') + if self.ShippingChargesPayment is not None: + showIndent(outfile, level) + outfile.write('ShippingChargesPayment=model_.Payment(\n') + self.ShippingChargesPayment.exportLiteral(outfile, level, name_='ShippingChargesPayment') + showIndent(outfile, level) + outfile.write('),\n') + if self.SpecialServicesRequested is not None: + showIndent(outfile, level) + outfile.write('SpecialServicesRequested=model_.ShipmentSpecialServicesRequested(\n') + self.SpecialServicesRequested.exportLiteral(outfile, level, name_='SpecialServicesRequested') + showIndent(outfile, level) + outfile.write('),\n') + if self.ExpressFreightDetail is not None: + showIndent(outfile, level) + outfile.write('ExpressFreightDetail=model_.ExpressFreightDetail(\n') + self.ExpressFreightDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.FreightShipmentDetail is not None: + showIndent(outfile, level) + outfile.write('FreightShipmentDetail=model_.FreightShipmentDetail(\n') + self.FreightShipmentDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.DeliveryInstructions is not None: + showIndent(outfile, level) + outfile.write('DeliveryInstructions=%s,\n' % quote_python(self.DeliveryInstructions).encode(ExternalEncoding)) + if self.VariableHandlingChargeDetail is not None: + showIndent(outfile, level) + outfile.write('VariableHandlingChargeDetail=model_.VariableHandlingChargeDetail(\n') + self.VariableHandlingChargeDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.CustomsClearanceDetail is not None: + showIndent(outfile, level) + outfile.write('CustomsClearanceDetail=model_.CustomsClearanceDetail(\n') + self.CustomsClearanceDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.PickupDetail is not None: + showIndent(outfile, level) + outfile.write('PickupDetail=model_.PickupDetail(\n') + self.PickupDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.SmartPostDetail is not None: + showIndent(outfile, level) + outfile.write('SmartPostDetail=model_.SmartPostShipmentDetail(\n') + self.SmartPostDetail.exportLiteral(outfile, level, name_='SmartPostDetail') + showIndent(outfile, level) + outfile.write('),\n') + if self.BlockInsightVisibility is not None: + showIndent(outfile, level) + outfile.write('BlockInsightVisibility=%s,\n' % self.BlockInsightVisibility) + if self.ErrorLabelBehavior is not None: + showIndent(outfile, level) + outfile.write('ErrorLabelBehavior=%s,\n' % quote_python(self.ErrorLabelBehavior).encode(ExternalEncoding)) + if self.LabelSpecification is not None: + showIndent(outfile, level) + outfile.write('LabelSpecification=model_.LabelSpecification(\n') + self.LabelSpecification.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ShippingDocumentSpecification is not None: + showIndent(outfile, level) + outfile.write('ShippingDocumentSpecification=model_.ShippingDocumentSpecification(\n') + self.ShippingDocumentSpecification.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('RateRequestTypes=[\n') + level += 1 + for RateRequestTypes_ in self.RateRequestTypes: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(RateRequestTypes_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.EdtRequestType is not None: + showIndent(outfile, level) + outfile.write('EdtRequestType=%s,\n' % quote_python(self.EdtRequestType).encode(ExternalEncoding)) + if self.MasterTrackingId is not None: + showIndent(outfile, level) + outfile.write('MasterTrackingId=model_.TrackingId(\n') + self.MasterTrackingId.exportLiteral(outfile, level, name_='MasterTrackingId') + showIndent(outfile, level) + outfile.write('),\n') + if self.CodReturnTrackingId is not None: + showIndent(outfile, level) + outfile.write('CodReturnTrackingId=model_.TrackingId(\n') + self.CodReturnTrackingId.exportLiteral(outfile, level, name_='CodReturnTrackingId') + showIndent(outfile, level) + outfile.write('),\n') + if self.PackageCount is not None: + showIndent(outfile, level) + outfile.write('PackageCount=%d,\n' % self.PackageCount) + showIndent(outfile, level) + outfile.write('RequestedPackageLineItems=[\n') + level += 1 + for RequestedPackageLineItems_ in self.RequestedPackageLineItems: + showIndent(outfile, level) + outfile.write('model_.RequestedPackageLineItem(\n') + RequestedPackageLineItems_.exportLiteral(outfile, level, name_='RequestedPackageLineItem') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'ShipTimestamp': + ShipTimestamp_ = child_.text + ShipTimestamp_ = self.gds_validate_string(ShipTimestamp_, node, 'ShipTimestamp') + self.ShipTimestamp = ShipTimestamp_ + elif nodeName_ == 'DropoffType': + DropoffType_ = child_.text + DropoffType_ = self.gds_validate_string(DropoffType_, node, 'DropoffType') + self.DropoffType = DropoffType_ + self.validate_DropoffType(self.DropoffType) # validate type DropoffType + elif nodeName_ == 'ServiceType': + ServiceType_ = child_.text + ServiceType_ = self.gds_validate_string(ServiceType_, node, 'ServiceType') + self.ServiceType = ServiceType_ + self.validate_ServiceType(self.ServiceType) # validate type ServiceType + elif nodeName_ == 'PackagingType': + PackagingType_ = child_.text + PackagingType_ = self.gds_validate_string(PackagingType_, node, 'PackagingType') + self.PackagingType = PackagingType_ + self.validate_PackagingType(self.PackagingType) # validate type PackagingType + elif nodeName_ == 'TotalWeight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_TotalWeight(obj_) + elif nodeName_ == 'TotalInsuredValue': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalInsuredValue(obj_) + elif nodeName_ == 'PreferredCurrency': + PreferredCurrency_ = child_.text + PreferredCurrency_ = self.gds_validate_string(PreferredCurrency_, node, 'PreferredCurrency') + self.PreferredCurrency = PreferredCurrency_ + elif nodeName_ == 'Shipper': + obj_ = Party.factory() + obj_.build(child_) + self.set_Shipper(obj_) + elif nodeName_ == 'Recipient': + obj_ = Party.factory() + obj_.build(child_) + self.set_Recipient(obj_) + elif nodeName_ == 'RecipientLocationNumber': + RecipientLocationNumber_ = child_.text + RecipientLocationNumber_ = self.gds_validate_string(RecipientLocationNumber_, node, 'RecipientLocationNumber') + self.RecipientLocationNumber = RecipientLocationNumber_ + elif nodeName_ == 'Origin': + obj_ = ContactAndAddress.factory() + obj_.build(child_) + self.set_Origin(obj_) + elif nodeName_ == 'ShippingChargesPayment': + obj_ = Payment.factory() + obj_.build(child_) + self.set_ShippingChargesPayment(obj_) + elif nodeName_ == 'SpecialServicesRequested': + obj_ = ShipmentSpecialServicesRequested.factory() + obj_.build(child_) + self.set_SpecialServicesRequested(obj_) + elif nodeName_ == 'ExpressFreightDetail': + obj_ = ExpressFreightDetail.factory() + obj_.build(child_) + self.set_ExpressFreightDetail(obj_) + elif nodeName_ == 'FreightShipmentDetail': + obj_ = FreightShipmentDetail.factory() + obj_.build(child_) + self.set_FreightShipmentDetail(obj_) + elif nodeName_ == 'DeliveryInstructions': + DeliveryInstructions_ = child_.text + DeliveryInstructions_ = self.gds_validate_string(DeliveryInstructions_, node, 'DeliveryInstructions') + self.DeliveryInstructions = DeliveryInstructions_ + elif nodeName_ == 'VariableHandlingChargeDetail': + obj_ = VariableHandlingChargeDetail.factory() + obj_.build(child_) + self.set_VariableHandlingChargeDetail(obj_) + elif nodeName_ == 'CustomsClearanceDetail': + obj_ = CustomsClearanceDetail.factory() + obj_.build(child_) + self.set_CustomsClearanceDetail(obj_) + elif nodeName_ == 'PickupDetail': + obj_ = PickupDetail.factory() + obj_.build(child_) + self.set_PickupDetail(obj_) + elif nodeName_ == 'SmartPostDetail': + obj_ = SmartPostShipmentDetail.factory() + obj_.build(child_) + self.set_SmartPostDetail(obj_) + elif nodeName_ == 'BlockInsightVisibility': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'BlockInsightVisibility') + self.BlockInsightVisibility = ival_ + elif nodeName_ == 'ErrorLabelBehavior': + ErrorLabelBehavior_ = child_.text + ErrorLabelBehavior_ = self.gds_validate_string(ErrorLabelBehavior_, node, 'ErrorLabelBehavior') + self.ErrorLabelBehavior = ErrorLabelBehavior_ + self.validate_ErrorLabelBehaviorType(self.ErrorLabelBehavior) # validate type ErrorLabelBehaviorType + elif nodeName_ == 'LabelSpecification': + obj_ = LabelSpecification.factory() + obj_.build(child_) + self.set_LabelSpecification(obj_) + elif nodeName_ == 'ShippingDocumentSpecification': + obj_ = ShippingDocumentSpecification.factory() + obj_.build(child_) + self.set_ShippingDocumentSpecification(obj_) + elif nodeName_ == 'RateRequestTypes': + RateRequestTypes_ = child_.text + RateRequestTypes_ = self.gds_validate_string(RateRequestTypes_, node, 'RateRequestTypes') + self.RateRequestTypes.append(RateRequestTypes_) + self.validate_RateRequestType(self.RateRequestTypes) # validate type RateRequestType + elif nodeName_ == 'EdtRequestType': + EdtRequestType_ = child_.text + EdtRequestType_ = self.gds_validate_string(EdtRequestType_, node, 'EdtRequestType') + self.EdtRequestType = EdtRequestType_ + self.validate_EdtRequestType(self.EdtRequestType) # validate type EdtRequestType + elif nodeName_ == 'MasterTrackingId': + obj_ = TrackingId.factory() + obj_.build(child_) + self.set_MasterTrackingId(obj_) + elif nodeName_ == 'CodReturnTrackingId': + obj_ = TrackingId.factory() + obj_.build(child_) + self.set_CodReturnTrackingId(obj_) + elif nodeName_ == 'PackageCount': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'PackageCount') + self.PackageCount = ival_ + elif nodeName_ == 'RequestedPackageLineItems': + obj_ = RequestedPackageLineItem.factory() + obj_.build(child_) + self.RequestedPackageLineItems.append(obj_) +# end class RequestedShipment + + +class ReturnEMailDetail(GeneratedsSuper): + """Return Email Details""" + subclass = None + superclass = None + def __init__(self, MerchantPhoneNumber=None, AllowedSpecialServices=None): + self.MerchantPhoneNumber = MerchantPhoneNumber + if AllowedSpecialServices is None: + self.AllowedSpecialServices = [] + else: + self.AllowedSpecialServices = AllowedSpecialServices + def factory(*args_, **kwargs_): + if ReturnEMailDetail.subclass: + return ReturnEMailDetail.subclass(*args_, **kwargs_) + else: + return ReturnEMailDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_MerchantPhoneNumber(self): return self.MerchantPhoneNumber + def set_MerchantPhoneNumber(self, MerchantPhoneNumber): self.MerchantPhoneNumber = MerchantPhoneNumber + def get_AllowedSpecialServices(self): return self.AllowedSpecialServices + def set_AllowedSpecialServices(self, AllowedSpecialServices): self.AllowedSpecialServices = AllowedSpecialServices + def add_AllowedSpecialServices(self, value): self.AllowedSpecialServices.append(value) + def insert_AllowedSpecialServices(self, index, value): self.AllowedSpecialServices[index] = value + def validate_ReturnEMailAllowedSpecialServiceType(self, value): + # Validate type ReturnEMailAllowedSpecialServiceType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='ReturnEMailDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ReturnEMailDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ReturnEMailDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ReturnEMailDetail', fromsubclass_=False): + if self.MerchantPhoneNumber is not None: + showIndent(outfile, level) + outfile.write('<%sMerchantPhoneNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.MerchantPhoneNumber).encode(ExternalEncoding), input_name='MerchantPhoneNumber'), namespace_)) + for AllowedSpecialServices_ in self.AllowedSpecialServices: + showIndent(outfile, level) + outfile.write('<%sAllowedSpecialServices>%s\n' % (namespace_, self.gds_format_string(quote_xml(AllowedSpecialServices_).encode(ExternalEncoding), input_name='AllowedSpecialServices'), namespace_)) + def hasContent_(self): + if ( + self.MerchantPhoneNumber is not None or + self.AllowedSpecialServices + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ReturnEMailDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.MerchantPhoneNumber is not None: + showIndent(outfile, level) + outfile.write('MerchantPhoneNumber=%s,\n' % quote_python(self.MerchantPhoneNumber).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('AllowedSpecialServices=[\n') + level += 1 + for AllowedSpecialServices_ in self.AllowedSpecialServices: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(AllowedSpecialServices_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'MerchantPhoneNumber': + MerchantPhoneNumber_ = child_.text + MerchantPhoneNumber_ = self.gds_validate_string(MerchantPhoneNumber_, node, 'MerchantPhoneNumber') + self.MerchantPhoneNumber = MerchantPhoneNumber_ + elif nodeName_ == 'AllowedSpecialServices': + AllowedSpecialServices_ = child_.text + AllowedSpecialServices_ = self.gds_validate_string(AllowedSpecialServices_, node, 'AllowedSpecialServices') + self.AllowedSpecialServices.append(AllowedSpecialServices_) + self.validate_ReturnEMailAllowedSpecialServiceType(self.AllowedSpecialServices) # validate type ReturnEMailAllowedSpecialServiceType +# end class ReturnEMailDetail + + +class ReturnShipmentDetail(GeneratedsSuper): + """Information relating to a return shipment.""" + subclass = None + superclass = None + def __init__(self, ReturnType=None, Rma=None, ReturnEMailDetail=None): + self.ReturnType = ReturnType + self.Rma = Rma + self.ReturnEMailDetail = ReturnEMailDetail + def factory(*args_, **kwargs_): + if ReturnShipmentDetail.subclass: + return ReturnShipmentDetail.subclass(*args_, **kwargs_) + else: + return ReturnShipmentDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_ReturnType(self): return self.ReturnType + def set_ReturnType(self, ReturnType): self.ReturnType = ReturnType + def validate_ReturnType(self, value): + # Validate type ReturnType, a restriction on xs:string. + pass + def get_Rma(self): return self.Rma + def set_Rma(self, Rma): self.Rma = Rma + def get_ReturnEMailDetail(self): return self.ReturnEMailDetail + def set_ReturnEMailDetail(self, ReturnEMailDetail): self.ReturnEMailDetail = ReturnEMailDetail + def export(self, outfile, level, namespace_='ns:', name_='ReturnShipmentDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ReturnShipmentDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ReturnShipmentDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ReturnShipmentDetail', fromsubclass_=False): + if self.ReturnType is not None: + showIndent(outfile, level) + outfile.write('<%sReturnType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ReturnType).encode(ExternalEncoding), input_name='ReturnType'), namespace_)) + if self.Rma: + self.Rma.export(outfile, level, namespace_, name_='Rma') + if self.ReturnEMailDetail: + self.ReturnEMailDetail.export(outfile, level, namespace_, name_='ReturnEMailDetail') + def hasContent_(self): + if ( + self.ReturnType is not None or + self.Rma is not None or + self.ReturnEMailDetail is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ReturnShipmentDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.ReturnType is not None: + showIndent(outfile, level) + outfile.write('ReturnType=%s,\n' % quote_python(self.ReturnType).encode(ExternalEncoding)) + if self.Rma is not None: + showIndent(outfile, level) + outfile.write('Rma=model_.Rma(\n') + self.Rma.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ReturnEMailDetail is not None: + showIndent(outfile, level) + outfile.write('ReturnEMailDetail=model_.ReturnEMailDetail(\n') + self.ReturnEMailDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'ReturnType': + ReturnType_ = child_.text + ReturnType_ = self.gds_validate_string(ReturnType_, node, 'ReturnType') + self.ReturnType = ReturnType_ + self.validate_ReturnType(self.ReturnType) # validate type ReturnType + elif nodeName_ == 'Rma': + obj_ = Rma.factory() + obj_.build(child_) + self.set_Rma(obj_) + elif nodeName_ == 'ReturnEMailDetail': + obj_ = ReturnEMailDetail.factory() + obj_.build(child_) + self.set_ReturnEMailDetail(obj_) +# end class ReturnShipmentDetail + + +class Rma(GeneratedsSuper): + """Return Merchant Authorization""" + subclass = None + superclass = None + def __init__(self, Number=None, Reason=None): + self.Number = Number + self.Reason = Reason + def factory(*args_, **kwargs_): + if Rma.subclass: + return Rma.subclass(*args_, **kwargs_) + else: + return Rma(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Number(self): return self.Number + def set_Number(self, Number): self.Number = Number + def get_Reason(self): return self.Reason + def set_Reason(self, Reason): self.Reason = Reason + def export(self, outfile, level, namespace_='ns:', name_='Rma', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Rma') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Rma'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Rma', fromsubclass_=False): + if self.Number is not None: + showIndent(outfile, level) + outfile.write('<%sNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Number).encode(ExternalEncoding), input_name='Number'), namespace_)) + if self.Reason is not None: + showIndent(outfile, level) + outfile.write('<%sReason>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Reason).encode(ExternalEncoding), input_name='Reason'), namespace_)) + def hasContent_(self): + if ( + self.Number is not None or + self.Reason is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Rma'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Number is not None: + showIndent(outfile, level) + outfile.write('Number=%s,\n' % quote_python(self.Number).encode(ExternalEncoding)) + if self.Reason is not None: + showIndent(outfile, level) + outfile.write('Reason=%s,\n' % quote_python(self.Reason).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Number': + Number_ = child_.text + Number_ = self.gds_validate_string(Number_, node, 'Number') + self.Number = Number_ + elif nodeName_ == 'Reason': + Reason_ = child_.text + Reason_ = self.gds_validate_string(Reason_, node, 'Reason') + self.Reason = Reason_ +# end class Rma + + +class ShipmentDryIceDetail(GeneratedsSuper): + """Shipment-level totals of dry ice data across all packages.""" + subclass = None + superclass = None + def __init__(self, PackageCount=None, TotalWeight=None): + self.PackageCount = PackageCount + self.TotalWeight = TotalWeight + def factory(*args_, **kwargs_): + if ShipmentDryIceDetail.subclass: + return ShipmentDryIceDetail.subclass(*args_, **kwargs_) + else: + return ShipmentDryIceDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_PackageCount(self): return self.PackageCount + def set_PackageCount(self, PackageCount): self.PackageCount = PackageCount + def get_TotalWeight(self): return self.TotalWeight + def set_TotalWeight(self, TotalWeight): self.TotalWeight = TotalWeight + def export(self, outfile, level, namespace_='ns:', name_='ShipmentDryIceDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ShipmentDryIceDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ShipmentDryIceDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ShipmentDryIceDetail', fromsubclass_=False): + if self.PackageCount is not None: + showIndent(outfile, level) + outfile.write('<%sPackageCount>%s\n' % (namespace_, self.gds_format_integer(self.PackageCount, input_name='PackageCount'), namespace_)) + if self.TotalWeight: + self.TotalWeight.export(outfile, level, namespace_, name_='TotalWeight', ) + def hasContent_(self): + if ( + self.PackageCount is not None or + self.TotalWeight is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ShipmentDryIceDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.PackageCount is not None: + showIndent(outfile, level) + outfile.write('PackageCount=%d,\n' % self.PackageCount) + if self.TotalWeight is not None: + showIndent(outfile, level) + outfile.write('TotalWeight=model_.Weight(\n') + self.TotalWeight.exportLiteral(outfile, level, name_='TotalWeight') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'PackageCount': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'PackageCount') + self.PackageCount = ival_ + elif nodeName_ == 'TotalWeight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_TotalWeight(obj_) +# end class ShipmentDryIceDetail + + +class ShipmentLegRateDetail(GeneratedsSuper): + """Data for a single leg of a shipment's total/summary rates, as + calculated per a specific rate type.""" + subclass = None + superclass = None + def __init__(self, LegDescription=None, LegOrigin=None, LegDestination=None, RateType=None, RateScale=None, RateZone=None, PricingCode=None, RatedWeightMethod=None, MinimumChargeType=None, CurrencyExchangeRate=None, SpecialRatingApplied=None, DimDivisor=None, DimDivisorType=None, FuelSurchargePercent=None, TotalBillingWeight=None, TotalDimWeight=None, TotalBaseCharge=None, TotalFreightDiscounts=None, TotalNetFreight=None, TotalSurcharges=None, TotalNetFedExCharge=None, TotalTaxes=None, TotalNetCharge=None, TotalRebates=None, TotalDutiesAndTaxes=None, TotalNetChargeWithDutiesAndTaxes=None, FreightRateDetail=None, FreightDiscounts=None, Rebates=None, Surcharges=None, Taxes=None, DutiesAndTaxes=None, VariableHandlingCharges=None, TotalVariableHandlingCharges=None): + self.LegDescription = LegDescription + self.LegOrigin = LegOrigin + self.LegDestination = LegDestination + self.RateType = RateType + self.RateScale = RateScale + self.RateZone = RateZone + self.PricingCode = PricingCode + self.RatedWeightMethod = RatedWeightMethod + self.MinimumChargeType = MinimumChargeType + self.CurrencyExchangeRate = CurrencyExchangeRate + if SpecialRatingApplied is None: + self.SpecialRatingApplied = [] + else: + self.SpecialRatingApplied = SpecialRatingApplied + self.DimDivisor = DimDivisor + self.DimDivisorType = DimDivisorType + self.FuelSurchargePercent = FuelSurchargePercent + self.TotalBillingWeight = TotalBillingWeight + self.TotalDimWeight = TotalDimWeight + self.TotalBaseCharge = TotalBaseCharge + self.TotalFreightDiscounts = TotalFreightDiscounts + self.TotalNetFreight = TotalNetFreight + self.TotalSurcharges = TotalSurcharges + self.TotalNetFedExCharge = TotalNetFedExCharge + self.TotalTaxes = TotalTaxes + self.TotalNetCharge = TotalNetCharge + self.TotalRebates = TotalRebates + self.TotalDutiesAndTaxes = TotalDutiesAndTaxes + self.TotalNetChargeWithDutiesAndTaxes = TotalNetChargeWithDutiesAndTaxes + self.FreightRateDetail = FreightRateDetail + if FreightDiscounts is None: + self.FreightDiscounts = [] + else: + self.FreightDiscounts = FreightDiscounts + if Rebates is None: + self.Rebates = [] + else: + self.Rebates = Rebates + if Surcharges is None: + self.Surcharges = [] + else: + self.Surcharges = Surcharges + if Taxes is None: + self.Taxes = [] + else: + self.Taxes = Taxes + if DutiesAndTaxes is None: + self.DutiesAndTaxes = [] + else: + self.DutiesAndTaxes = DutiesAndTaxes + self.VariableHandlingCharges = VariableHandlingCharges + self.TotalVariableHandlingCharges = TotalVariableHandlingCharges + def factory(*args_, **kwargs_): + if ShipmentLegRateDetail.subclass: + return ShipmentLegRateDetail.subclass(*args_, **kwargs_) + else: + return ShipmentLegRateDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_LegDescription(self): return self.LegDescription + def set_LegDescription(self, LegDescription): self.LegDescription = LegDescription + def get_LegOrigin(self): return self.LegOrigin + def set_LegOrigin(self, LegOrigin): self.LegOrigin = LegOrigin + def get_LegDestination(self): return self.LegDestination + def set_LegDestination(self, LegDestination): self.LegDestination = LegDestination + def get_RateType(self): return self.RateType + def set_RateType(self, RateType): self.RateType = RateType + def validate_ReturnedRateType(self, value): + # Validate type ReturnedRateType, a restriction on xs:string. + pass + def get_RateScale(self): return self.RateScale + def set_RateScale(self, RateScale): self.RateScale = RateScale + def get_RateZone(self): return self.RateZone + def set_RateZone(self, RateZone): self.RateZone = RateZone + def get_PricingCode(self): return self.PricingCode + def set_PricingCode(self, PricingCode): self.PricingCode = PricingCode + def validate_PricingCodeType(self, value): + # Validate type PricingCodeType, a restriction on xs:string. + pass + def get_RatedWeightMethod(self): return self.RatedWeightMethod + def set_RatedWeightMethod(self, RatedWeightMethod): self.RatedWeightMethod = RatedWeightMethod + def validate_RatedWeightMethod(self, value): + # Validate type RatedWeightMethod, a restriction on xs:string. + pass + def get_MinimumChargeType(self): return self.MinimumChargeType + def set_MinimumChargeType(self, MinimumChargeType): self.MinimumChargeType = MinimumChargeType + def validate_MinimumChargeType(self, value): + # Validate type MinimumChargeType, a restriction on xs:string. + pass + def get_CurrencyExchangeRate(self): return self.CurrencyExchangeRate + def set_CurrencyExchangeRate(self, CurrencyExchangeRate): self.CurrencyExchangeRate = CurrencyExchangeRate + def get_SpecialRatingApplied(self): return self.SpecialRatingApplied + def set_SpecialRatingApplied(self, SpecialRatingApplied): self.SpecialRatingApplied = SpecialRatingApplied + def add_SpecialRatingApplied(self, value): self.SpecialRatingApplied.append(value) + def insert_SpecialRatingApplied(self, index, value): self.SpecialRatingApplied[index] = value + def validate_SpecialRatingAppliedType(self, value): + # Validate type SpecialRatingAppliedType, a restriction on xs:string. + pass + def get_DimDivisor(self): return self.DimDivisor + def set_DimDivisor(self, DimDivisor): self.DimDivisor = DimDivisor + def get_DimDivisorType(self): return self.DimDivisorType + def set_DimDivisorType(self, DimDivisorType): self.DimDivisorType = DimDivisorType + def validate_RateDimensionalDivisorType(self, value): + # Validate type RateDimensionalDivisorType, a restriction on xs:string. + pass + def get_FuelSurchargePercent(self): return self.FuelSurchargePercent + def set_FuelSurchargePercent(self, FuelSurchargePercent): self.FuelSurchargePercent = FuelSurchargePercent + def get_TotalBillingWeight(self): return self.TotalBillingWeight + def set_TotalBillingWeight(self, TotalBillingWeight): self.TotalBillingWeight = TotalBillingWeight + def get_TotalDimWeight(self): return self.TotalDimWeight + def set_TotalDimWeight(self, TotalDimWeight): self.TotalDimWeight = TotalDimWeight + def get_TotalBaseCharge(self): return self.TotalBaseCharge + def set_TotalBaseCharge(self, TotalBaseCharge): self.TotalBaseCharge = TotalBaseCharge + def get_TotalFreightDiscounts(self): return self.TotalFreightDiscounts + def set_TotalFreightDiscounts(self, TotalFreightDiscounts): self.TotalFreightDiscounts = TotalFreightDiscounts + def get_TotalNetFreight(self): return self.TotalNetFreight + def set_TotalNetFreight(self, TotalNetFreight): self.TotalNetFreight = TotalNetFreight + def get_TotalSurcharges(self): return self.TotalSurcharges + def set_TotalSurcharges(self, TotalSurcharges): self.TotalSurcharges = TotalSurcharges + def get_TotalNetFedExCharge(self): return self.TotalNetFedExCharge + def set_TotalNetFedExCharge(self, TotalNetFedExCharge): self.TotalNetFedExCharge = TotalNetFedExCharge + def get_TotalTaxes(self): return self.TotalTaxes + def set_TotalTaxes(self, TotalTaxes): self.TotalTaxes = TotalTaxes + def get_TotalNetCharge(self): return self.TotalNetCharge + def set_TotalNetCharge(self, TotalNetCharge): self.TotalNetCharge = TotalNetCharge + def get_TotalRebates(self): return self.TotalRebates + def set_TotalRebates(self, TotalRebates): self.TotalRebates = TotalRebates + def get_TotalDutiesAndTaxes(self): return self.TotalDutiesAndTaxes + def set_TotalDutiesAndTaxes(self, TotalDutiesAndTaxes): self.TotalDutiesAndTaxes = TotalDutiesAndTaxes + def get_TotalNetChargeWithDutiesAndTaxes(self): return self.TotalNetChargeWithDutiesAndTaxes + def set_TotalNetChargeWithDutiesAndTaxes(self, TotalNetChargeWithDutiesAndTaxes): self.TotalNetChargeWithDutiesAndTaxes = TotalNetChargeWithDutiesAndTaxes + def get_FreightRateDetail(self): return self.FreightRateDetail + def set_FreightRateDetail(self, FreightRateDetail): self.FreightRateDetail = FreightRateDetail + def get_FreightDiscounts(self): return self.FreightDiscounts + def set_FreightDiscounts(self, FreightDiscounts): self.FreightDiscounts = FreightDiscounts + def add_FreightDiscounts(self, value): self.FreightDiscounts.append(value) + def insert_FreightDiscounts(self, index, value): self.FreightDiscounts[index] = value + def get_Rebates(self): return self.Rebates + def set_Rebates(self, Rebates): self.Rebates = Rebates + def add_Rebates(self, value): self.Rebates.append(value) + def insert_Rebates(self, index, value): self.Rebates[index] = value + def get_Surcharges(self): return self.Surcharges + def set_Surcharges(self, Surcharges): self.Surcharges = Surcharges + def add_Surcharges(self, value): self.Surcharges.append(value) + def insert_Surcharges(self, index, value): self.Surcharges[index] = value + def get_Taxes(self): return self.Taxes + def set_Taxes(self, Taxes): self.Taxes = Taxes + def add_Taxes(self, value): self.Taxes.append(value) + def insert_Taxes(self, index, value): self.Taxes[index] = value + def get_DutiesAndTaxes(self): return self.DutiesAndTaxes + def set_DutiesAndTaxes(self, DutiesAndTaxes): self.DutiesAndTaxes = DutiesAndTaxes + def add_DutiesAndTaxes(self, value): self.DutiesAndTaxes.append(value) + def insert_DutiesAndTaxes(self, index, value): self.DutiesAndTaxes[index] = value + def get_VariableHandlingCharges(self): return self.VariableHandlingCharges + def set_VariableHandlingCharges(self, VariableHandlingCharges): self.VariableHandlingCharges = VariableHandlingCharges + def get_TotalVariableHandlingCharges(self): return self.TotalVariableHandlingCharges + def set_TotalVariableHandlingCharges(self, TotalVariableHandlingCharges): self.TotalVariableHandlingCharges = TotalVariableHandlingCharges + def export(self, outfile, level, namespace_='ns:', name_='ShipmentLegRateDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ShipmentLegRateDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ShipmentLegRateDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ShipmentLegRateDetail', fromsubclass_=False): + if self.LegDescription is not None: + showIndent(outfile, level) + outfile.write('<%sLegDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LegDescription).encode(ExternalEncoding), input_name='LegDescription'), namespace_)) + if self.LegOrigin: + self.LegOrigin.export(outfile, level, namespace_, name_='LegOrigin') + if self.LegDestination: + self.LegDestination.export(outfile, level, namespace_, name_='LegDestination') + if self.RateType is not None: + showIndent(outfile, level) + outfile.write('<%sRateType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RateType).encode(ExternalEncoding), input_name='RateType'), namespace_)) + if self.RateScale is not None: + showIndent(outfile, level) + outfile.write('<%sRateScale>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RateScale).encode(ExternalEncoding), input_name='RateScale'), namespace_)) + if self.RateZone is not None: + showIndent(outfile, level) + outfile.write('<%sRateZone>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RateZone).encode(ExternalEncoding), input_name='RateZone'), namespace_)) + if self.PricingCode is not None: + showIndent(outfile, level) + outfile.write('<%sPricingCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PricingCode).encode(ExternalEncoding), input_name='PricingCode'), namespace_)) + if self.RatedWeightMethod is not None: + showIndent(outfile, level) + outfile.write('<%sRatedWeightMethod>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RatedWeightMethod).encode(ExternalEncoding), input_name='RatedWeightMethod'), namespace_)) + if self.MinimumChargeType is not None: + showIndent(outfile, level) + outfile.write('<%sMinimumChargeType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.MinimumChargeType).encode(ExternalEncoding), input_name='MinimumChargeType'), namespace_)) + if self.CurrencyExchangeRate: + self.CurrencyExchangeRate.export(outfile, level, namespace_, name_='CurrencyExchangeRate') + for SpecialRatingApplied_ in self.SpecialRatingApplied: + showIndent(outfile, level) + outfile.write('<%sSpecialRatingApplied>%s\n' % (namespace_, self.gds_format_string(quote_xml(SpecialRatingApplied_).encode(ExternalEncoding), input_name='SpecialRatingApplied'), namespace_)) + if self.DimDivisor is not None: + showIndent(outfile, level) + outfile.write('<%sDimDivisor>%s\n' % (namespace_, self.gds_format_integer(self.DimDivisor, input_name='DimDivisor'), namespace_)) + if self.DimDivisorType is not None: + showIndent(outfile, level) + outfile.write('<%sDimDivisorType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DimDivisorType).encode(ExternalEncoding), input_name='DimDivisorType'), namespace_)) + if self.FuelSurchargePercent is not None: + showIndent(outfile, level) + outfile.write('<%sFuelSurchargePercent>%s\n' % (namespace_, self.gds_format_float(self.FuelSurchargePercent, input_name='FuelSurchargePercent'), namespace_)) + if self.TotalBillingWeight: + self.TotalBillingWeight.export(outfile, level, namespace_, name_='TotalBillingWeight') + if self.TotalDimWeight: + self.TotalDimWeight.export(outfile, level, namespace_, name_='TotalDimWeight') + if self.TotalBaseCharge: + self.TotalBaseCharge.export(outfile, level, namespace_, name_='TotalBaseCharge') + if self.TotalFreightDiscounts: + self.TotalFreightDiscounts.export(outfile, level, namespace_, name_='TotalFreightDiscounts') + if self.TotalNetFreight: + self.TotalNetFreight.export(outfile, level, namespace_, name_='TotalNetFreight') + if self.TotalSurcharges: + self.TotalSurcharges.export(outfile, level, namespace_, name_='TotalSurcharges') + if self.TotalNetFedExCharge: + self.TotalNetFedExCharge.export(outfile, level, namespace_, name_='TotalNetFedExCharge') + if self.TotalTaxes: + self.TotalTaxes.export(outfile, level, namespace_, name_='TotalTaxes') + if self.TotalNetCharge: + self.TotalNetCharge.export(outfile, level, namespace_, name_='TotalNetCharge') + if self.TotalRebates: + self.TotalRebates.export(outfile, level, namespace_, name_='TotalRebates') + if self.TotalDutiesAndTaxes: + self.TotalDutiesAndTaxes.export(outfile, level, namespace_, name_='TotalDutiesAndTaxes') + if self.TotalNetChargeWithDutiesAndTaxes: + self.TotalNetChargeWithDutiesAndTaxes.export(outfile, level, namespace_, name_='TotalNetChargeWithDutiesAndTaxes') + if self.FreightRateDetail: + self.FreightRateDetail.export(outfile, level, namespace_, name_='FreightRateDetail') + for FreightDiscounts_ in self.FreightDiscounts: + FreightDiscounts_.export(outfile, level, namespace_, name_='FreightDiscounts') + for Rebates_ in self.Rebates: + Rebates_.export(outfile, level, namespace_, name_='Rebates') + for Surcharges_ in self.Surcharges: + Surcharges_.export(outfile, level, namespace_, name_='Surcharges') + for Taxes_ in self.Taxes: + Taxes_.export(outfile, level, namespace_, name_='Taxes') + for DutiesAndTaxes_ in self.DutiesAndTaxes: + DutiesAndTaxes_.export(outfile, level, namespace_, name_='DutiesAndTaxes') + if self.VariableHandlingCharges: + self.VariableHandlingCharges.export(outfile, level, namespace_, name_='VariableHandlingCharges') + if self.TotalVariableHandlingCharges: + self.TotalVariableHandlingCharges.export(outfile, level, namespace_, name_='TotalVariableHandlingCharges') + def hasContent_(self): + if ( + self.LegDescription is not None or + self.LegOrigin is not None or + self.LegDestination is not None or + self.RateType is not None or + self.RateScale is not None or + self.RateZone is not None or + self.PricingCode is not None or + self.RatedWeightMethod is not None or + self.MinimumChargeType is not None or + self.CurrencyExchangeRate is not None or + self.SpecialRatingApplied or + self.DimDivisor is not None or + self.DimDivisorType is not None or + self.FuelSurchargePercent is not None or + self.TotalBillingWeight is not None or + self.TotalDimWeight is not None or + self.TotalBaseCharge is not None or + self.TotalFreightDiscounts is not None or + self.TotalNetFreight is not None or + self.TotalSurcharges is not None or + self.TotalNetFedExCharge is not None or + self.TotalTaxes is not None or + self.TotalNetCharge is not None or + self.TotalRebates is not None or + self.TotalDutiesAndTaxes is not None or + self.TotalNetChargeWithDutiesAndTaxes is not None or + self.FreightRateDetail is not None or + self.FreightDiscounts or + self.Rebates or + self.Surcharges or + self.Taxes or + self.DutiesAndTaxes or + self.VariableHandlingCharges is not None or + self.TotalVariableHandlingCharges is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ShipmentLegRateDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.LegDescription is not None: + showIndent(outfile, level) + outfile.write('LegDescription=%s,\n' % quote_python(self.LegDescription).encode(ExternalEncoding)) + if self.LegOrigin is not None: + showIndent(outfile, level) + outfile.write('LegOrigin=model_.Address(\n') + self.LegOrigin.exportLiteral(outfile, level, name_='LegOrigin') + showIndent(outfile, level) + outfile.write('),\n') + if self.LegDestination is not None: + showIndent(outfile, level) + outfile.write('LegDestination=model_.Address(\n') + self.LegDestination.exportLiteral(outfile, level, name_='LegDestination') + showIndent(outfile, level) + outfile.write('),\n') + if self.RateType is not None: + showIndent(outfile, level) + outfile.write('RateType=%s,\n' % quote_python(self.RateType).encode(ExternalEncoding)) + if self.RateScale is not None: + showIndent(outfile, level) + outfile.write('RateScale=%s,\n' % quote_python(self.RateScale).encode(ExternalEncoding)) + if self.RateZone is not None: + showIndent(outfile, level) + outfile.write('RateZone=%s,\n' % quote_python(self.RateZone).encode(ExternalEncoding)) + if self.PricingCode is not None: + showIndent(outfile, level) + outfile.write('PricingCode=%s,\n' % quote_python(self.PricingCode).encode(ExternalEncoding)) + if self.RatedWeightMethod is not None: + showIndent(outfile, level) + outfile.write('RatedWeightMethod=%s,\n' % quote_python(self.RatedWeightMethod).encode(ExternalEncoding)) + if self.MinimumChargeType is not None: + showIndent(outfile, level) + outfile.write('MinimumChargeType=%s,\n' % quote_python(self.MinimumChargeType).encode(ExternalEncoding)) + if self.CurrencyExchangeRate is not None: + showIndent(outfile, level) + outfile.write('CurrencyExchangeRate=model_.CurrencyExchangeRate(\n') + self.CurrencyExchangeRate.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('SpecialRatingApplied=[\n') + level += 1 + for SpecialRatingApplied_ in self.SpecialRatingApplied: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(SpecialRatingApplied_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.DimDivisor is not None: + showIndent(outfile, level) + outfile.write('DimDivisor=%d,\n' % self.DimDivisor) + if self.DimDivisorType is not None: + showIndent(outfile, level) + outfile.write('DimDivisorType=%s,\n' % quote_python(self.DimDivisorType).encode(ExternalEncoding)) + if self.FuelSurchargePercent is not None: + showIndent(outfile, level) + outfile.write('FuelSurchargePercent=%f,\n' % self.FuelSurchargePercent) + if self.TotalBillingWeight is not None: + showIndent(outfile, level) + outfile.write('TotalBillingWeight=model_.Weight(\n') + self.TotalBillingWeight.exportLiteral(outfile, level, name_='TotalBillingWeight') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalDimWeight is not None: + showIndent(outfile, level) + outfile.write('TotalDimWeight=model_.Weight(\n') + self.TotalDimWeight.exportLiteral(outfile, level, name_='TotalDimWeight') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalBaseCharge is not None: + showIndent(outfile, level) + outfile.write('TotalBaseCharge=model_.Money(\n') + self.TotalBaseCharge.exportLiteral(outfile, level, name_='TotalBaseCharge') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalFreightDiscounts is not None: + showIndent(outfile, level) + outfile.write('TotalFreightDiscounts=model_.Money(\n') + self.TotalFreightDiscounts.exportLiteral(outfile, level, name_='TotalFreightDiscounts') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalNetFreight is not None: + showIndent(outfile, level) + outfile.write('TotalNetFreight=model_.Money(\n') + self.TotalNetFreight.exportLiteral(outfile, level, name_='TotalNetFreight') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalSurcharges is not None: + showIndent(outfile, level) + outfile.write('TotalSurcharges=model_.Money(\n') + self.TotalSurcharges.exportLiteral(outfile, level, name_='TotalSurcharges') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalNetFedExCharge is not None: + showIndent(outfile, level) + outfile.write('TotalNetFedExCharge=model_.Money(\n') + self.TotalNetFedExCharge.exportLiteral(outfile, level, name_='TotalNetFedExCharge') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalTaxes is not None: + showIndent(outfile, level) + outfile.write('TotalTaxes=model_.Money(\n') + self.TotalTaxes.exportLiteral(outfile, level, name_='TotalTaxes') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalNetCharge is not None: + showIndent(outfile, level) + outfile.write('TotalNetCharge=model_.Money(\n') + self.TotalNetCharge.exportLiteral(outfile, level, name_='TotalNetCharge') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalRebates is not None: + showIndent(outfile, level) + outfile.write('TotalRebates=model_.Money(\n') + self.TotalRebates.exportLiteral(outfile, level, name_='TotalRebates') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalDutiesAndTaxes is not None: + showIndent(outfile, level) + outfile.write('TotalDutiesAndTaxes=model_.Money(\n') + self.TotalDutiesAndTaxes.exportLiteral(outfile, level, name_='TotalDutiesAndTaxes') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalNetChargeWithDutiesAndTaxes is not None: + showIndent(outfile, level) + outfile.write('TotalNetChargeWithDutiesAndTaxes=model_.Money(\n') + self.TotalNetChargeWithDutiesAndTaxes.exportLiteral(outfile, level, name_='TotalNetChargeWithDutiesAndTaxes') + showIndent(outfile, level) + outfile.write('),\n') + if self.FreightRateDetail is not None: + showIndent(outfile, level) + outfile.write('FreightRateDetail=model_.FreightRateDetail(\n') + self.FreightRateDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('FreightDiscounts=[\n') + level += 1 + for FreightDiscounts_ in self.FreightDiscounts: + showIndent(outfile, level) + outfile.write('model_.RateDiscount(\n') + FreightDiscounts_.exportLiteral(outfile, level, name_='RateDiscount') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('Rebates=[\n') + level += 1 + for Rebates_ in self.Rebates: + showIndent(outfile, level) + outfile.write('model_.Rebate(\n') + Rebates_.exportLiteral(outfile, level, name_='Rebate') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('Surcharges=[\n') + level += 1 + for Surcharges_ in self.Surcharges: + showIndent(outfile, level) + outfile.write('model_.Surcharge(\n') + Surcharges_.exportLiteral(outfile, level, name_='Surcharge') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('Taxes=[\n') + level += 1 + for Taxes_ in self.Taxes: + showIndent(outfile, level) + outfile.write('model_.Tax(\n') + Taxes_.exportLiteral(outfile, level, name_='Tax') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('DutiesAndTaxes=[\n') + level += 1 + for DutiesAndTaxes_ in self.DutiesAndTaxes: + showIndent(outfile, level) + outfile.write('model_.EdtCommodityTax(\n') + DutiesAndTaxes_.exportLiteral(outfile, level, name_='EdtCommodityTax') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.VariableHandlingCharges is not None: + showIndent(outfile, level) + outfile.write('VariableHandlingCharges=model_.VariableHandlingCharges(\n') + self.VariableHandlingCharges.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalVariableHandlingCharges is not None: + showIndent(outfile, level) + outfile.write('TotalVariableHandlingCharges=model_.VariableHandlingCharges(\n') + self.TotalVariableHandlingCharges.exportLiteral(outfile, level, name_='TotalVariableHandlingCharges') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'LegDescription': + LegDescription_ = child_.text + LegDescription_ = self.gds_validate_string(LegDescription_, node, 'LegDescription') + self.LegDescription = LegDescription_ + elif nodeName_ == 'LegOrigin': + obj_ = Address.factory() + obj_.build(child_) + self.set_LegOrigin(obj_) + elif nodeName_ == 'LegDestination': + obj_ = Address.factory() + obj_.build(child_) + self.set_LegDestination(obj_) + elif nodeName_ == 'RateType': + RateType_ = child_.text + RateType_ = self.gds_validate_string(RateType_, node, 'RateType') + self.RateType = RateType_ + self.validate_ReturnedRateType(self.RateType) # validate type ReturnedRateType + elif nodeName_ == 'RateScale': + RateScale_ = child_.text + RateScale_ = self.gds_validate_string(RateScale_, node, 'RateScale') + self.RateScale = RateScale_ + elif nodeName_ == 'RateZone': + RateZone_ = child_.text + RateZone_ = self.gds_validate_string(RateZone_, node, 'RateZone') + self.RateZone = RateZone_ + elif nodeName_ == 'PricingCode': + PricingCode_ = child_.text + PricingCode_ = self.gds_validate_string(PricingCode_, node, 'PricingCode') + self.PricingCode = PricingCode_ + self.validate_PricingCodeType(self.PricingCode) # validate type PricingCodeType + elif nodeName_ == 'RatedWeightMethod': + RatedWeightMethod_ = child_.text + RatedWeightMethod_ = self.gds_validate_string(RatedWeightMethod_, node, 'RatedWeightMethod') + self.RatedWeightMethod = RatedWeightMethod_ + self.validate_RatedWeightMethod(self.RatedWeightMethod) # validate type RatedWeightMethod + elif nodeName_ == 'MinimumChargeType': + MinimumChargeType_ = child_.text + MinimumChargeType_ = self.gds_validate_string(MinimumChargeType_, node, 'MinimumChargeType') + self.MinimumChargeType = MinimumChargeType_ + self.validate_MinimumChargeType(self.MinimumChargeType) # validate type MinimumChargeType + elif nodeName_ == 'CurrencyExchangeRate': + obj_ = CurrencyExchangeRate.factory() + obj_.build(child_) + self.set_CurrencyExchangeRate(obj_) + elif nodeName_ == 'SpecialRatingApplied': + SpecialRatingApplied_ = child_.text + SpecialRatingApplied_ = self.gds_validate_string(SpecialRatingApplied_, node, 'SpecialRatingApplied') + self.SpecialRatingApplied.append(SpecialRatingApplied_) + self.validate_SpecialRatingAppliedType(self.SpecialRatingApplied) # validate type SpecialRatingAppliedType + elif nodeName_ == 'DimDivisor': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'DimDivisor') + self.DimDivisor = ival_ + elif nodeName_ == 'DimDivisorType': + DimDivisorType_ = child_.text + DimDivisorType_ = self.gds_validate_string(DimDivisorType_, node, 'DimDivisorType') + self.DimDivisorType = DimDivisorType_ + self.validate_RateDimensionalDivisorType(self.DimDivisorType) # validate type RateDimensionalDivisorType + elif nodeName_ == 'FuelSurchargePercent': + sval_ = child_.text + try: + fval_ = float(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires float or double: %s' % exp) + fval_ = self.gds_validate_float(fval_, node, 'FuelSurchargePercent') + self.FuelSurchargePercent = fval_ + elif nodeName_ == 'TotalBillingWeight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_TotalBillingWeight(obj_) + elif nodeName_ == 'TotalDimWeight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_TotalDimWeight(obj_) + elif nodeName_ == 'TotalBaseCharge': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalBaseCharge(obj_) + elif nodeName_ == 'TotalFreightDiscounts': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalFreightDiscounts(obj_) + elif nodeName_ == 'TotalNetFreight': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalNetFreight(obj_) + elif nodeName_ == 'TotalSurcharges': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalSurcharges(obj_) + elif nodeName_ == 'TotalNetFedExCharge': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalNetFedExCharge(obj_) + elif nodeName_ == 'TotalTaxes': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalTaxes(obj_) + elif nodeName_ == 'TotalNetCharge': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalNetCharge(obj_) + elif nodeName_ == 'TotalRebates': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalRebates(obj_) + elif nodeName_ == 'TotalDutiesAndTaxes': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalDutiesAndTaxes(obj_) + elif nodeName_ == 'TotalNetChargeWithDutiesAndTaxes': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalNetChargeWithDutiesAndTaxes(obj_) + elif nodeName_ == 'FreightRateDetail': + obj_ = FreightRateDetail.factory() + obj_.build(child_) + self.set_FreightRateDetail(obj_) + elif nodeName_ == 'FreightDiscounts': + obj_ = RateDiscount.factory() + obj_.build(child_) + self.FreightDiscounts.append(obj_) + elif nodeName_ == 'Rebates': + obj_ = Rebate.factory() + obj_.build(child_) + self.Rebates.append(obj_) + elif nodeName_ == 'Surcharges': + obj_ = Surcharge.factory() + obj_.build(child_) + self.Surcharges.append(obj_) + elif nodeName_ == 'Taxes': + obj_ = Tax.factory() + obj_.build(child_) + self.Taxes.append(obj_) + elif nodeName_ == 'DutiesAndTaxes': + obj_ = EdtCommodityTax.factory() + obj_.build(child_) + self.DutiesAndTaxes.append(obj_) + elif nodeName_ == 'VariableHandlingCharges': + obj_ = VariableHandlingCharges.factory() + obj_.build(child_) + self.set_VariableHandlingCharges(obj_) + elif nodeName_ == 'TotalVariableHandlingCharges': + obj_ = VariableHandlingCharges.factory() + obj_.build(child_) + self.set_TotalVariableHandlingCharges(obj_) +# end class ShipmentLegRateDetail + + +class ShipmentOperationalDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, UrsaPrefixCode=None, UrsaSuffixCode=None, OriginLocationId=None, OriginLocationNumber=None, OriginServiceArea=None, DestinationLocationId=None, DestinationLocationNumber=None, DestinationServiceArea=None, DestinationLocationStateOrProvinceCode=None, DeliveryDate=None, DeliveryDay=None, PublishedDeliveryTime=None, CommitDate=None, CommitDay=None, TransitTime=None, MaximumTransitTime=None, CustomTransitTime=None, IneligibleForMoneyBackGuarantee=None, DeliveryEligibilities=None, AstraPlannedServiceLevel=None, AstraDescription=None, PostalCode=None, StateOrProvinceCode=None, CountryCode=None, AirportId=None, ServiceCode=None): + self.UrsaPrefixCode = UrsaPrefixCode + self.UrsaSuffixCode = UrsaSuffixCode + self.OriginLocationId = OriginLocationId + self.OriginLocationNumber = OriginLocationNumber + self.OriginServiceArea = OriginServiceArea + self.DestinationLocationId = DestinationLocationId + self.DestinationLocationNumber = DestinationLocationNumber + self.DestinationServiceArea = DestinationServiceArea + self.DestinationLocationStateOrProvinceCode = DestinationLocationStateOrProvinceCode + self.DeliveryDate = DeliveryDate + self.DeliveryDay = DeliveryDay + self.PublishedDeliveryTime = PublishedDeliveryTime + self.CommitDate = CommitDate + self.CommitDay = CommitDay + self.TransitTime = TransitTime + self.MaximumTransitTime = MaximumTransitTime + self.CustomTransitTime = CustomTransitTime + self.IneligibleForMoneyBackGuarantee = IneligibleForMoneyBackGuarantee + if DeliveryEligibilities is None: + self.DeliveryEligibilities = [] + else: + self.DeliveryEligibilities = DeliveryEligibilities + self.AstraPlannedServiceLevel = AstraPlannedServiceLevel + self.AstraDescription = AstraDescription + self.PostalCode = PostalCode + self.StateOrProvinceCode = StateOrProvinceCode + self.CountryCode = CountryCode + self.AirportId = AirportId + self.ServiceCode = ServiceCode + def factory(*args_, **kwargs_): + if ShipmentOperationalDetail.subclass: + return ShipmentOperationalDetail.subclass(*args_, **kwargs_) + else: + return ShipmentOperationalDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_UrsaPrefixCode(self): return self.UrsaPrefixCode + def set_UrsaPrefixCode(self, UrsaPrefixCode): self.UrsaPrefixCode = UrsaPrefixCode + def get_UrsaSuffixCode(self): return self.UrsaSuffixCode + def set_UrsaSuffixCode(self, UrsaSuffixCode): self.UrsaSuffixCode = UrsaSuffixCode + def get_OriginLocationId(self): return self.OriginLocationId + def set_OriginLocationId(self, OriginLocationId): self.OriginLocationId = OriginLocationId + def get_OriginLocationNumber(self): return self.OriginLocationNumber + def set_OriginLocationNumber(self, OriginLocationNumber): self.OriginLocationNumber = OriginLocationNumber + def get_OriginServiceArea(self): return self.OriginServiceArea + def set_OriginServiceArea(self, OriginServiceArea): self.OriginServiceArea = OriginServiceArea + def get_DestinationLocationId(self): return self.DestinationLocationId + def set_DestinationLocationId(self, DestinationLocationId): self.DestinationLocationId = DestinationLocationId + def get_DestinationLocationNumber(self): return self.DestinationLocationNumber + def set_DestinationLocationNumber(self, DestinationLocationNumber): self.DestinationLocationNumber = DestinationLocationNumber + def get_DestinationServiceArea(self): return self.DestinationServiceArea + def set_DestinationServiceArea(self, DestinationServiceArea): self.DestinationServiceArea = DestinationServiceArea + def get_DestinationLocationStateOrProvinceCode(self): return self.DestinationLocationStateOrProvinceCode + def set_DestinationLocationStateOrProvinceCode(self, DestinationLocationStateOrProvinceCode): self.DestinationLocationStateOrProvinceCode = DestinationLocationStateOrProvinceCode + def get_DeliveryDate(self): return self.DeliveryDate + def set_DeliveryDate(self, DeliveryDate): self.DeliveryDate = DeliveryDate + def get_DeliveryDay(self): return self.DeliveryDay + def set_DeliveryDay(self, DeliveryDay): self.DeliveryDay = DeliveryDay + def validate_DayOfWeekType(self, value): + # Validate type DayOfWeekType, a restriction on xs:string. + pass + def get_PublishedDeliveryTime(self): return self.PublishedDeliveryTime + def set_PublishedDeliveryTime(self, PublishedDeliveryTime): self.PublishedDeliveryTime = PublishedDeliveryTime + def get_CommitDate(self): return self.CommitDate + def set_CommitDate(self, CommitDate): self.CommitDate = CommitDate + def get_CommitDay(self): return self.CommitDay + def set_CommitDay(self, CommitDay): self.CommitDay = CommitDay + def get_TransitTime(self): return self.TransitTime + def set_TransitTime(self, TransitTime): self.TransitTime = TransitTime + def validate_TransitTimeType(self, value): + # Validate type TransitTimeType, a restriction on xs:string. + pass + def get_MaximumTransitTime(self): return self.MaximumTransitTime + def set_MaximumTransitTime(self, MaximumTransitTime): self.MaximumTransitTime = MaximumTransitTime + def get_CustomTransitTime(self): return self.CustomTransitTime + def set_CustomTransitTime(self, CustomTransitTime): self.CustomTransitTime = CustomTransitTime + def get_IneligibleForMoneyBackGuarantee(self): return self.IneligibleForMoneyBackGuarantee + def set_IneligibleForMoneyBackGuarantee(self, IneligibleForMoneyBackGuarantee): self.IneligibleForMoneyBackGuarantee = IneligibleForMoneyBackGuarantee + def get_DeliveryEligibilities(self): return self.DeliveryEligibilities + def set_DeliveryEligibilities(self, DeliveryEligibilities): self.DeliveryEligibilities = DeliveryEligibilities + def add_DeliveryEligibilities(self, value): self.DeliveryEligibilities.append(value) + def insert_DeliveryEligibilities(self, index, value): self.DeliveryEligibilities[index] = value + def validate_GroundDeliveryEligibilityType(self, value): + # Validate type GroundDeliveryEligibilityType, a restriction on xs:string. + pass + def get_AstraPlannedServiceLevel(self): return self.AstraPlannedServiceLevel + def set_AstraPlannedServiceLevel(self, AstraPlannedServiceLevel): self.AstraPlannedServiceLevel = AstraPlannedServiceLevel + def get_AstraDescription(self): return self.AstraDescription + def set_AstraDescription(self, AstraDescription): self.AstraDescription = AstraDescription + def get_PostalCode(self): return self.PostalCode + def set_PostalCode(self, PostalCode): self.PostalCode = PostalCode + def get_StateOrProvinceCode(self): return self.StateOrProvinceCode + def set_StateOrProvinceCode(self, StateOrProvinceCode): self.StateOrProvinceCode = StateOrProvinceCode + def get_CountryCode(self): return self.CountryCode + def set_CountryCode(self, CountryCode): self.CountryCode = CountryCode + def get_AirportId(self): return self.AirportId + def set_AirportId(self, AirportId): self.AirportId = AirportId + def get_ServiceCode(self): return self.ServiceCode + def set_ServiceCode(self, ServiceCode): self.ServiceCode = ServiceCode + def export(self, outfile, level, namespace_='ns:', name_='ShipmentOperationalDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ShipmentOperationalDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ShipmentOperationalDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ShipmentOperationalDetail', fromsubclass_=False): + if self.UrsaPrefixCode is not None: + showIndent(outfile, level) + outfile.write('<%sUrsaPrefixCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.UrsaPrefixCode).encode(ExternalEncoding), input_name='UrsaPrefixCode'), namespace_)) + if self.UrsaSuffixCode is not None: + showIndent(outfile, level) + outfile.write('<%sUrsaSuffixCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.UrsaSuffixCode).encode(ExternalEncoding), input_name='UrsaSuffixCode'), namespace_)) + if self.OriginLocationId is not None: + showIndent(outfile, level) + outfile.write('<%sOriginLocationId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.OriginLocationId).encode(ExternalEncoding), input_name='OriginLocationId'), namespace_)) + if self.OriginLocationNumber is not None: + showIndent(outfile, level) + outfile.write('<%sOriginLocationNumber>%s\n' % (namespace_, self.gds_format_integer(self.OriginLocationNumber, input_name='OriginLocationNumber'), namespace_)) + if self.OriginServiceArea is not None: + showIndent(outfile, level) + outfile.write('<%sOriginServiceArea>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.OriginServiceArea).encode(ExternalEncoding), input_name='OriginServiceArea'), namespace_)) + if self.DestinationLocationId is not None: + showIndent(outfile, level) + outfile.write('<%sDestinationLocationId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DestinationLocationId).encode(ExternalEncoding), input_name='DestinationLocationId'), namespace_)) + if self.DestinationLocationNumber is not None: + showIndent(outfile, level) + outfile.write('<%sDestinationLocationNumber>%s\n' % (namespace_, self.gds_format_integer(self.DestinationLocationNumber, input_name='DestinationLocationNumber'), namespace_)) + if self.DestinationServiceArea is not None: + showIndent(outfile, level) + outfile.write('<%sDestinationServiceArea>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DestinationServiceArea).encode(ExternalEncoding), input_name='DestinationServiceArea'), namespace_)) + if self.DestinationLocationStateOrProvinceCode is not None: + showIndent(outfile, level) + outfile.write('<%sDestinationLocationStateOrProvinceCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DestinationLocationStateOrProvinceCode).encode(ExternalEncoding), input_name='DestinationLocationStateOrProvinceCode'), namespace_)) + if self.DeliveryDate is not None: + showIndent(outfile, level) + outfile.write('<%sDeliveryDate>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DeliveryDate).encode(ExternalEncoding), input_name='DeliveryDate'), namespace_)) + if self.DeliveryDay is not None: + showIndent(outfile, level) + outfile.write('<%sDeliveryDay>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DeliveryDay).encode(ExternalEncoding), input_name='DeliveryDay'), namespace_)) + if self.PublishedDeliveryTime: + self.PublishedDeliveryTime.export(outfile, level, namespace_, name_='PublishedDeliveryTime') + if self.CommitDate is not None: + showIndent(outfile, level) + outfile.write('<%sCommitDate>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CommitDate).encode(ExternalEncoding), input_name='CommitDate'), namespace_)) + if self.CommitDay is not None: + showIndent(outfile, level) + outfile.write('<%sCommitDay>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CommitDay).encode(ExternalEncoding), input_name='CommitDay'), namespace_)) + if self.TransitTime is not None: + showIndent(outfile, level) + outfile.write('<%sTransitTime>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.TransitTime).encode(ExternalEncoding), input_name='TransitTime'), namespace_)) + if self.MaximumTransitTime is not None: + showIndent(outfile, level) + outfile.write('<%sMaximumTransitTime>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.MaximumTransitTime).encode(ExternalEncoding), input_name='MaximumTransitTime'), namespace_)) + if self.CustomTransitTime is not None: + showIndent(outfile, level) + outfile.write('<%sCustomTransitTime>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CustomTransitTime).encode(ExternalEncoding), input_name='CustomTransitTime'), namespace_)) + if self.IneligibleForMoneyBackGuarantee is not None: + showIndent(outfile, level) + outfile.write('<%sIneligibleForMoneyBackGuarantee>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.IneligibleForMoneyBackGuarantee)), input_name='IneligibleForMoneyBackGuarantee'), namespace_)) + for DeliveryEligibilities_ in self.DeliveryEligibilities: + showIndent(outfile, level) + outfile.write('<%sDeliveryEligibilities>%s\n' % (namespace_, self.gds_format_string(quote_xml(DeliveryEligibilities_).encode(ExternalEncoding), input_name='DeliveryEligibilities'), namespace_)) + if self.AstraPlannedServiceLevel is not None: + showIndent(outfile, level) + outfile.write('<%sAstraPlannedServiceLevel>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AstraPlannedServiceLevel).encode(ExternalEncoding), input_name='AstraPlannedServiceLevel'), namespace_)) + if self.AstraDescription is not None: + showIndent(outfile, level) + outfile.write('<%sAstraDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AstraDescription).encode(ExternalEncoding), input_name='AstraDescription'), namespace_)) + if self.PostalCode is not None: + showIndent(outfile, level) + outfile.write('<%sPostalCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PostalCode).encode(ExternalEncoding), input_name='PostalCode'), namespace_)) + if self.StateOrProvinceCode is not None: + showIndent(outfile, level) + outfile.write('<%sStateOrProvinceCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.StateOrProvinceCode).encode(ExternalEncoding), input_name='StateOrProvinceCode'), namespace_)) + if self.CountryCode is not None: + showIndent(outfile, level) + outfile.write('<%sCountryCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CountryCode).encode(ExternalEncoding), input_name='CountryCode'), namespace_)) + if self.AirportId is not None: + showIndent(outfile, level) + outfile.write('<%sAirportId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AirportId).encode(ExternalEncoding), input_name='AirportId'), namespace_)) + if self.ServiceCode is not None: + showIndent(outfile, level) + outfile.write('<%sServiceCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ServiceCode).encode(ExternalEncoding), input_name='ServiceCode'), namespace_)) + def hasContent_(self): + if ( + self.UrsaPrefixCode is not None or + self.UrsaSuffixCode is not None or + self.OriginLocationId is not None or + self.OriginLocationNumber is not None or + self.OriginServiceArea is not None or + self.DestinationLocationId is not None or + self.DestinationLocationNumber is not None or + self.DestinationServiceArea is not None or + self.DestinationLocationStateOrProvinceCode is not None or + self.DeliveryDate is not None or + self.DeliveryDay is not None or + self.PublishedDeliveryTime is not None or + self.CommitDate is not None or + self.CommitDay is not None or + self.TransitTime is not None or + self.MaximumTransitTime is not None or + self.CustomTransitTime is not None or + self.IneligibleForMoneyBackGuarantee is not None or + self.DeliveryEligibilities or + self.AstraPlannedServiceLevel is not None or + self.AstraDescription is not None or + self.PostalCode is not None or + self.StateOrProvinceCode is not None or + self.CountryCode is not None or + self.AirportId is not None or + self.ServiceCode is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ShipmentOperationalDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.UrsaPrefixCode is not None: + showIndent(outfile, level) + outfile.write('UrsaPrefixCode=%s,\n' % quote_python(self.UrsaPrefixCode).encode(ExternalEncoding)) + if self.UrsaSuffixCode is not None: + showIndent(outfile, level) + outfile.write('UrsaSuffixCode=%s,\n' % quote_python(self.UrsaSuffixCode).encode(ExternalEncoding)) + if self.OriginLocationId is not None: + showIndent(outfile, level) + outfile.write('OriginLocationId=%s,\n' % quote_python(self.OriginLocationId).encode(ExternalEncoding)) + if self.OriginLocationNumber is not None: + showIndent(outfile, level) + outfile.write('OriginLocationNumber=%d,\n' % self.OriginLocationNumber) + if self.OriginServiceArea is not None: + showIndent(outfile, level) + outfile.write('OriginServiceArea=%s,\n' % quote_python(self.OriginServiceArea).encode(ExternalEncoding)) + if self.DestinationLocationId is not None: + showIndent(outfile, level) + outfile.write('DestinationLocationId=%s,\n' % quote_python(self.DestinationLocationId).encode(ExternalEncoding)) + if self.DestinationLocationNumber is not None: + showIndent(outfile, level) + outfile.write('DestinationLocationNumber=%d,\n' % self.DestinationLocationNumber) + if self.DestinationServiceArea is not None: + showIndent(outfile, level) + outfile.write('DestinationServiceArea=%s,\n' % quote_python(self.DestinationServiceArea).encode(ExternalEncoding)) + if self.DestinationLocationStateOrProvinceCode is not None: + showIndent(outfile, level) + outfile.write('DestinationLocationStateOrProvinceCode=%s,\n' % quote_python(self.DestinationLocationStateOrProvinceCode).encode(ExternalEncoding)) + if self.DeliveryDate is not None: + showIndent(outfile, level) + outfile.write('DeliveryDate=%s,\n' % quote_python(self.DeliveryDate).encode(ExternalEncoding)) + if self.DeliveryDay is not None: + showIndent(outfile, level) + outfile.write('DeliveryDay=%s,\n' % quote_python(self.DeliveryDay).encode(ExternalEncoding)) + if self.PublishedDeliveryTime is not None: + showIndent(outfile, level) + outfile.write('PublishedDeliveryTime=model_.xs_time(\n') + self.PublishedDeliveryTime.exportLiteral(outfile, level, name_='PublishedDeliveryTime') + showIndent(outfile, level) + outfile.write('),\n') + if self.CommitDate is not None: + showIndent(outfile, level) + outfile.write('CommitDate=%s,\n' % quote_python(self.CommitDate).encode(ExternalEncoding)) + if self.CommitDay is not None: + showIndent(outfile, level) + outfile.write('CommitDay=%s,\n' % quote_python(self.CommitDay).encode(ExternalEncoding)) + if self.TransitTime is not None: + showIndent(outfile, level) + outfile.write('TransitTime=%s,\n' % quote_python(self.TransitTime).encode(ExternalEncoding)) + if self.MaximumTransitTime is not None: + showIndent(outfile, level) + outfile.write('MaximumTransitTime=%s,\n' % quote_python(self.MaximumTransitTime).encode(ExternalEncoding)) + if self.CustomTransitTime is not None: + showIndent(outfile, level) + outfile.write('CustomTransitTime=%s,\n' % quote_python(self.CustomTransitTime).encode(ExternalEncoding)) + if self.IneligibleForMoneyBackGuarantee is not None: + showIndent(outfile, level) + outfile.write('IneligibleForMoneyBackGuarantee=%s,\n' % self.IneligibleForMoneyBackGuarantee) + showIndent(outfile, level) + outfile.write('DeliveryEligibilities=[\n') + level += 1 + for DeliveryEligibilities_ in self.DeliveryEligibilities: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(DeliveryEligibilities_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.AstraPlannedServiceLevel is not None: + showIndent(outfile, level) + outfile.write('AstraPlannedServiceLevel=%s,\n' % quote_python(self.AstraPlannedServiceLevel).encode(ExternalEncoding)) + if self.AstraDescription is not None: + showIndent(outfile, level) + outfile.write('AstraDescription=%s,\n' % quote_python(self.AstraDescription).encode(ExternalEncoding)) + if self.PostalCode is not None: + showIndent(outfile, level) + outfile.write('PostalCode=%s,\n' % quote_python(self.PostalCode).encode(ExternalEncoding)) + if self.StateOrProvinceCode is not None: + showIndent(outfile, level) + outfile.write('StateOrProvinceCode=%s,\n' % quote_python(self.StateOrProvinceCode).encode(ExternalEncoding)) + if self.CountryCode is not None: + showIndent(outfile, level) + outfile.write('CountryCode=%s,\n' % quote_python(self.CountryCode).encode(ExternalEncoding)) + if self.AirportId is not None: + showIndent(outfile, level) + outfile.write('AirportId=%s,\n' % quote_python(self.AirportId).encode(ExternalEncoding)) + if self.ServiceCode is not None: + showIndent(outfile, level) + outfile.write('ServiceCode=%s,\n' % quote_python(self.ServiceCode).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'UrsaPrefixCode': + UrsaPrefixCode_ = child_.text + UrsaPrefixCode_ = self.gds_validate_string(UrsaPrefixCode_, node, 'UrsaPrefixCode') + self.UrsaPrefixCode = UrsaPrefixCode_ + elif nodeName_ == 'UrsaSuffixCode': + UrsaSuffixCode_ = child_.text + UrsaSuffixCode_ = self.gds_validate_string(UrsaSuffixCode_, node, 'UrsaSuffixCode') + self.UrsaSuffixCode = UrsaSuffixCode_ + elif nodeName_ == 'OriginLocationId': + OriginLocationId_ = child_.text + OriginLocationId_ = self.gds_validate_string(OriginLocationId_, node, 'OriginLocationId') + self.OriginLocationId = OriginLocationId_ + elif nodeName_ == 'OriginLocationNumber': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'OriginLocationNumber') + self.OriginLocationNumber = ival_ + elif nodeName_ == 'OriginServiceArea': + OriginServiceArea_ = child_.text + OriginServiceArea_ = self.gds_validate_string(OriginServiceArea_, node, 'OriginServiceArea') + self.OriginServiceArea = OriginServiceArea_ + elif nodeName_ == 'DestinationLocationId': + DestinationLocationId_ = child_.text + DestinationLocationId_ = self.gds_validate_string(DestinationLocationId_, node, 'DestinationLocationId') + self.DestinationLocationId = DestinationLocationId_ + elif nodeName_ == 'DestinationLocationNumber': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'DestinationLocationNumber') + self.DestinationLocationNumber = ival_ + elif nodeName_ == 'DestinationServiceArea': + DestinationServiceArea_ = child_.text + DestinationServiceArea_ = self.gds_validate_string(DestinationServiceArea_, node, 'DestinationServiceArea') + self.DestinationServiceArea = DestinationServiceArea_ + elif nodeName_ == 'DestinationLocationStateOrProvinceCode': + DestinationLocationStateOrProvinceCode_ = child_.text + DestinationLocationStateOrProvinceCode_ = self.gds_validate_string(DestinationLocationStateOrProvinceCode_, node, 'DestinationLocationStateOrProvinceCode') + self.DestinationLocationStateOrProvinceCode = DestinationLocationStateOrProvinceCode_ + elif nodeName_ == 'DeliveryDate': + DeliveryDate_ = child_.text + DeliveryDate_ = self.gds_validate_string(DeliveryDate_, node, 'DeliveryDate') + self.DeliveryDate = DeliveryDate_ + elif nodeName_ == 'DeliveryDay': + DeliveryDay_ = child_.text + DeliveryDay_ = self.gds_validate_string(DeliveryDay_, node, 'DeliveryDay') + self.DeliveryDay = DeliveryDay_ + self.validate_DayOfWeekType(self.DeliveryDay) # validate type DayOfWeekType + elif nodeName_ == 'PublishedDeliveryTime': + obj_ = xs_time.factory() + obj_.build(child_) + self.set_PublishedDeliveryTime(obj_) + elif nodeName_ == 'CommitDate': + CommitDate_ = child_.text + CommitDate_ = self.gds_validate_string(CommitDate_, node, 'CommitDate') + self.CommitDate = CommitDate_ + elif nodeName_ == 'CommitDay': + CommitDay_ = child_.text + CommitDay_ = self.gds_validate_string(CommitDay_, node, 'CommitDay') + self.CommitDay = CommitDay_ + self.validate_DayOfWeekType(self.CommitDay) # validate type DayOfWeekType + elif nodeName_ == 'TransitTime': + TransitTime_ = child_.text + TransitTime_ = self.gds_validate_string(TransitTime_, node, 'TransitTime') + self.TransitTime = TransitTime_ + self.validate_TransitTimeType(self.TransitTime) # validate type TransitTimeType + elif nodeName_ == 'MaximumTransitTime': + MaximumTransitTime_ = child_.text + MaximumTransitTime_ = self.gds_validate_string(MaximumTransitTime_, node, 'MaximumTransitTime') + self.MaximumTransitTime = MaximumTransitTime_ + self.validate_TransitTimeType(self.MaximumTransitTime) # validate type TransitTimeType + elif nodeName_ == 'CustomTransitTime': + CustomTransitTime_ = child_.text + CustomTransitTime_ = self.gds_validate_string(CustomTransitTime_, node, 'CustomTransitTime') + self.CustomTransitTime = CustomTransitTime_ + self.validate_TransitTimeType(self.CustomTransitTime) # validate type TransitTimeType + elif nodeName_ == 'IneligibleForMoneyBackGuarantee': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'IneligibleForMoneyBackGuarantee') + self.IneligibleForMoneyBackGuarantee = ival_ + elif nodeName_ == 'DeliveryEligibilities': + DeliveryEligibilities_ = child_.text + DeliveryEligibilities_ = self.gds_validate_string(DeliveryEligibilities_, node, 'DeliveryEligibilities') + self.DeliveryEligibilities.append(DeliveryEligibilities_) + self.validate_GroundDeliveryEligibilityType(self.DeliveryEligibilities) # validate type GroundDeliveryEligibilityType + elif nodeName_ == 'AstraPlannedServiceLevel': + AstraPlannedServiceLevel_ = child_.text + AstraPlannedServiceLevel_ = self.gds_validate_string(AstraPlannedServiceLevel_, node, 'AstraPlannedServiceLevel') + self.AstraPlannedServiceLevel = AstraPlannedServiceLevel_ + elif nodeName_ == 'AstraDescription': + AstraDescription_ = child_.text + AstraDescription_ = self.gds_validate_string(AstraDescription_, node, 'AstraDescription') + self.AstraDescription = AstraDescription_ + elif nodeName_ == 'PostalCode': + PostalCode_ = child_.text + PostalCode_ = self.gds_validate_string(PostalCode_, node, 'PostalCode') + self.PostalCode = PostalCode_ + elif nodeName_ == 'StateOrProvinceCode': + StateOrProvinceCode_ = child_.text + StateOrProvinceCode_ = self.gds_validate_string(StateOrProvinceCode_, node, 'StateOrProvinceCode') + self.StateOrProvinceCode = StateOrProvinceCode_ + elif nodeName_ == 'CountryCode': + CountryCode_ = child_.text + CountryCode_ = self.gds_validate_string(CountryCode_, node, 'CountryCode') + self.CountryCode = CountryCode_ + elif nodeName_ == 'AirportId': + AirportId_ = child_.text + AirportId_ = self.gds_validate_string(AirportId_, node, 'AirportId') + self.AirportId = AirportId_ + elif nodeName_ == 'ServiceCode': + ServiceCode_ = child_.text + ServiceCode_ = self.gds_validate_string(ServiceCode_, node, 'ServiceCode') + self.ServiceCode = ServiceCode_ +# end class ShipmentOperationalDetail + + +class ShipmentRateDetail(GeneratedsSuper): + """Data for a shipment's total/summary rates, as calculated per a + specific rate type. The "total..." fields may differ from the + sum of corresponding package data for Multiweight or Express + MPS.""" + subclass = None + superclass = None + def __init__(self, RateType=None, RateScale=None, RateZone=None, PricingCode=None, RatedWeightMethod=None, MinimumChargeType=None, CurrencyExchangeRate=None, SpecialRatingApplied=None, DimDivisor=None, DimDivisorType=None, FuelSurchargePercent=None, TotalBillingWeight=None, TotalDimWeight=None, TotalBaseCharge=None, TotalFreightDiscounts=None, TotalNetFreight=None, TotalSurcharges=None, TotalNetFedExCharge=None, TotalTaxes=None, TotalNetCharge=None, TotalRebates=None, TotalDutiesAndTaxes=None, TotalNetChargeWithDutiesAndTaxes=None, ShipmentLegRateDetails=None, FreightRateDetail=None, FreightDiscounts=None, Rebates=None, Surcharges=None, Taxes=None, DutiesAndTaxes=None, VariableHandlingCharges=None, TotalVariableHandlingCharges=None): + self.RateType = RateType + self.RateScale = RateScale + self.RateZone = RateZone + self.PricingCode = PricingCode + self.RatedWeightMethod = RatedWeightMethod + self.MinimumChargeType = MinimumChargeType + self.CurrencyExchangeRate = CurrencyExchangeRate + if SpecialRatingApplied is None: + self.SpecialRatingApplied = [] + else: + self.SpecialRatingApplied = SpecialRatingApplied + self.DimDivisor = DimDivisor + self.DimDivisorType = DimDivisorType + self.FuelSurchargePercent = FuelSurchargePercent + self.TotalBillingWeight = TotalBillingWeight + self.TotalDimWeight = TotalDimWeight + self.TotalBaseCharge = TotalBaseCharge + self.TotalFreightDiscounts = TotalFreightDiscounts + self.TotalNetFreight = TotalNetFreight + self.TotalSurcharges = TotalSurcharges + self.TotalNetFedExCharge = TotalNetFedExCharge + self.TotalTaxes = TotalTaxes + self.TotalNetCharge = TotalNetCharge + self.TotalRebates = TotalRebates + self.TotalDutiesAndTaxes = TotalDutiesAndTaxes + self.TotalNetChargeWithDutiesAndTaxes = TotalNetChargeWithDutiesAndTaxes + if ShipmentLegRateDetails is None: + self.ShipmentLegRateDetails = [] + else: + self.ShipmentLegRateDetails = ShipmentLegRateDetails + self.FreightRateDetail = FreightRateDetail + if FreightDiscounts is None: + self.FreightDiscounts = [] + else: + self.FreightDiscounts = FreightDiscounts + if Rebates is None: + self.Rebates = [] + else: + self.Rebates = Rebates + if Surcharges is None: + self.Surcharges = [] + else: + self.Surcharges = Surcharges + if Taxes is None: + self.Taxes = [] + else: + self.Taxes = Taxes + if DutiesAndTaxes is None: + self.DutiesAndTaxes = [] + else: + self.DutiesAndTaxes = DutiesAndTaxes + self.VariableHandlingCharges = VariableHandlingCharges + self.TotalVariableHandlingCharges = TotalVariableHandlingCharges + def factory(*args_, **kwargs_): + if ShipmentRateDetail.subclass: + return ShipmentRateDetail.subclass(*args_, **kwargs_) + else: + return ShipmentRateDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_RateType(self): return self.RateType + def set_RateType(self, RateType): self.RateType = RateType + def validate_ReturnedRateType(self, value): + # Validate type ReturnedRateType, a restriction on xs:string. + pass + def get_RateScale(self): return self.RateScale + def set_RateScale(self, RateScale): self.RateScale = RateScale + def get_RateZone(self): return self.RateZone + def set_RateZone(self, RateZone): self.RateZone = RateZone + def get_PricingCode(self): return self.PricingCode + def set_PricingCode(self, PricingCode): self.PricingCode = PricingCode + def validate_PricingCodeType(self, value): + # Validate type PricingCodeType, a restriction on xs:string. + pass + def get_RatedWeightMethod(self): return self.RatedWeightMethod + def set_RatedWeightMethod(self, RatedWeightMethod): self.RatedWeightMethod = RatedWeightMethod + def validate_RatedWeightMethod(self, value): + # Validate type RatedWeightMethod, a restriction on xs:string. + pass + def get_MinimumChargeType(self): return self.MinimumChargeType + def set_MinimumChargeType(self, MinimumChargeType): self.MinimumChargeType = MinimumChargeType + def validate_MinimumChargeType(self, value): + # Validate type MinimumChargeType, a restriction on xs:string. + pass + def get_CurrencyExchangeRate(self): return self.CurrencyExchangeRate + def set_CurrencyExchangeRate(self, CurrencyExchangeRate): self.CurrencyExchangeRate = CurrencyExchangeRate + def get_SpecialRatingApplied(self): return self.SpecialRatingApplied + def set_SpecialRatingApplied(self, SpecialRatingApplied): self.SpecialRatingApplied = SpecialRatingApplied + def add_SpecialRatingApplied(self, value): self.SpecialRatingApplied.append(value) + def insert_SpecialRatingApplied(self, index, value): self.SpecialRatingApplied[index] = value + def validate_SpecialRatingAppliedType(self, value): + # Validate type SpecialRatingAppliedType, a restriction on xs:string. + pass + def get_DimDivisor(self): return self.DimDivisor + def set_DimDivisor(self, DimDivisor): self.DimDivisor = DimDivisor + def get_DimDivisorType(self): return self.DimDivisorType + def set_DimDivisorType(self, DimDivisorType): self.DimDivisorType = DimDivisorType + def validate_RateDimensionalDivisorType(self, value): + # Validate type RateDimensionalDivisorType, a restriction on xs:string. + pass + def get_FuelSurchargePercent(self): return self.FuelSurchargePercent + def set_FuelSurchargePercent(self, FuelSurchargePercent): self.FuelSurchargePercent = FuelSurchargePercent + def get_TotalBillingWeight(self): return self.TotalBillingWeight + def set_TotalBillingWeight(self, TotalBillingWeight): self.TotalBillingWeight = TotalBillingWeight + def get_TotalDimWeight(self): return self.TotalDimWeight + def set_TotalDimWeight(self, TotalDimWeight): self.TotalDimWeight = TotalDimWeight + def get_TotalBaseCharge(self): return self.TotalBaseCharge + def set_TotalBaseCharge(self, TotalBaseCharge): self.TotalBaseCharge = TotalBaseCharge + def get_TotalFreightDiscounts(self): return self.TotalFreightDiscounts + def set_TotalFreightDiscounts(self, TotalFreightDiscounts): self.TotalFreightDiscounts = TotalFreightDiscounts + def get_TotalNetFreight(self): return self.TotalNetFreight + def set_TotalNetFreight(self, TotalNetFreight): self.TotalNetFreight = TotalNetFreight + def get_TotalSurcharges(self): return self.TotalSurcharges + def set_TotalSurcharges(self, TotalSurcharges): self.TotalSurcharges = TotalSurcharges + def get_TotalNetFedExCharge(self): return self.TotalNetFedExCharge + def set_TotalNetFedExCharge(self, TotalNetFedExCharge): self.TotalNetFedExCharge = TotalNetFedExCharge + def get_TotalTaxes(self): return self.TotalTaxes + def set_TotalTaxes(self, TotalTaxes): self.TotalTaxes = TotalTaxes + def get_TotalNetCharge(self): return self.TotalNetCharge + def set_TotalNetCharge(self, TotalNetCharge): self.TotalNetCharge = TotalNetCharge + def get_TotalRebates(self): return self.TotalRebates + def set_TotalRebates(self, TotalRebates): self.TotalRebates = TotalRebates + def get_TotalDutiesAndTaxes(self): return self.TotalDutiesAndTaxes + def set_TotalDutiesAndTaxes(self, TotalDutiesAndTaxes): self.TotalDutiesAndTaxes = TotalDutiesAndTaxes + def get_TotalNetChargeWithDutiesAndTaxes(self): return self.TotalNetChargeWithDutiesAndTaxes + def set_TotalNetChargeWithDutiesAndTaxes(self, TotalNetChargeWithDutiesAndTaxes): self.TotalNetChargeWithDutiesAndTaxes = TotalNetChargeWithDutiesAndTaxes + def get_ShipmentLegRateDetails(self): return self.ShipmentLegRateDetails + def set_ShipmentLegRateDetails(self, ShipmentLegRateDetails): self.ShipmentLegRateDetails = ShipmentLegRateDetails + def add_ShipmentLegRateDetails(self, value): self.ShipmentLegRateDetails.append(value) + def insert_ShipmentLegRateDetails(self, index, value): self.ShipmentLegRateDetails[index] = value + def get_FreightRateDetail(self): return self.FreightRateDetail + def set_FreightRateDetail(self, FreightRateDetail): self.FreightRateDetail = FreightRateDetail + def get_FreightDiscounts(self): return self.FreightDiscounts + def set_FreightDiscounts(self, FreightDiscounts): self.FreightDiscounts = FreightDiscounts + def add_FreightDiscounts(self, value): self.FreightDiscounts.append(value) + def insert_FreightDiscounts(self, index, value): self.FreightDiscounts[index] = value + def get_Rebates(self): return self.Rebates + def set_Rebates(self, Rebates): self.Rebates = Rebates + def add_Rebates(self, value): self.Rebates.append(value) + def insert_Rebates(self, index, value): self.Rebates[index] = value + def get_Surcharges(self): return self.Surcharges + def set_Surcharges(self, Surcharges): self.Surcharges = Surcharges + def add_Surcharges(self, value): self.Surcharges.append(value) + def insert_Surcharges(self, index, value): self.Surcharges[index] = value + def get_Taxes(self): return self.Taxes + def set_Taxes(self, Taxes): self.Taxes = Taxes + def add_Taxes(self, value): self.Taxes.append(value) + def insert_Taxes(self, index, value): self.Taxes[index] = value + def get_DutiesAndTaxes(self): return self.DutiesAndTaxes + def set_DutiesAndTaxes(self, DutiesAndTaxes): self.DutiesAndTaxes = DutiesAndTaxes + def add_DutiesAndTaxes(self, value): self.DutiesAndTaxes.append(value) + def insert_DutiesAndTaxes(self, index, value): self.DutiesAndTaxes[index] = value + def get_VariableHandlingCharges(self): return self.VariableHandlingCharges + def set_VariableHandlingCharges(self, VariableHandlingCharges): self.VariableHandlingCharges = VariableHandlingCharges + def get_TotalVariableHandlingCharges(self): return self.TotalVariableHandlingCharges + def set_TotalVariableHandlingCharges(self, TotalVariableHandlingCharges): self.TotalVariableHandlingCharges = TotalVariableHandlingCharges + def export(self, outfile, level, namespace_='ns:', name_='ShipmentRateDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ShipmentRateDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ShipmentRateDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ShipmentRateDetail', fromsubclass_=False): + if self.RateType is not None: + showIndent(outfile, level) + outfile.write('<%sRateType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RateType).encode(ExternalEncoding), input_name='RateType'), namespace_)) + if self.RateScale is not None: + showIndent(outfile, level) + outfile.write('<%sRateScale>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RateScale).encode(ExternalEncoding), input_name='RateScale'), namespace_)) + if self.RateZone is not None: + showIndent(outfile, level) + outfile.write('<%sRateZone>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RateZone).encode(ExternalEncoding), input_name='RateZone'), namespace_)) + if self.PricingCode is not None: + showIndent(outfile, level) + outfile.write('<%sPricingCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PricingCode).encode(ExternalEncoding), input_name='PricingCode'), namespace_)) + if self.RatedWeightMethod is not None: + showIndent(outfile, level) + outfile.write('<%sRatedWeightMethod>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RatedWeightMethod).encode(ExternalEncoding), input_name='RatedWeightMethod'), namespace_)) + if self.MinimumChargeType is not None: + showIndent(outfile, level) + outfile.write('<%sMinimumChargeType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.MinimumChargeType).encode(ExternalEncoding), input_name='MinimumChargeType'), namespace_)) + if self.CurrencyExchangeRate: + self.CurrencyExchangeRate.export(outfile, level, namespace_, name_='CurrencyExchangeRate') + for SpecialRatingApplied_ in self.SpecialRatingApplied: + showIndent(outfile, level) + outfile.write('<%sSpecialRatingApplied>%s\n' % (namespace_, self.gds_format_string(quote_xml(SpecialRatingApplied_).encode(ExternalEncoding), input_name='SpecialRatingApplied'), namespace_)) + if self.DimDivisor is not None: + showIndent(outfile, level) + outfile.write('<%sDimDivisor>%s\n' % (namespace_, self.gds_format_integer(self.DimDivisor, input_name='DimDivisor'), namespace_)) + if self.DimDivisorType is not None: + showIndent(outfile, level) + outfile.write('<%sDimDivisorType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DimDivisorType).encode(ExternalEncoding), input_name='DimDivisorType'), namespace_)) + if self.FuelSurchargePercent is not None: + showIndent(outfile, level) + outfile.write('<%sFuelSurchargePercent>%s\n' % (namespace_, self.gds_format_float(self.FuelSurchargePercent, input_name='FuelSurchargePercent'), namespace_)) + if self.TotalBillingWeight: + self.TotalBillingWeight.export(outfile, level, namespace_, name_='TotalBillingWeight') + if self.TotalDimWeight: + self.TotalDimWeight.export(outfile, level, namespace_, name_='TotalDimWeight') + if self.TotalBaseCharge: + self.TotalBaseCharge.export(outfile, level, namespace_, name_='TotalBaseCharge') + if self.TotalFreightDiscounts: + self.TotalFreightDiscounts.export(outfile, level, namespace_, name_='TotalFreightDiscounts') + if self.TotalNetFreight: + self.TotalNetFreight.export(outfile, level, namespace_, name_='TotalNetFreight') + if self.TotalSurcharges: + self.TotalSurcharges.export(outfile, level, namespace_, name_='TotalSurcharges') + if self.TotalNetFedExCharge: + self.TotalNetFedExCharge.export(outfile, level, namespace_, name_='TotalNetFedExCharge') + if self.TotalTaxes: + self.TotalTaxes.export(outfile, level, namespace_, name_='TotalTaxes') + if self.TotalNetCharge: + self.TotalNetCharge.export(outfile, level, namespace_, name_='TotalNetCharge') + if self.TotalRebates: + self.TotalRebates.export(outfile, level, namespace_, name_='TotalRebates') + if self.TotalDutiesAndTaxes: + self.TotalDutiesAndTaxes.export(outfile, level, namespace_, name_='TotalDutiesAndTaxes') + if self.TotalNetChargeWithDutiesAndTaxes: + self.TotalNetChargeWithDutiesAndTaxes.export(outfile, level, namespace_, name_='TotalNetChargeWithDutiesAndTaxes') + for ShipmentLegRateDetails_ in self.ShipmentLegRateDetails: + ShipmentLegRateDetails_.export(outfile, level, namespace_, name_='ShipmentLegRateDetails') + if self.FreightRateDetail: + self.FreightRateDetail.export(outfile, level, namespace_, name_='FreightRateDetail') + for FreightDiscounts_ in self.FreightDiscounts: + FreightDiscounts_.export(outfile, level, namespace_, name_='FreightDiscounts') + for Rebates_ in self.Rebates: + Rebates_.export(outfile, level, namespace_, name_='Rebates') + for Surcharges_ in self.Surcharges: + Surcharges_.export(outfile, level, namespace_, name_='Surcharges') + for Taxes_ in self.Taxes: + Taxes_.export(outfile, level, namespace_, name_='Taxes') + for DutiesAndTaxes_ in self.DutiesAndTaxes: + DutiesAndTaxes_.export(outfile, level, namespace_, name_='DutiesAndTaxes') + if self.VariableHandlingCharges: + self.VariableHandlingCharges.export(outfile, level, namespace_, name_='VariableHandlingCharges') + if self.TotalVariableHandlingCharges: + self.TotalVariableHandlingCharges.export(outfile, level, namespace_, name_='TotalVariableHandlingCharges') + def hasContent_(self): + if ( + self.RateType is not None or + self.RateScale is not None or + self.RateZone is not None or + self.PricingCode is not None or + self.RatedWeightMethod is not None or + self.MinimumChargeType is not None or + self.CurrencyExchangeRate is not None or + self.SpecialRatingApplied or + self.DimDivisor is not None or + self.DimDivisorType is not None or + self.FuelSurchargePercent is not None or + self.TotalBillingWeight is not None or + self.TotalDimWeight is not None or + self.TotalBaseCharge is not None or + self.TotalFreightDiscounts is not None or + self.TotalNetFreight is not None or + self.TotalSurcharges is not None or + self.TotalNetFedExCharge is not None or + self.TotalTaxes is not None or + self.TotalNetCharge is not None or + self.TotalRebates is not None or + self.TotalDutiesAndTaxes is not None or + self.TotalNetChargeWithDutiesAndTaxes is not None or + self.ShipmentLegRateDetails or + self.FreightRateDetail is not None or + self.FreightDiscounts or + self.Rebates or + self.Surcharges or + self.Taxes or + self.DutiesAndTaxes or + self.VariableHandlingCharges is not None or + self.TotalVariableHandlingCharges is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ShipmentRateDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.RateType is not None: + showIndent(outfile, level) + outfile.write('RateType=%s,\n' % quote_python(self.RateType).encode(ExternalEncoding)) + if self.RateScale is not None: + showIndent(outfile, level) + outfile.write('RateScale=%s,\n' % quote_python(self.RateScale).encode(ExternalEncoding)) + if self.RateZone is not None: + showIndent(outfile, level) + outfile.write('RateZone=%s,\n' % quote_python(self.RateZone).encode(ExternalEncoding)) + if self.PricingCode is not None: + showIndent(outfile, level) + outfile.write('PricingCode=%s,\n' % quote_python(self.PricingCode).encode(ExternalEncoding)) + if self.RatedWeightMethod is not None: + showIndent(outfile, level) + outfile.write('RatedWeightMethod=%s,\n' % quote_python(self.RatedWeightMethod).encode(ExternalEncoding)) + if self.MinimumChargeType is not None: + showIndent(outfile, level) + outfile.write('MinimumChargeType=%s,\n' % quote_python(self.MinimumChargeType).encode(ExternalEncoding)) + if self.CurrencyExchangeRate is not None: + showIndent(outfile, level) + outfile.write('CurrencyExchangeRate=model_.CurrencyExchangeRate(\n') + self.CurrencyExchangeRate.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('SpecialRatingApplied=[\n') + level += 1 + for SpecialRatingApplied_ in self.SpecialRatingApplied: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(SpecialRatingApplied_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.DimDivisor is not None: + showIndent(outfile, level) + outfile.write('DimDivisor=%d,\n' % self.DimDivisor) + if self.DimDivisorType is not None: + showIndent(outfile, level) + outfile.write('DimDivisorType=%s,\n' % quote_python(self.DimDivisorType).encode(ExternalEncoding)) + if self.FuelSurchargePercent is not None: + showIndent(outfile, level) + outfile.write('FuelSurchargePercent=%f,\n' % self.FuelSurchargePercent) + if self.TotalBillingWeight is not None: + showIndent(outfile, level) + outfile.write('TotalBillingWeight=model_.Weight(\n') + self.TotalBillingWeight.exportLiteral(outfile, level, name_='TotalBillingWeight') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalDimWeight is not None: + showIndent(outfile, level) + outfile.write('TotalDimWeight=model_.Weight(\n') + self.TotalDimWeight.exportLiteral(outfile, level, name_='TotalDimWeight') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalBaseCharge is not None: + showIndent(outfile, level) + outfile.write('TotalBaseCharge=model_.Money(\n') + self.TotalBaseCharge.exportLiteral(outfile, level, name_='TotalBaseCharge') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalFreightDiscounts is not None: + showIndent(outfile, level) + outfile.write('TotalFreightDiscounts=model_.Money(\n') + self.TotalFreightDiscounts.exportLiteral(outfile, level, name_='TotalFreightDiscounts') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalNetFreight is not None: + showIndent(outfile, level) + outfile.write('TotalNetFreight=model_.Money(\n') + self.TotalNetFreight.exportLiteral(outfile, level, name_='TotalNetFreight') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalSurcharges is not None: + showIndent(outfile, level) + outfile.write('TotalSurcharges=model_.Money(\n') + self.TotalSurcharges.exportLiteral(outfile, level, name_='TotalSurcharges') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalNetFedExCharge is not None: + showIndent(outfile, level) + outfile.write('TotalNetFedExCharge=model_.Money(\n') + self.TotalNetFedExCharge.exportLiteral(outfile, level, name_='TotalNetFedExCharge') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalTaxes is not None: + showIndent(outfile, level) + outfile.write('TotalTaxes=model_.Money(\n') + self.TotalTaxes.exportLiteral(outfile, level, name_='TotalTaxes') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalNetCharge is not None: + showIndent(outfile, level) + outfile.write('TotalNetCharge=model_.Money(\n') + self.TotalNetCharge.exportLiteral(outfile, level, name_='TotalNetCharge') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalRebates is not None: + showIndent(outfile, level) + outfile.write('TotalRebates=model_.Money(\n') + self.TotalRebates.exportLiteral(outfile, level, name_='TotalRebates') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalDutiesAndTaxes is not None: + showIndent(outfile, level) + outfile.write('TotalDutiesAndTaxes=model_.Money(\n') + self.TotalDutiesAndTaxes.exportLiteral(outfile, level, name_='TotalDutiesAndTaxes') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalNetChargeWithDutiesAndTaxes is not None: + showIndent(outfile, level) + outfile.write('TotalNetChargeWithDutiesAndTaxes=model_.Money(\n') + self.TotalNetChargeWithDutiesAndTaxes.exportLiteral(outfile, level, name_='TotalNetChargeWithDutiesAndTaxes') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('ShipmentLegRateDetails=[\n') + level += 1 + for ShipmentLegRateDetails_ in self.ShipmentLegRateDetails: + showIndent(outfile, level) + outfile.write('model_.ShipmentLegRateDetail(\n') + ShipmentLegRateDetails_.exportLiteral(outfile, level, name_='ShipmentLegRateDetail') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.FreightRateDetail is not None: + showIndent(outfile, level) + outfile.write('FreightRateDetail=model_.FreightRateDetail(\n') + self.FreightRateDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('FreightDiscounts=[\n') + level += 1 + for FreightDiscounts_ in self.FreightDiscounts: + showIndent(outfile, level) + outfile.write('model_.RateDiscount(\n') + FreightDiscounts_.exportLiteral(outfile, level, name_='RateDiscount') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('Rebates=[\n') + level += 1 + for Rebates_ in self.Rebates: + showIndent(outfile, level) + outfile.write('model_.Rebate(\n') + Rebates_.exportLiteral(outfile, level, name_='Rebate') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('Surcharges=[\n') + level += 1 + for Surcharges_ in self.Surcharges: + showIndent(outfile, level) + outfile.write('model_.Surcharge(\n') + Surcharges_.exportLiteral(outfile, level, name_='Surcharge') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('Taxes=[\n') + level += 1 + for Taxes_ in self.Taxes: + showIndent(outfile, level) + outfile.write('model_.Tax(\n') + Taxes_.exportLiteral(outfile, level, name_='Tax') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('DutiesAndTaxes=[\n') + level += 1 + for DutiesAndTaxes_ in self.DutiesAndTaxes: + showIndent(outfile, level) + outfile.write('model_.EdtCommodityTax(\n') + DutiesAndTaxes_.exportLiteral(outfile, level, name_='EdtCommodityTax') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.VariableHandlingCharges is not None: + showIndent(outfile, level) + outfile.write('VariableHandlingCharges=model_.VariableHandlingCharges(\n') + self.VariableHandlingCharges.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalVariableHandlingCharges is not None: + showIndent(outfile, level) + outfile.write('TotalVariableHandlingCharges=model_.VariableHandlingCharges(\n') + self.TotalVariableHandlingCharges.exportLiteral(outfile, level, name_='TotalVariableHandlingCharges') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'RateType': + RateType_ = child_.text + RateType_ = self.gds_validate_string(RateType_, node, 'RateType') + self.RateType = RateType_ + self.validate_ReturnedRateType(self.RateType) # validate type ReturnedRateType + elif nodeName_ == 'RateScale': + RateScale_ = child_.text + RateScale_ = self.gds_validate_string(RateScale_, node, 'RateScale') + self.RateScale = RateScale_ + elif nodeName_ == 'RateZone': + RateZone_ = child_.text + RateZone_ = self.gds_validate_string(RateZone_, node, 'RateZone') + self.RateZone = RateZone_ + elif nodeName_ == 'PricingCode': + PricingCode_ = child_.text + PricingCode_ = self.gds_validate_string(PricingCode_, node, 'PricingCode') + self.PricingCode = PricingCode_ + self.validate_PricingCodeType(self.PricingCode) # validate type PricingCodeType + elif nodeName_ == 'RatedWeightMethod': + RatedWeightMethod_ = child_.text + RatedWeightMethod_ = self.gds_validate_string(RatedWeightMethod_, node, 'RatedWeightMethod') + self.RatedWeightMethod = RatedWeightMethod_ + self.validate_RatedWeightMethod(self.RatedWeightMethod) # validate type RatedWeightMethod + elif nodeName_ == 'MinimumChargeType': + MinimumChargeType_ = child_.text + MinimumChargeType_ = self.gds_validate_string(MinimumChargeType_, node, 'MinimumChargeType') + self.MinimumChargeType = MinimumChargeType_ + self.validate_MinimumChargeType(self.MinimumChargeType) # validate type MinimumChargeType + elif nodeName_ == 'CurrencyExchangeRate': + obj_ = CurrencyExchangeRate.factory() + obj_.build(child_) + self.set_CurrencyExchangeRate(obj_) + elif nodeName_ == 'SpecialRatingApplied': + SpecialRatingApplied_ = child_.text + SpecialRatingApplied_ = self.gds_validate_string(SpecialRatingApplied_, node, 'SpecialRatingApplied') + self.SpecialRatingApplied.append(SpecialRatingApplied_) + self.validate_SpecialRatingAppliedType(self.SpecialRatingApplied) # validate type SpecialRatingAppliedType + elif nodeName_ == 'DimDivisor': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'DimDivisor') + self.DimDivisor = ival_ + elif nodeName_ == 'DimDivisorType': + DimDivisorType_ = child_.text + DimDivisorType_ = self.gds_validate_string(DimDivisorType_, node, 'DimDivisorType') + self.DimDivisorType = DimDivisorType_ + self.validate_RateDimensionalDivisorType(self.DimDivisorType) # validate type RateDimensionalDivisorType + elif nodeName_ == 'FuelSurchargePercent': + sval_ = child_.text + try: + fval_ = float(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires float or double: %s' % exp) + fval_ = self.gds_validate_float(fval_, node, 'FuelSurchargePercent') + self.FuelSurchargePercent = fval_ + elif nodeName_ == 'TotalBillingWeight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_TotalBillingWeight(obj_) + elif nodeName_ == 'TotalDimWeight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_TotalDimWeight(obj_) + elif nodeName_ == 'TotalBaseCharge': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalBaseCharge(obj_) + elif nodeName_ == 'TotalFreightDiscounts': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalFreightDiscounts(obj_) + elif nodeName_ == 'TotalNetFreight': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalNetFreight(obj_) + elif nodeName_ == 'TotalSurcharges': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalSurcharges(obj_) + elif nodeName_ == 'TotalNetFedExCharge': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalNetFedExCharge(obj_) + elif nodeName_ == 'TotalTaxes': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalTaxes(obj_) + elif nodeName_ == 'TotalNetCharge': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalNetCharge(obj_) + elif nodeName_ == 'TotalRebates': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalRebates(obj_) + elif nodeName_ == 'TotalDutiesAndTaxes': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalDutiesAndTaxes(obj_) + elif nodeName_ == 'TotalNetChargeWithDutiesAndTaxes': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalNetChargeWithDutiesAndTaxes(obj_) + elif nodeName_ == 'ShipmentLegRateDetails': + obj_ = ShipmentLegRateDetail.factory() + obj_.build(child_) + self.ShipmentLegRateDetails.append(obj_) + elif nodeName_ == 'FreightRateDetail': + obj_ = FreightRateDetail.factory() + obj_.build(child_) + self.set_FreightRateDetail(obj_) + elif nodeName_ == 'FreightDiscounts': + obj_ = RateDiscount.factory() + obj_.build(child_) + self.FreightDiscounts.append(obj_) + elif nodeName_ == 'Rebates': + obj_ = Rebate.factory() + obj_.build(child_) + self.Rebates.append(obj_) + elif nodeName_ == 'Surcharges': + obj_ = Surcharge.factory() + obj_.build(child_) + self.Surcharges.append(obj_) + elif nodeName_ == 'Taxes': + obj_ = Tax.factory() + obj_.build(child_) + self.Taxes.append(obj_) + elif nodeName_ == 'DutiesAndTaxes': + obj_ = EdtCommodityTax.factory() + obj_.build(child_) + self.DutiesAndTaxes.append(obj_) + elif nodeName_ == 'VariableHandlingCharges': + obj_ = VariableHandlingCharges.factory() + obj_.build(child_) + self.set_VariableHandlingCharges(obj_) + elif nodeName_ == 'TotalVariableHandlingCharges': + obj_ = VariableHandlingCharges.factory() + obj_.build(child_) + self.set_TotalVariableHandlingCharges(obj_) +# end class ShipmentRateDetail + + +class ShipmentRating(GeneratedsSuper): + """This class groups together all shipment-level rate data (across all + rate types) as part of the response to a shipping request, which + groups shipment-level data together and groups package-level + data by package.""" + subclass = None + superclass = None + def __init__(self, ActualRateType=None, EffectiveNetDiscount=None, ShipmentRateDetails=None): + self.ActualRateType = ActualRateType + self.EffectiveNetDiscount = EffectiveNetDiscount + if ShipmentRateDetails is None: + self.ShipmentRateDetails = [] + else: + self.ShipmentRateDetails = ShipmentRateDetails + def factory(*args_, **kwargs_): + if ShipmentRating.subclass: + return ShipmentRating.subclass(*args_, **kwargs_) + else: + return ShipmentRating(*args_, **kwargs_) + factory = staticmethod(factory) + def get_ActualRateType(self): return self.ActualRateType + def set_ActualRateType(self, ActualRateType): self.ActualRateType = ActualRateType + def validate_ReturnedRateType(self, value): + # Validate type ReturnedRateType, a restriction on xs:string. + pass + def get_EffectiveNetDiscount(self): return self.EffectiveNetDiscount + def set_EffectiveNetDiscount(self, EffectiveNetDiscount): self.EffectiveNetDiscount = EffectiveNetDiscount + def get_ShipmentRateDetails(self): return self.ShipmentRateDetails + def set_ShipmentRateDetails(self, ShipmentRateDetails): self.ShipmentRateDetails = ShipmentRateDetails + def add_ShipmentRateDetails(self, value): self.ShipmentRateDetails.append(value) + def insert_ShipmentRateDetails(self, index, value): self.ShipmentRateDetails[index] = value + def export(self, outfile, level, namespace_='ns:', name_='ShipmentRating', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ShipmentRating') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ShipmentRating'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ShipmentRating', fromsubclass_=False): + if self.ActualRateType is not None: + showIndent(outfile, level) + outfile.write('<%sActualRateType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ActualRateType).encode(ExternalEncoding), input_name='ActualRateType'), namespace_)) + if self.EffectiveNetDiscount: + self.EffectiveNetDiscount.export(outfile, level, namespace_, name_='EffectiveNetDiscount') + for ShipmentRateDetails_ in self.ShipmentRateDetails: + ShipmentRateDetails_.export(outfile, level, namespace_, name_='ShipmentRateDetails') + def hasContent_(self): + if ( + self.ActualRateType is not None or + self.EffectiveNetDiscount is not None or + self.ShipmentRateDetails + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ShipmentRating'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.ActualRateType is not None: + showIndent(outfile, level) + outfile.write('ActualRateType=%s,\n' % quote_python(self.ActualRateType).encode(ExternalEncoding)) + if self.EffectiveNetDiscount is not None: + showIndent(outfile, level) + outfile.write('EffectiveNetDiscount=model_.Money(\n') + self.EffectiveNetDiscount.exportLiteral(outfile, level, name_='EffectiveNetDiscount') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('ShipmentRateDetails=[\n') + level += 1 + for ShipmentRateDetails_ in self.ShipmentRateDetails: + showIndent(outfile, level) + outfile.write('model_.ShipmentRateDetail(\n') + ShipmentRateDetails_.exportLiteral(outfile, level, name_='ShipmentRateDetail') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'ActualRateType': + ActualRateType_ = child_.text + ActualRateType_ = self.gds_validate_string(ActualRateType_, node, 'ActualRateType') + self.ActualRateType = ActualRateType_ + self.validate_ReturnedRateType(self.ActualRateType) # validate type ReturnedRateType + elif nodeName_ == 'EffectiveNetDiscount': + obj_ = Money.factory() + obj_.build(child_) + self.set_EffectiveNetDiscount(obj_) + elif nodeName_ == 'ShipmentRateDetails': + obj_ = ShipmentRateDetail.factory() + obj_.build(child_) + self.ShipmentRateDetails.append(obj_) +# end class ShipmentRating + + +class ShipmentReply(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, HighestSeverity=None, Notifications=None, TransactionDetail=None, Version=None): + self.HighestSeverity = HighestSeverity + if Notifications is None: + self.Notifications = [] + else: + self.Notifications = Notifications + self.TransactionDetail = TransactionDetail + self.Version = Version + def factory(*args_, **kwargs_): + if ShipmentReply.subclass: + return ShipmentReply.subclass(*args_, **kwargs_) + else: + return ShipmentReply(*args_, **kwargs_) + factory = staticmethod(factory) + def get_HighestSeverity(self): return self.HighestSeverity + def set_HighestSeverity(self, HighestSeverity): self.HighestSeverity = HighestSeverity + def validate_NotificationSeverityType(self, value): + # Validate type NotificationSeverityType, a restriction on xs:string. + pass + def get_Notifications(self): return self.Notifications + def set_Notifications(self, Notifications): self.Notifications = Notifications + def add_Notifications(self, value): self.Notifications.append(value) + def insert_Notifications(self, index, value): self.Notifications[index] = value + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def export(self, outfile, level, namespace_='ns:', name_='ShipmentReply', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ShipmentReply') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ShipmentReply'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ShipmentReply', fromsubclass_=False): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('<%sHighestSeverity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HighestSeverity).encode(ExternalEncoding), input_name='HighestSeverity'), namespace_)) + for Notifications_ in self.Notifications: + Notifications_.export(outfile, level, namespace_, name_='Notifications') + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + def hasContent_(self): + if ( + self.HighestSeverity is not None or + self.Notifications or + self.TransactionDetail is not None or + self.Version is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ShipmentReply'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('HighestSeverity=%s,\n' % quote_python(self.HighestSeverity).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Notifications=[\n') + level += 1 + for Notifications_ in self.Notifications: + showIndent(outfile, level) + outfile.write('model_.Notification(\n') + Notifications_.exportLiteral(outfile, level, name_='Notification') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'HighestSeverity': + HighestSeverity_ = child_.text + HighestSeverity_ = self.gds_validate_string(HighestSeverity_, node, 'HighestSeverity') + self.HighestSeverity = HighestSeverity_ + self.validate_NotificationSeverityType(self.HighestSeverity) # validate type NotificationSeverityType + elif nodeName_ == 'Notifications': + obj_ = Notification.factory() + obj_.build(child_) + self.Notifications.append(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) +# end class ShipmentReply + + +class ShipmentSpecialServicesRequested(GeneratedsSuper): + """These special services are available at the shipment level for some + or all service types. If the shipper is requesting a special + service which requires additional data (such as the COD amount), + the shipment special service type must be present in the + specialServiceTypes collection, and the supporting detail must + be provided in the appropriate sub-object below.""" + subclass = None + superclass = None + def __init__(self, SpecialServiceTypes=None, CodDetail=None, HoldAtLocationDetail=None, EMailNotificationDetail=None, ReturnShipmentDetail=None, PendingShipmentDetail=None, ShipmentDryIceDetail=None, HomeDeliveryPremiumDetail=None, FreightGuaranteeDetail=None, EtdDetail=None, CustomDeliveryWindowDetail=None): + if SpecialServiceTypes is None: + self.SpecialServiceTypes = [] + else: + self.SpecialServiceTypes = SpecialServiceTypes + self.CodDetail = CodDetail + self.HoldAtLocationDetail = HoldAtLocationDetail + self.EMailNotificationDetail = EMailNotificationDetail + self.ReturnShipmentDetail = ReturnShipmentDetail + self.PendingShipmentDetail = PendingShipmentDetail + self.ShipmentDryIceDetail = ShipmentDryIceDetail + self.HomeDeliveryPremiumDetail = HomeDeliveryPremiumDetail + self.FreightGuaranteeDetail = FreightGuaranteeDetail + self.EtdDetail = EtdDetail + self.CustomDeliveryWindowDetail = CustomDeliveryWindowDetail + def factory(*args_, **kwargs_): + if ShipmentSpecialServicesRequested.subclass: + return ShipmentSpecialServicesRequested.subclass(*args_, **kwargs_) + else: + return ShipmentSpecialServicesRequested(*args_, **kwargs_) + factory = staticmethod(factory) + def get_SpecialServiceTypes(self): return self.SpecialServiceTypes + def set_SpecialServiceTypes(self, SpecialServiceTypes): self.SpecialServiceTypes = SpecialServiceTypes + def add_SpecialServiceTypes(self, value): self.SpecialServiceTypes.append(value) + def insert_SpecialServiceTypes(self, index, value): self.SpecialServiceTypes[index] = value + def validate_ShipmentSpecialServiceType(self, value): + # Validate type ShipmentSpecialServiceType, a restriction on xs:string. + pass + def get_CodDetail(self): return self.CodDetail + def set_CodDetail(self, CodDetail): self.CodDetail = CodDetail + def get_HoldAtLocationDetail(self): return self.HoldAtLocationDetail + def set_HoldAtLocationDetail(self, HoldAtLocationDetail): self.HoldAtLocationDetail = HoldAtLocationDetail + def get_EMailNotificationDetail(self): return self.EMailNotificationDetail + def set_EMailNotificationDetail(self, EMailNotificationDetail): self.EMailNotificationDetail = EMailNotificationDetail + def get_ReturnShipmentDetail(self): return self.ReturnShipmentDetail + def set_ReturnShipmentDetail(self, ReturnShipmentDetail): self.ReturnShipmentDetail = ReturnShipmentDetail + def get_PendingShipmentDetail(self): return self.PendingShipmentDetail + def set_PendingShipmentDetail(self, PendingShipmentDetail): self.PendingShipmentDetail = PendingShipmentDetail + def get_ShipmentDryIceDetail(self): return self.ShipmentDryIceDetail + def set_ShipmentDryIceDetail(self, ShipmentDryIceDetail): self.ShipmentDryIceDetail = ShipmentDryIceDetail + def get_HomeDeliveryPremiumDetail(self): return self.HomeDeliveryPremiumDetail + def set_HomeDeliveryPremiumDetail(self, HomeDeliveryPremiumDetail): self.HomeDeliveryPremiumDetail = HomeDeliveryPremiumDetail + def get_FreightGuaranteeDetail(self): return self.FreightGuaranteeDetail + def set_FreightGuaranteeDetail(self, FreightGuaranteeDetail): self.FreightGuaranteeDetail = FreightGuaranteeDetail + def get_EtdDetail(self): return self.EtdDetail + def set_EtdDetail(self, EtdDetail): self.EtdDetail = EtdDetail + def get_CustomDeliveryWindowDetail(self): return self.CustomDeliveryWindowDetail + def set_CustomDeliveryWindowDetail(self, CustomDeliveryWindowDetail): self.CustomDeliveryWindowDetail = CustomDeliveryWindowDetail + def export(self, outfile, level, namespace_='ns:', name_='ShipmentSpecialServicesRequested', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ShipmentSpecialServicesRequested') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ShipmentSpecialServicesRequested'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ShipmentSpecialServicesRequested', fromsubclass_=False): + for SpecialServiceTypes_ in self.SpecialServiceTypes: + showIndent(outfile, level) + outfile.write('<%sSpecialServiceTypes>%s\n' % (namespace_, self.gds_format_string(quote_xml(SpecialServiceTypes_).encode(ExternalEncoding), input_name='SpecialServiceTypes'), namespace_)) + if self.CodDetail: + self.CodDetail.export(outfile, level, namespace_, name_='CodDetail') + if self.HoldAtLocationDetail: + self.HoldAtLocationDetail.export(outfile, level, namespace_, name_='HoldAtLocationDetail') + if self.EMailNotificationDetail: + self.EMailNotificationDetail.export(outfile, level, namespace_, name_='EMailNotificationDetail') + if self.ReturnShipmentDetail: + self.ReturnShipmentDetail.export(outfile, level, namespace_, name_='ReturnShipmentDetail') + if self.PendingShipmentDetail: + self.PendingShipmentDetail.export(outfile, level, namespace_, name_='PendingShipmentDetail') + if self.ShipmentDryIceDetail: + self.ShipmentDryIceDetail.export(outfile, level, namespace_, name_='ShipmentDryIceDetail') + if self.HomeDeliveryPremiumDetail: + self.HomeDeliveryPremiumDetail.export(outfile, level, namespace_, name_='HomeDeliveryPremiumDetail') + if self.FreightGuaranteeDetail: + self.FreightGuaranteeDetail.export(outfile, level, namespace_, name_='FreightGuaranteeDetail') + if self.EtdDetail: + self.EtdDetail.export(outfile, level, namespace_, name_='EtdDetail') + if self.CustomDeliveryWindowDetail: + self.CustomDeliveryWindowDetail.export(outfile, level, namespace_, name_='CustomDeliveryWindowDetail') + def hasContent_(self): + if ( + self.SpecialServiceTypes or + self.CodDetail is not None or + self.HoldAtLocationDetail is not None or + self.EMailNotificationDetail is not None or + self.ReturnShipmentDetail is not None or + self.PendingShipmentDetail is not None or + self.ShipmentDryIceDetail is not None or + self.HomeDeliveryPremiumDetail is not None or + self.FreightGuaranteeDetail is not None or + self.EtdDetail is not None or + self.CustomDeliveryWindowDetail is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ShipmentSpecialServicesRequested'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('SpecialServiceTypes=[\n') + level += 1 + for SpecialServiceTypes_ in self.SpecialServiceTypes: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(SpecialServiceTypes_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.CodDetail is not None: + showIndent(outfile, level) + outfile.write('CodDetail=model_.CodDetail(\n') + self.CodDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.HoldAtLocationDetail is not None: + showIndent(outfile, level) + outfile.write('HoldAtLocationDetail=model_.HoldAtLocationDetail(\n') + self.HoldAtLocationDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.EMailNotificationDetail is not None: + showIndent(outfile, level) + outfile.write('EMailNotificationDetail=model_.EMailNotificationDetail(\n') + self.EMailNotificationDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ReturnShipmentDetail is not None: + showIndent(outfile, level) + outfile.write('ReturnShipmentDetail=model_.ReturnShipmentDetail(\n') + self.ReturnShipmentDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.PendingShipmentDetail is not None: + showIndent(outfile, level) + outfile.write('PendingShipmentDetail=model_.PendingShipmentDetail(\n') + self.PendingShipmentDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ShipmentDryIceDetail is not None: + showIndent(outfile, level) + outfile.write('ShipmentDryIceDetail=model_.ShipmentDryIceDetail(\n') + self.ShipmentDryIceDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.HomeDeliveryPremiumDetail is not None: + showIndent(outfile, level) + outfile.write('HomeDeliveryPremiumDetail=model_.HomeDeliveryPremiumDetail(\n') + self.HomeDeliveryPremiumDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.FreightGuaranteeDetail is not None: + showIndent(outfile, level) + outfile.write('FreightGuaranteeDetail=model_.FreightGuaranteeDetail(\n') + self.FreightGuaranteeDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.EtdDetail is not None: + showIndent(outfile, level) + outfile.write('EtdDetail=model_.EtdDetail(\n') + self.EtdDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.CustomDeliveryWindowDetail is not None: + showIndent(outfile, level) + outfile.write('CustomDeliveryWindowDetail=model_.CustomDeliveryWindowDetail(\n') + self.CustomDeliveryWindowDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'SpecialServiceTypes': + SpecialServiceTypes_ = child_.text + SpecialServiceTypes_ = self.gds_validate_string(SpecialServiceTypes_, node, 'SpecialServiceTypes') + self.SpecialServiceTypes.append(SpecialServiceTypes_) + self.validate_ShipmentSpecialServiceType(self.SpecialServiceTypes) # validate type ShipmentSpecialServiceType + elif nodeName_ == 'CodDetail': + obj_ = CodDetail.factory() + obj_.build(child_) + self.set_CodDetail(obj_) + elif nodeName_ == 'HoldAtLocationDetail': + obj_ = HoldAtLocationDetail.factory() + obj_.build(child_) + self.set_HoldAtLocationDetail(obj_) + elif nodeName_ == 'EMailNotificationDetail': + obj_ = EMailNotificationDetail.factory() + obj_.build(child_) + self.set_EMailNotificationDetail(obj_) + elif nodeName_ == 'ReturnShipmentDetail': + obj_ = ReturnShipmentDetail.factory() + obj_.build(child_) + self.set_ReturnShipmentDetail(obj_) + elif nodeName_ == 'PendingShipmentDetail': + obj_ = PendingShipmentDetail.factory() + obj_.build(child_) + self.set_PendingShipmentDetail(obj_) + elif nodeName_ == 'ShipmentDryIceDetail': + obj_ = ShipmentDryIceDetail.factory() + obj_.build(child_) + self.set_ShipmentDryIceDetail(obj_) + elif nodeName_ == 'HomeDeliveryPremiumDetail': + obj_ = HomeDeliveryPremiumDetail.factory() + obj_.build(child_) + self.set_HomeDeliveryPremiumDetail(obj_) + elif nodeName_ == 'FreightGuaranteeDetail': + obj_ = FreightGuaranteeDetail.factory() + obj_.build(child_) + self.set_FreightGuaranteeDetail(obj_) + elif nodeName_ == 'EtdDetail': + obj_ = EtdDetail.factory() + obj_.build(child_) + self.set_EtdDetail(obj_) + elif nodeName_ == 'CustomDeliveryWindowDetail': + obj_ = CustomDeliveryWindowDetail.factory() + obj_.build(child_) + self.set_CustomDeliveryWindowDetail(obj_) +# end class ShipmentSpecialServicesRequested + + +class ShippingDocument(GeneratedsSuper): + """All package-level shipping documents (other than labels and + barcodes).""" + subclass = None + superclass = None + def __init__(self, Type=None, Grouping=None, ShippingDocumentDisposition=None, AccessReference=None, Resolution=None, CopiesToPrint=None, Parts=None): + self.Type = Type + self.Grouping = Grouping + self.ShippingDocumentDisposition = ShippingDocumentDisposition + self.AccessReference = AccessReference + self.Resolution = Resolution + self.CopiesToPrint = CopiesToPrint + if Parts is None: + self.Parts = [] + else: + self.Parts = Parts + def factory(*args_, **kwargs_): + if ShippingDocument.subclass: + return ShippingDocument.subclass(*args_, **kwargs_) + else: + return ShippingDocument(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Type(self): return self.Type + def set_Type(self, Type): self.Type = Type + def validate_ReturnedShippingDocumentType(self, value): + # Validate type ReturnedShippingDocumentType, a restriction on xs:string. + pass + def get_Grouping(self): return self.Grouping + def set_Grouping(self, Grouping): self.Grouping = Grouping + def validate_ShippingDocumentGroupingType(self, value): + # Validate type ShippingDocumentGroupingType, a restriction on xs:string. + pass + def get_ShippingDocumentDisposition(self): return self.ShippingDocumentDisposition + def set_ShippingDocumentDisposition(self, ShippingDocumentDisposition): self.ShippingDocumentDisposition = ShippingDocumentDisposition + def validate_ShippingDocumentDispositionType(self, value): + # Validate type ShippingDocumentDispositionType, a restriction on xs:string. + pass + def get_AccessReference(self): return self.AccessReference + def set_AccessReference(self, AccessReference): self.AccessReference = AccessReference + def get_Resolution(self): return self.Resolution + def set_Resolution(self, Resolution): self.Resolution = Resolution + def get_CopiesToPrint(self): return self.CopiesToPrint + def set_CopiesToPrint(self, CopiesToPrint): self.CopiesToPrint = CopiesToPrint + def get_Parts(self): return self.Parts + def set_Parts(self, Parts): self.Parts = Parts + def add_Parts(self, value): self.Parts.append(value) + def insert_Parts(self, index, value): self.Parts[index] = value + def export(self, outfile, level, namespace_='ns:', name_='ShippingDocument', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ShippingDocument') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ShippingDocument'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ShippingDocument', fromsubclass_=False): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('<%sType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Type).encode(ExternalEncoding), input_name='Type'), namespace_)) + if self.Grouping is not None: + showIndent(outfile, level) + outfile.write('<%sGrouping>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Grouping).encode(ExternalEncoding), input_name='Grouping'), namespace_)) + if self.ShippingDocumentDisposition is not None: + showIndent(outfile, level) + outfile.write('<%sShippingDocumentDisposition>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ShippingDocumentDisposition).encode(ExternalEncoding), input_name='ShippingDocumentDisposition'), namespace_)) + if self.AccessReference is not None: + showIndent(outfile, level) + outfile.write('<%sAccessReference>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AccessReference).encode(ExternalEncoding), input_name='AccessReference'), namespace_)) + if self.Resolution is not None: + showIndent(outfile, level) + outfile.write('<%sResolution>%s\n' % (namespace_, self.gds_format_integer(self.Resolution, input_name='Resolution'), namespace_)) + if self.CopiesToPrint is not None: + showIndent(outfile, level) + outfile.write('<%sCopiesToPrint>%s\n' % (namespace_, self.gds_format_integer(self.CopiesToPrint, input_name='CopiesToPrint'), namespace_)) + for Parts_ in self.Parts: + Parts_.export(outfile, level, namespace_, name_='Parts') + def hasContent_(self): + if ( + self.Type is not None or + self.Grouping is not None or + self.ShippingDocumentDisposition is not None or + self.AccessReference is not None or + self.Resolution is not None or + self.CopiesToPrint is not None or + self.Parts + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ShippingDocument'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('Type=%s,\n' % quote_python(self.Type).encode(ExternalEncoding)) + if self.Grouping is not None: + showIndent(outfile, level) + outfile.write('Grouping=%s,\n' % quote_python(self.Grouping).encode(ExternalEncoding)) + if self.ShippingDocumentDisposition is not None: + showIndent(outfile, level) + outfile.write('ShippingDocumentDisposition=%s,\n' % quote_python(self.ShippingDocumentDisposition).encode(ExternalEncoding)) + if self.AccessReference is not None: + showIndent(outfile, level) + outfile.write('AccessReference=%s,\n' % quote_python(self.AccessReference).encode(ExternalEncoding)) + if self.Resolution is not None: + showIndent(outfile, level) + outfile.write('Resolution=%d,\n' % self.Resolution) + if self.CopiesToPrint is not None: + showIndent(outfile, level) + outfile.write('CopiesToPrint=%d,\n' % self.CopiesToPrint) + showIndent(outfile, level) + outfile.write('Parts=[\n') + level += 1 + for Parts_ in self.Parts: + showIndent(outfile, level) + outfile.write('model_.ShippingDocumentPart(\n') + Parts_.exportLiteral(outfile, level, name_='ShippingDocumentPart') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Type': + Type_ = child_.text + Type_ = self.gds_validate_string(Type_, node, 'Type') + self.Type = Type_ + self.validate_ReturnedShippingDocumentType(self.Type) # validate type ReturnedShippingDocumentType + elif nodeName_ == 'Grouping': + Grouping_ = child_.text + Grouping_ = self.gds_validate_string(Grouping_, node, 'Grouping') + self.Grouping = Grouping_ + self.validate_ShippingDocumentGroupingType(self.Grouping) # validate type ShippingDocumentGroupingType + elif nodeName_ == 'ShippingDocumentDisposition': + ShippingDocumentDisposition_ = child_.text + ShippingDocumentDisposition_ = self.gds_validate_string(ShippingDocumentDisposition_, node, 'ShippingDocumentDisposition') + self.ShippingDocumentDisposition = ShippingDocumentDisposition_ + self.validate_ShippingDocumentDispositionType(self.ShippingDocumentDisposition) # validate type ShippingDocumentDispositionType + elif nodeName_ == 'AccessReference': + AccessReference_ = child_.text + AccessReference_ = self.gds_validate_string(AccessReference_, node, 'AccessReference') + self.AccessReference = AccessReference_ + elif nodeName_ == 'Resolution': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'Resolution') + self.Resolution = ival_ + elif nodeName_ == 'CopiesToPrint': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'CopiesToPrint') + self.CopiesToPrint = ival_ + elif nodeName_ == 'Parts': + obj_ = ShippingDocumentPart.factory() + obj_.build(child_) + self.Parts.append(obj_) +# end class ShippingDocument + + +class ShippingDocumentDispositionDetail(GeneratedsSuper): + """Each occurrence of this class specifies a particular way in which a + kind of shipping document is to be produced and provided.""" + subclass = None + superclass = None + def __init__(self, DispositionType=None, Grouping=None, EMailDetail=None, PrintDetail=None): + self.DispositionType = DispositionType + self.Grouping = Grouping + self.EMailDetail = EMailDetail + self.PrintDetail = PrintDetail + def factory(*args_, **kwargs_): + if ShippingDocumentDispositionDetail.subclass: + return ShippingDocumentDispositionDetail.subclass(*args_, **kwargs_) + else: + return ShippingDocumentDispositionDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_DispositionType(self): return self.DispositionType + def set_DispositionType(self, DispositionType): self.DispositionType = DispositionType + def validate_ShippingDocumentDispositionType(self, value): + # Validate type ShippingDocumentDispositionType, a restriction on xs:string. + pass + def get_Grouping(self): return self.Grouping + def set_Grouping(self, Grouping): self.Grouping = Grouping + def validate_ShippingDocumentGroupingType(self, value): + # Validate type ShippingDocumentGroupingType, a restriction on xs:string. + pass + def get_EMailDetail(self): return self.EMailDetail + def set_EMailDetail(self, EMailDetail): self.EMailDetail = EMailDetail + def get_PrintDetail(self): return self.PrintDetail + def set_PrintDetail(self, PrintDetail): self.PrintDetail = PrintDetail + def export(self, outfile, level, namespace_='ns:', name_='ShippingDocumentDispositionDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ShippingDocumentDispositionDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ShippingDocumentDispositionDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ShippingDocumentDispositionDetail', fromsubclass_=False): + if self.DispositionType is not None: + showIndent(outfile, level) + outfile.write('<%sDispositionType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DispositionType).encode(ExternalEncoding), input_name='DispositionType'), namespace_)) + if self.Grouping is not None: + showIndent(outfile, level) + outfile.write('<%sGrouping>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Grouping).encode(ExternalEncoding), input_name='Grouping'), namespace_)) + if self.EMailDetail: + self.EMailDetail.export(outfile, level, namespace_, name_='EMailDetail') + if self.PrintDetail: + self.PrintDetail.export(outfile, level, namespace_, name_='PrintDetail') + def hasContent_(self): + if ( + self.DispositionType is not None or + self.Grouping is not None or + self.EMailDetail is not None or + self.PrintDetail is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ShippingDocumentDispositionDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.DispositionType is not None: + showIndent(outfile, level) + outfile.write('DispositionType=%s,\n' % quote_python(self.DispositionType).encode(ExternalEncoding)) + if self.Grouping is not None: + showIndent(outfile, level) + outfile.write('Grouping=%s,\n' % quote_python(self.Grouping).encode(ExternalEncoding)) + if self.EMailDetail is not None: + showIndent(outfile, level) + outfile.write('EMailDetail=model_.ShippingDocumentEMailDetail(\n') + self.EMailDetail.exportLiteral(outfile, level, name_='EMailDetail') + showIndent(outfile, level) + outfile.write('),\n') + if self.PrintDetail is not None: + showIndent(outfile, level) + outfile.write('PrintDetail=model_.ShippingDocumentPrintDetail(\n') + self.PrintDetail.exportLiteral(outfile, level, name_='PrintDetail') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'DispositionType': + DispositionType_ = child_.text + DispositionType_ = self.gds_validate_string(DispositionType_, node, 'DispositionType') + self.DispositionType = DispositionType_ + self.validate_ShippingDocumentDispositionType(self.DispositionType) # validate type ShippingDocumentDispositionType + elif nodeName_ == 'Grouping': + Grouping_ = child_.text + Grouping_ = self.gds_validate_string(Grouping_, node, 'Grouping') + self.Grouping = Grouping_ + self.validate_ShippingDocumentGroupingType(self.Grouping) # validate type ShippingDocumentGroupingType + elif nodeName_ == 'EMailDetail': + obj_ = ShippingDocumentEMailDetail.factory() + obj_.build(child_) + self.set_EMailDetail(obj_) + elif nodeName_ == 'PrintDetail': + obj_ = ShippingDocumentPrintDetail.factory() + obj_.build(child_) + self.set_PrintDetail(obj_) +# end class ShippingDocumentDispositionDetail + + +class ShippingDocumentEMailDetail(GeneratedsSuper): + """Specifies how to e-mail shipping documents.""" + subclass = None + superclass = None + def __init__(self, EMailRecipients=None, Grouping=None): + if EMailRecipients is None: + self.EMailRecipients = [] + else: + self.EMailRecipients = EMailRecipients + self.Grouping = Grouping + def factory(*args_, **kwargs_): + if ShippingDocumentEMailDetail.subclass: + return ShippingDocumentEMailDetail.subclass(*args_, **kwargs_) + else: + return ShippingDocumentEMailDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_EMailRecipients(self): return self.EMailRecipients + def set_EMailRecipients(self, EMailRecipients): self.EMailRecipients = EMailRecipients + def add_EMailRecipients(self, value): self.EMailRecipients.append(value) + def insert_EMailRecipients(self, index, value): self.EMailRecipients[index] = value + def get_Grouping(self): return self.Grouping + def set_Grouping(self, Grouping): self.Grouping = Grouping + def validate_ShippingDocumentEMailGroupingType(self, value): + # Validate type ShippingDocumentEMailGroupingType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='ShippingDocumentEMailDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ShippingDocumentEMailDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ShippingDocumentEMailDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ShippingDocumentEMailDetail', fromsubclass_=False): + for EMailRecipients_ in self.EMailRecipients: + EMailRecipients_.export(outfile, level, namespace_, name_='EMailRecipients') + if self.Grouping is not None: + showIndent(outfile, level) + outfile.write('<%sGrouping>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Grouping).encode(ExternalEncoding), input_name='Grouping'), namespace_)) + def hasContent_(self): + if ( + self.EMailRecipients or + self.Grouping is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ShippingDocumentEMailDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('EMailRecipients=[\n') + level += 1 + for EMailRecipients_ in self.EMailRecipients: + showIndent(outfile, level) + outfile.write('model_.ShippingDocumentEMailRecipient(\n') + EMailRecipients_.exportLiteral(outfile, level, name_='ShippingDocumentEMailRecipient') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.Grouping is not None: + showIndent(outfile, level) + outfile.write('Grouping=%s,\n' % quote_python(self.Grouping).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'EMailRecipients': + obj_ = ShippingDocumentEMailRecipient.factory() + obj_.build(child_) + self.EMailRecipients.append(obj_) + elif nodeName_ == 'Grouping': + Grouping_ = child_.text + Grouping_ = self.gds_validate_string(Grouping_, node, 'Grouping') + self.Grouping = Grouping_ + self.validate_ShippingDocumentEMailGroupingType(self.Grouping) # validate type ShippingDocumentEMailGroupingType +# end class ShippingDocumentEMailDetail + + +class ShippingDocumentEMailRecipient(GeneratedsSuper): + """Specifies an individual recipient of e-mailed shipping document(s).""" + subclass = None + superclass = None + def __init__(self, RecipientType=None, Address=None): + self.RecipientType = RecipientType + self.Address = Address + def factory(*args_, **kwargs_): + if ShippingDocumentEMailRecipient.subclass: + return ShippingDocumentEMailRecipient.subclass(*args_, **kwargs_) + else: + return ShippingDocumentEMailRecipient(*args_, **kwargs_) + factory = staticmethod(factory) + def get_RecipientType(self): return self.RecipientType + def set_RecipientType(self, RecipientType): self.RecipientType = RecipientType + def validate_EMailNotificationRecipientType(self, value): + # Validate type EMailNotificationRecipientType, a restriction on xs:string. + pass + def get_Address(self): return self.Address + def set_Address(self, Address): self.Address = Address + def export(self, outfile, level, namespace_='ns:', name_='ShippingDocumentEMailRecipient', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ShippingDocumentEMailRecipient') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ShippingDocumentEMailRecipient'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ShippingDocumentEMailRecipient', fromsubclass_=False): + if self.RecipientType is not None: + showIndent(outfile, level) + outfile.write('<%sRecipientType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RecipientType).encode(ExternalEncoding), input_name='RecipientType'), namespace_)) + if self.Address is not None: + showIndent(outfile, level) + outfile.write('<%sAddress>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Address).encode(ExternalEncoding), input_name='Address'), namespace_)) + def hasContent_(self): + if ( + self.RecipientType is not None or + self.Address is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ShippingDocumentEMailRecipient'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.RecipientType is not None: + showIndent(outfile, level) + outfile.write('RecipientType=%s,\n' % quote_python(self.RecipientType).encode(ExternalEncoding)) + if self.Address is not None: + showIndent(outfile, level) + outfile.write('Address=%s,\n' % quote_python(self.Address).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'RecipientType': + RecipientType_ = child_.text + RecipientType_ = self.gds_validate_string(RecipientType_, node, 'RecipientType') + self.RecipientType = RecipientType_ + self.validate_EMailNotificationRecipientType(self.RecipientType) # validate type EMailNotificationRecipientType + elif nodeName_ == 'Address': + Address_ = child_.text + Address_ = self.gds_validate_string(Address_, node, 'Address') + self.Address = Address_ +# end class ShippingDocumentEMailRecipient + + +class ShippingDocumentFormat(GeneratedsSuper): + """Specifies characteristics of a shipping document to be produced.""" + subclass = None + superclass = None + def __init__(self, Dispositions=None, TopOfPageOffset=None, ImageType=None, StockType=None, ProvideInstructions=None, Localization=None, CustomDocumentIdentifier=None): + if Dispositions is None: + self.Dispositions = [] + else: + self.Dispositions = Dispositions + self.TopOfPageOffset = TopOfPageOffset + self.ImageType = ImageType + self.StockType = StockType + self.ProvideInstructions = ProvideInstructions + self.Localization = Localization + self.CustomDocumentIdentifier = CustomDocumentIdentifier + def factory(*args_, **kwargs_): + if ShippingDocumentFormat.subclass: + return ShippingDocumentFormat.subclass(*args_, **kwargs_) + else: + return ShippingDocumentFormat(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Dispositions(self): return self.Dispositions + def set_Dispositions(self, Dispositions): self.Dispositions = Dispositions + def add_Dispositions(self, value): self.Dispositions.append(value) + def insert_Dispositions(self, index, value): self.Dispositions[index] = value + def get_TopOfPageOffset(self): return self.TopOfPageOffset + def set_TopOfPageOffset(self, TopOfPageOffset): self.TopOfPageOffset = TopOfPageOffset + def get_ImageType(self): return self.ImageType + def set_ImageType(self, ImageType): self.ImageType = ImageType + def validate_ShippingDocumentImageType(self, value): + # Validate type ShippingDocumentImageType, a restriction on xs:string. + pass + def get_StockType(self): return self.StockType + def set_StockType(self, StockType): self.StockType = StockType + def validate_ShippingDocumentStockType(self, value): + # Validate type ShippingDocumentStockType, a restriction on xs:string. + pass + def get_ProvideInstructions(self): return self.ProvideInstructions + def set_ProvideInstructions(self, ProvideInstructions): self.ProvideInstructions = ProvideInstructions + def get_Localization(self): return self.Localization + def set_Localization(self, Localization): self.Localization = Localization + def get_CustomDocumentIdentifier(self): return self.CustomDocumentIdentifier + def set_CustomDocumentIdentifier(self, CustomDocumentIdentifier): self.CustomDocumentIdentifier = CustomDocumentIdentifier + def export(self, outfile, level, namespace_='ns:', name_='ShippingDocumentFormat', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ShippingDocumentFormat') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ShippingDocumentFormat'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ShippingDocumentFormat', fromsubclass_=False): + for Dispositions_ in self.Dispositions: + Dispositions_.export(outfile, level, namespace_, name_='Dispositions') + if self.TopOfPageOffset: + self.TopOfPageOffset.export(outfile, level, namespace_, name_='TopOfPageOffset') + if self.ImageType is not None: + showIndent(outfile, level) + outfile.write('<%sImageType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ImageType).encode(ExternalEncoding), input_name='ImageType'), namespace_)) + if self.StockType is not None: + showIndent(outfile, level) + outfile.write('<%sStockType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.StockType).encode(ExternalEncoding), input_name='StockType'), namespace_)) + if self.ProvideInstructions is not None: + showIndent(outfile, level) + outfile.write('<%sProvideInstructions>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.ProvideInstructions)), input_name='ProvideInstructions'), namespace_)) + if self.Localization: + self.Localization.export(outfile, level, namespace_, name_='Localization') + if self.CustomDocumentIdentifier is not None: + showIndent(outfile, level) + outfile.write('<%sCustomDocumentIdentifier>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CustomDocumentIdentifier).encode(ExternalEncoding), input_name='CustomDocumentIdentifier'), namespace_)) + def hasContent_(self): + if ( + self.Dispositions or + self.TopOfPageOffset is not None or + self.ImageType is not None or + self.StockType is not None or + self.ProvideInstructions is not None or + self.Localization is not None or + self.CustomDocumentIdentifier is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ShippingDocumentFormat'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('Dispositions=[\n') + level += 1 + for Dispositions_ in self.Dispositions: + showIndent(outfile, level) + outfile.write('model_.ShippingDocumentDispositionDetail(\n') + Dispositions_.exportLiteral(outfile, level, name_='ShippingDocumentDispositionDetail') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.TopOfPageOffset is not None: + showIndent(outfile, level) + outfile.write('TopOfPageOffset=model_.LinearMeasure(\n') + self.TopOfPageOffset.exportLiteral(outfile, level, name_='TopOfPageOffset') + showIndent(outfile, level) + outfile.write('),\n') + if self.ImageType is not None: + showIndent(outfile, level) + outfile.write('ImageType=%s,\n' % quote_python(self.ImageType).encode(ExternalEncoding)) + if self.StockType is not None: + showIndent(outfile, level) + outfile.write('StockType=%s,\n' % quote_python(self.StockType).encode(ExternalEncoding)) + if self.ProvideInstructions is not None: + showIndent(outfile, level) + outfile.write('ProvideInstructions=%s,\n' % self.ProvideInstructions) + if self.Localization is not None: + showIndent(outfile, level) + outfile.write('Localization=model_.Localization(\n') + self.Localization.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.CustomDocumentIdentifier is not None: + showIndent(outfile, level) + outfile.write('CustomDocumentIdentifier=%s,\n' % quote_python(self.CustomDocumentIdentifier).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Dispositions': + obj_ = ShippingDocumentDispositionDetail.factory() + obj_.build(child_) + self.Dispositions.append(obj_) + elif nodeName_ == 'TopOfPageOffset': + obj_ = LinearMeasure.factory() + obj_.build(child_) + self.set_TopOfPageOffset(obj_) + elif nodeName_ == 'ImageType': + ImageType_ = child_.text + ImageType_ = self.gds_validate_string(ImageType_, node, 'ImageType') + self.ImageType = ImageType_ + self.validate_ShippingDocumentImageType(self.ImageType) # validate type ShippingDocumentImageType + elif nodeName_ == 'StockType': + StockType_ = child_.text + StockType_ = self.gds_validate_string(StockType_, node, 'StockType') + self.StockType = StockType_ + self.validate_ShippingDocumentStockType(self.StockType) # validate type ShippingDocumentStockType + elif nodeName_ == 'ProvideInstructions': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'ProvideInstructions') + self.ProvideInstructions = ival_ + elif nodeName_ == 'Localization': + obj_ = Localization.factory() + obj_.build(child_) + self.set_Localization(obj_) + elif nodeName_ == 'CustomDocumentIdentifier': + CustomDocumentIdentifier_ = child_.text + CustomDocumentIdentifier_ = self.gds_validate_string(CustomDocumentIdentifier_, node, 'CustomDocumentIdentifier') + self.CustomDocumentIdentifier = CustomDocumentIdentifier_ +# end class ShippingDocumentFormat + + +class ShippingDocumentPart(GeneratedsSuper): + """A single part of a shipping document, such as one page of a + multiple-page document whose format requires a separate image + per page.""" + subclass = None + superclass = None + def __init__(self, DocumentPartSequenceNumber=None, Image=None): + self.DocumentPartSequenceNumber = DocumentPartSequenceNumber + self.Image = Image + def factory(*args_, **kwargs_): + if ShippingDocumentPart.subclass: + return ShippingDocumentPart.subclass(*args_, **kwargs_) + else: + return ShippingDocumentPart(*args_, **kwargs_) + factory = staticmethod(factory) + def get_DocumentPartSequenceNumber(self): return self.DocumentPartSequenceNumber + def set_DocumentPartSequenceNumber(self, DocumentPartSequenceNumber): self.DocumentPartSequenceNumber = DocumentPartSequenceNumber + def get_Image(self): return self.Image + def set_Image(self, Image): self.Image = Image + def export(self, outfile, level, namespace_='ns:', name_='ShippingDocumentPart', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ShippingDocumentPart') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ShippingDocumentPart'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ShippingDocumentPart', fromsubclass_=False): + if self.DocumentPartSequenceNumber is not None: + showIndent(outfile, level) + outfile.write('<%sDocumentPartSequenceNumber>%s\n' % (namespace_, self.gds_format_integer(self.DocumentPartSequenceNumber, input_name='DocumentPartSequenceNumber'), namespace_)) + if self.Image: + self.Image.export(outfile, level, namespace_, name_='Image') + def hasContent_(self): + if ( + self.DocumentPartSequenceNumber is not None or + self.Image is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ShippingDocumentPart'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.DocumentPartSequenceNumber is not None: + showIndent(outfile, level) + outfile.write('DocumentPartSequenceNumber=%d,\n' % self.DocumentPartSequenceNumber) + if self.Image is not None: + showIndent(outfile, level) + outfile.write('Image=model_.xs_base64Binary(\n') + self.Image.exportLiteral(outfile, level, name_='Image') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'DocumentPartSequenceNumber': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ <= 0: + raise_parse_error(child_, 'requires positiveInteger') + ival_ = self.gds_validate_integer(ival_, node, 'DocumentPartSequenceNumber') + self.DocumentPartSequenceNumber = ival_ + elif nodeName_ == 'Image': + obj_ = xs_base64Binary.factory() + obj_.build(child_) + self.set_Image(obj_) +# end class ShippingDocumentPart + + +class ShippingDocumentPrintDetail(GeneratedsSuper): + """Specifies printing options for a shipping document.""" + subclass = None + superclass = None + def __init__(self, PrinterId=None): + self.PrinterId = PrinterId + def factory(*args_, **kwargs_): + if ShippingDocumentPrintDetail.subclass: + return ShippingDocumentPrintDetail.subclass(*args_, **kwargs_) + else: + return ShippingDocumentPrintDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_PrinterId(self): return self.PrinterId + def set_PrinterId(self, PrinterId): self.PrinterId = PrinterId + def export(self, outfile, level, namespace_='ns:', name_='ShippingDocumentPrintDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ShippingDocumentPrintDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ShippingDocumentPrintDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ShippingDocumentPrintDetail', fromsubclass_=False): + if self.PrinterId is not None: + showIndent(outfile, level) + outfile.write('<%sPrinterId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PrinterId).encode(ExternalEncoding), input_name='PrinterId'), namespace_)) + def hasContent_(self): + if ( + self.PrinterId is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ShippingDocumentPrintDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.PrinterId is not None: + showIndent(outfile, level) + outfile.write('PrinterId=%s,\n' % quote_python(self.PrinterId).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'PrinterId': + PrinterId_ = child_.text + PrinterId_ = self.gds_validate_string(PrinterId_, node, 'PrinterId') + self.PrinterId = PrinterId_ +# end class ShippingDocumentPrintDetail + + +class ShippingDocumentSpecification(GeneratedsSuper): + """Contains all data required for additional (non-label) shipping + documents to be produced in conjunction with a specific + shipment.""" + subclass = None + superclass = None + def __init__(self, ShippingDocumentTypes=None, CertificateOfOrigin=None, CommercialInvoiceDetail=None, CustomPackageDocumentDetail=None, CustomShipmentDocumentDetail=None, GeneralAgencyAgreementDetail=None, NaftaCertificateOfOriginDetail=None, Op900Detail=None, FreightAddressLabelDetail=None): + if ShippingDocumentTypes is None: + self.ShippingDocumentTypes = [] + else: + self.ShippingDocumentTypes = ShippingDocumentTypes + self.CertificateOfOrigin = CertificateOfOrigin + self.CommercialInvoiceDetail = CommercialInvoiceDetail + if CustomPackageDocumentDetail is None: + self.CustomPackageDocumentDetail = [] + else: + self.CustomPackageDocumentDetail = CustomPackageDocumentDetail + if CustomShipmentDocumentDetail is None: + self.CustomShipmentDocumentDetail = [] + else: + self.CustomShipmentDocumentDetail = CustomShipmentDocumentDetail + self.GeneralAgencyAgreementDetail = GeneralAgencyAgreementDetail + self.NaftaCertificateOfOriginDetail = NaftaCertificateOfOriginDetail + self.Op900Detail = Op900Detail + self.FreightAddressLabelDetail = FreightAddressLabelDetail + def factory(*args_, **kwargs_): + if ShippingDocumentSpecification.subclass: + return ShippingDocumentSpecification.subclass(*args_, **kwargs_) + else: + return ShippingDocumentSpecification(*args_, **kwargs_) + factory = staticmethod(factory) + def get_ShippingDocumentTypes(self): return self.ShippingDocumentTypes + def set_ShippingDocumentTypes(self, ShippingDocumentTypes): self.ShippingDocumentTypes = ShippingDocumentTypes + def add_ShippingDocumentTypes(self, value): self.ShippingDocumentTypes.append(value) + def insert_ShippingDocumentTypes(self, index, value): self.ShippingDocumentTypes[index] = value + def validate_RequestedShippingDocumentType(self, value): + # Validate type RequestedShippingDocumentType, a restriction on xs:string. + pass + def get_CertificateOfOrigin(self): return self.CertificateOfOrigin + def set_CertificateOfOrigin(self, CertificateOfOrigin): self.CertificateOfOrigin = CertificateOfOrigin + def get_CommercialInvoiceDetail(self): return self.CommercialInvoiceDetail + def set_CommercialInvoiceDetail(self, CommercialInvoiceDetail): self.CommercialInvoiceDetail = CommercialInvoiceDetail + def get_CustomPackageDocumentDetail(self): return self.CustomPackageDocumentDetail + def set_CustomPackageDocumentDetail(self, CustomPackageDocumentDetail): self.CustomPackageDocumentDetail = CustomPackageDocumentDetail + def add_CustomPackageDocumentDetail(self, value): self.CustomPackageDocumentDetail.append(value) + def insert_CustomPackageDocumentDetail(self, index, value): self.CustomPackageDocumentDetail[index] = value + def get_CustomShipmentDocumentDetail(self): return self.CustomShipmentDocumentDetail + def set_CustomShipmentDocumentDetail(self, CustomShipmentDocumentDetail): self.CustomShipmentDocumentDetail = CustomShipmentDocumentDetail + def add_CustomShipmentDocumentDetail(self, value): self.CustomShipmentDocumentDetail.append(value) + def insert_CustomShipmentDocumentDetail(self, index, value): self.CustomShipmentDocumentDetail[index] = value + def get_GeneralAgencyAgreementDetail(self): return self.GeneralAgencyAgreementDetail + def set_GeneralAgencyAgreementDetail(self, GeneralAgencyAgreementDetail): self.GeneralAgencyAgreementDetail = GeneralAgencyAgreementDetail + def get_NaftaCertificateOfOriginDetail(self): return self.NaftaCertificateOfOriginDetail + def set_NaftaCertificateOfOriginDetail(self, NaftaCertificateOfOriginDetail): self.NaftaCertificateOfOriginDetail = NaftaCertificateOfOriginDetail + def get_Op900Detail(self): return self.Op900Detail + def set_Op900Detail(self, Op900Detail): self.Op900Detail = Op900Detail + def get_FreightAddressLabelDetail(self): return self.FreightAddressLabelDetail + def set_FreightAddressLabelDetail(self, FreightAddressLabelDetail): self.FreightAddressLabelDetail = FreightAddressLabelDetail + def export(self, outfile, level, namespace_='ns:', name_='ShippingDocumentSpecification', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ShippingDocumentSpecification') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ShippingDocumentSpecification'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ShippingDocumentSpecification', fromsubclass_=False): + for ShippingDocumentTypes_ in self.ShippingDocumentTypes: + showIndent(outfile, level) + outfile.write('<%sShippingDocumentTypes>%s\n' % (namespace_, self.gds_format_string(quote_xml(ShippingDocumentTypes_).encode(ExternalEncoding), input_name='ShippingDocumentTypes'), namespace_)) + if self.CertificateOfOrigin: + self.CertificateOfOrigin.export(outfile, level, namespace_, name_='CertificateOfOrigin') + if self.CommercialInvoiceDetail: + self.CommercialInvoiceDetail.export(outfile, level, namespace_, name_='CommercialInvoiceDetail') + for CustomPackageDocumentDetail_ in self.CustomPackageDocumentDetail: + CustomPackageDocumentDetail_.export(outfile, level, namespace_, name_='CustomPackageDocumentDetail') + for CustomShipmentDocumentDetail_ in self.CustomShipmentDocumentDetail: + CustomShipmentDocumentDetail_.export(outfile, level, namespace_, name_='CustomShipmentDocumentDetail') + if self.GeneralAgencyAgreementDetail: + self.GeneralAgencyAgreementDetail.export(outfile, level, namespace_, name_='GeneralAgencyAgreementDetail') + if self.NaftaCertificateOfOriginDetail: + self.NaftaCertificateOfOriginDetail.export(outfile, level, namespace_, name_='NaftaCertificateOfOriginDetail') + if self.Op900Detail: + self.Op900Detail.export(outfile, level, namespace_, name_='Op900Detail') + if self.FreightAddressLabelDetail: + self.FreightAddressLabelDetail.export(outfile, level, namespace_, name_='FreightAddressLabelDetail') + def hasContent_(self): + if ( + self.ShippingDocumentTypes or + self.CertificateOfOrigin is not None or + self.CommercialInvoiceDetail is not None or + self.CustomPackageDocumentDetail or + self.CustomShipmentDocumentDetail or + self.GeneralAgencyAgreementDetail is not None or + self.NaftaCertificateOfOriginDetail is not None or + self.Op900Detail is not None or + self.FreightAddressLabelDetail is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ShippingDocumentSpecification'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('ShippingDocumentTypes=[\n') + level += 1 + for ShippingDocumentTypes_ in self.ShippingDocumentTypes: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(ShippingDocumentTypes_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.CertificateOfOrigin is not None: + showIndent(outfile, level) + outfile.write('CertificateOfOrigin=model_.CertificateOfOriginDetail(\n') + self.CertificateOfOrigin.exportLiteral(outfile, level, name_='CertificateOfOrigin') + showIndent(outfile, level) + outfile.write('),\n') + if self.CommercialInvoiceDetail is not None: + showIndent(outfile, level) + outfile.write('CommercialInvoiceDetail=model_.CommercialInvoiceDetail(\n') + self.CommercialInvoiceDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('CustomPackageDocumentDetail=[\n') + level += 1 + for CustomPackageDocumentDetail_ in self.CustomPackageDocumentDetail: + showIndent(outfile, level) + outfile.write('model_.CustomDocumentDetail(\n') + CustomPackageDocumentDetail_.exportLiteral(outfile, level, name_='CustomDocumentDetail') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('CustomShipmentDocumentDetail=[\n') + level += 1 + for CustomShipmentDocumentDetail_ in self.CustomShipmentDocumentDetail: + showIndent(outfile, level) + outfile.write('model_.CustomDocumentDetail(\n') + CustomShipmentDocumentDetail_.exportLiteral(outfile, level, name_='CustomDocumentDetail') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.GeneralAgencyAgreementDetail is not None: + showIndent(outfile, level) + outfile.write('GeneralAgencyAgreementDetail=model_.GeneralAgencyAgreementDetail(\n') + self.GeneralAgencyAgreementDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.NaftaCertificateOfOriginDetail is not None: + showIndent(outfile, level) + outfile.write('NaftaCertificateOfOriginDetail=model_.NaftaCertificateOfOriginDetail(\n') + self.NaftaCertificateOfOriginDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Op900Detail is not None: + showIndent(outfile, level) + outfile.write('Op900Detail=model_.Op900Detail(\n') + self.Op900Detail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.FreightAddressLabelDetail is not None: + showIndent(outfile, level) + outfile.write('FreightAddressLabelDetail=model_.FreightAddressLabelDetail(\n') + self.FreightAddressLabelDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'ShippingDocumentTypes': + ShippingDocumentTypes_ = child_.text + ShippingDocumentTypes_ = self.gds_validate_string(ShippingDocumentTypes_, node, 'ShippingDocumentTypes') + self.ShippingDocumentTypes.append(ShippingDocumentTypes_) + self.validate_RequestedShippingDocumentType(self.ShippingDocumentTypes) # validate type RequestedShippingDocumentType + elif nodeName_ == 'CertificateOfOrigin': + obj_ = CertificateOfOriginDetail.factory() + obj_.build(child_) + self.set_CertificateOfOrigin(obj_) + elif nodeName_ == 'CommercialInvoiceDetail': + obj_ = CommercialInvoiceDetail.factory() + obj_.build(child_) + self.set_CommercialInvoiceDetail(obj_) + elif nodeName_ == 'CustomPackageDocumentDetail': + obj_ = CustomDocumentDetail.factory() + obj_.build(child_) + self.CustomPackageDocumentDetail.append(obj_) + elif nodeName_ == 'CustomShipmentDocumentDetail': + obj_ = CustomDocumentDetail.factory() + obj_.build(child_) + self.CustomShipmentDocumentDetail.append(obj_) + elif nodeName_ == 'GeneralAgencyAgreementDetail': + obj_ = GeneralAgencyAgreementDetail.factory() + obj_.build(child_) + self.set_GeneralAgencyAgreementDetail(obj_) + elif nodeName_ == 'NaftaCertificateOfOriginDetail': + obj_ = NaftaCertificateOfOriginDetail.factory() + obj_.build(child_) + self.set_NaftaCertificateOfOriginDetail(obj_) + elif nodeName_ == 'Op900Detail': + obj_ = Op900Detail.factory() + obj_.build(child_) + self.set_Op900Detail(obj_) + elif nodeName_ == 'FreightAddressLabelDetail': + obj_ = FreightAddressLabelDetail.factory() + obj_.build(child_) + self.set_FreightAddressLabelDetail(obj_) +# end class ShippingDocumentSpecification + + +class SignatureOptionDetail(GeneratedsSuper): + """The descriptive data required for FedEx delivery signature services.""" + subclass = None + superclass = None + def __init__(self, OptionType=None, SignatureReleaseNumber=None): + self.OptionType = OptionType + self.SignatureReleaseNumber = SignatureReleaseNumber + def factory(*args_, **kwargs_): + if SignatureOptionDetail.subclass: + return SignatureOptionDetail.subclass(*args_, **kwargs_) + else: + return SignatureOptionDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_OptionType(self): return self.OptionType + def set_OptionType(self, OptionType): self.OptionType = OptionType + def validate_SignatureOptionType(self, value): + # Validate type SignatureOptionType, a restriction on xs:string. + pass + def get_SignatureReleaseNumber(self): return self.SignatureReleaseNumber + def set_SignatureReleaseNumber(self, SignatureReleaseNumber): self.SignatureReleaseNumber = SignatureReleaseNumber + def export(self, outfile, level, namespace_='ns:', name_='SignatureOptionDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='SignatureOptionDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='SignatureOptionDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='SignatureOptionDetail', fromsubclass_=False): + if self.OptionType is not None: + showIndent(outfile, level) + outfile.write('<%sOptionType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.OptionType).encode(ExternalEncoding), input_name='OptionType'), namespace_)) + if self.SignatureReleaseNumber is not None: + showIndent(outfile, level) + outfile.write('<%sSignatureReleaseNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.SignatureReleaseNumber).encode(ExternalEncoding), input_name='SignatureReleaseNumber'), namespace_)) + def hasContent_(self): + if ( + self.OptionType is not None or + self.SignatureReleaseNumber is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='SignatureOptionDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.OptionType is not None: + showIndent(outfile, level) + outfile.write('OptionType=%s,\n' % quote_python(self.OptionType).encode(ExternalEncoding)) + if self.SignatureReleaseNumber is not None: + showIndent(outfile, level) + outfile.write('SignatureReleaseNumber=%s,\n' % quote_python(self.SignatureReleaseNumber).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'OptionType': + OptionType_ = child_.text + OptionType_ = self.gds_validate_string(OptionType_, node, 'OptionType') + self.OptionType = OptionType_ + self.validate_SignatureOptionType(self.OptionType) # validate type SignatureOptionType + elif nodeName_ == 'SignatureReleaseNumber': + SignatureReleaseNumber_ = child_.text + SignatureReleaseNumber_ = self.gds_validate_string(SignatureReleaseNumber_, node, 'SignatureReleaseNumber') + self.SignatureReleaseNumber = SignatureReleaseNumber_ +# end class SignatureOptionDetail + + +class SmartPostShipmentDetail(GeneratedsSuper): + """Data required for shipments handled under the SMART_POST and + GROUND_SMART_POST service types.""" + subclass = None + superclass = None + def __init__(self, Indicia=None, AncillaryEndorsement=None, HubId=None, CustomerManifestId=None): + self.Indicia = Indicia + self.AncillaryEndorsement = AncillaryEndorsement + self.HubId = HubId + self.CustomerManifestId = CustomerManifestId + def factory(*args_, **kwargs_): + if SmartPostShipmentDetail.subclass: + return SmartPostShipmentDetail.subclass(*args_, **kwargs_) + else: + return SmartPostShipmentDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Indicia(self): return self.Indicia + def set_Indicia(self, Indicia): self.Indicia = Indicia + def validate_SmartPostIndiciaType(self, value): + # Validate type SmartPostIndiciaType, a restriction on xs:string. + pass + def get_AncillaryEndorsement(self): return self.AncillaryEndorsement + def set_AncillaryEndorsement(self, AncillaryEndorsement): self.AncillaryEndorsement = AncillaryEndorsement + def validate_SmartPostAncillaryEndorsementType(self, value): + # Validate type SmartPostAncillaryEndorsementType, a restriction on xs:string. + pass + def get_HubId(self): return self.HubId + def set_HubId(self, HubId): self.HubId = HubId + def get_CustomerManifestId(self): return self.CustomerManifestId + def set_CustomerManifestId(self, CustomerManifestId): self.CustomerManifestId = CustomerManifestId + def export(self, outfile, level, namespace_='ns:', name_='SmartPostShipmentDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='SmartPostShipmentDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='SmartPostShipmentDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='SmartPostShipmentDetail', fromsubclass_=False): + if self.Indicia is not None: + showIndent(outfile, level) + outfile.write('<%sIndicia>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Indicia).encode(ExternalEncoding), input_name='Indicia'), namespace_)) + if self.AncillaryEndorsement is not None: + showIndent(outfile, level) + outfile.write('<%sAncillaryEndorsement>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AncillaryEndorsement).encode(ExternalEncoding), input_name='AncillaryEndorsement'), namespace_)) + if self.HubId is not None: + showIndent(outfile, level) + outfile.write('<%sHubId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HubId).encode(ExternalEncoding), input_name='HubId'), namespace_)) + if self.CustomerManifestId is not None: + showIndent(outfile, level) + outfile.write('<%sCustomerManifestId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CustomerManifestId).encode(ExternalEncoding), input_name='CustomerManifestId'), namespace_)) + def hasContent_(self): + if ( + self.Indicia is not None or + self.AncillaryEndorsement is not None or + self.HubId is not None or + self.CustomerManifestId is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='SmartPostShipmentDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Indicia is not None: + showIndent(outfile, level) + outfile.write('Indicia=%s,\n' % quote_python(self.Indicia).encode(ExternalEncoding)) + if self.AncillaryEndorsement is not None: + showIndent(outfile, level) + outfile.write('AncillaryEndorsement=%s,\n' % quote_python(self.AncillaryEndorsement).encode(ExternalEncoding)) + if self.HubId is not None: + showIndent(outfile, level) + outfile.write('HubId=%s,\n' % quote_python(self.HubId).encode(ExternalEncoding)) + if self.CustomerManifestId is not None: + showIndent(outfile, level) + outfile.write('CustomerManifestId=%s,\n' % quote_python(self.CustomerManifestId).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Indicia': + Indicia_ = child_.text + Indicia_ = self.gds_validate_string(Indicia_, node, 'Indicia') + self.Indicia = Indicia_ + self.validate_SmartPostIndiciaType(self.Indicia) # validate type SmartPostIndiciaType + elif nodeName_ == 'AncillaryEndorsement': + AncillaryEndorsement_ = child_.text + AncillaryEndorsement_ = self.gds_validate_string(AncillaryEndorsement_, node, 'AncillaryEndorsement') + self.AncillaryEndorsement = AncillaryEndorsement_ + self.validate_SmartPostAncillaryEndorsementType(self.AncillaryEndorsement) # validate type SmartPostAncillaryEndorsementType + elif nodeName_ == 'HubId': + HubId_ = child_.text + HubId_ = self.gds_validate_string(HubId_, node, 'HubId') + self.HubId = HubId_ + elif nodeName_ == 'CustomerManifestId': + CustomerManifestId_ = child_.text + CustomerManifestId_ = self.gds_validate_string(CustomerManifestId_, node, 'CustomerManifestId') + self.CustomerManifestId = CustomerManifestId_ +# end class SmartPostShipmentDetail + + +class StringBarcode(GeneratedsSuper): + """Each instance of this data type represents a barcode whose content + must be represented as ASCII text (i.e. not binary data).""" + subclass = None + superclass = None + def __init__(self, Type=None, Value=None): + self.Type = Type + self.Value = Value + def factory(*args_, **kwargs_): + if StringBarcode.subclass: + return StringBarcode.subclass(*args_, **kwargs_) + else: + return StringBarcode(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Type(self): return self.Type + def set_Type(self, Type): self.Type = Type + def validate_StringBarcodeType(self, value): + # Validate type StringBarcodeType, a restriction on xs:string. + pass + def get_Value(self): return self.Value + def set_Value(self, Value): self.Value = Value + def export(self, outfile, level, namespace_='ns:', name_='StringBarcode', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='StringBarcode') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='StringBarcode'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='StringBarcode', fromsubclass_=False): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('<%sType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Type).encode(ExternalEncoding), input_name='Type'), namespace_)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('<%sValue>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Value).encode(ExternalEncoding), input_name='Value'), namespace_)) + def hasContent_(self): + if ( + self.Type is not None or + self.Value is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='StringBarcode'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('Type=%s,\n' % quote_python(self.Type).encode(ExternalEncoding)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('Value=%s,\n' % quote_python(self.Value).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Type': + Type_ = child_.text + Type_ = self.gds_validate_string(Type_, node, 'Type') + self.Type = Type_ + self.validate_StringBarcodeType(self.Type) # validate type StringBarcodeType + elif nodeName_ == 'Value': + Value_ = child_.text + Value_ = self.gds_validate_string(Value_, node, 'Value') + self.Value = Value_ +# end class StringBarcode + + +class Surcharge(GeneratedsSuper): + """Identifies each surcharge applied to the shipment.""" + subclass = None + superclass = None + def __init__(self, SurchargeType=None, Level=None, Description=None, Amount=None): + self.SurchargeType = SurchargeType + self.Level = Level + self.Description = Description + self.Amount = Amount + def factory(*args_, **kwargs_): + if Surcharge.subclass: + return Surcharge.subclass(*args_, **kwargs_) + else: + return Surcharge(*args_, **kwargs_) + factory = staticmethod(factory) + def get_SurchargeType(self): return self.SurchargeType + def set_SurchargeType(self, SurchargeType): self.SurchargeType = SurchargeType + def validate_SurchargeType(self, value): + # Validate type SurchargeType, a restriction on xs:string. + pass + def get_Level(self): return self.Level + def set_Level(self, Level): self.Level = Level + def validate_SurchargeLevelType(self, value): + # Validate type SurchargeLevelType, a restriction on xs:string. + pass + def get_Description(self): return self.Description + def set_Description(self, Description): self.Description = Description + def get_Amount(self): return self.Amount + def set_Amount(self, Amount): self.Amount = Amount + def export(self, outfile, level, namespace_='ns:', name_='Surcharge', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Surcharge') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Surcharge'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Surcharge', fromsubclass_=False): + if self.SurchargeType is not None: + showIndent(outfile, level) + outfile.write('<%sSurchargeType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.SurchargeType).encode(ExternalEncoding), input_name='SurchargeType'), namespace_)) + if self.Level is not None: + showIndent(outfile, level) + outfile.write('<%sLevel>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Level).encode(ExternalEncoding), input_name='Level'), namespace_)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('<%sDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Description).encode(ExternalEncoding), input_name='Description'), namespace_)) + if self.Amount: + self.Amount.export(outfile, level, namespace_, name_='Amount', ) + def hasContent_(self): + if ( + self.SurchargeType is not None or + self.Level is not None or + self.Description is not None or + self.Amount is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Surcharge'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.SurchargeType is not None: + showIndent(outfile, level) + outfile.write('SurchargeType=%s,\n' % quote_python(self.SurchargeType).encode(ExternalEncoding)) + if self.Level is not None: + showIndent(outfile, level) + outfile.write('Level=%s,\n' % quote_python(self.Level).encode(ExternalEncoding)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('Description=%s,\n' % quote_python(self.Description).encode(ExternalEncoding)) + if self.Amount is not None: + showIndent(outfile, level) + outfile.write('Amount=model_.Money(\n') + self.Amount.exportLiteral(outfile, level, name_='Amount') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'SurchargeType': + SurchargeType_ = child_.text + SurchargeType_ = self.gds_validate_string(SurchargeType_, node, 'SurchargeType') + self.SurchargeType = SurchargeType_ + self.validate_SurchargeType(self.SurchargeType) # validate type SurchargeType + elif nodeName_ == 'Level': + Level_ = child_.text + Level_ = self.gds_validate_string(Level_, node, 'Level') + self.Level = Level_ + self.validate_SurchargeLevelType(self.Level) # validate type SurchargeLevelType + elif nodeName_ == 'Description': + Description_ = child_.text + Description_ = self.gds_validate_string(Description_, node, 'Description') + self.Description = Description_ + elif nodeName_ == 'Amount': + obj_ = Money.factory() + obj_.build(child_) + self.set_Amount(obj_) +# end class Surcharge + + +class Tax(GeneratedsSuper): + """Identifies each tax applied to the shipment.""" + subclass = None + superclass = None + def __init__(self, TaxType=None, Description=None, Amount=None): + self.TaxType = TaxType + self.Description = Description + self.Amount = Amount + def factory(*args_, **kwargs_): + if Tax.subclass: + return Tax.subclass(*args_, **kwargs_) + else: + return Tax(*args_, **kwargs_) + factory = staticmethod(factory) + def get_TaxType(self): return self.TaxType + def set_TaxType(self, TaxType): self.TaxType = TaxType + def validate_TaxType(self, value): + # Validate type TaxType, a restriction on xs:string. + pass + def get_Description(self): return self.Description + def set_Description(self, Description): self.Description = Description + def get_Amount(self): return self.Amount + def set_Amount(self, Amount): self.Amount = Amount + def export(self, outfile, level, namespace_='ns:', name_='Tax', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Tax') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Tax'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Tax', fromsubclass_=False): + if self.TaxType is not None: + showIndent(outfile, level) + outfile.write('<%sTaxType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.TaxType).encode(ExternalEncoding), input_name='TaxType'), namespace_)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('<%sDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Description).encode(ExternalEncoding), input_name='Description'), namespace_)) + if self.Amount: + self.Amount.export(outfile, level, namespace_, name_='Amount') + def hasContent_(self): + if ( + self.TaxType is not None or + self.Description is not None or + self.Amount is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Tax'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.TaxType is not None: + showIndent(outfile, level) + outfile.write('TaxType=%s,\n' % quote_python(self.TaxType).encode(ExternalEncoding)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('Description=%s,\n' % quote_python(self.Description).encode(ExternalEncoding)) + if self.Amount is not None: + showIndent(outfile, level) + outfile.write('Amount=model_.Money(\n') + self.Amount.exportLiteral(outfile, level, name_='Amount') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'TaxType': + TaxType_ = child_.text + TaxType_ = self.gds_validate_string(TaxType_, node, 'TaxType') + self.TaxType = TaxType_ + self.validate_TaxType(self.TaxType) # validate type TaxType + elif nodeName_ == 'Description': + Description_ = child_.text + Description_ = self.gds_validate_string(Description_, node, 'Description') + self.Description = Description_ + elif nodeName_ == 'Amount': + obj_ = Money.factory() + obj_.build(child_) + self.set_Amount(obj_) +# end class Tax + + +class TaxpayerIdentification(GeneratedsSuper): + """The descriptive data for taxpayer identification information.""" + subclass = None + superclass = None + def __init__(self, TinType=None, Number=None, Usage=None): + self.TinType = TinType + self.Number = Number + self.Usage = Usage + def factory(*args_, **kwargs_): + if TaxpayerIdentification.subclass: + return TaxpayerIdentification.subclass(*args_, **kwargs_) + else: + return TaxpayerIdentification(*args_, **kwargs_) + factory = staticmethod(factory) + def get_TinType(self): return self.TinType + def set_TinType(self, TinType): self.TinType = TinType + def validate_TinType(self, value): + # Validate type TinType, a restriction on xs:string. + pass + def get_Number(self): return self.Number + def set_Number(self, Number): self.Number = Number + def get_Usage(self): return self.Usage + def set_Usage(self, Usage): self.Usage = Usage + def export(self, outfile, level, namespace_='ns:', name_='TaxpayerIdentification', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='TaxpayerIdentification') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='TaxpayerIdentification'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='TaxpayerIdentification', fromsubclass_=False): + if self.TinType is not None: + showIndent(outfile, level) + outfile.write('<%sTinType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.TinType).encode(ExternalEncoding), input_name='TinType'), namespace_)) + if self.Number is not None: + showIndent(outfile, level) + outfile.write('<%sNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Number).encode(ExternalEncoding), input_name='Number'), namespace_)) + if self.Usage is not None: + showIndent(outfile, level) + outfile.write('<%sUsage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Usage).encode(ExternalEncoding), input_name='Usage'), namespace_)) + def hasContent_(self): + if ( + self.TinType is not None or + self.Number is not None or + self.Usage is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='TaxpayerIdentification'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.TinType is not None: + showIndent(outfile, level) + outfile.write('TinType=%s,\n' % quote_python(self.TinType).encode(ExternalEncoding)) + if self.Number is not None: + showIndent(outfile, level) + outfile.write('Number=%s,\n' % quote_python(self.Number).encode(ExternalEncoding)) + if self.Usage is not None: + showIndent(outfile, level) + outfile.write('Usage=%s,\n' % quote_python(self.Usage).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'TinType': + TinType_ = child_.text + TinType_ = self.gds_validate_string(TinType_, node, 'TinType') + self.TinType = TinType_ + self.validate_TinType(self.TinType) # validate type TinType + elif nodeName_ == 'Number': + Number_ = child_.text + Number_ = self.gds_validate_string(Number_, node, 'Number') + self.Number = Number_ + elif nodeName_ == 'Usage': + Usage_ = child_.text + Usage_ = self.gds_validate_string(Usage_, node, 'Usage') + self.Usage = Usage_ +# end class TaxpayerIdentification + + +class TrackingId(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, TrackingIdType=None, FormId=None, UspsApplicationId=None, TrackingNumber=None): + self.TrackingIdType = TrackingIdType + self.FormId = FormId + self.UspsApplicationId = UspsApplicationId + self.TrackingNumber = TrackingNumber + def factory(*args_, **kwargs_): + if TrackingId.subclass: + return TrackingId.subclass(*args_, **kwargs_) + else: + return TrackingId(*args_, **kwargs_) + factory = staticmethod(factory) + def get_TrackingIdType(self): return self.TrackingIdType + def set_TrackingIdType(self, TrackingIdType): self.TrackingIdType = TrackingIdType + def validate_TrackingIdType(self, value): + # Validate type TrackingIdType, a restriction on xs:string. + pass + def get_FormId(self): return self.FormId + def set_FormId(self, FormId): self.FormId = FormId + def get_UspsApplicationId(self): return self.UspsApplicationId + def set_UspsApplicationId(self, UspsApplicationId): self.UspsApplicationId = UspsApplicationId + def get_TrackingNumber(self): return self.TrackingNumber + def set_TrackingNumber(self, TrackingNumber): self.TrackingNumber = TrackingNumber + def export(self, outfile, level, namespace_='ns:', name_='TrackingId', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='TrackingId') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='TrackingId'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='TrackingId', fromsubclass_=False): + if self.TrackingIdType is not None: + showIndent(outfile, level) + outfile.write('<%sTrackingIdType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.TrackingIdType).encode(ExternalEncoding), input_name='TrackingIdType'), namespace_)) + if self.FormId is not None: + showIndent(outfile, level) + outfile.write('<%sFormId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.FormId).encode(ExternalEncoding), input_name='FormId'), namespace_)) + if self.UspsApplicationId is not None: + showIndent(outfile, level) + outfile.write('<%sUspsApplicationId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.UspsApplicationId).encode(ExternalEncoding), input_name='UspsApplicationId'), namespace_)) + if self.TrackingNumber is not None: + showIndent(outfile, level) + outfile.write('<%sTrackingNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.TrackingNumber).encode(ExternalEncoding), input_name='TrackingNumber'), namespace_)) + def hasContent_(self): + if ( + self.TrackingIdType is not None or + self.FormId is not None or + self.UspsApplicationId is not None or + self.TrackingNumber is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='TrackingId'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.TrackingIdType is not None: + showIndent(outfile, level) + outfile.write('TrackingIdType=%s,\n' % quote_python(self.TrackingIdType).encode(ExternalEncoding)) + if self.FormId is not None: + showIndent(outfile, level) + outfile.write('FormId=%s,\n' % quote_python(self.FormId).encode(ExternalEncoding)) + if self.UspsApplicationId is not None: + showIndent(outfile, level) + outfile.write('UspsApplicationId=%s,\n' % quote_python(self.UspsApplicationId).encode(ExternalEncoding)) + if self.TrackingNumber is not None: + showIndent(outfile, level) + outfile.write('TrackingNumber=%s,\n' % quote_python(self.TrackingNumber).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'TrackingIdType': + TrackingIdType_ = child_.text + TrackingIdType_ = self.gds_validate_string(TrackingIdType_, node, 'TrackingIdType') + self.TrackingIdType = TrackingIdType_ + self.validate_TrackingIdType(self.TrackingIdType) # validate type TrackingIdType + elif nodeName_ == 'FormId': + FormId_ = child_.text + FormId_ = self.gds_validate_string(FormId_, node, 'FormId') + self.FormId = FormId_ + elif nodeName_ == 'UspsApplicationId': + UspsApplicationId_ = child_.text + UspsApplicationId_ = self.gds_validate_string(UspsApplicationId_, node, 'UspsApplicationId') + self.UspsApplicationId = UspsApplicationId_ + elif nodeName_ == 'TrackingNumber': + TrackingNumber_ = child_.text + TrackingNumber_ = self.gds_validate_string(TrackingNumber_, node, 'TrackingNumber') + self.TrackingNumber = TrackingNumber_ +# end class TrackingId + + +class TransactionDetail(GeneratedsSuper): + """Descriptive data for this customer transaction. The + TransactionDetail from the request is echoed back to the caller + in the corresponding reply.""" + subclass = None + superclass = None + def __init__(self, CustomerTransactionId=None, Localization=None): + self.CustomerTransactionId = CustomerTransactionId + self.Localization = Localization + def factory(*args_, **kwargs_): + if TransactionDetail.subclass: + return TransactionDetail.subclass(*args_, **kwargs_) + else: + return TransactionDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_CustomerTransactionId(self): return self.CustomerTransactionId + def set_CustomerTransactionId(self, CustomerTransactionId): self.CustomerTransactionId = CustomerTransactionId + def get_Localization(self): return self.Localization + def set_Localization(self, Localization): self.Localization = Localization + def export(self, outfile, level, namespace_='ns:', name_='TransactionDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='TransactionDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='TransactionDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='TransactionDetail', fromsubclass_=False): + if self.CustomerTransactionId is not None: + showIndent(outfile, level) + outfile.write('<%sCustomerTransactionId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CustomerTransactionId).encode(ExternalEncoding), input_name='CustomerTransactionId'), namespace_)) + if self.Localization: + self.Localization.export(outfile, level, namespace_, name_='Localization') + def hasContent_(self): + if ( + self.CustomerTransactionId is not None or + self.Localization is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='TransactionDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.CustomerTransactionId is not None: + showIndent(outfile, level) + outfile.write('CustomerTransactionId=%s,\n' % quote_python(self.CustomerTransactionId).encode(ExternalEncoding)) + if self.Localization is not None: + showIndent(outfile, level) + outfile.write('Localization=model_.Localization(\n') + self.Localization.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'CustomerTransactionId': + CustomerTransactionId_ = child_.text + CustomerTransactionId_ = self.gds_validate_string(CustomerTransactionId_, node, 'CustomerTransactionId') + self.CustomerTransactionId = CustomerTransactionId_ + elif nodeName_ == 'Localization': + obj_ = Localization.factory() + obj_.build(child_) + self.set_Localization(obj_) +# end class TransactionDetail + + +class UploadDocumentReferenceDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, LineNumber=None, CustomerReference=None, DocumentProducer=None, DocumentType=None, DocumentId=None, DocumentIdProducer=None): + self.LineNumber = LineNumber + self.CustomerReference = CustomerReference + self.DocumentProducer = DocumentProducer + self.DocumentType = DocumentType + self.DocumentId = DocumentId + self.DocumentIdProducer = DocumentIdProducer + def factory(*args_, **kwargs_): + if UploadDocumentReferenceDetail.subclass: + return UploadDocumentReferenceDetail.subclass(*args_, **kwargs_) + else: + return UploadDocumentReferenceDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_LineNumber(self): return self.LineNumber + def set_LineNumber(self, LineNumber): self.LineNumber = LineNumber + def get_CustomerReference(self): return self.CustomerReference + def set_CustomerReference(self, CustomerReference): self.CustomerReference = CustomerReference + def get_DocumentProducer(self): return self.DocumentProducer + def set_DocumentProducer(self, DocumentProducer): self.DocumentProducer = DocumentProducer + def validate_UploadDocumentProducerType(self, value): + # Validate type UploadDocumentProducerType, a restriction on xs:string. + pass + def get_DocumentType(self): return self.DocumentType + def set_DocumentType(self, DocumentType): self.DocumentType = DocumentType + def validate_UploadDocumentType(self, value): + # Validate type UploadDocumentType, a restriction on xs:string. + pass + def get_DocumentId(self): return self.DocumentId + def set_DocumentId(self, DocumentId): self.DocumentId = DocumentId + def get_DocumentIdProducer(self): return self.DocumentIdProducer + def set_DocumentIdProducer(self, DocumentIdProducer): self.DocumentIdProducer = DocumentIdProducer + def validate_UploadDocumentIdProducer(self, value): + # Validate type UploadDocumentIdProducer, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='UploadDocumentReferenceDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='UploadDocumentReferenceDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='UploadDocumentReferenceDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='UploadDocumentReferenceDetail', fromsubclass_=False): + if self.LineNumber is not None: + showIndent(outfile, level) + outfile.write('<%sLineNumber>%s\n' % (namespace_, self.gds_format_integer(self.LineNumber, input_name='LineNumber'), namespace_)) + if self.CustomerReference is not None: + showIndent(outfile, level) + outfile.write('<%sCustomerReference>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CustomerReference).encode(ExternalEncoding), input_name='CustomerReference'), namespace_)) + if self.DocumentProducer is not None: + showIndent(outfile, level) + outfile.write('<%sDocumentProducer>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DocumentProducer).encode(ExternalEncoding), input_name='DocumentProducer'), namespace_)) + if self.DocumentType is not None: + showIndent(outfile, level) + outfile.write('<%sDocumentType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DocumentType).encode(ExternalEncoding), input_name='DocumentType'), namespace_)) + if self.DocumentId is not None: + showIndent(outfile, level) + outfile.write('<%sDocumentId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DocumentId).encode(ExternalEncoding), input_name='DocumentId'), namespace_)) + if self.DocumentIdProducer is not None: + showIndent(outfile, level) + outfile.write('<%sDocumentIdProducer>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DocumentIdProducer).encode(ExternalEncoding), input_name='DocumentIdProducer'), namespace_)) + def hasContent_(self): + if ( + self.LineNumber is not None or + self.CustomerReference is not None or + self.DocumentProducer is not None or + self.DocumentType is not None or + self.DocumentId is not None or + self.DocumentIdProducer is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='UploadDocumentReferenceDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.LineNumber is not None: + showIndent(outfile, level) + outfile.write('LineNumber=%d,\n' % self.LineNumber) + if self.CustomerReference is not None: + showIndent(outfile, level) + outfile.write('CustomerReference=%s,\n' % quote_python(self.CustomerReference).encode(ExternalEncoding)) + if self.DocumentProducer is not None: + showIndent(outfile, level) + outfile.write('DocumentProducer=%s,\n' % quote_python(self.DocumentProducer).encode(ExternalEncoding)) + if self.DocumentType is not None: + showIndent(outfile, level) + outfile.write('DocumentType=%s,\n' % quote_python(self.DocumentType).encode(ExternalEncoding)) + if self.DocumentId is not None: + showIndent(outfile, level) + outfile.write('DocumentId=%s,\n' % quote_python(self.DocumentId).encode(ExternalEncoding)) + if self.DocumentIdProducer is not None: + showIndent(outfile, level) + outfile.write('DocumentIdProducer=%s,\n' % quote_python(self.DocumentIdProducer).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'LineNumber': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'LineNumber') + self.LineNumber = ival_ + elif nodeName_ == 'CustomerReference': + CustomerReference_ = child_.text + CustomerReference_ = self.gds_validate_string(CustomerReference_, node, 'CustomerReference') + self.CustomerReference = CustomerReference_ + elif nodeName_ == 'DocumentProducer': + DocumentProducer_ = child_.text + DocumentProducer_ = self.gds_validate_string(DocumentProducer_, node, 'DocumentProducer') + self.DocumentProducer = DocumentProducer_ + self.validate_UploadDocumentProducerType(self.DocumentProducer) # validate type UploadDocumentProducerType + elif nodeName_ == 'DocumentType': + DocumentType_ = child_.text + DocumentType_ = self.gds_validate_string(DocumentType_, node, 'DocumentType') + self.DocumentType = DocumentType_ + self.validate_UploadDocumentType(self.DocumentType) # validate type UploadDocumentType + elif nodeName_ == 'DocumentId': + DocumentId_ = child_.text + DocumentId_ = self.gds_validate_string(DocumentId_, node, 'DocumentId') + self.DocumentId = DocumentId_ + elif nodeName_ == 'DocumentIdProducer': + DocumentIdProducer_ = child_.text + DocumentIdProducer_ = self.gds_validate_string(DocumentIdProducer_, node, 'DocumentIdProducer') + self.DocumentIdProducer = DocumentIdProducer_ + self.validate_UploadDocumentIdProducer(self.DocumentIdProducer) # validate type UploadDocumentIdProducer +# end class UploadDocumentReferenceDetail + + +class ValidateShipmentRequest(GeneratedsSuper): + """Descriptive data sent to FedEx by a customer in order to validate a + shipment.""" + subclass = None + superclass = None + def __init__(self, WebAuthenticationDetail=None, ClientDetail=None, TransactionDetail=None, Version=None, RequestedShipment=None): + self.WebAuthenticationDetail = WebAuthenticationDetail + self.ClientDetail = ClientDetail + self.TransactionDetail = TransactionDetail + self.Version = Version + self.RequestedShipment = RequestedShipment + def factory(*args_, **kwargs_): + if ValidateShipmentRequest.subclass: + return ValidateShipmentRequest.subclass(*args_, **kwargs_) + else: + return ValidateShipmentRequest(*args_, **kwargs_) + factory = staticmethod(factory) + def get_WebAuthenticationDetail(self): return self.WebAuthenticationDetail + def set_WebAuthenticationDetail(self, WebAuthenticationDetail): self.WebAuthenticationDetail = WebAuthenticationDetail + def get_ClientDetail(self): return self.ClientDetail + def set_ClientDetail(self, ClientDetail): self.ClientDetail = ClientDetail + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_RequestedShipment(self): return self.RequestedShipment + def set_RequestedShipment(self, RequestedShipment): self.RequestedShipment = RequestedShipment + def export(self, outfile, level, namespace_='ns:', name_='ValidateShipmentRequest', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ValidateShipmentRequest') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ValidateShipmentRequest'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ValidateShipmentRequest', fromsubclass_=False): + if self.WebAuthenticationDetail: + self.WebAuthenticationDetail.export(outfile, level, namespace_, name_='WebAuthenticationDetail', ) + if self.ClientDetail: + self.ClientDetail.export(outfile, level, namespace_, name_='ClientDetail', ) + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.RequestedShipment: + self.RequestedShipment.export(outfile, level, namespace_, name_='RequestedShipment', ) + def hasContent_(self): + if ( + self.WebAuthenticationDetail is not None or + self.ClientDetail is not None or + self.TransactionDetail is not None or + self.Version is not None or + self.RequestedShipment is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ValidateShipmentRequest'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.WebAuthenticationDetail is not None: + showIndent(outfile, level) + outfile.write('WebAuthenticationDetail=model_.WebAuthenticationDetail(\n') + self.WebAuthenticationDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ClientDetail is not None: + showIndent(outfile, level) + outfile.write('ClientDetail=model_.ClientDetail(\n') + self.ClientDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.RequestedShipment is not None: + showIndent(outfile, level) + outfile.write('RequestedShipment=model_.RequestedShipment(\n') + self.RequestedShipment.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'WebAuthenticationDetail': + obj_ = WebAuthenticationDetail.factory() + obj_.build(child_) + self.set_WebAuthenticationDetail(obj_) + elif nodeName_ == 'ClientDetail': + obj_ = ClientDetail.factory() + obj_.build(child_) + self.set_ClientDetail(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'RequestedShipment': + obj_ = RequestedShipment.factory() + obj_.build(child_) + self.set_RequestedShipment(obj_) +# end class ValidateShipmentRequest + + +class ValidatedHazardousCommodityContent(GeneratedsSuper): + """Documents the kind and quantity of an individual hazardous commodity + in a package.""" + subclass = None + superclass = None + def __init__(self, Description=None, Quantity=None, Options=None): + self.Description = Description + self.Quantity = Quantity + self.Options = Options + def factory(*args_, **kwargs_): + if ValidatedHazardousCommodityContent.subclass: + return ValidatedHazardousCommodityContent.subclass(*args_, **kwargs_) + else: + return ValidatedHazardousCommodityContent(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Description(self): return self.Description + def set_Description(self, Description): self.Description = Description + def get_Quantity(self): return self.Quantity + def set_Quantity(self, Quantity): self.Quantity = Quantity + def get_Options(self): return self.Options + def set_Options(self, Options): self.Options = Options + def export(self, outfile, level, namespace_='ns:', name_='ValidatedHazardousCommodityContent', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ValidatedHazardousCommodityContent') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ValidatedHazardousCommodityContent'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ValidatedHazardousCommodityContent', fromsubclass_=False): + if self.Description: + self.Description.export(outfile, level, namespace_, name_='Description') + if self.Quantity: + self.Quantity.export(outfile, level, namespace_, name_='Quantity') + if self.Options: + self.Options.export(outfile, level, namespace_, name_='Options') + def hasContent_(self): + if ( + self.Description is not None or + self.Quantity is not None or + self.Options is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ValidatedHazardousCommodityContent'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Description is not None: + showIndent(outfile, level) + outfile.write('Description=model_.ValidatedHazardousCommodityDescription(\n') + self.Description.exportLiteral(outfile, level, name_='Description') + showIndent(outfile, level) + outfile.write('),\n') + if self.Quantity is not None: + showIndent(outfile, level) + outfile.write('Quantity=model_.HazardousCommodityQuantityDetail(\n') + self.Quantity.exportLiteral(outfile, level, name_='Quantity') + showIndent(outfile, level) + outfile.write('),\n') + if self.Options is not None: + showIndent(outfile, level) + outfile.write('Options=model_.HazardousCommodityOptionDetail(\n') + self.Options.exportLiteral(outfile, level, name_='Options') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Description': + obj_ = ValidatedHazardousCommodityDescription.factory() + obj_.build(child_) + self.set_Description(obj_) + elif nodeName_ == 'Quantity': + obj_ = HazardousCommodityQuantityDetail.factory() + obj_.build(child_) + self.set_Quantity(obj_) + elif nodeName_ == 'Options': + obj_ = HazardousCommodityOptionDetail.factory() + obj_.build(child_) + self.set_Options(obj_) +# end class ValidatedHazardousCommodityContent + + +class ValidatedHazardousCommodityDescription(GeneratedsSuper): + """Identifies and describes an individual hazardous commodity. For + 201001 load, this is based on data from the FedEx Ground + Hazardous Materials Shipping Guide.""" + subclass = None + superclass = None + def __init__(self, Id=None, PackingGroup=None, ProperShippingName=None, ProperShippingNameAndDescription=None, TechnicalName=None, HazardClass=None, SubsidiaryClasses=None, Symbols=None, LabelText=None): + self.Id = Id + self.PackingGroup = PackingGroup + self.ProperShippingName = ProperShippingName + self.ProperShippingNameAndDescription = ProperShippingNameAndDescription + self.TechnicalName = TechnicalName + self.HazardClass = HazardClass + if SubsidiaryClasses is None: + self.SubsidiaryClasses = [] + else: + self.SubsidiaryClasses = SubsidiaryClasses + self.Symbols = Symbols + self.LabelText = LabelText + def factory(*args_, **kwargs_): + if ValidatedHazardousCommodityDescription.subclass: + return ValidatedHazardousCommodityDescription.subclass(*args_, **kwargs_) + else: + return ValidatedHazardousCommodityDescription(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Id(self): return self.Id + def set_Id(self, Id): self.Id = Id + def get_PackingGroup(self): return self.PackingGroup + def set_PackingGroup(self, PackingGroup): self.PackingGroup = PackingGroup + def validate_HazardousCommodityPackingGroupType(self, value): + # Validate type HazardousCommodityPackingGroupType, a restriction on xs:string. + pass + def get_ProperShippingName(self): return self.ProperShippingName + def set_ProperShippingName(self, ProperShippingName): self.ProperShippingName = ProperShippingName + def get_ProperShippingNameAndDescription(self): return self.ProperShippingNameAndDescription + def set_ProperShippingNameAndDescription(self, ProperShippingNameAndDescription): self.ProperShippingNameAndDescription = ProperShippingNameAndDescription + def get_TechnicalName(self): return self.TechnicalName + def set_TechnicalName(self, TechnicalName): self.TechnicalName = TechnicalName + def get_HazardClass(self): return self.HazardClass + def set_HazardClass(self, HazardClass): self.HazardClass = HazardClass + def get_SubsidiaryClasses(self): return self.SubsidiaryClasses + def set_SubsidiaryClasses(self, SubsidiaryClasses): self.SubsidiaryClasses = SubsidiaryClasses + def add_SubsidiaryClasses(self, value): self.SubsidiaryClasses.append(value) + def insert_SubsidiaryClasses(self, index, value): self.SubsidiaryClasses[index] = value + def get_Symbols(self): return self.Symbols + def set_Symbols(self, Symbols): self.Symbols = Symbols + def get_LabelText(self): return self.LabelText + def set_LabelText(self, LabelText): self.LabelText = LabelText + def export(self, outfile, level, namespace_='ns:', name_='ValidatedHazardousCommodityDescription', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ValidatedHazardousCommodityDescription') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ValidatedHazardousCommodityDescription'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ValidatedHazardousCommodityDescription', fromsubclass_=False): + if self.Id is not None: + showIndent(outfile, level) + outfile.write('<%sId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Id).encode(ExternalEncoding), input_name='Id'), namespace_)) + if self.PackingGroup is not None: + showIndent(outfile, level) + outfile.write('<%sPackingGroup>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PackingGroup).encode(ExternalEncoding), input_name='PackingGroup'), namespace_)) + if self.ProperShippingName is not None: + showIndent(outfile, level) + outfile.write('<%sProperShippingName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ProperShippingName).encode(ExternalEncoding), input_name='ProperShippingName'), namespace_)) + if self.ProperShippingNameAndDescription is not None: + showIndent(outfile, level) + outfile.write('<%sProperShippingNameAndDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ProperShippingNameAndDescription).encode(ExternalEncoding), input_name='ProperShippingNameAndDescription'), namespace_)) + if self.TechnicalName is not None: + showIndent(outfile, level) + outfile.write('<%sTechnicalName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.TechnicalName).encode(ExternalEncoding), input_name='TechnicalName'), namespace_)) + if self.HazardClass is not None: + showIndent(outfile, level) + outfile.write('<%sHazardClass>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HazardClass).encode(ExternalEncoding), input_name='HazardClass'), namespace_)) + for SubsidiaryClasses_ in self.SubsidiaryClasses: + showIndent(outfile, level) + outfile.write('<%sSubsidiaryClasses>%s\n' % (namespace_, self.gds_format_string(quote_xml(SubsidiaryClasses_).encode(ExternalEncoding), input_name='SubsidiaryClasses'), namespace_)) + if self.Symbols is not None: + showIndent(outfile, level) + outfile.write('<%sSymbols>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Symbols).encode(ExternalEncoding), input_name='Symbols'), namespace_)) + if self.LabelText is not None: + showIndent(outfile, level) + outfile.write('<%sLabelText>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LabelText).encode(ExternalEncoding), input_name='LabelText'), namespace_)) + def hasContent_(self): + if ( + self.Id is not None or + self.PackingGroup is not None or + self.ProperShippingName is not None or + self.ProperShippingNameAndDescription is not None or + self.TechnicalName is not None or + self.HazardClass is not None or + self.SubsidiaryClasses or + self.Symbols is not None or + self.LabelText is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ValidatedHazardousCommodityDescription'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Id is not None: + showIndent(outfile, level) + outfile.write('Id=%s,\n' % quote_python(self.Id).encode(ExternalEncoding)) + if self.PackingGroup is not None: + showIndent(outfile, level) + outfile.write('PackingGroup=%s,\n' % quote_python(self.PackingGroup).encode(ExternalEncoding)) + if self.ProperShippingName is not None: + showIndent(outfile, level) + outfile.write('ProperShippingName=%s,\n' % quote_python(self.ProperShippingName).encode(ExternalEncoding)) + if self.ProperShippingNameAndDescription is not None: + showIndent(outfile, level) + outfile.write('ProperShippingNameAndDescription=%s,\n' % quote_python(self.ProperShippingNameAndDescription).encode(ExternalEncoding)) + if self.TechnicalName is not None: + showIndent(outfile, level) + outfile.write('TechnicalName=%s,\n' % quote_python(self.TechnicalName).encode(ExternalEncoding)) + if self.HazardClass is not None: + showIndent(outfile, level) + outfile.write('HazardClass=%s,\n' % quote_python(self.HazardClass).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('SubsidiaryClasses=[\n') + level += 1 + for SubsidiaryClasses_ in self.SubsidiaryClasses: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(SubsidiaryClasses_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.Symbols is not None: + showIndent(outfile, level) + outfile.write('Symbols=%s,\n' % quote_python(self.Symbols).encode(ExternalEncoding)) + if self.LabelText is not None: + showIndent(outfile, level) + outfile.write('LabelText=%s,\n' % quote_python(self.LabelText).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Id': + Id_ = child_.text + Id_ = self.gds_validate_string(Id_, node, 'Id') + self.Id = Id_ + elif nodeName_ == 'PackingGroup': + PackingGroup_ = child_.text + PackingGroup_ = self.gds_validate_string(PackingGroup_, node, 'PackingGroup') + self.PackingGroup = PackingGroup_ + self.validate_HazardousCommodityPackingGroupType(self.PackingGroup) # validate type HazardousCommodityPackingGroupType + elif nodeName_ == 'ProperShippingName': + ProperShippingName_ = child_.text + ProperShippingName_ = self.gds_validate_string(ProperShippingName_, node, 'ProperShippingName') + self.ProperShippingName = ProperShippingName_ + elif nodeName_ == 'ProperShippingNameAndDescription': + ProperShippingNameAndDescription_ = child_.text + ProperShippingNameAndDescription_ = self.gds_validate_string(ProperShippingNameAndDescription_, node, 'ProperShippingNameAndDescription') + self.ProperShippingNameAndDescription = ProperShippingNameAndDescription_ + elif nodeName_ == 'TechnicalName': + TechnicalName_ = child_.text + TechnicalName_ = self.gds_validate_string(TechnicalName_, node, 'TechnicalName') + self.TechnicalName = TechnicalName_ + elif nodeName_ == 'HazardClass': + HazardClass_ = child_.text + HazardClass_ = self.gds_validate_string(HazardClass_, node, 'HazardClass') + self.HazardClass = HazardClass_ + elif nodeName_ == 'SubsidiaryClasses': + SubsidiaryClasses_ = child_.text + SubsidiaryClasses_ = self.gds_validate_string(SubsidiaryClasses_, node, 'SubsidiaryClasses') + self.SubsidiaryClasses.append(SubsidiaryClasses_) + elif nodeName_ == 'Symbols': + Symbols_ = child_.text + Symbols_ = self.gds_validate_string(Symbols_, node, 'Symbols') + self.Symbols = Symbols_ + elif nodeName_ == 'LabelText': + LabelText_ = child_.text + LabelText_ = self.gds_validate_string(LabelText_, node, 'LabelText') + self.LabelText = LabelText_ +# end class ValidatedHazardousCommodityDescription + + +class VariableHandlingChargeDetail(GeneratedsSuper): + """Details about how to calculate variable handling charges at the + shipment level.""" + subclass = None + superclass = None + def __init__(self, FixedValue=None, PercentValue=None, RateElementBasis=None, RateTypeBasis=None): + self.FixedValue = FixedValue + self.PercentValue = PercentValue + self.RateElementBasis = RateElementBasis + self.RateTypeBasis = RateTypeBasis + def factory(*args_, **kwargs_): + if VariableHandlingChargeDetail.subclass: + return VariableHandlingChargeDetail.subclass(*args_, **kwargs_) + else: + return VariableHandlingChargeDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_FixedValue(self): return self.FixedValue + def set_FixedValue(self, FixedValue): self.FixedValue = FixedValue + def get_PercentValue(self): return self.PercentValue + def set_PercentValue(self, PercentValue): self.PercentValue = PercentValue + def get_RateElementBasis(self): return self.RateElementBasis + def set_RateElementBasis(self, RateElementBasis): self.RateElementBasis = RateElementBasis + def validate_RateElementBasisType(self, value): + # Validate type RateElementBasisType, a restriction on xs:string. + pass + def get_RateTypeBasis(self): return self.RateTypeBasis + def set_RateTypeBasis(self, RateTypeBasis): self.RateTypeBasis = RateTypeBasis + def validate_RateTypeBasisType(self, value): + # Validate type RateTypeBasisType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='VariableHandlingChargeDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='VariableHandlingChargeDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='VariableHandlingChargeDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='VariableHandlingChargeDetail', fromsubclass_=False): + if self.FixedValue: + self.FixedValue.export(outfile, level, namespace_, name_='FixedValue') + if self.PercentValue is not None: + showIndent(outfile, level) + outfile.write('<%sPercentValue>%s\n' % (namespace_, self.gds_format_float(self.PercentValue, input_name='PercentValue'), namespace_)) + if self.RateElementBasis is not None: + showIndent(outfile, level) + outfile.write('<%sRateElementBasis>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RateElementBasis).encode(ExternalEncoding), input_name='RateElementBasis'), namespace_)) + if self.RateTypeBasis is not None: + showIndent(outfile, level) + outfile.write('<%sRateTypeBasis>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RateTypeBasis).encode(ExternalEncoding), input_name='RateTypeBasis'), namespace_)) + def hasContent_(self): + if ( + self.FixedValue is not None or + self.PercentValue is not None or + self.RateElementBasis is not None or + self.RateTypeBasis is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='VariableHandlingChargeDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.FixedValue is not None: + showIndent(outfile, level) + outfile.write('FixedValue=model_.Money(\n') + self.FixedValue.exportLiteral(outfile, level, name_='FixedValue') + showIndent(outfile, level) + outfile.write('),\n') + if self.PercentValue is not None: + showIndent(outfile, level) + outfile.write('PercentValue=%f,\n' % self.PercentValue) + if self.RateElementBasis is not None: + showIndent(outfile, level) + outfile.write('RateElementBasis=%s,\n' % quote_python(self.RateElementBasis).encode(ExternalEncoding)) + if self.RateTypeBasis is not None: + showIndent(outfile, level) + outfile.write('RateTypeBasis=%s,\n' % quote_python(self.RateTypeBasis).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'FixedValue': + obj_ = Money.factory() + obj_.build(child_) + self.set_FixedValue(obj_) + elif nodeName_ == 'PercentValue': + sval_ = child_.text + try: + fval_ = float(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires float or double: %s' % exp) + fval_ = self.gds_validate_float(fval_, node, 'PercentValue') + self.PercentValue = fval_ + elif nodeName_ == 'RateElementBasis': + RateElementBasis_ = child_.text + RateElementBasis_ = self.gds_validate_string(RateElementBasis_, node, 'RateElementBasis') + self.RateElementBasis = RateElementBasis_ + self.validate_RateElementBasisType(self.RateElementBasis) # validate type RateElementBasisType + elif nodeName_ == 'RateTypeBasis': + RateTypeBasis_ = child_.text + RateTypeBasis_ = self.gds_validate_string(RateTypeBasis_, node, 'RateTypeBasis') + self.RateTypeBasis = RateTypeBasis_ + self.validate_RateTypeBasisType(self.RateTypeBasis) # validate type RateTypeBasisType +# end class VariableHandlingChargeDetail + + +class VariableHandlingCharges(GeneratedsSuper): + """The variable handling charges calculated based on the type variable + handling charges requested.""" + subclass = None + superclass = None + def __init__(self, VariableHandlingCharge=None, TotalCustomerCharge=None): + self.VariableHandlingCharge = VariableHandlingCharge + self.TotalCustomerCharge = TotalCustomerCharge + def factory(*args_, **kwargs_): + if VariableHandlingCharges.subclass: + return VariableHandlingCharges.subclass(*args_, **kwargs_) + else: + return VariableHandlingCharges(*args_, **kwargs_) + factory = staticmethod(factory) + def get_VariableHandlingCharge(self): return self.VariableHandlingCharge + def set_VariableHandlingCharge(self, VariableHandlingCharge): self.VariableHandlingCharge = VariableHandlingCharge + def get_TotalCustomerCharge(self): return self.TotalCustomerCharge + def set_TotalCustomerCharge(self, TotalCustomerCharge): self.TotalCustomerCharge = TotalCustomerCharge + def export(self, outfile, level, namespace_='ns:', name_='VariableHandlingCharges', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='VariableHandlingCharges') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='VariableHandlingCharges'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='VariableHandlingCharges', fromsubclass_=False): + if self.VariableHandlingCharge: + self.VariableHandlingCharge.export(outfile, level, namespace_, name_='VariableHandlingCharge') + if self.TotalCustomerCharge: + self.TotalCustomerCharge.export(outfile, level, namespace_, name_='TotalCustomerCharge') + def hasContent_(self): + if ( + self.VariableHandlingCharge is not None or + self.TotalCustomerCharge is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='VariableHandlingCharges'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.VariableHandlingCharge is not None: + showIndent(outfile, level) + outfile.write('VariableHandlingCharge=model_.Money(\n') + self.VariableHandlingCharge.exportLiteral(outfile, level, name_='VariableHandlingCharge') + showIndent(outfile, level) + outfile.write('),\n') + if self.TotalCustomerCharge is not None: + showIndent(outfile, level) + outfile.write('TotalCustomerCharge=model_.Money(\n') + self.TotalCustomerCharge.exportLiteral(outfile, level, name_='TotalCustomerCharge') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'VariableHandlingCharge': + obj_ = Money.factory() + obj_.build(child_) + self.set_VariableHandlingCharge(obj_) + elif nodeName_ == 'TotalCustomerCharge': + obj_ = Money.factory() + obj_.build(child_) + self.set_TotalCustomerCharge(obj_) +# end class VariableHandlingCharges + + +class Volume(GeneratedsSuper): + """Three-dimensional volume/cubic measurement.""" + subclass = None + superclass = None + def __init__(self, Units=None, Value=None): + self.Units = Units + self.Value = Value + def factory(*args_, **kwargs_): + if Volume.subclass: + return Volume.subclass(*args_, **kwargs_) + else: + return Volume(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Units(self): return self.Units + def set_Units(self, Units): self.Units = Units + def validate_VolumeUnits(self, value): + # Validate type VolumeUnits, a restriction on xs:string. + pass + def get_Value(self): return self.Value + def set_Value(self, Value): self.Value = Value + def export(self, outfile, level, namespace_='ns:', name_='Volume', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Volume') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Volume'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Volume', fromsubclass_=False): + if self.Units is not None: + showIndent(outfile, level) + outfile.write('<%sUnits>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Units).encode(ExternalEncoding), input_name='Units'), namespace_)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('<%sValue>%s\n' % (namespace_, self.gds_format_float(self.Value, input_name='Value'), namespace_)) + def hasContent_(self): + if ( + self.Units is not None or + self.Value is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Volume'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Units is not None: + showIndent(outfile, level) + outfile.write('Units=%s,\n' % quote_python(self.Units).encode(ExternalEncoding)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('Value=%f,\n' % self.Value) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Units': + Units_ = child_.text + Units_ = self.gds_validate_string(Units_, node, 'Units') + self.Units = Units_ + self.validate_VolumeUnits(self.Units) # validate type VolumeUnits + elif nodeName_ == 'Value': + sval_ = child_.text + try: + fval_ = float(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires float or double: %s' % exp) + fval_ = self.gds_validate_float(fval_, node, 'Value') + self.Value = fval_ +# end class Volume + + +class Weight(GeneratedsSuper): + """The descriptive data for the heaviness of an object.""" + subclass = None + superclass = None + def __init__(self, Units=None, Value=None): + self.Units = Units + self.Value = Value + def factory(*args_, **kwargs_): + if Weight.subclass: + return Weight.subclass(*args_, **kwargs_) + else: + return Weight(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Units(self): return self.Units + def set_Units(self, Units): self.Units = Units + def validate_WeightUnits(self, value): + # Validate type WeightUnits, a restriction on xs:string. + pass + def get_Value(self): return self.Value + def set_Value(self, Value): self.Value = Value + def export(self, outfile, level, namespace_='ns:', name_='Weight', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Weight') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Weight'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Weight', fromsubclass_=False): + if self.Units is not None: + showIndent(outfile, level) + outfile.write('<%sUnits>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Units).encode(ExternalEncoding), input_name='Units'), namespace_)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('<%sValue>%s\n' % (namespace_, self.gds_format_float(self.Value, input_name='Value'), namespace_)) + def hasContent_(self): + if ( + self.Units is not None or + self.Value is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Weight'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Units is not None: + showIndent(outfile, level) + outfile.write('Units=%s,\n' % quote_python(self.Units).encode(ExternalEncoding)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('Value=%f,\n' % self.Value) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Units': + Units_ = child_.text + Units_ = self.gds_validate_string(Units_, node, 'Units') + self.Units = Units_ + self.validate_WeightUnits(self.Units) # validate type WeightUnits + elif nodeName_ == 'Value': + sval_ = child_.text + try: + fval_ = float(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires float or double: %s' % exp) + fval_ = self.gds_validate_float(fval_, node, 'Value') + self.Value = fval_ +# end class Weight + + +class WebAuthenticationDetail(GeneratedsSuper): + """Used in authentication of the sender's identity.""" + subclass = None + superclass = None + def __init__(self, UserCredential=None): + self.UserCredential = UserCredential + def factory(*args_, **kwargs_): + if WebAuthenticationDetail.subclass: + return WebAuthenticationDetail.subclass(*args_, **kwargs_) + else: + return WebAuthenticationDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_UserCredential(self): return self.UserCredential + def set_UserCredential(self, UserCredential): self.UserCredential = UserCredential + def export(self, outfile, level, namespace_='ns:', name_='WebAuthenticationDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='WebAuthenticationDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='WebAuthenticationDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='WebAuthenticationDetail', fromsubclass_=False): + if self.UserCredential: + self.UserCredential.export(outfile, level, namespace_, name_='UserCredential', ) + def hasContent_(self): + if ( + self.UserCredential is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='WebAuthenticationDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.UserCredential is not None: + showIndent(outfile, level) + outfile.write('UserCredential=model_.WebAuthenticationCredential(\n') + self.UserCredential.exportLiteral(outfile, level, name_='UserCredential') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'UserCredential': + obj_ = WebAuthenticationCredential.factory() + obj_.build(child_) + self.set_UserCredential(obj_) +# end class WebAuthenticationDetail + + +class WebAuthenticationCredential(GeneratedsSuper): + """Two part authentication string used for the sender's identity""" + subclass = None + superclass = None + def __init__(self, Key=None, Password=None): + self.Key = Key + self.Password = Password + def factory(*args_, **kwargs_): + if WebAuthenticationCredential.subclass: + return WebAuthenticationCredential.subclass(*args_, **kwargs_) + else: + return WebAuthenticationCredential(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Key(self): return self.Key + def set_Key(self, Key): self.Key = Key + def get_Password(self): return self.Password + def set_Password(self, Password): self.Password = Password + def export(self, outfile, level, namespace_='ns:', name_='WebAuthenticationCredential', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='WebAuthenticationCredential') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='WebAuthenticationCredential'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='WebAuthenticationCredential', fromsubclass_=False): + if self.Key is not None: + showIndent(outfile, level) + outfile.write('<%sKey>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Key).encode(ExternalEncoding), input_name='Key'), namespace_)) + if self.Password is not None: + showIndent(outfile, level) + outfile.write('<%sPassword>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Password).encode(ExternalEncoding), input_name='Password'), namespace_)) + def hasContent_(self): + if ( + self.Key is not None or + self.Password is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='WebAuthenticationCredential'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Key is not None: + showIndent(outfile, level) + outfile.write('Key=%s,\n' % quote_python(self.Key).encode(ExternalEncoding)) + if self.Password is not None: + showIndent(outfile, level) + outfile.write('Password=%s,\n' % quote_python(self.Password).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Key': + Key_ = child_.text + Key_ = self.gds_validate_string(Key_, node, 'Key') + self.Key = Key_ + elif nodeName_ == 'Password': + Password_ = child_.text + Password_ = self.gds_validate_string(Password_, node, 'Password') + self.Password = Password_ +# end class WebAuthenticationCredential + + +class VersionId(GeneratedsSuper): + """Identifies the version/level of a service operation expected by a + caller (in each request) and performed by the callee (in each + reply).""" + subclass = None + superclass = None + def __init__(self, ServiceId=None, Major=None, Intermediate=None, Minor=None): + self.ServiceId = ServiceId + self.Major = Major + self.Intermediate = Intermediate + self.Minor = Minor + def factory(*args_, **kwargs_): + if VersionId.subclass: + return VersionId.subclass(*args_, **kwargs_) + else: + return VersionId(*args_, **kwargs_) + factory = staticmethod(factory) + def get_ServiceId(self): return self.ServiceId + def set_ServiceId(self, ServiceId): self.ServiceId = ServiceId + def get_Major(self): return self.Major + def set_Major(self, Major): self.Major = Major + def get_Intermediate(self): return self.Intermediate + def set_Intermediate(self, Intermediate): self.Intermediate = Intermediate + def get_Minor(self): return self.Minor + def set_Minor(self, Minor): self.Minor = Minor + def export(self, outfile, level, namespace_='ns:', name_='VersionId', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='VersionId') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='VersionId'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='VersionId', fromsubclass_=False): + if self.ServiceId is not None: + showIndent(outfile, level) + outfile.write('<%sServiceId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ServiceId).encode(ExternalEncoding), input_name='ServiceId'), namespace_)) + if self.Major is not None: + showIndent(outfile, level) + outfile.write('<%sMajor>%s\n' % (namespace_, self.gds_format_integer(self.Major, input_name='Major'), namespace_)) + if self.Intermediate is not None: + showIndent(outfile, level) + outfile.write('<%sIntermediate>%s\n' % (namespace_, self.gds_format_integer(self.Intermediate, input_name='Intermediate'), namespace_)) + if self.Minor is not None: + showIndent(outfile, level) + outfile.write('<%sMinor>%s\n' % (namespace_, self.gds_format_integer(self.Minor, input_name='Minor'), namespace_)) + def hasContent_(self): + if ( + self.ServiceId is not None or + self.Major is not None or + self.Intermediate is not None or + self.Minor is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='VersionId'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.ServiceId is not None: + showIndent(outfile, level) + outfile.write('ServiceId=%s,\n' % quote_python(self.ServiceId).encode(ExternalEncoding)) + if self.Major is not None: + showIndent(outfile, level) + outfile.write('Major=%d,\n' % self.Major) + if self.Intermediate is not None: + showIndent(outfile, level) + outfile.write('Intermediate=%d,\n' % self.Intermediate) + if self.Minor is not None: + showIndent(outfile, level) + outfile.write('Minor=%d,\n' % self.Minor) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'ServiceId': + ServiceId_ = child_.text + ServiceId_ = self.gds_validate_string(ServiceId_, node, 'ServiceId') + self.ServiceId = ServiceId_ + elif nodeName_ == 'Major': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'Major') + self.Major = ival_ + elif nodeName_ == 'Intermediate': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'Intermediate') + self.Intermediate = ival_ + elif nodeName_ == 'Minor': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'Minor') + self.Minor = ival_ +# end class VersionId + + +USAGE_TEXT = """ +Usage: python .py [ -s ] +""" + +def usage(): + print USAGE_TEXT + sys.exit(1) + + +def get_root_tag(node): + tag = Tag_pattern_.match(node.tag).groups()[-1] + rootClass = globals().get(tag) + return tag, rootClass + + +def parse(inFileName): + doc = parsexml_(inFileName) + rootNode = doc.getroot() + rootTag, rootClass = get_root_tag(rootNode) + if rootClass is None: + rootTag = 'CancelPendingShipmentReply' + rootClass = CancelPendingShipmentReply + rootObj = rootClass.factory() + rootObj.build(rootNode) + # Enable Python to collect the space used by the DOM. + doc = None + sys.stdout.write('\n') + rootObj.export(sys.stdout, 0, name_=rootTag, + namespacedef_='') + return rootObj + + +def parseString(inString): + from StringIO import StringIO + doc = parsexml_(StringIO(inString)) + rootNode = doc.getroot() + rootTag, rootClass = get_root_tag(rootNode) + if rootClass is None: + rootTag = 'CancelPendingShipmentReply' + rootClass = CancelPendingShipmentReply + rootObj = rootClass.factory() + rootObj.build(rootNode) + # Enable Python to collect the space used by the DOM. + doc = None + sys.stdout.write('\n') + rootObj.export(sys.stdout, 0, name_="CancelPendingShipmentReply", + namespacedef_='') + return rootObj + + +def parseLiteral(inFileName): + doc = parsexml_(inFileName) + rootNode = doc.getroot() + rootTag, rootClass = get_root_tag(rootNode) + if rootClass is None: + rootTag = 'CancelPendingShipmentReply' + rootClass = CancelPendingShipmentReply + rootObj = rootClass.factory() + rootObj.build(rootNode) + # Enable Python to collect the space used by the DOM. + doc = None + sys.stdout.write('#from ship import *\n\n') + sys.stdout.write('import ship as model_\n\n') + sys.stdout.write('rootObj = model_.rootTag(\n') + rootObj.exportLiteral(sys.stdout, 0, name_=rootTag) + sys.stdout.write(')\n') + return rootObj + + +def main(): + args = sys.argv[1:] + if len(args) == 1: + parse(args[0]) + else: + usage() + + +if __name__ == '__main__': + #import pdb; pdb.set_trace() + main() + + +__all__ = [ + "AdditionalLabelsDetail", + "Address", + "BinaryBarcode", + "CancelPendingShipmentReply", + "CancelPendingShipmentRequest", + "CertificateOfOriginDetail", + "ClientDetail", + "CodAddTransportationChargesDetail", + "CodDetail", + "CodReturnPackageDetail", + "CodReturnShipmentDetail", + "CommercialInvoice", + "CommercialInvoiceDetail", + "Commodity", + "CompletedEtdDetail", + "CompletedHoldAtLocationDetail", + "CompletedPackageDetail", + "CompletedShipmentDetail", + "CompletedSmartPostDetail", + "CompletedTagDetail", + "ConfigurableLabelReferenceEntry", + "Contact", + "ContactAndAddress", + "ContentRecord", + "CreatePendingShipmentReply", + "CreatePendingShipmentRequest", + "CurrencyExchangeRate", + "CustomDeliveryWindowDetail", + "CustomDocumentDetail", + "CustomLabelBarcodeEntry", + "CustomLabelBoxEntry", + "CustomLabelDetail", + "CustomLabelGraphicEntry", + "CustomLabelPosition", + "CustomLabelTextEntry", + "CustomerImageUsage", + "CustomerReference", + "CustomerSpecifiedLabelDetail", + "CustomsClearanceDetail", + "DangerousGoodsDetail", + "DateRange", + "DeleteShipmentRequest", + "DeleteTagRequest", + "DestinationControlDetail", + "Dimensions", + "DocTabContent", + "DocTabContentBarcoded", + "DocTabContentZone001", + "DocTabZoneSpecification", + "EMailLabelDetail", + "EMailNotificationDetail", + "EMailNotificationRecipient", + "EdtCommodityTax", + "EdtExciseCondition", + "EdtTaxDetail", + "EtdDetail", + "ExportDetail", + "ExpressFreightDetail", + "FreightAddressLabelDetail", + "FreightBaseCharge", + "FreightGuaranteeDetail", + "FreightRateDetail", + "FreightRateNotation", + "FreightShipmentDetail", + "FreightShipmentLineItem", + "FreightSpecialServicePayment", + "GeneralAgencyAgreementDetail", + "HazardousCommodityContent", + "HazardousCommodityDescription", + "HazardousCommodityOptionDetail", + "HazardousCommodityPackagingDetail", + "HazardousCommodityQuantityDetail", + "HoldAtLocationDetail", + "HomeDeliveryPremiumDetail", + "LabelSpecification", + "LiabilityCoverageDetail", + "LinearMeasure", + "Localization", + "Measure", + "Money", + "NaftaCertificateOfOriginDetail", + "NaftaCommodityDetail", + "NaftaProducer", + "Notification", + "NotificationParameter", + "Op900Detail", + "OperationalInstruction", + "PackageBarcodes", + "PackageOperationalDetail", + "PackageRateDetail", + "PackageRating", + "PackageSpecialServicesRequested", + "Party", + "Payment", + "Payor", + "PendingShipmentAccessDetail", + "PendingShipmentDetail", + "PickupDetail", + "PrintedReference", + "PriorityAlertDetail", + "ProcessShipmentReply", + "ProcessShipmentRequest", + "ProcessTagReply", + "ProcessTagRequest", + "RateDiscount", + "Rebate", + "RecipientCustomsId", + "RequestedPackageLineItem", + "RequestedShipment", + "ReturnEMailDetail", + "ReturnShipmentDetail", + "Rma", + "ShipmentDryIceDetail", + "ShipmentLegRateDetail", + "ShipmentOperationalDetail", + "ShipmentRateDetail", + "ShipmentRating", + "ShipmentReply", + "ShipmentSpecialServicesRequested", + "ShippingDocument", + "ShippingDocumentDispositionDetail", + "ShippingDocumentEMailDetail", + "ShippingDocumentEMailRecipient", + "ShippingDocumentFormat", + "ShippingDocumentPart", + "ShippingDocumentPrintDetail", + "ShippingDocumentSpecification", + "SignatureOptionDetail", + "SmartPostShipmentDetail", + "StringBarcode", + "Surcharge", + "Tax", + "TaxpayerIdentification", + "TrackingId", + "TransactionDetail", + "UploadDocumentReferenceDetail", + "ValidateShipmentRequest", + "ValidatedHazardousCommodityContent", + "ValidatedHazardousCommodityDescription", + "VariableHandlingChargeDetail", + "VariableHandlingCharges", + "VersionId", + "Volume", + "WebAuthenticationCredential", + "WebAuthenticationDetail", + "Weight" + ] diff --git a/webxml/fedex/track.py b/webxml/fedex/track.py new file mode 100644 index 0000000..bae769a --- /dev/null +++ b/webxml/fedex/track.py @@ -0,0 +1,5470 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# +# Generated Mon Nov 28 15:45:03 2011 by generateDS.py version 2.6a. +# + +import sys +import getopt +import re as re_ + +etree_ = None +Verbose_import_ = False +( XMLParser_import_none, XMLParser_import_lxml, + XMLParser_import_elementtree + ) = range(3) +XMLParser_import_library = None +try: + # lxml + from lxml import etree as etree_ + XMLParser_import_library = XMLParser_import_lxml + if Verbose_import_: + print("running with lxml.etree") +except ImportError: + try: + # cElementTree from Python 2.5+ + import xml.etree.cElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with cElementTree on Python 2.5+") + except ImportError: + try: + # ElementTree from Python 2.5+ + import xml.etree.ElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with ElementTree on Python 2.5+") + except ImportError: + try: + # normal cElementTree install + import cElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with cElementTree") + except ImportError: + try: + # normal ElementTree install + import elementtree.ElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with ElementTree") + except ImportError: + raise ImportError("Failed to import ElementTree from any known place") + +def parsexml_(*args, **kwargs): + if (XMLParser_import_library == XMLParser_import_lxml and + 'parser' not in kwargs): + # Use the lxml ElementTree compatible parser so that, e.g., + # we ignore comments. + kwargs['parser'] = etree_.ETCompatXMLParser() + doc = etree_.parse(*args, **kwargs) + return doc + +# +# User methods +# +# Calls to the methods in these classes are generated by generateDS.py. +# You can replace these methods by re-implementing the following class +# in a module named generatedssuper.py. + +try: + from generatedssuper import GeneratedsSuper +except ImportError, exp: + + class GeneratedsSuper(object): + def gds_format_string(self, input_data, input_name=''): + return input_data + def gds_validate_string(self, input_data, node, input_name=''): + return input_data + def gds_format_integer(self, input_data, input_name=''): + return '%d' % input_data + def gds_validate_integer(self, input_data, node, input_name=''): + return input_data + def gds_format_integer_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_integer_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + try: + fvalue = float(value) + except (TypeError, ValueError), exp: + raise_parse_error(node, 'Requires sequence of integers') + return input_data + def gds_format_float(self, input_data, input_name=''): + return '%f' % input_data + def gds_validate_float(self, input_data, node, input_name=''): + return input_data + def gds_format_float_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_float_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + try: + fvalue = float(value) + except (TypeError, ValueError), exp: + raise_parse_error(node, 'Requires sequence of floats') + return input_data + def gds_format_double(self, input_data, input_name=''): + return '%e' % input_data + def gds_validate_double(self, input_data, node, input_name=''): + return input_data + def gds_format_double_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_double_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + try: + fvalue = float(value) + except (TypeError, ValueError), exp: + raise_parse_error(node, 'Requires sequence of doubles') + return input_data + def gds_format_boolean(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_boolean(self, input_data, node, input_name=''): + return input_data + def gds_format_boolean_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_boolean_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + if value not in ('true', '1', 'false', '0', ): + raise_parse_error(node, 'Requires sequence of booleans ("true", "1", "false", "0")') + return input_data + def gds_str_lower(self, instring): + return instring.lower() + def get_path_(self, node): + path_list = [] + self.get_path_list_(node, path_list) + path_list.reverse() + path = '/'.join(path_list) + return path + Tag_strip_pattern_ = re_.compile(r'\{.*\}') + def get_path_list_(self, node, path_list): + if node is None: + return + tag = GeneratedsSuper.Tag_strip_pattern_.sub('', node.tag) + if tag: + path_list.append(tag) + self.get_path_list_(node.getparent(), path_list) + def get_class_obj_(self, node, default_class=None): + class_obj1 = default_class + if 'xsi' in node.nsmap: + classname = node.get('{%s}type' % node.nsmap['xsi']) + if classname is not None: + names = classname.split(':') + if len(names) == 2: + classname = names[1] + class_obj2 = globals().get(classname) + if class_obj2 is not None: + class_obj1 = class_obj2 + return class_obj1 + + +# +# If you have installed IPython you can uncomment and use the following. +# IPython is available from http://ipython.scipy.org/. +# + +## from IPython.Shell import IPShellEmbed +## args = '' +## ipshell = IPShellEmbed(args, +## banner = 'Dropping into IPython', +## exit_msg = 'Leaving Interpreter, back to program.') + +# Then use the following line where and when you want to drop into the +# IPython shell: +# ipshell(' -- Entering ipshell.\nHit Ctrl-D to exit') + +# +# Globals +# + +ExternalEncoding = 'ascii' +Tag_pattern_ = re_.compile(r'({.*})?(.*)') +String_cleanup_pat_ = re_.compile(r"[\n\r\s]+") +Namespace_extract_pat_ = re_.compile(r'{(.*)}(.*)') + +# +# Support/utility functions. +# + +def showIndent(outfile, level): + for idx in range(level): + outfile.write(' ') + +def quote_xml(inStr): + if not inStr: + return '' + s1 = (isinstance(inStr, basestring) and inStr or + '%s' % inStr) + s1 = s1.replace('&', '&') + s1 = s1.replace('<', '<') + s1 = s1.replace('>', '>') + return s1 + +def quote_attrib(inStr): + s1 = (isinstance(inStr, basestring) and inStr or + '%s' % inStr) + s1 = s1.replace('&', '&') + s1 = s1.replace('<', '<') + s1 = s1.replace('>', '>') + if '"' in s1: + if "'" in s1: + s1 = '"%s"' % s1.replace('"', """) + else: + s1 = "'%s'" % s1 + else: + s1 = '"%s"' % s1 + return s1 + +def quote_python(inStr): + s1 = inStr + if s1.find("'") == -1: + if s1.find('\n') == -1: + return "'%s'" % s1 + else: + return "'''%s'''" % s1 + else: + if s1.find('"') != -1: + s1 = s1.replace('"', '\\"') + if s1.find('\n') == -1: + return '"%s"' % s1 + else: + return '"""%s"""' % s1 + +def get_all_text_(node): + if node.text is not None: + text = node.text + else: + text = '' + for child in node: + if child.tail is not None: + text += child.tail + return text + +def find_attr_value_(attr_name, node): + attrs = node.attrib + attr_parts = attr_name.split(':') + value = None + if len(attr_parts) == 1: + value = attrs.get(attr_name) + elif len(attr_parts) == 2: + prefix, name = attr_parts + namespace = node.nsmap.get(prefix) + if namespace is not None: + value = attrs.get('{%s}%s' % (namespace, name, )) + return value + + +class GDSParseError(Exception): + pass + +def raise_parse_error(node, msg): + if XMLParser_import_library == XMLParser_import_lxml: + msg = '%s (element %s/line %d)' % (msg, node.tag, node.sourceline, ) + else: + msg = '%s (element %s)' % (msg, node.tag, ) + raise GDSParseError(msg) + + +class MixedContainer: + # Constants for category: + CategoryNone = 0 + CategoryText = 1 + CategorySimple = 2 + CategoryComplex = 3 + # Constants for content_type: + TypeNone = 0 + TypeText = 1 + TypeString = 2 + TypeInteger = 3 + TypeFloat = 4 + TypeDecimal = 5 + TypeDouble = 6 + TypeBoolean = 7 + def __init__(self, category, content_type, name, value): + self.category = category + self.content_type = content_type + self.name = name + self.value = value + def getCategory(self): + return self.category + def getContenttype(self, content_type): + return self.content_type + def getValue(self): + return self.value + def getName(self): + return self.name + def export(self, outfile, level, name, namespace): + if self.category == MixedContainer.CategoryText: + # Prevent exporting empty content as empty lines. + if self.value.strip(): + outfile.write(self.value) + elif self.category == MixedContainer.CategorySimple: + self.exportSimple(outfile, level, name) + else: # category == MixedContainer.CategoryComplex + self.value.export(outfile, level, namespace,name) + def exportSimple(self, outfile, level, name): + if self.content_type == MixedContainer.TypeString: + outfile.write('<%s>%s' % (self.name, self.value, self.name)) + elif self.content_type == MixedContainer.TypeInteger or \ + self.content_type == MixedContainer.TypeBoolean: + outfile.write('<%s>%d' % (self.name, self.value, self.name)) + elif self.content_type == MixedContainer.TypeFloat or \ + self.content_type == MixedContainer.TypeDecimal: + outfile.write('<%s>%f' % (self.name, self.value, self.name)) + elif self.content_type == MixedContainer.TypeDouble: + outfile.write('<%s>%g' % (self.name, self.value, self.name)) + def exportLiteral(self, outfile, level, name): + if self.category == MixedContainer.CategoryText: + showIndent(outfile, level) + outfile.write('model_.MixedContainer(%d, %d, "%s", "%s"),\n' % \ + (self.category, self.content_type, self.name, self.value)) + elif self.category == MixedContainer.CategorySimple: + showIndent(outfile, level) + outfile.write('model_.MixedContainer(%d, %d, "%s", "%s"),\n' % \ + (self.category, self.content_type, self.name, self.value)) + else: # category == MixedContainer.CategoryComplex + showIndent(outfile, level) + outfile.write('model_.MixedContainer(%d, %d, "%s",\n' % \ + (self.category, self.content_type, self.name,)) + self.value.exportLiteral(outfile, level + 1) + showIndent(outfile, level) + outfile.write(')\n') + + +class MemberSpec_(object): + def __init__(self, name='', data_type='', container=0): + self.name = name + self.data_type = data_type + self.container = container + def set_name(self, name): self.name = name + def get_name(self): return self.name + def set_data_type(self, data_type): self.data_type = data_type + def get_data_type_chain(self): return self.data_type + def get_data_type(self): + if isinstance(self.data_type, list): + if len(self.data_type) > 0: + return self.data_type[-1] + else: + return 'xs:string' + else: + return self.data_type + def set_container(self, container): self.container = container + def get_container(self): return self.container + +def _cast(typ, value): + if typ is None or value is None: + return value + return typ(value) + +# +# Data representation classes. +# + +class Address(GeneratedsSuper): + """Descriptive data for a physical location. May be used as an actual + physical address (place to which one could go), or as a + container of "address parts" which should be handled as a unit + (such as a city-state-ZIP combination within the US).""" + subclass = None + superclass = None + def __init__(self, StreetLines=None, City=None, StateOrProvinceCode=None, PostalCode=None, UrbanizationCode=None, CountryCode=None, Residential=None): + if StreetLines is None: + self.StreetLines = [] + else: + self.StreetLines = StreetLines + self.City = City + self.StateOrProvinceCode = StateOrProvinceCode + self.PostalCode = PostalCode + self.UrbanizationCode = UrbanizationCode + self.CountryCode = CountryCode + self.Residential = Residential + def factory(*args_, **kwargs_): + if Address.subclass: + return Address.subclass(*args_, **kwargs_) + else: + return Address(*args_, **kwargs_) + factory = staticmethod(factory) + def get_StreetLines(self): return self.StreetLines + def set_StreetLines(self, StreetLines): self.StreetLines = StreetLines + def add_StreetLines(self, value): self.StreetLines.append(value) + def insert_StreetLines(self, index, value): self.StreetLines[index] = value + def get_City(self): return self.City + def set_City(self, City): self.City = City + def get_StateOrProvinceCode(self): return self.StateOrProvinceCode + def set_StateOrProvinceCode(self, StateOrProvinceCode): self.StateOrProvinceCode = StateOrProvinceCode + def get_PostalCode(self): return self.PostalCode + def set_PostalCode(self, PostalCode): self.PostalCode = PostalCode + def get_UrbanizationCode(self): return self.UrbanizationCode + def set_UrbanizationCode(self, UrbanizationCode): self.UrbanizationCode = UrbanizationCode + def get_CountryCode(self): return self.CountryCode + def set_CountryCode(self, CountryCode): self.CountryCode = CountryCode + def get_Residential(self): return self.Residential + def set_Residential(self, Residential): self.Residential = Residential + def export(self, outfile, level, namespace_='ns:', name_='Address', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Address') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Address'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Address', fromsubclass_=False): + for StreetLines_ in self.StreetLines: + showIndent(outfile, level) + outfile.write('<%sStreetLines>%s\n' % (namespace_, self.gds_format_string(quote_xml(StreetLines_).encode(ExternalEncoding), input_name='StreetLines'), namespace_)) + if self.City is not None: + showIndent(outfile, level) + outfile.write('<%sCity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.City).encode(ExternalEncoding), input_name='City'), namespace_)) + if self.StateOrProvinceCode is not None: + showIndent(outfile, level) + outfile.write('<%sStateOrProvinceCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.StateOrProvinceCode).encode(ExternalEncoding), input_name='StateOrProvinceCode'), namespace_)) + if self.PostalCode is not None: + showIndent(outfile, level) + outfile.write('<%sPostalCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PostalCode).encode(ExternalEncoding), input_name='PostalCode'), namespace_)) + if self.UrbanizationCode is not None: + showIndent(outfile, level) + outfile.write('<%sUrbanizationCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.UrbanizationCode).encode(ExternalEncoding), input_name='UrbanizationCode'), namespace_)) + if self.CountryCode is not None: + showIndent(outfile, level) + outfile.write('<%sCountryCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CountryCode).encode(ExternalEncoding), input_name='CountryCode'), namespace_)) + if self.Residential is not None: + showIndent(outfile, level) + outfile.write('<%sResidential>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.Residential)), input_name='Residential'), namespace_)) + def hasContent_(self): + if ( + self.StreetLines or + self.City is not None or + self.StateOrProvinceCode is not None or + self.PostalCode is not None or + self.UrbanizationCode is not None or + self.CountryCode is not None or + self.Residential is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Address'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('StreetLines=[\n') + level += 1 + for StreetLines_ in self.StreetLines: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(StreetLines_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.City is not None: + showIndent(outfile, level) + outfile.write('City=%s,\n' % quote_python(self.City).encode(ExternalEncoding)) + if self.StateOrProvinceCode is not None: + showIndent(outfile, level) + outfile.write('StateOrProvinceCode=%s,\n' % quote_python(self.StateOrProvinceCode).encode(ExternalEncoding)) + if self.PostalCode is not None: + showIndent(outfile, level) + outfile.write('PostalCode=%s,\n' % quote_python(self.PostalCode).encode(ExternalEncoding)) + if self.UrbanizationCode is not None: + showIndent(outfile, level) + outfile.write('UrbanizationCode=%s,\n' % quote_python(self.UrbanizationCode).encode(ExternalEncoding)) + if self.CountryCode is not None: + showIndent(outfile, level) + outfile.write('CountryCode=%s,\n' % quote_python(self.CountryCode).encode(ExternalEncoding)) + if self.Residential is not None: + showIndent(outfile, level) + outfile.write('Residential=%s,\n' % self.Residential) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'StreetLines': + StreetLines_ = child_.text + StreetLines_ = self.gds_validate_string(StreetLines_, node, 'StreetLines') + self.StreetLines.append(StreetLines_) + elif nodeName_ == 'City': + City_ = child_.text + City_ = self.gds_validate_string(City_, node, 'City') + self.City = City_ + elif nodeName_ == 'StateOrProvinceCode': + StateOrProvinceCode_ = child_.text + StateOrProvinceCode_ = self.gds_validate_string(StateOrProvinceCode_, node, 'StateOrProvinceCode') + self.StateOrProvinceCode = StateOrProvinceCode_ + elif nodeName_ == 'PostalCode': + PostalCode_ = child_.text + PostalCode_ = self.gds_validate_string(PostalCode_, node, 'PostalCode') + self.PostalCode = PostalCode_ + elif nodeName_ == 'UrbanizationCode': + UrbanizationCode_ = child_.text + UrbanizationCode_ = self.gds_validate_string(UrbanizationCode_, node, 'UrbanizationCode') + self.UrbanizationCode = UrbanizationCode_ + elif nodeName_ == 'CountryCode': + CountryCode_ = child_.text + CountryCode_ = self.gds_validate_string(CountryCode_, node, 'CountryCode') + self.CountryCode = CountryCode_ + elif nodeName_ == 'Residential': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'Residential') + self.Residential = ival_ +# end class Address + + +class ClientDetail(GeneratedsSuper): + """Descriptive data for the client submitting a transaction.""" + subclass = None + superclass = None + def __init__(self, AccountNumber=None, MeterNumber=None, IntegratorId=None, Localization=None): + self.AccountNumber = AccountNumber + self.MeterNumber = MeterNumber + self.IntegratorId = IntegratorId + self.Localization = Localization + def factory(*args_, **kwargs_): + if ClientDetail.subclass: + return ClientDetail.subclass(*args_, **kwargs_) + else: + return ClientDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_AccountNumber(self): return self.AccountNumber + def set_AccountNumber(self, AccountNumber): self.AccountNumber = AccountNumber + def get_MeterNumber(self): return self.MeterNumber + def set_MeterNumber(self, MeterNumber): self.MeterNumber = MeterNumber + def get_IntegratorId(self): return self.IntegratorId + def set_IntegratorId(self, IntegratorId): self.IntegratorId = IntegratorId + def get_Localization(self): return self.Localization + def set_Localization(self, Localization): self.Localization = Localization + def export(self, outfile, level, namespace_='ns:', name_='ClientDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ClientDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ClientDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ClientDetail', fromsubclass_=False): + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('<%sAccountNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AccountNumber).encode(ExternalEncoding), input_name='AccountNumber'), namespace_)) + if self.MeterNumber is not None: + showIndent(outfile, level) + outfile.write('<%sMeterNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.MeterNumber).encode(ExternalEncoding), input_name='MeterNumber'), namespace_)) + if self.IntegratorId is not None: + showIndent(outfile, level) + outfile.write('<%sIntegratorId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.IntegratorId).encode(ExternalEncoding), input_name='IntegratorId'), namespace_)) + if self.Localization: + self.Localization.export(outfile, level, namespace_, name_='Localization') + def hasContent_(self): + if ( + self.AccountNumber is not None or + self.MeterNumber is not None or + self.IntegratorId is not None or + self.Localization is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ClientDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('AccountNumber=%s,\n' % quote_python(self.AccountNumber).encode(ExternalEncoding)) + if self.MeterNumber is not None: + showIndent(outfile, level) + outfile.write('MeterNumber=%s,\n' % quote_python(self.MeterNumber).encode(ExternalEncoding)) + if self.IntegratorId is not None: + showIndent(outfile, level) + outfile.write('IntegratorId=%s,\n' % quote_python(self.IntegratorId).encode(ExternalEncoding)) + if self.Localization is not None: + showIndent(outfile, level) + outfile.write('Localization=model_.Localization(\n') + self.Localization.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'AccountNumber': + AccountNumber_ = child_.text + AccountNumber_ = self.gds_validate_string(AccountNumber_, node, 'AccountNumber') + self.AccountNumber = AccountNumber_ + elif nodeName_ == 'MeterNumber': + MeterNumber_ = child_.text + MeterNumber_ = self.gds_validate_string(MeterNumber_, node, 'MeterNumber') + self.MeterNumber = MeterNumber_ + elif nodeName_ == 'IntegratorId': + IntegratorId_ = child_.text + IntegratorId_ = self.gds_validate_string(IntegratorId_, node, 'IntegratorId') + self.IntegratorId = IntegratorId_ + elif nodeName_ == 'Localization': + obj_ = Localization.factory() + obj_.build(child_) + self.set_Localization(obj_) +# end class ClientDetail + + +class Contact(GeneratedsSuper): + """The descriptive data for a point-of-contact person.""" + subclass = None + superclass = None + def __init__(self, PersonName=None, Title=None, CompanyName=None, PhoneNumber=None, PhoneExtension=None, PagerNumber=None, FaxNumber=None, EMailAddress=None): + self.PersonName = PersonName + self.Title = Title + self.CompanyName = CompanyName + self.PhoneNumber = PhoneNumber + self.PhoneExtension = PhoneExtension + self.PagerNumber = PagerNumber + self.FaxNumber = FaxNumber + self.EMailAddress = EMailAddress + def factory(*args_, **kwargs_): + if Contact.subclass: + return Contact.subclass(*args_, **kwargs_) + else: + return Contact(*args_, **kwargs_) + factory = staticmethod(factory) + def get_PersonName(self): return self.PersonName + def set_PersonName(self, PersonName): self.PersonName = PersonName + def get_Title(self): return self.Title + def set_Title(self, Title): self.Title = Title + def get_CompanyName(self): return self.CompanyName + def set_CompanyName(self, CompanyName): self.CompanyName = CompanyName + def get_PhoneNumber(self): return self.PhoneNumber + def set_PhoneNumber(self, PhoneNumber): self.PhoneNumber = PhoneNumber + def get_PhoneExtension(self): return self.PhoneExtension + def set_PhoneExtension(self, PhoneExtension): self.PhoneExtension = PhoneExtension + def get_PagerNumber(self): return self.PagerNumber + def set_PagerNumber(self, PagerNumber): self.PagerNumber = PagerNumber + def get_FaxNumber(self): return self.FaxNumber + def set_FaxNumber(self, FaxNumber): self.FaxNumber = FaxNumber + def get_EMailAddress(self): return self.EMailAddress + def set_EMailAddress(self, EMailAddress): self.EMailAddress = EMailAddress + def export(self, outfile, level, namespace_='ns:', name_='Contact', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Contact') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Contact'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Contact', fromsubclass_=False): + if self.PersonName is not None: + showIndent(outfile, level) + outfile.write('<%sPersonName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PersonName).encode(ExternalEncoding), input_name='PersonName'), namespace_)) + if self.Title is not None: + showIndent(outfile, level) + outfile.write('<%sTitle>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Title).encode(ExternalEncoding), input_name='Title'), namespace_)) + if self.CompanyName is not None: + showIndent(outfile, level) + outfile.write('<%sCompanyName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CompanyName).encode(ExternalEncoding), input_name='CompanyName'), namespace_)) + if self.PhoneNumber is not None: + showIndent(outfile, level) + outfile.write('<%sPhoneNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PhoneNumber).encode(ExternalEncoding), input_name='PhoneNumber'), namespace_)) + if self.PhoneExtension is not None: + showIndent(outfile, level) + outfile.write('<%sPhoneExtension>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PhoneExtension).encode(ExternalEncoding), input_name='PhoneExtension'), namespace_)) + if self.PagerNumber is not None: + showIndent(outfile, level) + outfile.write('<%sPagerNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PagerNumber).encode(ExternalEncoding), input_name='PagerNumber'), namespace_)) + if self.FaxNumber is not None: + showIndent(outfile, level) + outfile.write('<%sFaxNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.FaxNumber).encode(ExternalEncoding), input_name='FaxNumber'), namespace_)) + if self.EMailAddress is not None: + showIndent(outfile, level) + outfile.write('<%sEMailAddress>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.EMailAddress).encode(ExternalEncoding), input_name='EMailAddress'), namespace_)) + def hasContent_(self): + if ( + self.PersonName is not None or + self.Title is not None or + self.CompanyName is not None or + self.PhoneNumber is not None or + self.PhoneExtension is not None or + self.PagerNumber is not None or + self.FaxNumber is not None or + self.EMailAddress is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Contact'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.PersonName is not None: + showIndent(outfile, level) + outfile.write('PersonName=%s,\n' % quote_python(self.PersonName).encode(ExternalEncoding)) + if self.Title is not None: + showIndent(outfile, level) + outfile.write('Title=%s,\n' % quote_python(self.Title).encode(ExternalEncoding)) + if self.CompanyName is not None: + showIndent(outfile, level) + outfile.write('CompanyName=%s,\n' % quote_python(self.CompanyName).encode(ExternalEncoding)) + if self.PhoneNumber is not None: + showIndent(outfile, level) + outfile.write('PhoneNumber=%s,\n' % quote_python(self.PhoneNumber).encode(ExternalEncoding)) + if self.PhoneExtension is not None: + showIndent(outfile, level) + outfile.write('PhoneExtension=%s,\n' % quote_python(self.PhoneExtension).encode(ExternalEncoding)) + if self.PagerNumber is not None: + showIndent(outfile, level) + outfile.write('PagerNumber=%s,\n' % quote_python(self.PagerNumber).encode(ExternalEncoding)) + if self.FaxNumber is not None: + showIndent(outfile, level) + outfile.write('FaxNumber=%s,\n' % quote_python(self.FaxNumber).encode(ExternalEncoding)) + if self.EMailAddress is not None: + showIndent(outfile, level) + outfile.write('EMailAddress=%s,\n' % quote_python(self.EMailAddress).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'PersonName': + PersonName_ = child_.text + PersonName_ = self.gds_validate_string(PersonName_, node, 'PersonName') + self.PersonName = PersonName_ + elif nodeName_ == 'Title': + Title_ = child_.text + Title_ = self.gds_validate_string(Title_, node, 'Title') + self.Title = Title_ + elif nodeName_ == 'CompanyName': + CompanyName_ = child_.text + CompanyName_ = self.gds_validate_string(CompanyName_, node, 'CompanyName') + self.CompanyName = CompanyName_ + elif nodeName_ == 'PhoneNumber': + PhoneNumber_ = child_.text + PhoneNumber_ = self.gds_validate_string(PhoneNumber_, node, 'PhoneNumber') + self.PhoneNumber = PhoneNumber_ + elif nodeName_ == 'PhoneExtension': + PhoneExtension_ = child_.text + PhoneExtension_ = self.gds_validate_string(PhoneExtension_, node, 'PhoneExtension') + self.PhoneExtension = PhoneExtension_ + elif nodeName_ == 'PagerNumber': + PagerNumber_ = child_.text + PagerNumber_ = self.gds_validate_string(PagerNumber_, node, 'PagerNumber') + self.PagerNumber = PagerNumber_ + elif nodeName_ == 'FaxNumber': + FaxNumber_ = child_.text + FaxNumber_ = self.gds_validate_string(FaxNumber_, node, 'FaxNumber') + self.FaxNumber = FaxNumber_ + elif nodeName_ == 'EMailAddress': + EMailAddress_ = child_.text + EMailAddress_ = self.gds_validate_string(EMailAddress_, node, 'EMailAddress') + self.EMailAddress = EMailAddress_ +# end class Contact + + +class ContactAndAddress(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Contact=None, Address=None): + self.Contact = Contact + self.Address = Address + def factory(*args_, **kwargs_): + if ContactAndAddress.subclass: + return ContactAndAddress.subclass(*args_, **kwargs_) + else: + return ContactAndAddress(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Contact(self): return self.Contact + def set_Contact(self, Contact): self.Contact = Contact + def get_Address(self): return self.Address + def set_Address(self, Address): self.Address = Address + def export(self, outfile, level, namespace_='ns:', name_='ContactAndAddress', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ContactAndAddress') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ContactAndAddress'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ContactAndAddress', fromsubclass_=False): + if self.Contact: + self.Contact.export(outfile, level, namespace_, name_='Contact', ) + if self.Address: + self.Address.export(outfile, level, namespace_, name_='Address') + def hasContent_(self): + if ( + self.Contact is not None or + self.Address is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ContactAndAddress'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Contact is not None: + showIndent(outfile, level) + outfile.write('Contact=model_.Contact(\n') + self.Contact.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Address is not None: + showIndent(outfile, level) + outfile.write('Address=model_.Address(\n') + self.Address.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Contact': + obj_ = Contact.factory() + obj_.build(child_) + self.set_Contact(obj_) + elif nodeName_ == 'Address': + obj_ = Address.factory() + obj_.build(child_) + self.set_Address(obj_) +# end class ContactAndAddress + + +class Dimensions(GeneratedsSuper): + """The dimensions of this package and the unit type used for the + measurements.""" + subclass = None + superclass = None + def __init__(self, Length=None, Width=None, Height=None, Units=None): + self.Length = Length + self.Width = Width + self.Height = Height + self.Units = Units + def factory(*args_, **kwargs_): + if Dimensions.subclass: + return Dimensions.subclass(*args_, **kwargs_) + else: + return Dimensions(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Length(self): return self.Length + def set_Length(self, Length): self.Length = Length + def get_Width(self): return self.Width + def set_Width(self, Width): self.Width = Width + def get_Height(self): return self.Height + def set_Height(self, Height): self.Height = Height + def get_Units(self): return self.Units + def set_Units(self, Units): self.Units = Units + def validate_LinearUnits(self, value): + # Validate type LinearUnits, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='Dimensions', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Dimensions') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Dimensions'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Dimensions', fromsubclass_=False): + if self.Length is not None: + showIndent(outfile, level) + outfile.write('<%sLength>%s\n' % (namespace_, self.gds_format_integer(self.Length, input_name='Length'), namespace_)) + if self.Width is not None: + showIndent(outfile, level) + outfile.write('<%sWidth>%s\n' % (namespace_, self.gds_format_integer(self.Width, input_name='Width'), namespace_)) + if self.Height is not None: + showIndent(outfile, level) + outfile.write('<%sHeight>%s\n' % (namespace_, self.gds_format_integer(self.Height, input_name='Height'), namespace_)) + if self.Units is not None: + showIndent(outfile, level) + outfile.write('<%sUnits>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Units).encode(ExternalEncoding), input_name='Units'), namespace_)) + def hasContent_(self): + if ( + self.Length is not None or + self.Width is not None or + self.Height is not None or + self.Units is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Dimensions'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Length is not None: + showIndent(outfile, level) + outfile.write('Length=%d,\n' % self.Length) + if self.Width is not None: + showIndent(outfile, level) + outfile.write('Width=%d,\n' % self.Width) + if self.Height is not None: + showIndent(outfile, level) + outfile.write('Height=%d,\n' % self.Height) + if self.Units is not None: + showIndent(outfile, level) + outfile.write('Units=%s,\n' % quote_python(self.Units).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Length': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'Length') + self.Length = ival_ + elif nodeName_ == 'Width': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'Width') + self.Width = ival_ + elif nodeName_ == 'Height': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'Height') + self.Height = ival_ + elif nodeName_ == 'Units': + Units_ = child_.text + Units_ = self.gds_validate_string(Units_, node, 'Units') + self.Units = Units_ + self.validate_LinearUnits(self.Units) # validate type LinearUnits +# end class Dimensions + + +class Distance(GeneratedsSuper): + """Driving or other transportation distances, distinct from dimension + measurements.""" + subclass = None + superclass = None + def __init__(self, Value=None, Units=None): + self.Value = Value + self.Units = Units + def factory(*args_, **kwargs_): + if Distance.subclass: + return Distance.subclass(*args_, **kwargs_) + else: + return Distance(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Value(self): return self.Value + def set_Value(self, Value): self.Value = Value + def get_Units(self): return self.Units + def set_Units(self, Units): self.Units = Units + def validate_DistanceUnits(self, value): + # Validate type DistanceUnits, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='Distance', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Distance') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Distance'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Distance', fromsubclass_=False): + if self.Value is not None: + showIndent(outfile, level) + outfile.write('<%sValue>%s\n' % (namespace_, self.gds_format_float(self.Value, input_name='Value'), namespace_)) + if self.Units is not None: + showIndent(outfile, level) + outfile.write('<%sUnits>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Units).encode(ExternalEncoding), input_name='Units'), namespace_)) + def hasContent_(self): + if ( + self.Value is not None or + self.Units is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Distance'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Value is not None: + showIndent(outfile, level) + outfile.write('Value=%f,\n' % self.Value) + if self.Units is not None: + showIndent(outfile, level) + outfile.write('Units=%s,\n' % quote_python(self.Units).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Value': + sval_ = child_.text + try: + fval_ = float(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires float or double: %s' % exp) + fval_ = self.gds_validate_float(fval_, node, 'Value') + self.Value = fval_ + elif nodeName_ == 'Units': + Units_ = child_.text + Units_ = self.gds_validate_string(Units_, node, 'Units') + self.Units = Units_ + self.validate_DistanceUnits(self.Units) # validate type DistanceUnits +# end class Distance + + +class EMailNotificationDetail(GeneratedsSuper): + """Information describing email notifications that will be sent in + relation to events that occur during package movement""" + subclass = None + superclass = None + def __init__(self, PersonalMessage=None, Recipients=None): + self.PersonalMessage = PersonalMessage + if Recipients is None: + self.Recipients = [] + else: + self.Recipients = Recipients + def factory(*args_, **kwargs_): + if EMailNotificationDetail.subclass: + return EMailNotificationDetail.subclass(*args_, **kwargs_) + else: + return EMailNotificationDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_PersonalMessage(self): return self.PersonalMessage + def set_PersonalMessage(self, PersonalMessage): self.PersonalMessage = PersonalMessage + def get_Recipients(self): return self.Recipients + def set_Recipients(self, Recipients): self.Recipients = Recipients + def add_Recipients(self, value): self.Recipients.append(value) + def insert_Recipients(self, index, value): self.Recipients[index] = value + def export(self, outfile, level, namespace_='ns:', name_='EMailNotificationDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='EMailNotificationDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='EMailNotificationDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='EMailNotificationDetail', fromsubclass_=False): + if self.PersonalMessage is not None: + showIndent(outfile, level) + outfile.write('<%sPersonalMessage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PersonalMessage).encode(ExternalEncoding), input_name='PersonalMessage'), namespace_)) + for Recipients_ in self.Recipients: + Recipients_.export(outfile, level, namespace_, name_='Recipients') + def hasContent_(self): + if ( + self.PersonalMessage is not None or + self.Recipients + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='EMailNotificationDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.PersonalMessage is not None: + showIndent(outfile, level) + outfile.write('PersonalMessage=%s,\n' % quote_python(self.PersonalMessage).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Recipients=[\n') + level += 1 + for Recipients_ in self.Recipients: + showIndent(outfile, level) + outfile.write('model_.EMailNotificationRecipient(\n') + Recipients_.exportLiteral(outfile, level, name_='EMailNotificationRecipient') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'PersonalMessage': + PersonalMessage_ = child_.text + PersonalMessage_ = self.gds_validate_string(PersonalMessage_, node, 'PersonalMessage') + self.PersonalMessage = PersonalMessage_ + elif nodeName_ == 'Recipients': + obj_ = EMailNotificationRecipient.factory() + obj_.build(child_) + self.Recipients.append(obj_) +# end class EMailNotificationDetail + + +class EMailNotificationRecipient(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, EMailNotificationRecipientType=None, EMailAddress=None, NotificationEventsRequested=None, Format=None, Localization=None): + self.EMailNotificationRecipientType = EMailNotificationRecipientType + self.EMailAddress = EMailAddress + if NotificationEventsRequested is None: + self.NotificationEventsRequested = [] + else: + self.NotificationEventsRequested = NotificationEventsRequested + self.Format = Format + self.Localization = Localization + def factory(*args_, **kwargs_): + if EMailNotificationRecipient.subclass: + return EMailNotificationRecipient.subclass(*args_, **kwargs_) + else: + return EMailNotificationRecipient(*args_, **kwargs_) + factory = staticmethod(factory) + def get_EMailNotificationRecipientType(self): return self.EMailNotificationRecipientType + def set_EMailNotificationRecipientType(self, EMailNotificationRecipientType): self.EMailNotificationRecipientType = EMailNotificationRecipientType + def validate_EMailNotificationRecipientType(self, value): + # Validate type EMailNotificationRecipientType, a restriction on xs:string. + pass + def get_EMailAddress(self): return self.EMailAddress + def set_EMailAddress(self, EMailAddress): self.EMailAddress = EMailAddress + def get_NotificationEventsRequested(self): return self.NotificationEventsRequested + def set_NotificationEventsRequested(self, NotificationEventsRequested): self.NotificationEventsRequested = NotificationEventsRequested + def add_NotificationEventsRequested(self, value): self.NotificationEventsRequested.append(value) + def insert_NotificationEventsRequested(self, index, value): self.NotificationEventsRequested[index] = value + def validate_EMailNotificationEventType(self, value): + # Validate type EMailNotificationEventType, a restriction on xs:string. + pass + def get_Format(self): return self.Format + def set_Format(self, Format): self.Format = Format + def validate_EMailNotificationFormatType(self, value): + # Validate type EMailNotificationFormatType, a restriction on xs:string. + pass + def get_Localization(self): return self.Localization + def set_Localization(self, Localization): self.Localization = Localization + def export(self, outfile, level, namespace_='ns:', name_='EMailNotificationRecipient', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='EMailNotificationRecipient') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='EMailNotificationRecipient'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='EMailNotificationRecipient', fromsubclass_=False): + if self.EMailNotificationRecipientType is not None: + showIndent(outfile, level) + outfile.write('<%sEMailNotificationRecipientType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.EMailNotificationRecipientType).encode(ExternalEncoding), input_name='EMailNotificationRecipientType'), namespace_)) + if self.EMailAddress is not None: + showIndent(outfile, level) + outfile.write('<%sEMailAddress>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.EMailAddress).encode(ExternalEncoding), input_name='EMailAddress'), namespace_)) + for NotificationEventsRequested_ in self.NotificationEventsRequested: + showIndent(outfile, level) + outfile.write('<%sNotificationEventsRequested>%s\n' % (namespace_, self.gds_format_string(quote_xml(NotificationEventsRequested_).encode(ExternalEncoding), input_name='NotificationEventsRequested'), namespace_)) + if self.Format is not None: + showIndent(outfile, level) + outfile.write('<%sFormat>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Format).encode(ExternalEncoding), input_name='Format'), namespace_)) + if self.Localization: + self.Localization.export(outfile, level, namespace_, name_='Localization') + def hasContent_(self): + if ( + self.EMailNotificationRecipientType is not None or + self.EMailAddress is not None or + self.NotificationEventsRequested or + self.Format is not None or + self.Localization is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='EMailNotificationRecipient'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.EMailNotificationRecipientType is not None: + showIndent(outfile, level) + outfile.write('EMailNotificationRecipientType=%s,\n' % quote_python(self.EMailNotificationRecipientType).encode(ExternalEncoding)) + if self.EMailAddress is not None: + showIndent(outfile, level) + outfile.write('EMailAddress=%s,\n' % quote_python(self.EMailAddress).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('NotificationEventsRequested=[\n') + level += 1 + for NotificationEventsRequested_ in self.NotificationEventsRequested: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(NotificationEventsRequested_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.Format is not None: + showIndent(outfile, level) + outfile.write('Format=%s,\n' % quote_python(self.Format).encode(ExternalEncoding)) + if self.Localization is not None: + showIndent(outfile, level) + outfile.write('Localization=model_.Localization(\n') + self.Localization.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'EMailNotificationRecipientType': + EMailNotificationRecipientType_ = child_.text + EMailNotificationRecipientType_ = self.gds_validate_string(EMailNotificationRecipientType_, node, 'EMailNotificationRecipientType') + self.EMailNotificationRecipientType = EMailNotificationRecipientType_ + self.validate_EMailNotificationRecipientType(self.EMailNotificationRecipientType) # validate type EMailNotificationRecipientType + elif nodeName_ == 'EMailAddress': + EMailAddress_ = child_.text + EMailAddress_ = self.gds_validate_string(EMailAddress_, node, 'EMailAddress') + self.EMailAddress = EMailAddress_ + elif nodeName_ == 'NotificationEventsRequested': + NotificationEventsRequested_ = child_.text + NotificationEventsRequested_ = self.gds_validate_string(NotificationEventsRequested_, node, 'NotificationEventsRequested') + self.NotificationEventsRequested.append(NotificationEventsRequested_) + self.validate_EMailNotificationEventType(self.NotificationEventsRequested) # validate type EMailNotificationEventType + elif nodeName_ == 'Format': + Format_ = child_.text + Format_ = self.gds_validate_string(Format_, node, 'Format') + self.Format = Format_ + self.validate_EMailNotificationFormatType(self.Format) # validate type EMailNotificationFormatType + elif nodeName_ == 'Localization': + obj_ = Localization.factory() + obj_.build(child_) + self.set_Localization(obj_) +# end class EMailNotificationRecipient + + +class Localization(GeneratedsSuper): + """Identifies the representation of human-readable text.""" + subclass = None + superclass = None + def __init__(self, LanguageCode=None, LocaleCode=None): + self.LanguageCode = LanguageCode + self.LocaleCode = LocaleCode + def factory(*args_, **kwargs_): + if Localization.subclass: + return Localization.subclass(*args_, **kwargs_) + else: + return Localization(*args_, **kwargs_) + factory = staticmethod(factory) + def get_LanguageCode(self): return self.LanguageCode + def set_LanguageCode(self, LanguageCode): self.LanguageCode = LanguageCode + def get_LocaleCode(self): return self.LocaleCode + def set_LocaleCode(self, LocaleCode): self.LocaleCode = LocaleCode + def export(self, outfile, level, namespace_='ns:', name_='Localization', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Localization') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Localization'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Localization', fromsubclass_=False): + if self.LanguageCode is not None: + showIndent(outfile, level) + outfile.write('<%sLanguageCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LanguageCode).encode(ExternalEncoding), input_name='LanguageCode'), namespace_)) + if self.LocaleCode is not None: + showIndent(outfile, level) + outfile.write('<%sLocaleCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LocaleCode).encode(ExternalEncoding), input_name='LocaleCode'), namespace_)) + def hasContent_(self): + if ( + self.LanguageCode is not None or + self.LocaleCode is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Localization'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.LanguageCode is not None: + showIndent(outfile, level) + outfile.write('LanguageCode=%s,\n' % quote_python(self.LanguageCode).encode(ExternalEncoding)) + if self.LocaleCode is not None: + showIndent(outfile, level) + outfile.write('LocaleCode=%s,\n' % quote_python(self.LocaleCode).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'LanguageCode': + LanguageCode_ = child_.text + LanguageCode_ = self.gds_validate_string(LanguageCode_, node, 'LanguageCode') + self.LanguageCode = LanguageCode_ + elif nodeName_ == 'LocaleCode': + LocaleCode_ = child_.text + LocaleCode_ = self.gds_validate_string(LocaleCode_, node, 'LocaleCode') + self.LocaleCode = LocaleCode_ +# end class Localization + + +class Notification(GeneratedsSuper): + """The descriptive data regarding the result of the submitted + transaction.""" + subclass = None + superclass = None + def __init__(self, Severity=None, Source=None, Code=None, Message=None, LocalizedMessage=None, MessageParameters=None): + self.Severity = Severity + self.Source = Source + self.Code = Code + self.Message = Message + self.LocalizedMessage = LocalizedMessage + if MessageParameters is None: + self.MessageParameters = [] + else: + self.MessageParameters = MessageParameters + def factory(*args_, **kwargs_): + if Notification.subclass: + return Notification.subclass(*args_, **kwargs_) + else: + return Notification(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Severity(self): return self.Severity + def set_Severity(self, Severity): self.Severity = Severity + def validate_NotificationSeverityType(self, value): + # Validate type NotificationSeverityType, a restriction on xs:string. + pass + def get_Source(self): return self.Source + def set_Source(self, Source): self.Source = Source + def get_Code(self): return self.Code + def set_Code(self, Code): self.Code = Code + def get_Message(self): return self.Message + def set_Message(self, Message): self.Message = Message + def get_LocalizedMessage(self): return self.LocalizedMessage + def set_LocalizedMessage(self, LocalizedMessage): self.LocalizedMessage = LocalizedMessage + def get_MessageParameters(self): return self.MessageParameters + def set_MessageParameters(self, MessageParameters): self.MessageParameters = MessageParameters + def add_MessageParameters(self, value): self.MessageParameters.append(value) + def insert_MessageParameters(self, index, value): self.MessageParameters[index] = value + def export(self, outfile, level, namespace_='ns:', name_='Notification', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Notification') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Notification'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Notification', fromsubclass_=False): + if self.Severity is not None: + showIndent(outfile, level) + outfile.write('<%sSeverity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Severity).encode(ExternalEncoding), input_name='Severity'), namespace_)) + if self.Source is not None: + showIndent(outfile, level) + outfile.write('<%sSource>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Source).encode(ExternalEncoding), input_name='Source'), namespace_)) + if self.Code is not None: + showIndent(outfile, level) + outfile.write('<%sCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Code).encode(ExternalEncoding), input_name='Code'), namespace_)) + if self.Message is not None: + showIndent(outfile, level) + outfile.write('<%sMessage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Message).encode(ExternalEncoding), input_name='Message'), namespace_)) + if self.LocalizedMessage is not None: + showIndent(outfile, level) + outfile.write('<%sLocalizedMessage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LocalizedMessage).encode(ExternalEncoding), input_name='LocalizedMessage'), namespace_)) + for MessageParameters_ in self.MessageParameters: + MessageParameters_.export(outfile, level, namespace_, name_='MessageParameters') + def hasContent_(self): + if ( + self.Severity is not None or + self.Source is not None or + self.Code is not None or + self.Message is not None or + self.LocalizedMessage is not None or + self.MessageParameters + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Notification'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Severity is not None: + showIndent(outfile, level) + outfile.write('Severity=%s,\n' % quote_python(self.Severity).encode(ExternalEncoding)) + if self.Source is not None: + showIndent(outfile, level) + outfile.write('Source=%s,\n' % quote_python(self.Source).encode(ExternalEncoding)) + if self.Code is not None: + showIndent(outfile, level) + outfile.write('Code=%s,\n' % quote_python(self.Code).encode(ExternalEncoding)) + if self.Message is not None: + showIndent(outfile, level) + outfile.write('Message=%s,\n' % quote_python(self.Message).encode(ExternalEncoding)) + if self.LocalizedMessage is not None: + showIndent(outfile, level) + outfile.write('LocalizedMessage=%s,\n' % quote_python(self.LocalizedMessage).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('MessageParameters=[\n') + level += 1 + for MessageParameters_ in self.MessageParameters: + showIndent(outfile, level) + outfile.write('model_.NotificationParameter(\n') + MessageParameters_.exportLiteral(outfile, level, name_='NotificationParameter') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Severity': + Severity_ = child_.text + Severity_ = self.gds_validate_string(Severity_, node, 'Severity') + self.Severity = Severity_ + self.validate_NotificationSeverityType(self.Severity) # validate type NotificationSeverityType + elif nodeName_ == 'Source': + Source_ = child_.text + Source_ = self.gds_validate_string(Source_, node, 'Source') + self.Source = Source_ + elif nodeName_ == 'Code': + Code_ = child_.text + Code_ = self.gds_validate_string(Code_, node, 'Code') + self.Code = Code_ + elif nodeName_ == 'Message': + Message_ = child_.text + Message_ = self.gds_validate_string(Message_, node, 'Message') + self.Message = Message_ + elif nodeName_ == 'LocalizedMessage': + LocalizedMessage_ = child_.text + LocalizedMessage_ = self.gds_validate_string(LocalizedMessage_, node, 'LocalizedMessage') + self.LocalizedMessage = LocalizedMessage_ + elif nodeName_ == 'MessageParameters': + obj_ = NotificationParameter.factory() + obj_.build(child_) + self.MessageParameters.append(obj_) +# end class Notification + + +class NotificationParameter(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Id=None, Value=None): + self.Id = Id + self.Value = Value + def factory(*args_, **kwargs_): + if NotificationParameter.subclass: + return NotificationParameter.subclass(*args_, **kwargs_) + else: + return NotificationParameter(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Id(self): return self.Id + def set_Id(self, Id): self.Id = Id + def get_Value(self): return self.Value + def set_Value(self, Value): self.Value = Value + def export(self, outfile, level, namespace_='ns:', name_='NotificationParameter', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='NotificationParameter') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='NotificationParameter'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='NotificationParameter', fromsubclass_=False): + if self.Id is not None: + showIndent(outfile, level) + outfile.write('<%sId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Id).encode(ExternalEncoding), input_name='Id'), namespace_)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('<%sValue>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Value).encode(ExternalEncoding), input_name='Value'), namespace_)) + def hasContent_(self): + if ( + self.Id is not None or + self.Value is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='NotificationParameter'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Id is not None: + showIndent(outfile, level) + outfile.write('Id=%s,\n' % quote_python(self.Id).encode(ExternalEncoding)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('Value=%s,\n' % quote_python(self.Value).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Id': + Id_ = child_.text + Id_ = self.gds_validate_string(Id_, node, 'Id') + self.Id = Id_ + elif nodeName_ == 'Value': + Value_ = child_.text + Value_ = self.gds_validate_string(Value_, node, 'Value') + self.Value = Value_ +# end class NotificationParameter + + +class QualifiedTrackingNumber(GeneratedsSuper): + """Tracking number and additional shipment data used to identify a + unique shipment for proof of delivery.""" + subclass = None + superclass = None + def __init__(self, TrackingNumber=None, ShipDate=None, AccountNumber=None, Carrier=None, Destination=None): + self.TrackingNumber = TrackingNumber + self.ShipDate = ShipDate + self.AccountNumber = AccountNumber + self.Carrier = Carrier + self.Destination = Destination + def factory(*args_, **kwargs_): + if QualifiedTrackingNumber.subclass: + return QualifiedTrackingNumber.subclass(*args_, **kwargs_) + else: + return QualifiedTrackingNumber(*args_, **kwargs_) + factory = staticmethod(factory) + def get_TrackingNumber(self): return self.TrackingNumber + def set_TrackingNumber(self, TrackingNumber): self.TrackingNumber = TrackingNumber + def get_ShipDate(self): return self.ShipDate + def set_ShipDate(self, ShipDate): self.ShipDate = ShipDate + def get_AccountNumber(self): return self.AccountNumber + def set_AccountNumber(self, AccountNumber): self.AccountNumber = AccountNumber + def get_Carrier(self): return self.Carrier + def set_Carrier(self, Carrier): self.Carrier = Carrier + def validate_CarrierCodeType(self, value): + # Validate type CarrierCodeType, a restriction on xs:string. + pass + def get_Destination(self): return self.Destination + def set_Destination(self, Destination): self.Destination = Destination + def export(self, outfile, level, namespace_='ns:', name_='QualifiedTrackingNumber', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='QualifiedTrackingNumber') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='QualifiedTrackingNumber'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='QualifiedTrackingNumber', fromsubclass_=False): + if self.TrackingNumber is not None: + showIndent(outfile, level) + outfile.write('<%sTrackingNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.TrackingNumber).encode(ExternalEncoding), input_name='TrackingNumber'), namespace_)) + if self.ShipDate is not None: + showIndent(outfile, level) + outfile.write('<%sShipDate>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ShipDate).encode(ExternalEncoding), input_name='ShipDate'), namespace_)) + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('<%sAccountNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AccountNumber).encode(ExternalEncoding), input_name='AccountNumber'), namespace_)) + if self.Carrier is not None: + showIndent(outfile, level) + outfile.write('<%sCarrier>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Carrier).encode(ExternalEncoding), input_name='Carrier'), namespace_)) + if self.Destination: + self.Destination.export(outfile, level, namespace_, name_='Destination') + def hasContent_(self): + if ( + self.TrackingNumber is not None or + self.ShipDate is not None or + self.AccountNumber is not None or + self.Carrier is not None or + self.Destination is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='QualifiedTrackingNumber'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.TrackingNumber is not None: + showIndent(outfile, level) + outfile.write('TrackingNumber=%s,\n' % quote_python(self.TrackingNumber).encode(ExternalEncoding)) + if self.ShipDate is not None: + showIndent(outfile, level) + outfile.write('ShipDate=%s,\n' % quote_python(self.ShipDate).encode(ExternalEncoding)) + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('AccountNumber=%s,\n' % quote_python(self.AccountNumber).encode(ExternalEncoding)) + if self.Carrier is not None: + showIndent(outfile, level) + outfile.write('Carrier=%s,\n' % quote_python(self.Carrier).encode(ExternalEncoding)) + if self.Destination is not None: + showIndent(outfile, level) + outfile.write('Destination=model_.Address(\n') + self.Destination.exportLiteral(outfile, level, name_='Destination') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'TrackingNumber': + TrackingNumber_ = child_.text + TrackingNumber_ = self.gds_validate_string(TrackingNumber_, node, 'TrackingNumber') + self.TrackingNumber = TrackingNumber_ + elif nodeName_ == 'ShipDate': + ShipDate_ = child_.text + ShipDate_ = self.gds_validate_string(ShipDate_, node, 'ShipDate') + self.ShipDate = ShipDate_ + elif nodeName_ == 'AccountNumber': + AccountNumber_ = child_.text + AccountNumber_ = self.gds_validate_string(AccountNumber_, node, 'AccountNumber') + self.AccountNumber = AccountNumber_ + elif nodeName_ == 'Carrier': + Carrier_ = child_.text + Carrier_ = self.gds_validate_string(Carrier_, node, 'Carrier') + self.Carrier = Carrier_ + self.validate_CarrierCodeType(self.Carrier) # validate type CarrierCodeType + elif nodeName_ == 'Destination': + obj_ = Address.factory() + obj_.build(child_) + self.set_Destination(obj_) +# end class QualifiedTrackingNumber + + +class SignatureProofOfDeliveryFaxReply(GeneratedsSuper): + """FedEx Signature Proof Of Delivery Fax reply.""" + subclass = None + superclass = None + def __init__(self, HighestSeverity=None, Notifications=None, TransactionDetail=None, Version=None, FaxConfirmationNumber=None): + self.HighestSeverity = HighestSeverity + if Notifications is None: + self.Notifications = [] + else: + self.Notifications = Notifications + self.TransactionDetail = TransactionDetail + self.Version = Version + self.FaxConfirmationNumber = FaxConfirmationNumber + def factory(*args_, **kwargs_): + if SignatureProofOfDeliveryFaxReply.subclass: + return SignatureProofOfDeliveryFaxReply.subclass(*args_, **kwargs_) + else: + return SignatureProofOfDeliveryFaxReply(*args_, **kwargs_) + factory = staticmethod(factory) + def get_HighestSeverity(self): return self.HighestSeverity + def set_HighestSeverity(self, HighestSeverity): self.HighestSeverity = HighestSeverity + def validate_NotificationSeverityType(self, value): + # Validate type NotificationSeverityType, a restriction on xs:string. + pass + def get_Notifications(self): return self.Notifications + def set_Notifications(self, Notifications): self.Notifications = Notifications + def add_Notifications(self, value): self.Notifications.append(value) + def insert_Notifications(self, index, value): self.Notifications[index] = value + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_FaxConfirmationNumber(self): return self.FaxConfirmationNumber + def set_FaxConfirmationNumber(self, FaxConfirmationNumber): self.FaxConfirmationNumber = FaxConfirmationNumber + def export(self, outfile, level, namespace_='ns:', name_='SignatureProofOfDeliveryFaxReply', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='SignatureProofOfDeliveryFaxReply') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='SignatureProofOfDeliveryFaxReply'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='SignatureProofOfDeliveryFaxReply', fromsubclass_=False): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('<%sHighestSeverity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HighestSeverity).encode(ExternalEncoding), input_name='HighestSeverity'), namespace_)) + for Notifications_ in self.Notifications: + Notifications_.export(outfile, level, namespace_, name_='Notifications') + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.FaxConfirmationNumber is not None: + showIndent(outfile, level) + outfile.write('<%sFaxConfirmationNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.FaxConfirmationNumber).encode(ExternalEncoding), input_name='FaxConfirmationNumber'), namespace_)) + def hasContent_(self): + if ( + self.HighestSeverity is not None or + self.Notifications or + self.TransactionDetail is not None or + self.Version is not None or + self.FaxConfirmationNumber is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='SignatureProofOfDeliveryFaxReply'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('HighestSeverity=%s,\n' % quote_python(self.HighestSeverity).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Notifications=[\n') + level += 1 + for Notifications_ in self.Notifications: + showIndent(outfile, level) + outfile.write('model_.Notification(\n') + Notifications_.exportLiteral(outfile, level, name_='Notification') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.FaxConfirmationNumber is not None: + showIndent(outfile, level) + outfile.write('FaxConfirmationNumber=%s,\n' % quote_python(self.FaxConfirmationNumber).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'HighestSeverity': + HighestSeverity_ = child_.text + HighestSeverity_ = self.gds_validate_string(HighestSeverity_, node, 'HighestSeverity') + self.HighestSeverity = HighestSeverity_ + self.validate_NotificationSeverityType(self.HighestSeverity) # validate type NotificationSeverityType + elif nodeName_ == 'Notifications': + obj_ = Notification.factory() + obj_.build(child_) + self.Notifications.append(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'FaxConfirmationNumber': + FaxConfirmationNumber_ = child_.text + FaxConfirmationNumber_ = self.gds_validate_string(FaxConfirmationNumber_, node, 'FaxConfirmationNumber') + self.FaxConfirmationNumber = FaxConfirmationNumber_ +# end class SignatureProofOfDeliveryFaxReply + + +class SignatureProofOfDeliveryFaxRequest(GeneratedsSuper): + """FedEx Signature Proof Of Delivery Fax request.""" + subclass = None + superclass = None + def __init__(self, WebAuthenticationDetail=None, ClientDetail=None, TransactionDetail=None, Version=None, QualifiedTrackingNumber=None, AdditionalComments=None, FaxSender=None, FaxRecipient=None): + self.WebAuthenticationDetail = WebAuthenticationDetail + self.ClientDetail = ClientDetail + self.TransactionDetail = TransactionDetail + self.Version = Version + self.QualifiedTrackingNumber = QualifiedTrackingNumber + self.AdditionalComments = AdditionalComments + self.FaxSender = FaxSender + self.FaxRecipient = FaxRecipient + def factory(*args_, **kwargs_): + if SignatureProofOfDeliveryFaxRequest.subclass: + return SignatureProofOfDeliveryFaxRequest.subclass(*args_, **kwargs_) + else: + return SignatureProofOfDeliveryFaxRequest(*args_, **kwargs_) + factory = staticmethod(factory) + def get_WebAuthenticationDetail(self): return self.WebAuthenticationDetail + def set_WebAuthenticationDetail(self, WebAuthenticationDetail): self.WebAuthenticationDetail = WebAuthenticationDetail + def get_ClientDetail(self): return self.ClientDetail + def set_ClientDetail(self, ClientDetail): self.ClientDetail = ClientDetail + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_QualifiedTrackingNumber(self): return self.QualifiedTrackingNumber + def set_QualifiedTrackingNumber(self, QualifiedTrackingNumber): self.QualifiedTrackingNumber = QualifiedTrackingNumber + def get_AdditionalComments(self): return self.AdditionalComments + def set_AdditionalComments(self, AdditionalComments): self.AdditionalComments = AdditionalComments + def get_FaxSender(self): return self.FaxSender + def set_FaxSender(self, FaxSender): self.FaxSender = FaxSender + def get_FaxRecipient(self): return self.FaxRecipient + def set_FaxRecipient(self, FaxRecipient): self.FaxRecipient = FaxRecipient + def export(self, outfile, level, namespace_='ns:', name_='SignatureProofOfDeliveryFaxRequest', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='SignatureProofOfDeliveryFaxRequest') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='SignatureProofOfDeliveryFaxRequest'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='SignatureProofOfDeliveryFaxRequest', fromsubclass_=False): + if self.WebAuthenticationDetail: + self.WebAuthenticationDetail.export(outfile, level, namespace_, name_='WebAuthenticationDetail', ) + if self.ClientDetail: + self.ClientDetail.export(outfile, level, namespace_, name_='ClientDetail', ) + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.QualifiedTrackingNumber: + self.QualifiedTrackingNumber.export(outfile, level, namespace_, name_='QualifiedTrackingNumber') + if self.AdditionalComments is not None: + showIndent(outfile, level) + outfile.write('<%sAdditionalComments>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AdditionalComments).encode(ExternalEncoding), input_name='AdditionalComments'), namespace_)) + if self.FaxSender: + self.FaxSender.export(outfile, level, namespace_, name_='FaxSender') + if self.FaxRecipient: + self.FaxRecipient.export(outfile, level, namespace_, name_='FaxRecipient') + def hasContent_(self): + if ( + self.WebAuthenticationDetail is not None or + self.ClientDetail is not None or + self.TransactionDetail is not None or + self.Version is not None or + self.QualifiedTrackingNumber is not None or + self.AdditionalComments is not None or + self.FaxSender is not None or + self.FaxRecipient is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='SignatureProofOfDeliveryFaxRequest'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.WebAuthenticationDetail is not None: + showIndent(outfile, level) + outfile.write('WebAuthenticationDetail=model_.WebAuthenticationDetail(\n') + self.WebAuthenticationDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ClientDetail is not None: + showIndent(outfile, level) + outfile.write('ClientDetail=model_.ClientDetail(\n') + self.ClientDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.QualifiedTrackingNumber is not None: + showIndent(outfile, level) + outfile.write('QualifiedTrackingNumber=model_.QualifiedTrackingNumber(\n') + self.QualifiedTrackingNumber.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.AdditionalComments is not None: + showIndent(outfile, level) + outfile.write('AdditionalComments=%s,\n' % quote_python(self.AdditionalComments).encode(ExternalEncoding)) + if self.FaxSender is not None: + showIndent(outfile, level) + outfile.write('FaxSender=model_.ContactAndAddress(\n') + self.FaxSender.exportLiteral(outfile, level, name_='FaxSender') + showIndent(outfile, level) + outfile.write('),\n') + if self.FaxRecipient is not None: + showIndent(outfile, level) + outfile.write('FaxRecipient=model_.ContactAndAddress(\n') + self.FaxRecipient.exportLiteral(outfile, level, name_='FaxRecipient') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'WebAuthenticationDetail': + obj_ = WebAuthenticationDetail.factory() + obj_.build(child_) + self.set_WebAuthenticationDetail(obj_) + elif nodeName_ == 'ClientDetail': + obj_ = ClientDetail.factory() + obj_.build(child_) + self.set_ClientDetail(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'QualifiedTrackingNumber': + obj_ = QualifiedTrackingNumber.factory() + obj_.build(child_) + self.set_QualifiedTrackingNumber(obj_) + elif nodeName_ == 'AdditionalComments': + AdditionalComments_ = child_.text + AdditionalComments_ = self.gds_validate_string(AdditionalComments_, node, 'AdditionalComments') + self.AdditionalComments = AdditionalComments_ + elif nodeName_ == 'FaxSender': + obj_ = ContactAndAddress.factory() + obj_.build(child_) + self.set_FaxSender(obj_) + elif nodeName_ == 'FaxRecipient': + obj_ = ContactAndAddress.factory() + obj_.build(child_) + self.set_FaxRecipient(obj_) +# end class SignatureProofOfDeliveryFaxRequest + + +class SignatureProofOfDeliveryLetterReply(GeneratedsSuper): + """FedEx Signature Proof Of Delivery Letter reply.""" + subclass = None + superclass = None + def __init__(self, HighestSeverity=None, Notifications=None, TransactionDetail=None, Version=None, Letter=None): + self.HighestSeverity = HighestSeverity + if Notifications is None: + self.Notifications = [] + else: + self.Notifications = Notifications + self.TransactionDetail = TransactionDetail + self.Version = Version + self.Letter = Letter + def factory(*args_, **kwargs_): + if SignatureProofOfDeliveryLetterReply.subclass: + return SignatureProofOfDeliveryLetterReply.subclass(*args_, **kwargs_) + else: + return SignatureProofOfDeliveryLetterReply(*args_, **kwargs_) + factory = staticmethod(factory) + def get_HighestSeverity(self): return self.HighestSeverity + def set_HighestSeverity(self, HighestSeverity): self.HighestSeverity = HighestSeverity + def validate_NotificationSeverityType(self, value): + # Validate type NotificationSeverityType, a restriction on xs:string. + pass + def get_Notifications(self): return self.Notifications + def set_Notifications(self, Notifications): self.Notifications = Notifications + def add_Notifications(self, value): self.Notifications.append(value) + def insert_Notifications(self, index, value): self.Notifications[index] = value + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_Letter(self): return self.Letter + def set_Letter(self, Letter): self.Letter = Letter + def export(self, outfile, level, namespace_='ns:', name_='SignatureProofOfDeliveryLetterReply', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='SignatureProofOfDeliveryLetterReply') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='SignatureProofOfDeliveryLetterReply'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='SignatureProofOfDeliveryLetterReply', fromsubclass_=False): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('<%sHighestSeverity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HighestSeverity).encode(ExternalEncoding), input_name='HighestSeverity'), namespace_)) + for Notifications_ in self.Notifications: + Notifications_.export(outfile, level, namespace_, name_='Notifications') + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.Letter: + self.Letter.export(outfile, level, namespace_, name_='Letter') + def hasContent_(self): + if ( + self.HighestSeverity is not None or + self.Notifications or + self.TransactionDetail is not None or + self.Version is not None or + self.Letter is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='SignatureProofOfDeliveryLetterReply'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('HighestSeverity=%s,\n' % quote_python(self.HighestSeverity).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Notifications=[\n') + level += 1 + for Notifications_ in self.Notifications: + showIndent(outfile, level) + outfile.write('model_.Notification(\n') + Notifications_.exportLiteral(outfile, level, name_='Notification') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.Letter is not None: + showIndent(outfile, level) + outfile.write('Letter=model_.xs_base64Binary(\n') + self.Letter.exportLiteral(outfile, level, name_='Letter') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'HighestSeverity': + HighestSeverity_ = child_.text + HighestSeverity_ = self.gds_validate_string(HighestSeverity_, node, 'HighestSeverity') + self.HighestSeverity = HighestSeverity_ + self.validate_NotificationSeverityType(self.HighestSeverity) # validate type NotificationSeverityType + elif nodeName_ == 'Notifications': + obj_ = Notification.factory() + obj_.build(child_) + self.Notifications.append(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'Letter': + obj_ = xs_base64Binary.factory() + obj_.build(child_) + self.set_Letter(obj_) +# end class SignatureProofOfDeliveryLetterReply + + +class SignatureProofOfDeliveryLetterRequest(GeneratedsSuper): + """FedEx Signature Proof Of Delivery Letter request.""" + subclass = None + superclass = None + def __init__(self, WebAuthenticationDetail=None, ClientDetail=None, TransactionDetail=None, Version=None, QualifiedTrackingNumber=None, AdditionalComments=None, LetterFormat=None, Consignee=None): + self.WebAuthenticationDetail = WebAuthenticationDetail + self.ClientDetail = ClientDetail + self.TransactionDetail = TransactionDetail + self.Version = Version + self.QualifiedTrackingNumber = QualifiedTrackingNumber + self.AdditionalComments = AdditionalComments + self.LetterFormat = LetterFormat + self.Consignee = Consignee + def factory(*args_, **kwargs_): + if SignatureProofOfDeliveryLetterRequest.subclass: + return SignatureProofOfDeliveryLetterRequest.subclass(*args_, **kwargs_) + else: + return SignatureProofOfDeliveryLetterRequest(*args_, **kwargs_) + factory = staticmethod(factory) + def get_WebAuthenticationDetail(self): return self.WebAuthenticationDetail + def set_WebAuthenticationDetail(self, WebAuthenticationDetail): self.WebAuthenticationDetail = WebAuthenticationDetail + def get_ClientDetail(self): return self.ClientDetail + def set_ClientDetail(self, ClientDetail): self.ClientDetail = ClientDetail + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_QualifiedTrackingNumber(self): return self.QualifiedTrackingNumber + def set_QualifiedTrackingNumber(self, QualifiedTrackingNumber): self.QualifiedTrackingNumber = QualifiedTrackingNumber + def get_AdditionalComments(self): return self.AdditionalComments + def set_AdditionalComments(self, AdditionalComments): self.AdditionalComments = AdditionalComments + def get_LetterFormat(self): return self.LetterFormat + def set_LetterFormat(self, LetterFormat): self.LetterFormat = LetterFormat + def validate_SignatureProofOfDeliveryImageType(self, value): + # Validate type SignatureProofOfDeliveryImageType, a restriction on xs:string. + pass + def get_Consignee(self): return self.Consignee + def set_Consignee(self, Consignee): self.Consignee = Consignee + def export(self, outfile, level, namespace_='ns:', name_='SignatureProofOfDeliveryLetterRequest', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='SignatureProofOfDeliveryLetterRequest') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='SignatureProofOfDeliveryLetterRequest'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='SignatureProofOfDeliveryLetterRequest', fromsubclass_=False): + if self.WebAuthenticationDetail: + self.WebAuthenticationDetail.export(outfile, level, namespace_, name_='WebAuthenticationDetail', ) + if self.ClientDetail: + self.ClientDetail.export(outfile, level, namespace_, name_='ClientDetail', ) + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.QualifiedTrackingNumber: + self.QualifiedTrackingNumber.export(outfile, level, namespace_, name_='QualifiedTrackingNumber') + if self.AdditionalComments is not None: + showIndent(outfile, level) + outfile.write('<%sAdditionalComments>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AdditionalComments).encode(ExternalEncoding), input_name='AdditionalComments'), namespace_)) + if self.LetterFormat is not None: + showIndent(outfile, level) + outfile.write('<%sLetterFormat>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LetterFormat).encode(ExternalEncoding), input_name='LetterFormat'), namespace_)) + if self.Consignee: + self.Consignee.export(outfile, level, namespace_, name_='Consignee') + def hasContent_(self): + if ( + self.WebAuthenticationDetail is not None or + self.ClientDetail is not None or + self.TransactionDetail is not None or + self.Version is not None or + self.QualifiedTrackingNumber is not None or + self.AdditionalComments is not None or + self.LetterFormat is not None or + self.Consignee is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='SignatureProofOfDeliveryLetterRequest'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.WebAuthenticationDetail is not None: + showIndent(outfile, level) + outfile.write('WebAuthenticationDetail=model_.WebAuthenticationDetail(\n') + self.WebAuthenticationDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ClientDetail is not None: + showIndent(outfile, level) + outfile.write('ClientDetail=model_.ClientDetail(\n') + self.ClientDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.QualifiedTrackingNumber is not None: + showIndent(outfile, level) + outfile.write('QualifiedTrackingNumber=model_.QualifiedTrackingNumber(\n') + self.QualifiedTrackingNumber.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.AdditionalComments is not None: + showIndent(outfile, level) + outfile.write('AdditionalComments=%s,\n' % quote_python(self.AdditionalComments).encode(ExternalEncoding)) + if self.LetterFormat is not None: + showIndent(outfile, level) + outfile.write('LetterFormat=%s,\n' % quote_python(self.LetterFormat).encode(ExternalEncoding)) + if self.Consignee is not None: + showIndent(outfile, level) + outfile.write('Consignee=model_.ContactAndAddress(\n') + self.Consignee.exportLiteral(outfile, level, name_='Consignee') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'WebAuthenticationDetail': + obj_ = WebAuthenticationDetail.factory() + obj_.build(child_) + self.set_WebAuthenticationDetail(obj_) + elif nodeName_ == 'ClientDetail': + obj_ = ClientDetail.factory() + obj_.build(child_) + self.set_ClientDetail(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'QualifiedTrackingNumber': + obj_ = QualifiedTrackingNumber.factory() + obj_.build(child_) + self.set_QualifiedTrackingNumber(obj_) + elif nodeName_ == 'AdditionalComments': + AdditionalComments_ = child_.text + AdditionalComments_ = self.gds_validate_string(AdditionalComments_, node, 'AdditionalComments') + self.AdditionalComments = AdditionalComments_ + elif nodeName_ == 'LetterFormat': + LetterFormat_ = child_.text + LetterFormat_ = self.gds_validate_string(LetterFormat_, node, 'LetterFormat') + self.LetterFormat = LetterFormat_ + self.validate_SignatureProofOfDeliveryImageType(self.LetterFormat) # validate type SignatureProofOfDeliveryImageType + elif nodeName_ == 'Consignee': + obj_ = ContactAndAddress.factory() + obj_.build(child_) + self.set_Consignee(obj_) +# end class SignatureProofOfDeliveryLetterRequest + + +class StringBarcode(GeneratedsSuper): + """Each instance of this data type represents a barcode whose content + must be represented as ASCII text (i.e. not binary data).""" + subclass = None + superclass = None + def __init__(self, Type=None, Value=None): + self.Type = Type + self.Value = Value + def factory(*args_, **kwargs_): + if StringBarcode.subclass: + return StringBarcode.subclass(*args_, **kwargs_) + else: + return StringBarcode(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Type(self): return self.Type + def set_Type(self, Type): self.Type = Type + def validate_StringBarcodeType(self, value): + # Validate type StringBarcodeType, a restriction on xs:string. + pass + def get_Value(self): return self.Value + def set_Value(self, Value): self.Value = Value + def export(self, outfile, level, namespace_='ns:', name_='StringBarcode', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='StringBarcode') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='StringBarcode'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='StringBarcode', fromsubclass_=False): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('<%sType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Type).encode(ExternalEncoding), input_name='Type'), namespace_)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('<%sValue>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Value).encode(ExternalEncoding), input_name='Value'), namespace_)) + def hasContent_(self): + if ( + self.Type is not None or + self.Value is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='StringBarcode'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Type is not None: + showIndent(outfile, level) + outfile.write('Type=%s,\n' % quote_python(self.Type).encode(ExternalEncoding)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('Value=%s,\n' % quote_python(self.Value).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Type': + Type_ = child_.text + Type_ = self.gds_validate_string(Type_, node, 'Type') + self.Type = Type_ + self.validate_StringBarcodeType(self.Type) # validate type StringBarcodeType + elif nodeName_ == 'Value': + Value_ = child_.text + Value_ = self.gds_validate_string(Value_, node, 'Value') + self.Value = Value_ +# end class StringBarcode + + +class TrackDetail(GeneratedsSuper): + """Detailed tracking information about a particular package.""" + subclass = None + superclass = None + def __init__(self, Notification=None, TrackingNumber=None, Barcode=None, TrackingNumberUniqueIdentifier=None, StatusCode=None, StatusDescription=None, Reconciliation=None, ServiceCommitMessage=None, CarrierCode=None, OperatingCompany=None, ProductionLocationContactAndAddress=None, OtherIdentifiers=None, ServiceInfo=None, ServiceType=None, PackageWeight=None, PackageDimensions=None, PackageDimensionalWeight=None, ShipmentWeight=None, Packaging=None, PackagingType=None, PackageSequenceNumber=None, PackageCount=None, TrackReturnLabelType=None, TrackReturnDescription=None, ShipperAddress=None, OriginLocationAddress=None, EstimatedPickupTimestamp=None, ShipTimestamp=None, TotalTransitDistance=None, DistanceToDestination=None, DestinationAddress=None, DestinationLocationAddress=None, EstimatedDeliveryTimestamp=None, ActualDeliveryTimestamp=None, ActualDeliveryAddress=None, OfficeOrderDeliveryMethod=None, DeliveryLocationType=None, DeliveryLocationDescription=None, DeliverySignatureName=None, SignatureProofOfDeliveryAvailable=None, NotificationEventsAvailable=None, SplitShipmentParts=None, RedirectToHoldEligibility=None, Events=None): + self.Notification = Notification + self.TrackingNumber = TrackingNumber + self.Barcode = Barcode + self.TrackingNumberUniqueIdentifier = TrackingNumberUniqueIdentifier + self.StatusCode = StatusCode + self.StatusDescription = StatusDescription + self.Reconciliation = Reconciliation + self.ServiceCommitMessage = ServiceCommitMessage + self.CarrierCode = CarrierCode + self.OperatingCompany = OperatingCompany + self.ProductionLocationContactAndAddress = ProductionLocationContactAndAddress + if OtherIdentifiers is None: + self.OtherIdentifiers = [] + else: + self.OtherIdentifiers = OtherIdentifiers + self.ServiceInfo = ServiceInfo + self.ServiceType = ServiceType + self.PackageWeight = PackageWeight + self.PackageDimensions = PackageDimensions + self.PackageDimensionalWeight = PackageDimensionalWeight + self.ShipmentWeight = ShipmentWeight + self.Packaging = Packaging + self.PackagingType = PackagingType + self.PackageSequenceNumber = PackageSequenceNumber + self.PackageCount = PackageCount + self.TrackReturnLabelType = TrackReturnLabelType + self.TrackReturnDescription = TrackReturnDescription + self.ShipperAddress = ShipperAddress + self.OriginLocationAddress = OriginLocationAddress + self.EstimatedPickupTimestamp = EstimatedPickupTimestamp + self.ShipTimestamp = ShipTimestamp + self.TotalTransitDistance = TotalTransitDistance + self.DistanceToDestination = DistanceToDestination + self.DestinationAddress = DestinationAddress + self.DestinationLocationAddress = DestinationLocationAddress + self.EstimatedDeliveryTimestamp = EstimatedDeliveryTimestamp + self.ActualDeliveryTimestamp = ActualDeliveryTimestamp + self.ActualDeliveryAddress = ActualDeliveryAddress + self.OfficeOrderDeliveryMethod = OfficeOrderDeliveryMethod + self.DeliveryLocationType = DeliveryLocationType + self.DeliveryLocationDescription = DeliveryLocationDescription + self.DeliverySignatureName = DeliverySignatureName + self.SignatureProofOfDeliveryAvailable = SignatureProofOfDeliveryAvailable + if NotificationEventsAvailable is None: + self.NotificationEventsAvailable = [] + else: + self.NotificationEventsAvailable = NotificationEventsAvailable + if SplitShipmentParts is None: + self.SplitShipmentParts = [] + else: + self.SplitShipmentParts = SplitShipmentParts + self.RedirectToHoldEligibility = RedirectToHoldEligibility + if Events is None: + self.Events = [] + else: + self.Events = Events + def factory(*args_, **kwargs_): + if TrackDetail.subclass: + return TrackDetail.subclass(*args_, **kwargs_) + else: + return TrackDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Notification(self): return self.Notification + def set_Notification(self, Notification): self.Notification = Notification + def get_TrackingNumber(self): return self.TrackingNumber + def set_TrackingNumber(self, TrackingNumber): self.TrackingNumber = TrackingNumber + def get_Barcode(self): return self.Barcode + def set_Barcode(self, Barcode): self.Barcode = Barcode + def get_TrackingNumberUniqueIdentifier(self): return self.TrackingNumberUniqueIdentifier + def set_TrackingNumberUniqueIdentifier(self, TrackingNumberUniqueIdentifier): self.TrackingNumberUniqueIdentifier = TrackingNumberUniqueIdentifier + def get_StatusCode(self): return self.StatusCode + def set_StatusCode(self, StatusCode): self.StatusCode = StatusCode + def get_StatusDescription(self): return self.StatusDescription + def set_StatusDescription(self, StatusDescription): self.StatusDescription = StatusDescription + def get_Reconciliation(self): return self.Reconciliation + def set_Reconciliation(self, Reconciliation): self.Reconciliation = Reconciliation + def get_ServiceCommitMessage(self): return self.ServiceCommitMessage + def set_ServiceCommitMessage(self, ServiceCommitMessage): self.ServiceCommitMessage = ServiceCommitMessage + def get_CarrierCode(self): return self.CarrierCode + def set_CarrierCode(self, CarrierCode): self.CarrierCode = CarrierCode + def validate_CarrierCodeType(self, value): + # Validate type CarrierCodeType, a restriction on xs:string. + pass + def get_OperatingCompany(self): return self.OperatingCompany + def set_OperatingCompany(self, OperatingCompany): self.OperatingCompany = OperatingCompany + def validate_OperatingCompanyType(self, value): + # Validate type OperatingCompanyType, a restriction on xs:string. + pass + def get_ProductionLocationContactAndAddress(self): return self.ProductionLocationContactAndAddress + def set_ProductionLocationContactAndAddress(self, ProductionLocationContactAndAddress): self.ProductionLocationContactAndAddress = ProductionLocationContactAndAddress + def get_OtherIdentifiers(self): return self.OtherIdentifiers + def set_OtherIdentifiers(self, OtherIdentifiers): self.OtherIdentifiers = OtherIdentifiers + def add_OtherIdentifiers(self, value): self.OtherIdentifiers.append(value) + def insert_OtherIdentifiers(self, index, value): self.OtherIdentifiers[index] = value + def get_ServiceInfo(self): return self.ServiceInfo + def set_ServiceInfo(self, ServiceInfo): self.ServiceInfo = ServiceInfo + def get_ServiceType(self): return self.ServiceType + def set_ServiceType(self, ServiceType): self.ServiceType = ServiceType + def validate_ServiceType(self, value): + # Validate type ServiceType, a restriction on xs:string. + pass + def get_PackageWeight(self): return self.PackageWeight + def set_PackageWeight(self, PackageWeight): self.PackageWeight = PackageWeight + def get_PackageDimensions(self): return self.PackageDimensions + def set_PackageDimensions(self, PackageDimensions): self.PackageDimensions = PackageDimensions + def get_PackageDimensionalWeight(self): return self.PackageDimensionalWeight + def set_PackageDimensionalWeight(self, PackageDimensionalWeight): self.PackageDimensionalWeight = PackageDimensionalWeight + def get_ShipmentWeight(self): return self.ShipmentWeight + def set_ShipmentWeight(self, ShipmentWeight): self.ShipmentWeight = ShipmentWeight + def get_Packaging(self): return self.Packaging + def set_Packaging(self, Packaging): self.Packaging = Packaging + def get_PackagingType(self): return self.PackagingType + def set_PackagingType(self, PackagingType): self.PackagingType = PackagingType + def validate_PackagingType(self, value): + # Validate type PackagingType, a restriction on xs:string. + pass + def get_PackageSequenceNumber(self): return self.PackageSequenceNumber + def set_PackageSequenceNumber(self, PackageSequenceNumber): self.PackageSequenceNumber = PackageSequenceNumber + def get_PackageCount(self): return self.PackageCount + def set_PackageCount(self, PackageCount): self.PackageCount = PackageCount + def get_TrackReturnLabelType(self): return self.TrackReturnLabelType + def set_TrackReturnLabelType(self, TrackReturnLabelType): self.TrackReturnLabelType = TrackReturnLabelType + def validate_TrackReturnLabelType(self, value): + # Validate type TrackReturnLabelType, a restriction on xs:string. + pass + def get_TrackReturnDescription(self): return self.TrackReturnDescription + def set_TrackReturnDescription(self, TrackReturnDescription): self.TrackReturnDescription = TrackReturnDescription + def get_ShipperAddress(self): return self.ShipperAddress + def set_ShipperAddress(self, ShipperAddress): self.ShipperAddress = ShipperAddress + def get_OriginLocationAddress(self): return self.OriginLocationAddress + def set_OriginLocationAddress(self, OriginLocationAddress): self.OriginLocationAddress = OriginLocationAddress + def get_EstimatedPickupTimestamp(self): return self.EstimatedPickupTimestamp + def set_EstimatedPickupTimestamp(self, EstimatedPickupTimestamp): self.EstimatedPickupTimestamp = EstimatedPickupTimestamp + def get_ShipTimestamp(self): return self.ShipTimestamp + def set_ShipTimestamp(self, ShipTimestamp): self.ShipTimestamp = ShipTimestamp + def get_TotalTransitDistance(self): return self.TotalTransitDistance + def set_TotalTransitDistance(self, TotalTransitDistance): self.TotalTransitDistance = TotalTransitDistance + def get_DistanceToDestination(self): return self.DistanceToDestination + def set_DistanceToDestination(self, DistanceToDestination): self.DistanceToDestination = DistanceToDestination + def get_DestinationAddress(self): return self.DestinationAddress + def set_DestinationAddress(self, DestinationAddress): self.DestinationAddress = DestinationAddress + def get_DestinationLocationAddress(self): return self.DestinationLocationAddress + def set_DestinationLocationAddress(self, DestinationLocationAddress): self.DestinationLocationAddress = DestinationLocationAddress + def get_EstimatedDeliveryTimestamp(self): return self.EstimatedDeliveryTimestamp + def set_EstimatedDeliveryTimestamp(self, EstimatedDeliveryTimestamp): self.EstimatedDeliveryTimestamp = EstimatedDeliveryTimestamp + def get_ActualDeliveryTimestamp(self): return self.ActualDeliveryTimestamp + def set_ActualDeliveryTimestamp(self, ActualDeliveryTimestamp): self.ActualDeliveryTimestamp = ActualDeliveryTimestamp + def get_ActualDeliveryAddress(self): return self.ActualDeliveryAddress + def set_ActualDeliveryAddress(self, ActualDeliveryAddress): self.ActualDeliveryAddress = ActualDeliveryAddress + def get_OfficeOrderDeliveryMethod(self): return self.OfficeOrderDeliveryMethod + def set_OfficeOrderDeliveryMethod(self, OfficeOrderDeliveryMethod): self.OfficeOrderDeliveryMethod = OfficeOrderDeliveryMethod + def validate_OfficeOrderDeliveryMethodType(self, value): + # Validate type OfficeOrderDeliveryMethodType, a restriction on xs:string. + pass + def get_DeliveryLocationType(self): return self.DeliveryLocationType + def set_DeliveryLocationType(self, DeliveryLocationType): self.DeliveryLocationType = DeliveryLocationType + def validate_TrackDeliveryLocationType(self, value): + # Validate type TrackDeliveryLocationType, a restriction on xs:string. + pass + def get_DeliveryLocationDescription(self): return self.DeliveryLocationDescription + def set_DeliveryLocationDescription(self, DeliveryLocationDescription): self.DeliveryLocationDescription = DeliveryLocationDescription + def get_DeliverySignatureName(self): return self.DeliverySignatureName + def set_DeliverySignatureName(self, DeliverySignatureName): self.DeliverySignatureName = DeliverySignatureName + def get_SignatureProofOfDeliveryAvailable(self): return self.SignatureProofOfDeliveryAvailable + def set_SignatureProofOfDeliveryAvailable(self, SignatureProofOfDeliveryAvailable): self.SignatureProofOfDeliveryAvailable = SignatureProofOfDeliveryAvailable + def get_NotificationEventsAvailable(self): return self.NotificationEventsAvailable + def set_NotificationEventsAvailable(self, NotificationEventsAvailable): self.NotificationEventsAvailable = NotificationEventsAvailable + def add_NotificationEventsAvailable(self, value): self.NotificationEventsAvailable.append(value) + def insert_NotificationEventsAvailable(self, index, value): self.NotificationEventsAvailable[index] = value + def validate_EMailNotificationEventType(self, value): + # Validate type EMailNotificationEventType, a restriction on xs:string. + pass + def get_SplitShipmentParts(self): return self.SplitShipmentParts + def set_SplitShipmentParts(self, SplitShipmentParts): self.SplitShipmentParts = SplitShipmentParts + def add_SplitShipmentParts(self, value): self.SplitShipmentParts.append(value) + def insert_SplitShipmentParts(self, index, value): self.SplitShipmentParts[index] = value + def get_RedirectToHoldEligibility(self): return self.RedirectToHoldEligibility + def set_RedirectToHoldEligibility(self, RedirectToHoldEligibility): self.RedirectToHoldEligibility = RedirectToHoldEligibility + def validate_RedirectToHoldEligibilityType(self, value): + # Validate type RedirectToHoldEligibilityType, a restriction on xs:string. + pass + def get_Events(self): return self.Events + def set_Events(self, Events): self.Events = Events + def add_Events(self, value): self.Events.append(value) + def insert_Events(self, index, value): self.Events[index] = value + def export(self, outfile, level, namespace_='ns:', name_='TrackDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='TrackDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='TrackDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='TrackDetail', fromsubclass_=False): + if self.Notification: + self.Notification.export(outfile, level, namespace_, name_='Notification') + if self.TrackingNumber is not None: + showIndent(outfile, level) + outfile.write('<%sTrackingNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.TrackingNumber).encode(ExternalEncoding), input_name='TrackingNumber'), namespace_)) + if self.Barcode: + self.Barcode.export(outfile, level, namespace_, name_='Barcode') + if self.TrackingNumberUniqueIdentifier is not None: + showIndent(outfile, level) + outfile.write('<%sTrackingNumberUniqueIdentifier>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.TrackingNumberUniqueIdentifier).encode(ExternalEncoding), input_name='TrackingNumberUniqueIdentifier'), namespace_)) + if self.StatusCode is not None: + showIndent(outfile, level) + outfile.write('<%sStatusCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.StatusCode).encode(ExternalEncoding), input_name='StatusCode'), namespace_)) + if self.StatusDescription is not None: + showIndent(outfile, level) + outfile.write('<%sStatusDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.StatusDescription).encode(ExternalEncoding), input_name='StatusDescription'), namespace_)) + if self.Reconciliation: + self.Reconciliation.export(outfile, level, namespace_, name_='Reconciliation') + if self.ServiceCommitMessage is not None: + showIndent(outfile, level) + outfile.write('<%sServiceCommitMessage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ServiceCommitMessage).encode(ExternalEncoding), input_name='ServiceCommitMessage'), namespace_)) + if self.CarrierCode is not None: + showIndent(outfile, level) + outfile.write('<%sCarrierCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CarrierCode).encode(ExternalEncoding), input_name='CarrierCode'), namespace_)) + if self.OperatingCompany is not None: + showIndent(outfile, level) + outfile.write('<%sOperatingCompany>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.OperatingCompany).encode(ExternalEncoding), input_name='OperatingCompany'), namespace_)) + if self.ProductionLocationContactAndAddress: + self.ProductionLocationContactAndAddress.export(outfile, level, namespace_, name_='ProductionLocationContactAndAddress') + for OtherIdentifiers_ in self.OtherIdentifiers: + OtherIdentifiers_.export(outfile, level, namespace_, name_='OtherIdentifiers') + if self.ServiceInfo is not None: + showIndent(outfile, level) + outfile.write('<%sServiceInfo>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ServiceInfo).encode(ExternalEncoding), input_name='ServiceInfo'), namespace_)) + if self.ServiceType is not None: + showIndent(outfile, level) + outfile.write('<%sServiceType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ServiceType).encode(ExternalEncoding), input_name='ServiceType'), namespace_)) + if self.PackageWeight: + self.PackageWeight.export(outfile, level, namespace_, name_='PackageWeight') + if self.PackageDimensions: + self.PackageDimensions.export(outfile, level, namespace_, name_='PackageDimensions') + if self.PackageDimensionalWeight: + self.PackageDimensionalWeight.export(outfile, level, namespace_, name_='PackageDimensionalWeight') + if self.ShipmentWeight: + self.ShipmentWeight.export(outfile, level, namespace_, name_='ShipmentWeight') + if self.Packaging is not None: + showIndent(outfile, level) + outfile.write('<%sPackaging>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Packaging).encode(ExternalEncoding), input_name='Packaging'), namespace_)) + if self.PackagingType is not None: + showIndent(outfile, level) + outfile.write('<%sPackagingType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PackagingType).encode(ExternalEncoding), input_name='PackagingType'), namespace_)) + if self.PackageSequenceNumber is not None: + showIndent(outfile, level) + outfile.write('<%sPackageSequenceNumber>%s\n' % (namespace_, self.gds_format_integer(self.PackageSequenceNumber, input_name='PackageSequenceNumber'), namespace_)) + if self.PackageCount is not None: + showIndent(outfile, level) + outfile.write('<%sPackageCount>%s\n' % (namespace_, self.gds_format_integer(self.PackageCount, input_name='PackageCount'), namespace_)) + if self.TrackReturnLabelType is not None: + showIndent(outfile, level) + outfile.write('<%sTrackReturnLabelType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.TrackReturnLabelType).encode(ExternalEncoding), input_name='TrackReturnLabelType'), namespace_)) + if self.TrackReturnDescription is not None: + showIndent(outfile, level) + outfile.write('<%sTrackReturnDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.TrackReturnDescription).encode(ExternalEncoding), input_name='TrackReturnDescription'), namespace_)) + if self.ShipperAddress: + self.ShipperAddress.export(outfile, level, namespace_, name_='ShipperAddress') + if self.OriginLocationAddress: + self.OriginLocationAddress.export(outfile, level, namespace_, name_='OriginLocationAddress') + if self.EstimatedPickupTimestamp is not None: + showIndent(outfile, level) + outfile.write('<%sEstimatedPickupTimestamp>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.EstimatedPickupTimestamp).encode(ExternalEncoding), input_name='EstimatedPickupTimestamp'), namespace_)) + if self.ShipTimestamp is not None: + showIndent(outfile, level) + outfile.write('<%sShipTimestamp>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ShipTimestamp).encode(ExternalEncoding), input_name='ShipTimestamp'), namespace_)) + if self.TotalTransitDistance: + self.TotalTransitDistance.export(outfile, level, namespace_, name_='TotalTransitDistance') + if self.DistanceToDestination: + self.DistanceToDestination.export(outfile, level, namespace_, name_='DistanceToDestination') + if self.DestinationAddress: + self.DestinationAddress.export(outfile, level, namespace_, name_='DestinationAddress') + if self.DestinationLocationAddress: + self.DestinationLocationAddress.export(outfile, level, namespace_, name_='DestinationLocationAddress') + if self.EstimatedDeliveryTimestamp is not None: + showIndent(outfile, level) + outfile.write('<%sEstimatedDeliveryTimestamp>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.EstimatedDeliveryTimestamp).encode(ExternalEncoding), input_name='EstimatedDeliveryTimestamp'), namespace_)) + if self.ActualDeliveryTimestamp is not None: + showIndent(outfile, level) + outfile.write('<%sActualDeliveryTimestamp>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ActualDeliveryTimestamp).encode(ExternalEncoding), input_name='ActualDeliveryTimestamp'), namespace_)) + if self.ActualDeliveryAddress: + self.ActualDeliveryAddress.export(outfile, level, namespace_, name_='ActualDeliveryAddress') + if self.OfficeOrderDeliveryMethod is not None: + showIndent(outfile, level) + outfile.write('<%sOfficeOrderDeliveryMethod>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.OfficeOrderDeliveryMethod).encode(ExternalEncoding), input_name='OfficeOrderDeliveryMethod'), namespace_)) + if self.DeliveryLocationType is not None: + showIndent(outfile, level) + outfile.write('<%sDeliveryLocationType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DeliveryLocationType).encode(ExternalEncoding), input_name='DeliveryLocationType'), namespace_)) + if self.DeliveryLocationDescription is not None: + showIndent(outfile, level) + outfile.write('<%sDeliveryLocationDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DeliveryLocationDescription).encode(ExternalEncoding), input_name='DeliveryLocationDescription'), namespace_)) + if self.DeliverySignatureName is not None: + showIndent(outfile, level) + outfile.write('<%sDeliverySignatureName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DeliverySignatureName).encode(ExternalEncoding), input_name='DeliverySignatureName'), namespace_)) + if self.SignatureProofOfDeliveryAvailable is not None: + showIndent(outfile, level) + outfile.write('<%sSignatureProofOfDeliveryAvailable>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.SignatureProofOfDeliveryAvailable)), input_name='SignatureProofOfDeliveryAvailable'), namespace_)) + for NotificationEventsAvailable_ in self.NotificationEventsAvailable: + showIndent(outfile, level) + outfile.write('<%sNotificationEventsAvailable>%s\n' % (namespace_, self.gds_format_string(quote_xml(NotificationEventsAvailable_).encode(ExternalEncoding), input_name='NotificationEventsAvailable'), namespace_)) + for SplitShipmentParts_ in self.SplitShipmentParts: + SplitShipmentParts_.export(outfile, level, namespace_, name_='SplitShipmentParts') + if self.RedirectToHoldEligibility is not None: + showIndent(outfile, level) + outfile.write('<%sRedirectToHoldEligibility>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.RedirectToHoldEligibility).encode(ExternalEncoding), input_name='RedirectToHoldEligibility'), namespace_)) + for Events_ in self.Events: + Events_.export(outfile, level, namespace_, name_='Events') + def hasContent_(self): + if ( + self.Notification is not None or + self.TrackingNumber is not None or + self.Barcode is not None or + self.TrackingNumberUniqueIdentifier is not None or + self.StatusCode is not None or + self.StatusDescription is not None or + self.Reconciliation is not None or + self.ServiceCommitMessage is not None or + self.CarrierCode is not None or + self.OperatingCompany is not None or + self.ProductionLocationContactAndAddress is not None or + self.OtherIdentifiers or + self.ServiceInfo is not None or + self.ServiceType is not None or + self.PackageWeight is not None or + self.PackageDimensions is not None or + self.PackageDimensionalWeight is not None or + self.ShipmentWeight is not None or + self.Packaging is not None or + self.PackagingType is not None or + self.PackageSequenceNumber is not None or + self.PackageCount is not None or + self.TrackReturnLabelType is not None or + self.TrackReturnDescription is not None or + self.ShipperAddress is not None or + self.OriginLocationAddress is not None or + self.EstimatedPickupTimestamp is not None or + self.ShipTimestamp is not None or + self.TotalTransitDistance is not None or + self.DistanceToDestination is not None or + self.DestinationAddress is not None or + self.DestinationLocationAddress is not None or + self.EstimatedDeliveryTimestamp is not None or + self.ActualDeliveryTimestamp is not None or + self.ActualDeliveryAddress is not None or + self.OfficeOrderDeliveryMethod is not None or + self.DeliveryLocationType is not None or + self.DeliveryLocationDescription is not None or + self.DeliverySignatureName is not None or + self.SignatureProofOfDeliveryAvailable is not None or + self.NotificationEventsAvailable or + self.SplitShipmentParts or + self.RedirectToHoldEligibility is not None or + self.Events + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='TrackDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Notification is not None: + showIndent(outfile, level) + outfile.write('Notification=model_.Notification(\n') + self.Notification.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.TrackingNumber is not None: + showIndent(outfile, level) + outfile.write('TrackingNumber=%s,\n' % quote_python(self.TrackingNumber).encode(ExternalEncoding)) + if self.Barcode is not None: + showIndent(outfile, level) + outfile.write('Barcode=model_.StringBarcode(\n') + self.Barcode.exportLiteral(outfile, level, name_='Barcode') + showIndent(outfile, level) + outfile.write('),\n') + if self.TrackingNumberUniqueIdentifier is not None: + showIndent(outfile, level) + outfile.write('TrackingNumberUniqueIdentifier=%s,\n' % quote_python(self.TrackingNumberUniqueIdentifier).encode(ExternalEncoding)) + if self.StatusCode is not None: + showIndent(outfile, level) + outfile.write('StatusCode=%s,\n' % quote_python(self.StatusCode).encode(ExternalEncoding)) + if self.StatusDescription is not None: + showIndent(outfile, level) + outfile.write('StatusDescription=%s,\n' % quote_python(self.StatusDescription).encode(ExternalEncoding)) + if self.Reconciliation is not None: + showIndent(outfile, level) + outfile.write('Reconciliation=model_.TrackReconciliation(\n') + self.Reconciliation.exportLiteral(outfile, level, name_='Reconciliation') + showIndent(outfile, level) + outfile.write('),\n') + if self.ServiceCommitMessage is not None: + showIndent(outfile, level) + outfile.write('ServiceCommitMessage=%s,\n' % quote_python(self.ServiceCommitMessage).encode(ExternalEncoding)) + if self.CarrierCode is not None: + showIndent(outfile, level) + outfile.write('CarrierCode=%s,\n' % quote_python(self.CarrierCode).encode(ExternalEncoding)) + if self.OperatingCompany is not None: + showIndent(outfile, level) + outfile.write('OperatingCompany=%s,\n' % quote_python(self.OperatingCompany).encode(ExternalEncoding)) + if self.ProductionLocationContactAndAddress is not None: + showIndent(outfile, level) + outfile.write('ProductionLocationContactAndAddress=model_.ContactAndAddress(\n') + self.ProductionLocationContactAndAddress.exportLiteral(outfile, level, name_='ProductionLocationContactAndAddress') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('OtherIdentifiers=[\n') + level += 1 + for OtherIdentifiers_ in self.OtherIdentifiers: + showIndent(outfile, level) + outfile.write('model_.TrackPackageIdentifier(\n') + OtherIdentifiers_.exportLiteral(outfile, level, name_='TrackPackageIdentifier') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.ServiceInfo is not None: + showIndent(outfile, level) + outfile.write('ServiceInfo=%s,\n' % quote_python(self.ServiceInfo).encode(ExternalEncoding)) + if self.ServiceType is not None: + showIndent(outfile, level) + outfile.write('ServiceType=%s,\n' % quote_python(self.ServiceType).encode(ExternalEncoding)) + if self.PackageWeight is not None: + showIndent(outfile, level) + outfile.write('PackageWeight=model_.Weight(\n') + self.PackageWeight.exportLiteral(outfile, level, name_='PackageWeight') + showIndent(outfile, level) + outfile.write('),\n') + if self.PackageDimensions is not None: + showIndent(outfile, level) + outfile.write('PackageDimensions=model_.Dimensions(\n') + self.PackageDimensions.exportLiteral(outfile, level, name_='PackageDimensions') + showIndent(outfile, level) + outfile.write('),\n') + if self.PackageDimensionalWeight is not None: + showIndent(outfile, level) + outfile.write('PackageDimensionalWeight=model_.Weight(\n') + self.PackageDimensionalWeight.exportLiteral(outfile, level, name_='PackageDimensionalWeight') + showIndent(outfile, level) + outfile.write('),\n') + if self.ShipmentWeight is not None: + showIndent(outfile, level) + outfile.write('ShipmentWeight=model_.Weight(\n') + self.ShipmentWeight.exportLiteral(outfile, level, name_='ShipmentWeight') + showIndent(outfile, level) + outfile.write('),\n') + if self.Packaging is not None: + showIndent(outfile, level) + outfile.write('Packaging=%s,\n' % quote_python(self.Packaging).encode(ExternalEncoding)) + if self.PackagingType is not None: + showIndent(outfile, level) + outfile.write('PackagingType=%s,\n' % quote_python(self.PackagingType).encode(ExternalEncoding)) + if self.PackageSequenceNumber is not None: + showIndent(outfile, level) + outfile.write('PackageSequenceNumber=%d,\n' % self.PackageSequenceNumber) + if self.PackageCount is not None: + showIndent(outfile, level) + outfile.write('PackageCount=%d,\n' % self.PackageCount) + if self.TrackReturnLabelType is not None: + showIndent(outfile, level) + outfile.write('TrackReturnLabelType=%s,\n' % quote_python(self.TrackReturnLabelType).encode(ExternalEncoding)) + if self.TrackReturnDescription is not None: + showIndent(outfile, level) + outfile.write('TrackReturnDescription=%s,\n' % quote_python(self.TrackReturnDescription).encode(ExternalEncoding)) + if self.ShipperAddress is not None: + showIndent(outfile, level) + outfile.write('ShipperAddress=model_.Address(\n') + self.ShipperAddress.exportLiteral(outfile, level, name_='ShipperAddress') + showIndent(outfile, level) + outfile.write('),\n') + if self.OriginLocationAddress is not None: + showIndent(outfile, level) + outfile.write('OriginLocationAddress=model_.Address(\n') + self.OriginLocationAddress.exportLiteral(outfile, level, name_='OriginLocationAddress') + showIndent(outfile, level) + outfile.write('),\n') + if self.EstimatedPickupTimestamp is not None: + showIndent(outfile, level) + outfile.write('EstimatedPickupTimestamp=%s,\n' % quote_python(self.EstimatedPickupTimestamp).encode(ExternalEncoding)) + if self.ShipTimestamp is not None: + showIndent(outfile, level) + outfile.write('ShipTimestamp=%s,\n' % quote_python(self.ShipTimestamp).encode(ExternalEncoding)) + if self.TotalTransitDistance is not None: + showIndent(outfile, level) + outfile.write('TotalTransitDistance=model_.Distance(\n') + self.TotalTransitDistance.exportLiteral(outfile, level, name_='TotalTransitDistance') + showIndent(outfile, level) + outfile.write('),\n') + if self.DistanceToDestination is not None: + showIndent(outfile, level) + outfile.write('DistanceToDestination=model_.Distance(\n') + self.DistanceToDestination.exportLiteral(outfile, level, name_='DistanceToDestination') + showIndent(outfile, level) + outfile.write('),\n') + if self.DestinationAddress is not None: + showIndent(outfile, level) + outfile.write('DestinationAddress=model_.Address(\n') + self.DestinationAddress.exportLiteral(outfile, level, name_='DestinationAddress') + showIndent(outfile, level) + outfile.write('),\n') + if self.DestinationLocationAddress is not None: + showIndent(outfile, level) + outfile.write('DestinationLocationAddress=model_.Address(\n') + self.DestinationLocationAddress.exportLiteral(outfile, level, name_='DestinationLocationAddress') + showIndent(outfile, level) + outfile.write('),\n') + if self.EstimatedDeliveryTimestamp is not None: + showIndent(outfile, level) + outfile.write('EstimatedDeliveryTimestamp=%s,\n' % quote_python(self.EstimatedDeliveryTimestamp).encode(ExternalEncoding)) + if self.ActualDeliveryTimestamp is not None: + showIndent(outfile, level) + outfile.write('ActualDeliveryTimestamp=%s,\n' % quote_python(self.ActualDeliveryTimestamp).encode(ExternalEncoding)) + if self.ActualDeliveryAddress is not None: + showIndent(outfile, level) + outfile.write('ActualDeliveryAddress=model_.Address(\n') + self.ActualDeliveryAddress.exportLiteral(outfile, level, name_='ActualDeliveryAddress') + showIndent(outfile, level) + outfile.write('),\n') + if self.OfficeOrderDeliveryMethod is not None: + showIndent(outfile, level) + outfile.write('OfficeOrderDeliveryMethod=%s,\n' % quote_python(self.OfficeOrderDeliveryMethod).encode(ExternalEncoding)) + if self.DeliveryLocationType is not None: + showIndent(outfile, level) + outfile.write('DeliveryLocationType=%s,\n' % quote_python(self.DeliveryLocationType).encode(ExternalEncoding)) + if self.DeliveryLocationDescription is not None: + showIndent(outfile, level) + outfile.write('DeliveryLocationDescription=%s,\n' % quote_python(self.DeliveryLocationDescription).encode(ExternalEncoding)) + if self.DeliverySignatureName is not None: + showIndent(outfile, level) + outfile.write('DeliverySignatureName=%s,\n' % quote_python(self.DeliverySignatureName).encode(ExternalEncoding)) + if self.SignatureProofOfDeliveryAvailable is not None: + showIndent(outfile, level) + outfile.write('SignatureProofOfDeliveryAvailable=%s,\n' % self.SignatureProofOfDeliveryAvailable) + showIndent(outfile, level) + outfile.write('NotificationEventsAvailable=[\n') + level += 1 + for NotificationEventsAvailable_ in self.NotificationEventsAvailable: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(NotificationEventsAvailable_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + showIndent(outfile, level) + outfile.write('SplitShipmentParts=[\n') + level += 1 + for SplitShipmentParts_ in self.SplitShipmentParts: + showIndent(outfile, level) + outfile.write('model_.TrackSplitShipmentPart(\n') + SplitShipmentParts_.exportLiteral(outfile, level, name_='TrackSplitShipmentPart') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.RedirectToHoldEligibility is not None: + showIndent(outfile, level) + outfile.write('RedirectToHoldEligibility=%s,\n' % quote_python(self.RedirectToHoldEligibility).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Events=[\n') + level += 1 + for Events_ in self.Events: + showIndent(outfile, level) + outfile.write('model_.TrackEvent(\n') + Events_.exportLiteral(outfile, level, name_='TrackEvent') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Notification': + obj_ = Notification.factory() + obj_.build(child_) + self.set_Notification(obj_) + elif nodeName_ == 'TrackingNumber': + TrackingNumber_ = child_.text + TrackingNumber_ = self.gds_validate_string(TrackingNumber_, node, 'TrackingNumber') + self.TrackingNumber = TrackingNumber_ + elif nodeName_ == 'Barcode': + obj_ = StringBarcode.factory() + obj_.build(child_) + self.set_Barcode(obj_) + elif nodeName_ == 'TrackingNumberUniqueIdentifier': + TrackingNumberUniqueIdentifier_ = child_.text + TrackingNumberUniqueIdentifier_ = self.gds_validate_string(TrackingNumberUniqueIdentifier_, node, 'TrackingNumberUniqueIdentifier') + self.TrackingNumberUniqueIdentifier = TrackingNumberUniqueIdentifier_ + elif nodeName_ == 'StatusCode': + StatusCode_ = child_.text + StatusCode_ = self.gds_validate_string(StatusCode_, node, 'StatusCode') + self.StatusCode = StatusCode_ + elif nodeName_ == 'StatusDescription': + StatusDescription_ = child_.text + StatusDescription_ = self.gds_validate_string(StatusDescription_, node, 'StatusDescription') + self.StatusDescription = StatusDescription_ + elif nodeName_ == 'Reconciliation': + obj_ = TrackReconciliation.factory() + obj_.build(child_) + self.set_Reconciliation(obj_) + elif nodeName_ == 'ServiceCommitMessage': + ServiceCommitMessage_ = child_.text + ServiceCommitMessage_ = self.gds_validate_string(ServiceCommitMessage_, node, 'ServiceCommitMessage') + self.ServiceCommitMessage = ServiceCommitMessage_ + elif nodeName_ == 'CarrierCode': + CarrierCode_ = child_.text + CarrierCode_ = self.gds_validate_string(CarrierCode_, node, 'CarrierCode') + self.CarrierCode = CarrierCode_ + self.validate_CarrierCodeType(self.CarrierCode) # validate type CarrierCodeType + elif nodeName_ == 'OperatingCompany': + OperatingCompany_ = child_.text + OperatingCompany_ = self.gds_validate_string(OperatingCompany_, node, 'OperatingCompany') + self.OperatingCompany = OperatingCompany_ + self.validate_OperatingCompanyType(self.OperatingCompany) # validate type OperatingCompanyType + elif nodeName_ == 'ProductionLocationContactAndAddress': + obj_ = ContactAndAddress.factory() + obj_.build(child_) + self.set_ProductionLocationContactAndAddress(obj_) + elif nodeName_ == 'OtherIdentifiers': + obj_ = TrackPackageIdentifier.factory() + obj_.build(child_) + self.OtherIdentifiers.append(obj_) + elif nodeName_ == 'ServiceInfo': + ServiceInfo_ = child_.text + ServiceInfo_ = self.gds_validate_string(ServiceInfo_, node, 'ServiceInfo') + self.ServiceInfo = ServiceInfo_ + elif nodeName_ == 'ServiceType': + ServiceType_ = child_.text + ServiceType_ = self.gds_validate_string(ServiceType_, node, 'ServiceType') + self.ServiceType = ServiceType_ + self.validate_ServiceType(self.ServiceType) # validate type ServiceType + elif nodeName_ == 'PackageWeight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_PackageWeight(obj_) + elif nodeName_ == 'PackageDimensions': + obj_ = Dimensions.factory() + obj_.build(child_) + self.set_PackageDimensions(obj_) + elif nodeName_ == 'PackageDimensionalWeight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_PackageDimensionalWeight(obj_) + elif nodeName_ == 'ShipmentWeight': + obj_ = Weight.factory() + obj_.build(child_) + self.set_ShipmentWeight(obj_) + elif nodeName_ == 'Packaging': + Packaging_ = child_.text + Packaging_ = self.gds_validate_string(Packaging_, node, 'Packaging') + self.Packaging = Packaging_ + elif nodeName_ == 'PackagingType': + PackagingType_ = child_.text + PackagingType_ = self.gds_validate_string(PackagingType_, node, 'PackagingType') + self.PackagingType = PackagingType_ + self.validate_PackagingType(self.PackagingType) # validate type PackagingType + elif nodeName_ == 'PackageSequenceNumber': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'PackageSequenceNumber') + self.PackageSequenceNumber = ival_ + elif nodeName_ == 'PackageCount': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'PackageCount') + self.PackageCount = ival_ + elif nodeName_ == 'TrackReturnLabelType': + TrackReturnLabelType_ = child_.text + TrackReturnLabelType_ = self.gds_validate_string(TrackReturnLabelType_, node, 'TrackReturnLabelType') + self.TrackReturnLabelType = TrackReturnLabelType_ + self.validate_TrackReturnLabelType(self.TrackReturnLabelType) # validate type TrackReturnLabelType + elif nodeName_ == 'TrackReturnDescription': + TrackReturnDescription_ = child_.text + TrackReturnDescription_ = self.gds_validate_string(TrackReturnDescription_, node, 'TrackReturnDescription') + self.TrackReturnDescription = TrackReturnDescription_ + elif nodeName_ == 'ShipperAddress': + obj_ = Address.factory() + obj_.build(child_) + self.set_ShipperAddress(obj_) + elif nodeName_ == 'OriginLocationAddress': + obj_ = Address.factory() + obj_.build(child_) + self.set_OriginLocationAddress(obj_) + elif nodeName_ == 'EstimatedPickupTimestamp': + EstimatedPickupTimestamp_ = child_.text + EstimatedPickupTimestamp_ = self.gds_validate_string(EstimatedPickupTimestamp_, node, 'EstimatedPickupTimestamp') + self.EstimatedPickupTimestamp = EstimatedPickupTimestamp_ + elif nodeName_ == 'ShipTimestamp': + ShipTimestamp_ = child_.text + ShipTimestamp_ = self.gds_validate_string(ShipTimestamp_, node, 'ShipTimestamp') + self.ShipTimestamp = ShipTimestamp_ + elif nodeName_ == 'TotalTransitDistance': + obj_ = Distance.factory() + obj_.build(child_) + self.set_TotalTransitDistance(obj_) + elif nodeName_ == 'DistanceToDestination': + obj_ = Distance.factory() + obj_.build(child_) + self.set_DistanceToDestination(obj_) + elif nodeName_ == 'DestinationAddress': + obj_ = Address.factory() + obj_.build(child_) + self.set_DestinationAddress(obj_) + elif nodeName_ == 'DestinationLocationAddress': + obj_ = Address.factory() + obj_.build(child_) + self.set_DestinationLocationAddress(obj_) + elif nodeName_ == 'EstimatedDeliveryTimestamp': + EstimatedDeliveryTimestamp_ = child_.text + EstimatedDeliveryTimestamp_ = self.gds_validate_string(EstimatedDeliveryTimestamp_, node, 'EstimatedDeliveryTimestamp') + self.EstimatedDeliveryTimestamp = EstimatedDeliveryTimestamp_ + elif nodeName_ == 'ActualDeliveryTimestamp': + ActualDeliveryTimestamp_ = child_.text + ActualDeliveryTimestamp_ = self.gds_validate_string(ActualDeliveryTimestamp_, node, 'ActualDeliveryTimestamp') + self.ActualDeliveryTimestamp = ActualDeliveryTimestamp_ + elif nodeName_ == 'ActualDeliveryAddress': + obj_ = Address.factory() + obj_.build(child_) + self.set_ActualDeliveryAddress(obj_) + elif nodeName_ == 'OfficeOrderDeliveryMethod': + OfficeOrderDeliveryMethod_ = child_.text + OfficeOrderDeliveryMethod_ = self.gds_validate_string(OfficeOrderDeliveryMethod_, node, 'OfficeOrderDeliveryMethod') + self.OfficeOrderDeliveryMethod = OfficeOrderDeliveryMethod_ + self.validate_OfficeOrderDeliveryMethodType(self.OfficeOrderDeliveryMethod) # validate type OfficeOrderDeliveryMethodType + elif nodeName_ == 'DeliveryLocationType': + DeliveryLocationType_ = child_.text + DeliveryLocationType_ = self.gds_validate_string(DeliveryLocationType_, node, 'DeliveryLocationType') + self.DeliveryLocationType = DeliveryLocationType_ + self.validate_TrackDeliveryLocationType(self.DeliveryLocationType) # validate type TrackDeliveryLocationType + elif nodeName_ == 'DeliveryLocationDescription': + DeliveryLocationDescription_ = child_.text + DeliveryLocationDescription_ = self.gds_validate_string(DeliveryLocationDescription_, node, 'DeliveryLocationDescription') + self.DeliveryLocationDescription = DeliveryLocationDescription_ + elif nodeName_ == 'DeliverySignatureName': + DeliverySignatureName_ = child_.text + DeliverySignatureName_ = self.gds_validate_string(DeliverySignatureName_, node, 'DeliverySignatureName') + self.DeliverySignatureName = DeliverySignatureName_ + elif nodeName_ == 'SignatureProofOfDeliveryAvailable': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'SignatureProofOfDeliveryAvailable') + self.SignatureProofOfDeliveryAvailable = ival_ + elif nodeName_ == 'NotificationEventsAvailable': + NotificationEventsAvailable_ = child_.text + NotificationEventsAvailable_ = self.gds_validate_string(NotificationEventsAvailable_, node, 'NotificationEventsAvailable') + self.NotificationEventsAvailable.append(NotificationEventsAvailable_) + self.validate_EMailNotificationEventType(self.NotificationEventsAvailable) # validate type EMailNotificationEventType + elif nodeName_ == 'SplitShipmentParts': + obj_ = TrackSplitShipmentPart.factory() + obj_.build(child_) + self.SplitShipmentParts.append(obj_) + elif nodeName_ == 'RedirectToHoldEligibility': + RedirectToHoldEligibility_ = child_.text + RedirectToHoldEligibility_ = self.gds_validate_string(RedirectToHoldEligibility_, node, 'RedirectToHoldEligibility') + self.RedirectToHoldEligibility = RedirectToHoldEligibility_ + self.validate_RedirectToHoldEligibilityType(self.RedirectToHoldEligibility) # validate type RedirectToHoldEligibilityType + elif nodeName_ == 'Events': + obj_ = TrackEvent.factory() + obj_.build(child_) + self.Events.append(obj_) +# end class TrackDetail + + +class TrackEvent(GeneratedsSuper): + """FedEx scanning information about a package.""" + subclass = None + superclass = None + def __init__(self, Timestamp=None, EventType=None, EventDescription=None, StatusExceptionCode=None, StatusExceptionDescription=None, Address=None, ArrivalLocation=None): + self.Timestamp = Timestamp + self.EventType = EventType + self.EventDescription = EventDescription + self.StatusExceptionCode = StatusExceptionCode + self.StatusExceptionDescription = StatusExceptionDescription + self.Address = Address + self.ArrivalLocation = ArrivalLocation + def factory(*args_, **kwargs_): + if TrackEvent.subclass: + return TrackEvent.subclass(*args_, **kwargs_) + else: + return TrackEvent(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Timestamp(self): return self.Timestamp + def set_Timestamp(self, Timestamp): self.Timestamp = Timestamp + def get_EventType(self): return self.EventType + def set_EventType(self, EventType): self.EventType = EventType + def get_EventDescription(self): return self.EventDescription + def set_EventDescription(self, EventDescription): self.EventDescription = EventDescription + def get_StatusExceptionCode(self): return self.StatusExceptionCode + def set_StatusExceptionCode(self, StatusExceptionCode): self.StatusExceptionCode = StatusExceptionCode + def get_StatusExceptionDescription(self): return self.StatusExceptionDescription + def set_StatusExceptionDescription(self, StatusExceptionDescription): self.StatusExceptionDescription = StatusExceptionDescription + def get_Address(self): return self.Address + def set_Address(self, Address): self.Address = Address + def get_ArrivalLocation(self): return self.ArrivalLocation + def set_ArrivalLocation(self, ArrivalLocation): self.ArrivalLocation = ArrivalLocation + def validate_ArrivalLocationType(self, value): + # Validate type ArrivalLocationType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='TrackEvent', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='TrackEvent') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='TrackEvent'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='TrackEvent', fromsubclass_=False): + if self.Timestamp is not None: + showIndent(outfile, level) + outfile.write('<%sTimestamp>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Timestamp).encode(ExternalEncoding), input_name='Timestamp'), namespace_)) + if self.EventType is not None: + showIndent(outfile, level) + outfile.write('<%sEventType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.EventType).encode(ExternalEncoding), input_name='EventType'), namespace_)) + if self.EventDescription is not None: + showIndent(outfile, level) + outfile.write('<%sEventDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.EventDescription).encode(ExternalEncoding), input_name='EventDescription'), namespace_)) + if self.StatusExceptionCode is not None: + showIndent(outfile, level) + outfile.write('<%sStatusExceptionCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.StatusExceptionCode).encode(ExternalEncoding), input_name='StatusExceptionCode'), namespace_)) + if self.StatusExceptionDescription is not None: + showIndent(outfile, level) + outfile.write('<%sStatusExceptionDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.StatusExceptionDescription).encode(ExternalEncoding), input_name='StatusExceptionDescription'), namespace_)) + if self.Address: + self.Address.export(outfile, level, namespace_, name_='Address') + if self.ArrivalLocation is not None: + showIndent(outfile, level) + outfile.write('<%sArrivalLocation>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ArrivalLocation).encode(ExternalEncoding), input_name='ArrivalLocation'), namespace_)) + def hasContent_(self): + if ( + self.Timestamp is not None or + self.EventType is not None or + self.EventDescription is not None or + self.StatusExceptionCode is not None or + self.StatusExceptionDescription is not None or + self.Address is not None or + self.ArrivalLocation is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='TrackEvent'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Timestamp is not None: + showIndent(outfile, level) + outfile.write('Timestamp=%s,\n' % quote_python(self.Timestamp).encode(ExternalEncoding)) + if self.EventType is not None: + showIndent(outfile, level) + outfile.write('EventType=%s,\n' % quote_python(self.EventType).encode(ExternalEncoding)) + if self.EventDescription is not None: + showIndent(outfile, level) + outfile.write('EventDescription=%s,\n' % quote_python(self.EventDescription).encode(ExternalEncoding)) + if self.StatusExceptionCode is not None: + showIndent(outfile, level) + outfile.write('StatusExceptionCode=%s,\n' % quote_python(self.StatusExceptionCode).encode(ExternalEncoding)) + if self.StatusExceptionDescription is not None: + showIndent(outfile, level) + outfile.write('StatusExceptionDescription=%s,\n' % quote_python(self.StatusExceptionDescription).encode(ExternalEncoding)) + if self.Address is not None: + showIndent(outfile, level) + outfile.write('Address=model_.Address(\n') + self.Address.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ArrivalLocation is not None: + showIndent(outfile, level) + outfile.write('ArrivalLocation=%s,\n' % quote_python(self.ArrivalLocation).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Timestamp': + Timestamp_ = child_.text + Timestamp_ = self.gds_validate_string(Timestamp_, node, 'Timestamp') + self.Timestamp = Timestamp_ + elif nodeName_ == 'EventType': + EventType_ = child_.text + EventType_ = self.gds_validate_string(EventType_, node, 'EventType') + self.EventType = EventType_ + elif nodeName_ == 'EventDescription': + EventDescription_ = child_.text + EventDescription_ = self.gds_validate_string(EventDescription_, node, 'EventDescription') + self.EventDescription = EventDescription_ + elif nodeName_ == 'StatusExceptionCode': + StatusExceptionCode_ = child_.text + StatusExceptionCode_ = self.gds_validate_string(StatusExceptionCode_, node, 'StatusExceptionCode') + self.StatusExceptionCode = StatusExceptionCode_ + elif nodeName_ == 'StatusExceptionDescription': + StatusExceptionDescription_ = child_.text + StatusExceptionDescription_ = self.gds_validate_string(StatusExceptionDescription_, node, 'StatusExceptionDescription') + self.StatusExceptionDescription = StatusExceptionDescription_ + elif nodeName_ == 'Address': + obj_ = Address.factory() + obj_.build(child_) + self.set_Address(obj_) + elif nodeName_ == 'ArrivalLocation': + ArrivalLocation_ = child_.text + ArrivalLocation_ = self.gds_validate_string(ArrivalLocation_, node, 'ArrivalLocation') + self.ArrivalLocation = ArrivalLocation_ + self.validate_ArrivalLocationType(self.ArrivalLocation) # validate type ArrivalLocationType +# end class TrackEvent + + +class TrackNotificationPackage(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, TrackingNumber=None, TrackingNumberUniqueIdentifiers=None, CarrierCode=None, ShipDate=None, Destination=None, RecipientDetails=None): + self.TrackingNumber = TrackingNumber + self.TrackingNumberUniqueIdentifiers = TrackingNumberUniqueIdentifiers + self.CarrierCode = CarrierCode + self.ShipDate = ShipDate + self.Destination = Destination + if RecipientDetails is None: + self.RecipientDetails = [] + else: + self.RecipientDetails = RecipientDetails + def factory(*args_, **kwargs_): + if TrackNotificationPackage.subclass: + return TrackNotificationPackage.subclass(*args_, **kwargs_) + else: + return TrackNotificationPackage(*args_, **kwargs_) + factory = staticmethod(factory) + def get_TrackingNumber(self): return self.TrackingNumber + def set_TrackingNumber(self, TrackingNumber): self.TrackingNumber = TrackingNumber + def get_TrackingNumberUniqueIdentifiers(self): return self.TrackingNumberUniqueIdentifiers + def set_TrackingNumberUniqueIdentifiers(self, TrackingNumberUniqueIdentifiers): self.TrackingNumberUniqueIdentifiers = TrackingNumberUniqueIdentifiers + def get_CarrierCode(self): return self.CarrierCode + def set_CarrierCode(self, CarrierCode): self.CarrierCode = CarrierCode + def validate_CarrierCodeType(self, value): + # Validate type CarrierCodeType, a restriction on xs:string. + pass + def get_ShipDate(self): return self.ShipDate + def set_ShipDate(self, ShipDate): self.ShipDate = ShipDate + def get_Destination(self): return self.Destination + def set_Destination(self, Destination): self.Destination = Destination + def get_RecipientDetails(self): return self.RecipientDetails + def set_RecipientDetails(self, RecipientDetails): self.RecipientDetails = RecipientDetails + def add_RecipientDetails(self, value): self.RecipientDetails.append(value) + def insert_RecipientDetails(self, index, value): self.RecipientDetails[index] = value + def export(self, outfile, level, namespace_='ns:', name_='TrackNotificationPackage', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='TrackNotificationPackage') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='TrackNotificationPackage'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='TrackNotificationPackage', fromsubclass_=False): + if self.TrackingNumber is not None: + showIndent(outfile, level) + outfile.write('<%sTrackingNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.TrackingNumber).encode(ExternalEncoding), input_name='TrackingNumber'), namespace_)) + if self.TrackingNumberUniqueIdentifiers is not None: + showIndent(outfile, level) + outfile.write('<%sTrackingNumberUniqueIdentifiers>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.TrackingNumberUniqueIdentifiers).encode(ExternalEncoding), input_name='TrackingNumberUniqueIdentifiers'), namespace_)) + if self.CarrierCode is not None: + showIndent(outfile, level) + outfile.write('<%sCarrierCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CarrierCode).encode(ExternalEncoding), input_name='CarrierCode'), namespace_)) + if self.ShipDate is not None: + showIndent(outfile, level) + outfile.write('<%sShipDate>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ShipDate).encode(ExternalEncoding), input_name='ShipDate'), namespace_)) + if self.Destination: + self.Destination.export(outfile, level, namespace_, name_='Destination') + for RecipientDetails_ in self.RecipientDetails: + RecipientDetails_.export(outfile, level, namespace_, name_='RecipientDetails') + def hasContent_(self): + if ( + self.TrackingNumber is not None or + self.TrackingNumberUniqueIdentifiers is not None or + self.CarrierCode is not None or + self.ShipDate is not None or + self.Destination is not None or + self.RecipientDetails + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='TrackNotificationPackage'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.TrackingNumber is not None: + showIndent(outfile, level) + outfile.write('TrackingNumber=%s,\n' % quote_python(self.TrackingNumber).encode(ExternalEncoding)) + if self.TrackingNumberUniqueIdentifiers is not None: + showIndent(outfile, level) + outfile.write('TrackingNumberUniqueIdentifiers=%s,\n' % quote_python(self.TrackingNumberUniqueIdentifiers).encode(ExternalEncoding)) + if self.CarrierCode is not None: + showIndent(outfile, level) + outfile.write('CarrierCode=%s,\n' % quote_python(self.CarrierCode).encode(ExternalEncoding)) + if self.ShipDate is not None: + showIndent(outfile, level) + outfile.write('ShipDate=%s,\n' % quote_python(self.ShipDate).encode(ExternalEncoding)) + if self.Destination is not None: + showIndent(outfile, level) + outfile.write('Destination=model_.Address(\n') + self.Destination.exportLiteral(outfile, level, name_='Destination') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('RecipientDetails=[\n') + level += 1 + for RecipientDetails_ in self.RecipientDetails: + showIndent(outfile, level) + outfile.write('model_.TrackNotificationRecipientDetail(\n') + RecipientDetails_.exportLiteral(outfile, level, name_='TrackNotificationRecipientDetail') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'TrackingNumber': + TrackingNumber_ = child_.text + TrackingNumber_ = self.gds_validate_string(TrackingNumber_, node, 'TrackingNumber') + self.TrackingNumber = TrackingNumber_ + elif nodeName_ == 'TrackingNumberUniqueIdentifiers': + TrackingNumberUniqueIdentifiers_ = child_.text + TrackingNumberUniqueIdentifiers_ = self.gds_validate_string(TrackingNumberUniqueIdentifiers_, node, 'TrackingNumberUniqueIdentifiers') + self.TrackingNumberUniqueIdentifiers = TrackingNumberUniqueIdentifiers_ + elif nodeName_ == 'CarrierCode': + CarrierCode_ = child_.text + CarrierCode_ = self.gds_validate_string(CarrierCode_, node, 'CarrierCode') + self.CarrierCode = CarrierCode_ + self.validate_CarrierCodeType(self.CarrierCode) # validate type CarrierCodeType + elif nodeName_ == 'ShipDate': + ShipDate_ = child_.text + ShipDate_ = self.gds_validate_string(ShipDate_, node, 'ShipDate') + self.ShipDate = ShipDate_ + elif nodeName_ == 'Destination': + obj_ = Address.factory() + obj_.build(child_) + self.set_Destination(obj_) + elif nodeName_ == 'RecipientDetails': + obj_ = TrackNotificationRecipientDetail.factory() + obj_.build(child_) + self.RecipientDetails.append(obj_) +# end class TrackNotificationPackage + + +class TrackNotificationRecipientDetail(GeneratedsSuper): + """Options available for a tracking notification recipient.""" + subclass = None + superclass = None + def __init__(self, NotificationEventsAvailable=None): + if NotificationEventsAvailable is None: + self.NotificationEventsAvailable = [] + else: + self.NotificationEventsAvailable = NotificationEventsAvailable + def factory(*args_, **kwargs_): + if TrackNotificationRecipientDetail.subclass: + return TrackNotificationRecipientDetail.subclass(*args_, **kwargs_) + else: + return TrackNotificationRecipientDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_NotificationEventsAvailable(self): return self.NotificationEventsAvailable + def set_NotificationEventsAvailable(self, NotificationEventsAvailable): self.NotificationEventsAvailable = NotificationEventsAvailable + def add_NotificationEventsAvailable(self, value): self.NotificationEventsAvailable.append(value) + def insert_NotificationEventsAvailable(self, index, value): self.NotificationEventsAvailable[index] = value + def validate_EMailNotificationEventType(self, value): + # Validate type EMailNotificationEventType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='TrackNotificationRecipientDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='TrackNotificationRecipientDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='TrackNotificationRecipientDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='TrackNotificationRecipientDetail', fromsubclass_=False): + for NotificationEventsAvailable_ in self.NotificationEventsAvailable: + showIndent(outfile, level) + outfile.write('<%sNotificationEventsAvailable>%s\n' % (namespace_, self.gds_format_string(quote_xml(NotificationEventsAvailable_).encode(ExternalEncoding), input_name='NotificationEventsAvailable'), namespace_)) + def hasContent_(self): + if ( + self.NotificationEventsAvailable + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='TrackNotificationRecipientDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + showIndent(outfile, level) + outfile.write('NotificationEventsAvailable=[\n') + level += 1 + for NotificationEventsAvailable_ in self.NotificationEventsAvailable: + showIndent(outfile, level) + outfile.write('%s,\n' % quote_python(NotificationEventsAvailable_).encode(ExternalEncoding)) + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'NotificationEventsAvailable': + NotificationEventsAvailable_ = child_.text + NotificationEventsAvailable_ = self.gds_validate_string(NotificationEventsAvailable_, node, 'NotificationEventsAvailable') + self.NotificationEventsAvailable.append(NotificationEventsAvailable_) + self.validate_EMailNotificationEventType(self.NotificationEventsAvailable) # validate type EMailNotificationEventType +# end class TrackNotificationRecipientDetail + + +class TrackNotificationReply(GeneratedsSuper): + """FedEx Track Notification reply.""" + subclass = None + superclass = None + def __init__(self, HighestSeverity=None, Notifications=None, TransactionDetail=None, Version=None, DuplicateWaybill=None, MoreDataAvailable=None, PagingToken=None, Packages=None): + self.HighestSeverity = HighestSeverity + if Notifications is None: + self.Notifications = [] + else: + self.Notifications = Notifications + self.TransactionDetail = TransactionDetail + self.Version = Version + self.DuplicateWaybill = DuplicateWaybill + self.MoreDataAvailable = MoreDataAvailable + self.PagingToken = PagingToken + if Packages is None: + self.Packages = [] + else: + self.Packages = Packages + def factory(*args_, **kwargs_): + if TrackNotificationReply.subclass: + return TrackNotificationReply.subclass(*args_, **kwargs_) + else: + return TrackNotificationReply(*args_, **kwargs_) + factory = staticmethod(factory) + def get_HighestSeverity(self): return self.HighestSeverity + def set_HighestSeverity(self, HighestSeverity): self.HighestSeverity = HighestSeverity + def validate_NotificationSeverityType(self, value): + # Validate type NotificationSeverityType, a restriction on xs:string. + pass + def get_Notifications(self): return self.Notifications + def set_Notifications(self, Notifications): self.Notifications = Notifications + def add_Notifications(self, value): self.Notifications.append(value) + def insert_Notifications(self, index, value): self.Notifications[index] = value + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_DuplicateWaybill(self): return self.DuplicateWaybill + def set_DuplicateWaybill(self, DuplicateWaybill): self.DuplicateWaybill = DuplicateWaybill + def get_MoreDataAvailable(self): return self.MoreDataAvailable + def set_MoreDataAvailable(self, MoreDataAvailable): self.MoreDataAvailable = MoreDataAvailable + def get_PagingToken(self): return self.PagingToken + def set_PagingToken(self, PagingToken): self.PagingToken = PagingToken + def get_Packages(self): return self.Packages + def set_Packages(self, Packages): self.Packages = Packages + def add_Packages(self, value): self.Packages.append(value) + def insert_Packages(self, index, value): self.Packages[index] = value + def export(self, outfile, level, namespace_='ns:', name_='TrackNotificationReply', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='TrackNotificationReply') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='TrackNotificationReply'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='TrackNotificationReply', fromsubclass_=False): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('<%sHighestSeverity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HighestSeverity).encode(ExternalEncoding), input_name='HighestSeverity'), namespace_)) + for Notifications_ in self.Notifications: + Notifications_.export(outfile, level, namespace_, name_='Notifications') + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.DuplicateWaybill is not None: + showIndent(outfile, level) + outfile.write('<%sDuplicateWaybill>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.DuplicateWaybill)), input_name='DuplicateWaybill'), namespace_)) + if self.MoreDataAvailable is not None: + showIndent(outfile, level) + outfile.write('<%sMoreDataAvailable>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.MoreDataAvailable)), input_name='MoreDataAvailable'), namespace_)) + if self.PagingToken is not None: + showIndent(outfile, level) + outfile.write('<%sPagingToken>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PagingToken).encode(ExternalEncoding), input_name='PagingToken'), namespace_)) + for Packages_ in self.Packages: + Packages_.export(outfile, level, namespace_, name_='Packages') + def hasContent_(self): + if ( + self.HighestSeverity is not None or + self.Notifications or + self.TransactionDetail is not None or + self.Version is not None or + self.DuplicateWaybill is not None or + self.MoreDataAvailable is not None or + self.PagingToken is not None or + self.Packages + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='TrackNotificationReply'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('HighestSeverity=%s,\n' % quote_python(self.HighestSeverity).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Notifications=[\n') + level += 1 + for Notifications_ in self.Notifications: + showIndent(outfile, level) + outfile.write('model_.Notification(\n') + Notifications_.exportLiteral(outfile, level, name_='Notification') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.DuplicateWaybill is not None: + showIndent(outfile, level) + outfile.write('DuplicateWaybill=%s,\n' % self.DuplicateWaybill) + if self.MoreDataAvailable is not None: + showIndent(outfile, level) + outfile.write('MoreDataAvailable=%s,\n' % self.MoreDataAvailable) + if self.PagingToken is not None: + showIndent(outfile, level) + outfile.write('PagingToken=%s,\n' % quote_python(self.PagingToken).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Packages=[\n') + level += 1 + for Packages_ in self.Packages: + showIndent(outfile, level) + outfile.write('model_.TrackNotificationPackage(\n') + Packages_.exportLiteral(outfile, level, name_='TrackNotificationPackage') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'HighestSeverity': + HighestSeverity_ = child_.text + HighestSeverity_ = self.gds_validate_string(HighestSeverity_, node, 'HighestSeverity') + self.HighestSeverity = HighestSeverity_ + self.validate_NotificationSeverityType(self.HighestSeverity) # validate type NotificationSeverityType + elif nodeName_ == 'Notifications': + obj_ = Notification.factory() + obj_.build(child_) + self.Notifications.append(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'DuplicateWaybill': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'DuplicateWaybill') + self.DuplicateWaybill = ival_ + elif nodeName_ == 'MoreDataAvailable': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'MoreDataAvailable') + self.MoreDataAvailable = ival_ + elif nodeName_ == 'PagingToken': + PagingToken_ = child_.text + PagingToken_ = self.gds_validate_string(PagingToken_, node, 'PagingToken') + self.PagingToken = PagingToken_ + elif nodeName_ == 'Packages': + obj_ = TrackNotificationPackage.factory() + obj_.build(child_) + self.Packages.append(obj_) +# end class TrackNotificationReply + + +class TrackNotificationRequest(GeneratedsSuper): + """FedEx Track Notification request.""" + subclass = None + superclass = None + def __init__(self, WebAuthenticationDetail=None, ClientDetail=None, TransactionDetail=None, Version=None, TrackingNumber=None, MultiPiece=None, PagingToken=None, TrackingNumberUniqueId=None, ShipDateRangeBegin=None, ShipDateRangeEnd=None, SenderEMailAddress=None, SenderContactName=None, NotificationDetail=None): + self.WebAuthenticationDetail = WebAuthenticationDetail + self.ClientDetail = ClientDetail + self.TransactionDetail = TransactionDetail + self.Version = Version + self.TrackingNumber = TrackingNumber + self.MultiPiece = MultiPiece + self.PagingToken = PagingToken + self.TrackingNumberUniqueId = TrackingNumberUniqueId + self.ShipDateRangeBegin = ShipDateRangeBegin + self.ShipDateRangeEnd = ShipDateRangeEnd + self.SenderEMailAddress = SenderEMailAddress + self.SenderContactName = SenderContactName + self.NotificationDetail = NotificationDetail + def factory(*args_, **kwargs_): + if TrackNotificationRequest.subclass: + return TrackNotificationRequest.subclass(*args_, **kwargs_) + else: + return TrackNotificationRequest(*args_, **kwargs_) + factory = staticmethod(factory) + def get_WebAuthenticationDetail(self): return self.WebAuthenticationDetail + def set_WebAuthenticationDetail(self, WebAuthenticationDetail): self.WebAuthenticationDetail = WebAuthenticationDetail + def get_ClientDetail(self): return self.ClientDetail + def set_ClientDetail(self, ClientDetail): self.ClientDetail = ClientDetail + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_TrackingNumber(self): return self.TrackingNumber + def set_TrackingNumber(self, TrackingNumber): self.TrackingNumber = TrackingNumber + def get_MultiPiece(self): return self.MultiPiece + def set_MultiPiece(self, MultiPiece): self.MultiPiece = MultiPiece + def get_PagingToken(self): return self.PagingToken + def set_PagingToken(self, PagingToken): self.PagingToken = PagingToken + def get_TrackingNumberUniqueId(self): return self.TrackingNumberUniqueId + def set_TrackingNumberUniqueId(self, TrackingNumberUniqueId): self.TrackingNumberUniqueId = TrackingNumberUniqueId + def get_ShipDateRangeBegin(self): return self.ShipDateRangeBegin + def set_ShipDateRangeBegin(self, ShipDateRangeBegin): self.ShipDateRangeBegin = ShipDateRangeBegin + def get_ShipDateRangeEnd(self): return self.ShipDateRangeEnd + def set_ShipDateRangeEnd(self, ShipDateRangeEnd): self.ShipDateRangeEnd = ShipDateRangeEnd + def get_SenderEMailAddress(self): return self.SenderEMailAddress + def set_SenderEMailAddress(self, SenderEMailAddress): self.SenderEMailAddress = SenderEMailAddress + def get_SenderContactName(self): return self.SenderContactName + def set_SenderContactName(self, SenderContactName): self.SenderContactName = SenderContactName + def get_NotificationDetail(self): return self.NotificationDetail + def set_NotificationDetail(self, NotificationDetail): self.NotificationDetail = NotificationDetail + def export(self, outfile, level, namespace_='ns:', name_='TrackNotificationRequest', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='TrackNotificationRequest') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='TrackNotificationRequest'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='TrackNotificationRequest', fromsubclass_=False): + if self.WebAuthenticationDetail: + self.WebAuthenticationDetail.export(outfile, level, namespace_, name_='WebAuthenticationDetail', ) + if self.ClientDetail: + self.ClientDetail.export(outfile, level, namespace_, name_='ClientDetail', ) + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.TrackingNumber is not None: + showIndent(outfile, level) + outfile.write('<%sTrackingNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.TrackingNumber).encode(ExternalEncoding), input_name='TrackingNumber'), namespace_)) + if self.MultiPiece is not None: + showIndent(outfile, level) + outfile.write('<%sMultiPiece>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.MultiPiece)), input_name='MultiPiece'), namespace_)) + if self.PagingToken is not None: + showIndent(outfile, level) + outfile.write('<%sPagingToken>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PagingToken).encode(ExternalEncoding), input_name='PagingToken'), namespace_)) + if self.TrackingNumberUniqueId is not None: + showIndent(outfile, level) + outfile.write('<%sTrackingNumberUniqueId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.TrackingNumberUniqueId).encode(ExternalEncoding), input_name='TrackingNumberUniqueId'), namespace_)) + if self.ShipDateRangeBegin is not None: + showIndent(outfile, level) + outfile.write('<%sShipDateRangeBegin>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ShipDateRangeBegin).encode(ExternalEncoding), input_name='ShipDateRangeBegin'), namespace_)) + if self.ShipDateRangeEnd is not None: + showIndent(outfile, level) + outfile.write('<%sShipDateRangeEnd>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ShipDateRangeEnd).encode(ExternalEncoding), input_name='ShipDateRangeEnd'), namespace_)) + if self.SenderEMailAddress is not None: + showIndent(outfile, level) + outfile.write('<%sSenderEMailAddress>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.SenderEMailAddress).encode(ExternalEncoding), input_name='SenderEMailAddress'), namespace_)) + if self.SenderContactName is not None: + showIndent(outfile, level) + outfile.write('<%sSenderContactName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.SenderContactName).encode(ExternalEncoding), input_name='SenderContactName'), namespace_)) + if self.NotificationDetail: + self.NotificationDetail.export(outfile, level, namespace_, name_='NotificationDetail', ) + def hasContent_(self): + if ( + self.WebAuthenticationDetail is not None or + self.ClientDetail is not None or + self.TransactionDetail is not None or + self.Version is not None or + self.TrackingNumber is not None or + self.MultiPiece is not None or + self.PagingToken is not None or + self.TrackingNumberUniqueId is not None or + self.ShipDateRangeBegin is not None or + self.ShipDateRangeEnd is not None or + self.SenderEMailAddress is not None or + self.SenderContactName is not None or + self.NotificationDetail is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='TrackNotificationRequest'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.WebAuthenticationDetail is not None: + showIndent(outfile, level) + outfile.write('WebAuthenticationDetail=model_.WebAuthenticationDetail(\n') + self.WebAuthenticationDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ClientDetail is not None: + showIndent(outfile, level) + outfile.write('ClientDetail=model_.ClientDetail(\n') + self.ClientDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.TrackingNumber is not None: + showIndent(outfile, level) + outfile.write('TrackingNumber=%s,\n' % quote_python(self.TrackingNumber).encode(ExternalEncoding)) + if self.MultiPiece is not None: + showIndent(outfile, level) + outfile.write('MultiPiece=%s,\n' % self.MultiPiece) + if self.PagingToken is not None: + showIndent(outfile, level) + outfile.write('PagingToken=%s,\n' % quote_python(self.PagingToken).encode(ExternalEncoding)) + if self.TrackingNumberUniqueId is not None: + showIndent(outfile, level) + outfile.write('TrackingNumberUniqueId=%s,\n' % quote_python(self.TrackingNumberUniqueId).encode(ExternalEncoding)) + if self.ShipDateRangeBegin is not None: + showIndent(outfile, level) + outfile.write('ShipDateRangeBegin=%s,\n' % quote_python(self.ShipDateRangeBegin).encode(ExternalEncoding)) + if self.ShipDateRangeEnd is not None: + showIndent(outfile, level) + outfile.write('ShipDateRangeEnd=%s,\n' % quote_python(self.ShipDateRangeEnd).encode(ExternalEncoding)) + if self.SenderEMailAddress is not None: + showIndent(outfile, level) + outfile.write('SenderEMailAddress=%s,\n' % quote_python(self.SenderEMailAddress).encode(ExternalEncoding)) + if self.SenderContactName is not None: + showIndent(outfile, level) + outfile.write('SenderContactName=%s,\n' % quote_python(self.SenderContactName).encode(ExternalEncoding)) + if self.NotificationDetail is not None: + showIndent(outfile, level) + outfile.write('NotificationDetail=model_.EMailNotificationDetail(\n') + self.NotificationDetail.exportLiteral(outfile, level, name_='NotificationDetail') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'WebAuthenticationDetail': + obj_ = WebAuthenticationDetail.factory() + obj_.build(child_) + self.set_WebAuthenticationDetail(obj_) + elif nodeName_ == 'ClientDetail': + obj_ = ClientDetail.factory() + obj_.build(child_) + self.set_ClientDetail(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'TrackingNumber': + TrackingNumber_ = child_.text + TrackingNumber_ = self.gds_validate_string(TrackingNumber_, node, 'TrackingNumber') + self.TrackingNumber = TrackingNumber_ + elif nodeName_ == 'MultiPiece': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'MultiPiece') + self.MultiPiece = ival_ + elif nodeName_ == 'PagingToken': + PagingToken_ = child_.text + PagingToken_ = self.gds_validate_string(PagingToken_, node, 'PagingToken') + self.PagingToken = PagingToken_ + elif nodeName_ == 'TrackingNumberUniqueId': + TrackingNumberUniqueId_ = child_.text + TrackingNumberUniqueId_ = self.gds_validate_string(TrackingNumberUniqueId_, node, 'TrackingNumberUniqueId') + self.TrackingNumberUniqueId = TrackingNumberUniqueId_ + elif nodeName_ == 'ShipDateRangeBegin': + ShipDateRangeBegin_ = child_.text + ShipDateRangeBegin_ = self.gds_validate_string(ShipDateRangeBegin_, node, 'ShipDateRangeBegin') + self.ShipDateRangeBegin = ShipDateRangeBegin_ + elif nodeName_ == 'ShipDateRangeEnd': + ShipDateRangeEnd_ = child_.text + ShipDateRangeEnd_ = self.gds_validate_string(ShipDateRangeEnd_, node, 'ShipDateRangeEnd') + self.ShipDateRangeEnd = ShipDateRangeEnd_ + elif nodeName_ == 'SenderEMailAddress': + SenderEMailAddress_ = child_.text + SenderEMailAddress_ = self.gds_validate_string(SenderEMailAddress_, node, 'SenderEMailAddress') + self.SenderEMailAddress = SenderEMailAddress_ + elif nodeName_ == 'SenderContactName': + SenderContactName_ = child_.text + SenderContactName_ = self.gds_validate_string(SenderContactName_, node, 'SenderContactName') + self.SenderContactName = SenderContactName_ + elif nodeName_ == 'NotificationDetail': + obj_ = EMailNotificationDetail.factory() + obj_.build(child_) + self.set_NotificationDetail(obj_) +# end class TrackNotificationRequest + + +class TrackPackageIdentifier(GeneratedsSuper): + """The type and value of the package identifier that is to be used to + retrieve the tracking information for a package.""" + subclass = None + superclass = None + def __init__(self, Value=None, Type=None): + self.Value = Value + self.Type = Type + def factory(*args_, **kwargs_): + if TrackPackageIdentifier.subclass: + return TrackPackageIdentifier.subclass(*args_, **kwargs_) + else: + return TrackPackageIdentifier(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Value(self): return self.Value + def set_Value(self, Value): self.Value = Value + def get_Type(self): return self.Type + def set_Type(self, Type): self.Type = Type + def validate_TrackIdentifierType(self, value): + # Validate type TrackIdentifierType, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='TrackPackageIdentifier', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='TrackPackageIdentifier') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='TrackPackageIdentifier'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='TrackPackageIdentifier', fromsubclass_=False): + if self.Value is not None: + showIndent(outfile, level) + outfile.write('<%sValue>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Value).encode(ExternalEncoding), input_name='Value'), namespace_)) + if self.Type is not None: + showIndent(outfile, level) + outfile.write('<%sType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Type).encode(ExternalEncoding), input_name='Type'), namespace_)) + def hasContent_(self): + if ( + self.Value is not None or + self.Type is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='TrackPackageIdentifier'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Value is not None: + showIndent(outfile, level) + outfile.write('Value=%s,\n' % quote_python(self.Value).encode(ExternalEncoding)) + if self.Type is not None: + showIndent(outfile, level) + outfile.write('Type=%s,\n' % quote_python(self.Type).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Value': + Value_ = child_.text + Value_ = self.gds_validate_string(Value_, node, 'Value') + self.Value = Value_ + elif nodeName_ == 'Type': + Type_ = child_.text + Type_ = self.gds_validate_string(Type_, node, 'Type') + self.Type = Type_ + self.validate_TrackIdentifierType(self.Type) # validate type TrackIdentifierType +# end class TrackPackageIdentifier + + +class TrackReconciliation(GeneratedsSuper): + """Used to report the status of a piece of a multiple piece shipment + which is no longer traveling with the rest of the packages in + the shipment or has not been accounted for.""" + subclass = None + superclass = None + def __init__(self, Status=None, Description=None): + self.Status = Status + self.Description = Description + def factory(*args_, **kwargs_): + if TrackReconciliation.subclass: + return TrackReconciliation.subclass(*args_, **kwargs_) + else: + return TrackReconciliation(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Status(self): return self.Status + def set_Status(self, Status): self.Status = Status + def get_Description(self): return self.Description + def set_Description(self, Description): self.Description = Description + def export(self, outfile, level, namespace_='ns:', name_='TrackReconciliation', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='TrackReconciliation') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='TrackReconciliation'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='TrackReconciliation', fromsubclass_=False): + if self.Status is not None: + showIndent(outfile, level) + outfile.write('<%sStatus>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Status).encode(ExternalEncoding), input_name='Status'), namespace_)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('<%sDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Description).encode(ExternalEncoding), input_name='Description'), namespace_)) + def hasContent_(self): + if ( + self.Status is not None or + self.Description is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='TrackReconciliation'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Status is not None: + showIndent(outfile, level) + outfile.write('Status=%s,\n' % quote_python(self.Status).encode(ExternalEncoding)) + if self.Description is not None: + showIndent(outfile, level) + outfile.write('Description=%s,\n' % quote_python(self.Description).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Status': + Status_ = child_.text + Status_ = self.gds_validate_string(Status_, node, 'Status') + self.Status = Status_ + elif nodeName_ == 'Description': + Description_ = child_.text + Description_ = self.gds_validate_string(Description_, node, 'Description') + self.Description = Description_ +# end class TrackReconciliation + + +class TrackReply(GeneratedsSuper): + """The descriptive data returned from a FedEx package tracking request.""" + subclass = None + superclass = None + def __init__(self, HighestSeverity=None, Notifications=None, TransactionDetail=None, Version=None, DuplicateWaybill=None, MoreData=None, PagingToken=None, TrackDetails=None): + self.HighestSeverity = HighestSeverity + if Notifications is None: + self.Notifications = [] + else: + self.Notifications = Notifications + self.TransactionDetail = TransactionDetail + self.Version = Version + self.DuplicateWaybill = DuplicateWaybill + self.MoreData = MoreData + self.PagingToken = PagingToken + if TrackDetails is None: + self.TrackDetails = [] + else: + self.TrackDetails = TrackDetails + def factory(*args_, **kwargs_): + if TrackReply.subclass: + return TrackReply.subclass(*args_, **kwargs_) + else: + return TrackReply(*args_, **kwargs_) + factory = staticmethod(factory) + def get_HighestSeverity(self): return self.HighestSeverity + def set_HighestSeverity(self, HighestSeverity): self.HighestSeverity = HighestSeverity + def validate_NotificationSeverityType(self, value): + # Validate type NotificationSeverityType, a restriction on xs:string. + pass + def get_Notifications(self): return self.Notifications + def set_Notifications(self, Notifications): self.Notifications = Notifications + def add_Notifications(self, value): self.Notifications.append(value) + def insert_Notifications(self, index, value): self.Notifications[index] = value + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_DuplicateWaybill(self): return self.DuplicateWaybill + def set_DuplicateWaybill(self, DuplicateWaybill): self.DuplicateWaybill = DuplicateWaybill + def get_MoreData(self): return self.MoreData + def set_MoreData(self, MoreData): self.MoreData = MoreData + def get_PagingToken(self): return self.PagingToken + def set_PagingToken(self, PagingToken): self.PagingToken = PagingToken + def get_TrackDetails(self): return self.TrackDetails + def set_TrackDetails(self, TrackDetails): self.TrackDetails = TrackDetails + def add_TrackDetails(self, value): self.TrackDetails.append(value) + def insert_TrackDetails(self, index, value): self.TrackDetails[index] = value + def export(self, outfile, level, namespace_='ns:', name_='TrackReply', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='TrackReply') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='TrackReply'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='TrackReply', fromsubclass_=False): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('<%sHighestSeverity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HighestSeverity).encode(ExternalEncoding), input_name='HighestSeverity'), namespace_)) + for Notifications_ in self.Notifications: + Notifications_.export(outfile, level, namespace_, name_='Notifications') + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.DuplicateWaybill is not None: + showIndent(outfile, level) + outfile.write('<%sDuplicateWaybill>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.DuplicateWaybill)), input_name='DuplicateWaybill'), namespace_)) + if self.MoreData is not None: + showIndent(outfile, level) + outfile.write('<%sMoreData>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.MoreData)), input_name='MoreData'), namespace_)) + if self.PagingToken is not None: + showIndent(outfile, level) + outfile.write('<%sPagingToken>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PagingToken).encode(ExternalEncoding), input_name='PagingToken'), namespace_)) + for TrackDetails_ in self.TrackDetails: + TrackDetails_.export(outfile, level, namespace_, name_='TrackDetails') + def hasContent_(self): + if ( + self.HighestSeverity is not None or + self.Notifications or + self.TransactionDetail is not None or + self.Version is not None or + self.DuplicateWaybill is not None or + self.MoreData is not None or + self.PagingToken is not None or + self.TrackDetails + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='TrackReply'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('HighestSeverity=%s,\n' % quote_python(self.HighestSeverity).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Notifications=[\n') + level += 1 + for Notifications_ in self.Notifications: + showIndent(outfile, level) + outfile.write('model_.Notification(\n') + Notifications_.exportLiteral(outfile, level, name_='Notification') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.DuplicateWaybill is not None: + showIndent(outfile, level) + outfile.write('DuplicateWaybill=%s,\n' % self.DuplicateWaybill) + if self.MoreData is not None: + showIndent(outfile, level) + outfile.write('MoreData=%s,\n' % self.MoreData) + if self.PagingToken is not None: + showIndent(outfile, level) + outfile.write('PagingToken=%s,\n' % quote_python(self.PagingToken).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('TrackDetails=[\n') + level += 1 + for TrackDetails_ in self.TrackDetails: + showIndent(outfile, level) + outfile.write('model_.TrackDetail(\n') + TrackDetails_.exportLiteral(outfile, level, name_='TrackDetail') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'HighestSeverity': + HighestSeverity_ = child_.text + HighestSeverity_ = self.gds_validate_string(HighestSeverity_, node, 'HighestSeverity') + self.HighestSeverity = HighestSeverity_ + self.validate_NotificationSeverityType(self.HighestSeverity) # validate type NotificationSeverityType + elif nodeName_ == 'Notifications': + obj_ = Notification.factory() + obj_.build(child_) + self.Notifications.append(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'DuplicateWaybill': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'DuplicateWaybill') + self.DuplicateWaybill = ival_ + elif nodeName_ == 'MoreData': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'MoreData') + self.MoreData = ival_ + elif nodeName_ == 'PagingToken': + PagingToken_ = child_.text + PagingToken_ = self.gds_validate_string(PagingToken_, node, 'PagingToken') + self.PagingToken = PagingToken_ + elif nodeName_ == 'TrackDetails': + obj_ = TrackDetail.factory() + obj_.build(child_) + self.TrackDetails.append(obj_) +# end class TrackReply + + +class TrackRequest(GeneratedsSuper): + """The descriptive data sent by a client to track a FedEx package.""" + subclass = None + superclass = None + def __init__(self, WebAuthenticationDetail=None, ClientDetail=None, TransactionDetail=None, Version=None, CarrierCode=None, OperatingCompany=None, PackageIdentifier=None, TrackingNumberUniqueIdentifier=None, ShipDateRangeBegin=None, ShipDateRangeEnd=None, ShipmentAccountNumber=None, Destination=None, IncludeDetailedScans=None, PagingToken=None): + self.WebAuthenticationDetail = WebAuthenticationDetail + self.ClientDetail = ClientDetail + self.TransactionDetail = TransactionDetail + self.Version = Version + self.CarrierCode = CarrierCode + self.OperatingCompany = OperatingCompany + self.PackageIdentifier = PackageIdentifier + self.TrackingNumberUniqueIdentifier = TrackingNumberUniqueIdentifier + self.ShipDateRangeBegin = ShipDateRangeBegin + self.ShipDateRangeEnd = ShipDateRangeEnd + self.ShipmentAccountNumber = ShipmentAccountNumber + self.Destination = Destination + self.IncludeDetailedScans = IncludeDetailedScans + self.PagingToken = PagingToken + def factory(*args_, **kwargs_): + if TrackRequest.subclass: + return TrackRequest.subclass(*args_, **kwargs_) + else: + return TrackRequest(*args_, **kwargs_) + factory = staticmethod(factory) + def get_WebAuthenticationDetail(self): return self.WebAuthenticationDetail + def set_WebAuthenticationDetail(self, WebAuthenticationDetail): self.WebAuthenticationDetail = WebAuthenticationDetail + def get_ClientDetail(self): return self.ClientDetail + def set_ClientDetail(self, ClientDetail): self.ClientDetail = ClientDetail + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_CarrierCode(self): return self.CarrierCode + def set_CarrierCode(self, CarrierCode): self.CarrierCode = CarrierCode + def validate_CarrierCodeType(self, value): + # Validate type CarrierCodeType, a restriction on xs:string. + pass + def get_OperatingCompany(self): return self.OperatingCompany + def set_OperatingCompany(self, OperatingCompany): self.OperatingCompany = OperatingCompany + def validate_OperatingCompanyType(self, value): + # Validate type OperatingCompanyType, a restriction on xs:string. + pass + def get_PackageIdentifier(self): return self.PackageIdentifier + def set_PackageIdentifier(self, PackageIdentifier): self.PackageIdentifier = PackageIdentifier + def get_TrackingNumberUniqueIdentifier(self): return self.TrackingNumberUniqueIdentifier + def set_TrackingNumberUniqueIdentifier(self, TrackingNumberUniqueIdentifier): self.TrackingNumberUniqueIdentifier = TrackingNumberUniqueIdentifier + def get_ShipDateRangeBegin(self): return self.ShipDateRangeBegin + def set_ShipDateRangeBegin(self, ShipDateRangeBegin): self.ShipDateRangeBegin = ShipDateRangeBegin + def get_ShipDateRangeEnd(self): return self.ShipDateRangeEnd + def set_ShipDateRangeEnd(self, ShipDateRangeEnd): self.ShipDateRangeEnd = ShipDateRangeEnd + def get_ShipmentAccountNumber(self): return self.ShipmentAccountNumber + def set_ShipmentAccountNumber(self, ShipmentAccountNumber): self.ShipmentAccountNumber = ShipmentAccountNumber + def get_Destination(self): return self.Destination + def set_Destination(self, Destination): self.Destination = Destination + def get_IncludeDetailedScans(self): return self.IncludeDetailedScans + def set_IncludeDetailedScans(self, IncludeDetailedScans): self.IncludeDetailedScans = IncludeDetailedScans + def get_PagingToken(self): return self.PagingToken + def set_PagingToken(self, PagingToken): self.PagingToken = PagingToken + def export(self, outfile, level, namespace_='ns:', name_='TrackRequest', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='TrackRequest') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='TrackRequest'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='TrackRequest', fromsubclass_=False): + if self.WebAuthenticationDetail: + self.WebAuthenticationDetail.export(outfile, level, namespace_, name_='WebAuthenticationDetail', ) + if self.ClientDetail: + self.ClientDetail.export(outfile, level, namespace_, name_='ClientDetail', ) + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.CarrierCode is not None: + showIndent(outfile, level) + outfile.write('<%sCarrierCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CarrierCode).encode(ExternalEncoding), input_name='CarrierCode'), namespace_)) + if self.OperatingCompany is not None: + showIndent(outfile, level) + outfile.write('<%sOperatingCompany>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.OperatingCompany).encode(ExternalEncoding), input_name='OperatingCompany'), namespace_)) + if self.PackageIdentifier: + self.PackageIdentifier.export(outfile, level, namespace_, name_='PackageIdentifier', ) + if self.TrackingNumberUniqueIdentifier is not None: + showIndent(outfile, level) + outfile.write('<%sTrackingNumberUniqueIdentifier>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.TrackingNumberUniqueIdentifier).encode(ExternalEncoding), input_name='TrackingNumberUniqueIdentifier'), namespace_)) + if self.ShipDateRangeBegin is not None: + showIndent(outfile, level) + outfile.write('<%sShipDateRangeBegin>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ShipDateRangeBegin).encode(ExternalEncoding), input_name='ShipDateRangeBegin'), namespace_)) + if self.ShipDateRangeEnd is not None: + showIndent(outfile, level) + outfile.write('<%sShipDateRangeEnd>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ShipDateRangeEnd).encode(ExternalEncoding), input_name='ShipDateRangeEnd'), namespace_)) + if self.ShipmentAccountNumber is not None: + showIndent(outfile, level) + outfile.write('<%sShipmentAccountNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ShipmentAccountNumber).encode(ExternalEncoding), input_name='ShipmentAccountNumber'), namespace_)) + if self.Destination: + self.Destination.export(outfile, level, namespace_, name_='Destination') + if self.IncludeDetailedScans is not None: + showIndent(outfile, level) + outfile.write('<%sIncludeDetailedScans>%s\n' % (namespace_, self.gds_format_boolean(self.gds_str_lower(str(self.IncludeDetailedScans)), input_name='IncludeDetailedScans'), namespace_)) + if self.PagingToken is not None: + showIndent(outfile, level) + outfile.write('<%sPagingToken>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.PagingToken).encode(ExternalEncoding), input_name='PagingToken'), namespace_)) + def hasContent_(self): + if ( + self.WebAuthenticationDetail is not None or + self.ClientDetail is not None or + self.TransactionDetail is not None or + self.Version is not None or + self.CarrierCode is not None or + self.OperatingCompany is not None or + self.PackageIdentifier is not None or + self.TrackingNumberUniqueIdentifier is not None or + self.ShipDateRangeBegin is not None or + self.ShipDateRangeEnd is not None or + self.ShipmentAccountNumber is not None or + self.Destination is not None or + self.IncludeDetailedScans is not None or + self.PagingToken is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='TrackRequest'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.WebAuthenticationDetail is not None: + showIndent(outfile, level) + outfile.write('WebAuthenticationDetail=model_.WebAuthenticationDetail(\n') + self.WebAuthenticationDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ClientDetail is not None: + showIndent(outfile, level) + outfile.write('ClientDetail=model_.ClientDetail(\n') + self.ClientDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.CarrierCode is not None: + showIndent(outfile, level) + outfile.write('CarrierCode=%s,\n' % quote_python(self.CarrierCode).encode(ExternalEncoding)) + if self.OperatingCompany is not None: + showIndent(outfile, level) + outfile.write('OperatingCompany=%s,\n' % quote_python(self.OperatingCompany).encode(ExternalEncoding)) + if self.PackageIdentifier is not None: + showIndent(outfile, level) + outfile.write('PackageIdentifier=model_.TrackPackageIdentifier(\n') + self.PackageIdentifier.exportLiteral(outfile, level, name_='PackageIdentifier') + showIndent(outfile, level) + outfile.write('),\n') + if self.TrackingNumberUniqueIdentifier is not None: + showIndent(outfile, level) + outfile.write('TrackingNumberUniqueIdentifier=%s,\n' % quote_python(self.TrackingNumberUniqueIdentifier).encode(ExternalEncoding)) + if self.ShipDateRangeBegin is not None: + showIndent(outfile, level) + outfile.write('ShipDateRangeBegin=%s,\n' % quote_python(self.ShipDateRangeBegin).encode(ExternalEncoding)) + if self.ShipDateRangeEnd is not None: + showIndent(outfile, level) + outfile.write('ShipDateRangeEnd=%s,\n' % quote_python(self.ShipDateRangeEnd).encode(ExternalEncoding)) + if self.ShipmentAccountNumber is not None: + showIndent(outfile, level) + outfile.write('ShipmentAccountNumber=%s,\n' % quote_python(self.ShipmentAccountNumber).encode(ExternalEncoding)) + if self.Destination is not None: + showIndent(outfile, level) + outfile.write('Destination=model_.Address(\n') + self.Destination.exportLiteral(outfile, level, name_='Destination') + showIndent(outfile, level) + outfile.write('),\n') + if self.IncludeDetailedScans is not None: + showIndent(outfile, level) + outfile.write('IncludeDetailedScans=%s,\n' % self.IncludeDetailedScans) + if self.PagingToken is not None: + showIndent(outfile, level) + outfile.write('PagingToken=%s,\n' % quote_python(self.PagingToken).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'WebAuthenticationDetail': + obj_ = WebAuthenticationDetail.factory() + obj_.build(child_) + self.set_WebAuthenticationDetail(obj_) + elif nodeName_ == 'ClientDetail': + obj_ = ClientDetail.factory() + obj_.build(child_) + self.set_ClientDetail(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'CarrierCode': + CarrierCode_ = child_.text + CarrierCode_ = self.gds_validate_string(CarrierCode_, node, 'CarrierCode') + self.CarrierCode = CarrierCode_ + self.validate_CarrierCodeType(self.CarrierCode) # validate type CarrierCodeType + elif nodeName_ == 'OperatingCompany': + OperatingCompany_ = child_.text + OperatingCompany_ = self.gds_validate_string(OperatingCompany_, node, 'OperatingCompany') + self.OperatingCompany = OperatingCompany_ + self.validate_OperatingCompanyType(self.OperatingCompany) # validate type OperatingCompanyType + elif nodeName_ == 'PackageIdentifier': + obj_ = TrackPackageIdentifier.factory() + obj_.build(child_) + self.set_PackageIdentifier(obj_) + elif nodeName_ == 'TrackingNumberUniqueIdentifier': + TrackingNumberUniqueIdentifier_ = child_.text + TrackingNumberUniqueIdentifier_ = self.gds_validate_string(TrackingNumberUniqueIdentifier_, node, 'TrackingNumberUniqueIdentifier') + self.TrackingNumberUniqueIdentifier = TrackingNumberUniqueIdentifier_ + elif nodeName_ == 'ShipDateRangeBegin': + ShipDateRangeBegin_ = child_.text + ShipDateRangeBegin_ = self.gds_validate_string(ShipDateRangeBegin_, node, 'ShipDateRangeBegin') + self.ShipDateRangeBegin = ShipDateRangeBegin_ + elif nodeName_ == 'ShipDateRangeEnd': + ShipDateRangeEnd_ = child_.text + ShipDateRangeEnd_ = self.gds_validate_string(ShipDateRangeEnd_, node, 'ShipDateRangeEnd') + self.ShipDateRangeEnd = ShipDateRangeEnd_ + elif nodeName_ == 'ShipmentAccountNumber': + ShipmentAccountNumber_ = child_.text + ShipmentAccountNumber_ = self.gds_validate_string(ShipmentAccountNumber_, node, 'ShipmentAccountNumber') + self.ShipmentAccountNumber = ShipmentAccountNumber_ + elif nodeName_ == 'Destination': + obj_ = Address.factory() + obj_.build(child_) + self.set_Destination(obj_) + elif nodeName_ == 'IncludeDetailedScans': + sval_ = child_.text + if sval_ in ('true', '1'): + ival_ = True + elif sval_ in ('false', '0'): + ival_ = False + else: + raise_parse_error(child_, 'requires boolean') + ival_ = self.gds_validate_boolean(ival_, node, 'IncludeDetailedScans') + self.IncludeDetailedScans = ival_ + elif nodeName_ == 'PagingToken': + PagingToken_ = child_.text + PagingToken_ = self.gds_validate_string(PagingToken_, node, 'PagingToken') + self.PagingToken = PagingToken_ +# end class TrackRequest + + +class TrackSplitShipmentPart(GeneratedsSuper): + """Used when a cargo shipment is split across vehicles. This is used to + give the status of each part of the shipment.""" + subclass = None + superclass = None + def __init__(self, PieceCount=None, Timestamp=None, StatusCode=None, StatusDescription=None): + self.PieceCount = PieceCount + self.Timestamp = Timestamp + self.StatusCode = StatusCode + self.StatusDescription = StatusDescription + def factory(*args_, **kwargs_): + if TrackSplitShipmentPart.subclass: + return TrackSplitShipmentPart.subclass(*args_, **kwargs_) + else: + return TrackSplitShipmentPart(*args_, **kwargs_) + factory = staticmethod(factory) + def get_PieceCount(self): return self.PieceCount + def set_PieceCount(self, PieceCount): self.PieceCount = PieceCount + def get_Timestamp(self): return self.Timestamp + def set_Timestamp(self, Timestamp): self.Timestamp = Timestamp + def get_StatusCode(self): return self.StatusCode + def set_StatusCode(self, StatusCode): self.StatusCode = StatusCode + def get_StatusDescription(self): return self.StatusDescription + def set_StatusDescription(self, StatusDescription): self.StatusDescription = StatusDescription + def export(self, outfile, level, namespace_='ns:', name_='TrackSplitShipmentPart', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='TrackSplitShipmentPart') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='TrackSplitShipmentPart'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='TrackSplitShipmentPart', fromsubclass_=False): + if self.PieceCount is not None: + showIndent(outfile, level) + outfile.write('<%sPieceCount>%s\n' % (namespace_, self.gds_format_integer(self.PieceCount, input_name='PieceCount'), namespace_)) + if self.Timestamp is not None: + showIndent(outfile, level) + outfile.write('<%sTimestamp>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Timestamp).encode(ExternalEncoding), input_name='Timestamp'), namespace_)) + if self.StatusCode is not None: + showIndent(outfile, level) + outfile.write('<%sStatusCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.StatusCode).encode(ExternalEncoding), input_name='StatusCode'), namespace_)) + if self.StatusDescription is not None: + showIndent(outfile, level) + outfile.write('<%sStatusDescription>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.StatusDescription).encode(ExternalEncoding), input_name='StatusDescription'), namespace_)) + def hasContent_(self): + if ( + self.PieceCount is not None or + self.Timestamp is not None or + self.StatusCode is not None or + self.StatusDescription is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='TrackSplitShipmentPart'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.PieceCount is not None: + showIndent(outfile, level) + outfile.write('PieceCount=%d,\n' % self.PieceCount) + if self.Timestamp is not None: + showIndent(outfile, level) + outfile.write('Timestamp=%s,\n' % quote_python(self.Timestamp).encode(ExternalEncoding)) + if self.StatusCode is not None: + showIndent(outfile, level) + outfile.write('StatusCode=%s,\n' % quote_python(self.StatusCode).encode(ExternalEncoding)) + if self.StatusDescription is not None: + showIndent(outfile, level) + outfile.write('StatusDescription=%s,\n' % quote_python(self.StatusDescription).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'PieceCount': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ <= 0: + raise_parse_error(child_, 'requires positiveInteger') + ival_ = self.gds_validate_integer(ival_, node, 'PieceCount') + self.PieceCount = ival_ + elif nodeName_ == 'Timestamp': + Timestamp_ = child_.text + Timestamp_ = self.gds_validate_string(Timestamp_, node, 'Timestamp') + self.Timestamp = Timestamp_ + elif nodeName_ == 'StatusCode': + StatusCode_ = child_.text + StatusCode_ = self.gds_validate_string(StatusCode_, node, 'StatusCode') + self.StatusCode = StatusCode_ + elif nodeName_ == 'StatusDescription': + StatusDescription_ = child_.text + StatusDescription_ = self.gds_validate_string(StatusDescription_, node, 'StatusDescription') + self.StatusDescription = StatusDescription_ +# end class TrackSplitShipmentPart + + +class TransactionDetail(GeneratedsSuper): + """Descriptive data that governs data payload language/translations. + The TransactionDetail from the request is echoed back to the + caller in the corresponding reply.""" + subclass = None + superclass = None + def __init__(self, CustomerTransactionId=None, Localization=None): + self.CustomerTransactionId = CustomerTransactionId + self.Localization = Localization + def factory(*args_, **kwargs_): + if TransactionDetail.subclass: + return TransactionDetail.subclass(*args_, **kwargs_) + else: + return TransactionDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_CustomerTransactionId(self): return self.CustomerTransactionId + def set_CustomerTransactionId(self, CustomerTransactionId): self.CustomerTransactionId = CustomerTransactionId + def get_Localization(self): return self.Localization + def set_Localization(self, Localization): self.Localization = Localization + def export(self, outfile, level, namespace_='ns:', name_='TransactionDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='TransactionDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='TransactionDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='TransactionDetail', fromsubclass_=False): + if self.CustomerTransactionId is not None: + showIndent(outfile, level) + outfile.write('<%sCustomerTransactionId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CustomerTransactionId).encode(ExternalEncoding), input_name='CustomerTransactionId'), namespace_)) + if self.Localization: + self.Localization.export(outfile, level, namespace_, name_='Localization') + def hasContent_(self): + if ( + self.CustomerTransactionId is not None or + self.Localization is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='TransactionDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.CustomerTransactionId is not None: + showIndent(outfile, level) + outfile.write('CustomerTransactionId=%s,\n' % quote_python(self.CustomerTransactionId).encode(ExternalEncoding)) + if self.Localization is not None: + showIndent(outfile, level) + outfile.write('Localization=model_.Localization(\n') + self.Localization.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'CustomerTransactionId': + CustomerTransactionId_ = child_.text + CustomerTransactionId_ = self.gds_validate_string(CustomerTransactionId_, node, 'CustomerTransactionId') + self.CustomerTransactionId = CustomerTransactionId_ + elif nodeName_ == 'Localization': + obj_ = Localization.factory() + obj_.build(child_) + self.set_Localization(obj_) +# end class TransactionDetail + + +class Weight(GeneratedsSuper): + """The descriptive data for the heaviness of an object.""" + subclass = None + superclass = None + def __init__(self, Units=None, Value=None): + self.Units = Units + self.Value = Value + def factory(*args_, **kwargs_): + if Weight.subclass: + return Weight.subclass(*args_, **kwargs_) + else: + return Weight(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Units(self): return self.Units + def set_Units(self, Units): self.Units = Units + def validate_WeightUnits(self, value): + # Validate type WeightUnits, a restriction on xs:string. + pass + def get_Value(self): return self.Value + def set_Value(self, Value): self.Value = Value + def export(self, outfile, level, namespace_='ns:', name_='Weight', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Weight') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Weight'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Weight', fromsubclass_=False): + if self.Units is not None: + showIndent(outfile, level) + outfile.write('<%sUnits>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Units).encode(ExternalEncoding), input_name='Units'), namespace_)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('<%sValue>%s\n' % (namespace_, self.gds_format_float(self.Value, input_name='Value'), namespace_)) + def hasContent_(self): + if ( + self.Units is not None or + self.Value is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Weight'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Units is not None: + showIndent(outfile, level) + outfile.write('Units=%s,\n' % quote_python(self.Units).encode(ExternalEncoding)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('Value=%f,\n' % self.Value) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Units': + Units_ = child_.text + Units_ = self.gds_validate_string(Units_, node, 'Units') + self.Units = Units_ + self.validate_WeightUnits(self.Units) # validate type WeightUnits + elif nodeName_ == 'Value': + sval_ = child_.text + try: + fval_ = float(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires float or double: %s' % exp) + fval_ = self.gds_validate_float(fval_, node, 'Value') + self.Value = fval_ +# end class Weight + + +class WebAuthenticationDetail(GeneratedsSuper): + """Used in authentication of the sender's identity.""" + subclass = None + superclass = None + def __init__(self, UserCredential=None): + self.UserCredential = UserCredential + def factory(*args_, **kwargs_): + if WebAuthenticationDetail.subclass: + return WebAuthenticationDetail.subclass(*args_, **kwargs_) + else: + return WebAuthenticationDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_UserCredential(self): return self.UserCredential + def set_UserCredential(self, UserCredential): self.UserCredential = UserCredential + def export(self, outfile, level, namespace_='ns:', name_='WebAuthenticationDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='WebAuthenticationDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='WebAuthenticationDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='WebAuthenticationDetail', fromsubclass_=False): + if self.UserCredential: + self.UserCredential.export(outfile, level, namespace_, name_='UserCredential', ) + def hasContent_(self): + if ( + self.UserCredential is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='WebAuthenticationDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.UserCredential is not None: + showIndent(outfile, level) + outfile.write('UserCredential=model_.WebAuthenticationCredential(\n') + self.UserCredential.exportLiteral(outfile, level, name_='UserCredential') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'UserCredential': + obj_ = WebAuthenticationCredential.factory() + obj_.build(child_) + self.set_UserCredential(obj_) +# end class WebAuthenticationDetail + + +class WebAuthenticationCredential(GeneratedsSuper): + """Two part authentication string used for the sender's identity""" + subclass = None + superclass = None + def __init__(self, Key=None, Password=None): + self.Key = Key + self.Password = Password + def factory(*args_, **kwargs_): + if WebAuthenticationCredential.subclass: + return WebAuthenticationCredential.subclass(*args_, **kwargs_) + else: + return WebAuthenticationCredential(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Key(self): return self.Key + def set_Key(self, Key): self.Key = Key + def get_Password(self): return self.Password + def set_Password(self, Password): self.Password = Password + def export(self, outfile, level, namespace_='ns:', name_='WebAuthenticationCredential', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='WebAuthenticationCredential') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='WebAuthenticationCredential'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='WebAuthenticationCredential', fromsubclass_=False): + if self.Key is not None: + showIndent(outfile, level) + outfile.write('<%sKey>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Key).encode(ExternalEncoding), input_name='Key'), namespace_)) + if self.Password is not None: + showIndent(outfile, level) + outfile.write('<%sPassword>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Password).encode(ExternalEncoding), input_name='Password'), namespace_)) + def hasContent_(self): + if ( + self.Key is not None or + self.Password is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='WebAuthenticationCredential'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Key is not None: + showIndent(outfile, level) + outfile.write('Key=%s,\n' % quote_python(self.Key).encode(ExternalEncoding)) + if self.Password is not None: + showIndent(outfile, level) + outfile.write('Password=%s,\n' % quote_python(self.Password).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Key': + Key_ = child_.text + Key_ = self.gds_validate_string(Key_, node, 'Key') + self.Key = Key_ + elif nodeName_ == 'Password': + Password_ = child_.text + Password_ = self.gds_validate_string(Password_, node, 'Password') + self.Password = Password_ +# end class WebAuthenticationCredential + + +class VersionId(GeneratedsSuper): + """Identifies the version/level of a service operation expected by a + caller (in each request) and performed by the callee (in each + reply).""" + subclass = None + superclass = None + def __init__(self, ServiceId=None, Major=None, Intermediate=None, Minor=None): + self.ServiceId = ServiceId + self.Major = Major + self.Intermediate = Intermediate + self.Minor = Minor + def factory(*args_, **kwargs_): + if VersionId.subclass: + return VersionId.subclass(*args_, **kwargs_) + else: + return VersionId(*args_, **kwargs_) + factory = staticmethod(factory) + def get_ServiceId(self): return self.ServiceId + def set_ServiceId(self, ServiceId): self.ServiceId = ServiceId + def get_Major(self): return self.Major + def set_Major(self, Major): self.Major = Major + def get_Intermediate(self): return self.Intermediate + def set_Intermediate(self, Intermediate): self.Intermediate = Intermediate + def get_Minor(self): return self.Minor + def set_Minor(self, Minor): self.Minor = Minor + def export(self, outfile, level, namespace_='ns:', name_='VersionId', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='VersionId') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='VersionId'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='VersionId', fromsubclass_=False): + if self.ServiceId is not None: + showIndent(outfile, level) + outfile.write('<%sServiceId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ServiceId).encode(ExternalEncoding), input_name='ServiceId'), namespace_)) + if self.Major is not None: + showIndent(outfile, level) + outfile.write('<%sMajor>%s\n' % (namespace_, self.gds_format_integer(self.Major, input_name='Major'), namespace_)) + if self.Intermediate is not None: + showIndent(outfile, level) + outfile.write('<%sIntermediate>%s\n' % (namespace_, self.gds_format_integer(self.Intermediate, input_name='Intermediate'), namespace_)) + if self.Minor is not None: + showIndent(outfile, level) + outfile.write('<%sMinor>%s\n' % (namespace_, self.gds_format_integer(self.Minor, input_name='Minor'), namespace_)) + def hasContent_(self): + if ( + self.ServiceId is not None or + self.Major is not None or + self.Intermediate is not None or + self.Minor is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='VersionId'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.ServiceId is not None: + showIndent(outfile, level) + outfile.write('ServiceId=%s,\n' % quote_python(self.ServiceId).encode(ExternalEncoding)) + if self.Major is not None: + showIndent(outfile, level) + outfile.write('Major=%d,\n' % self.Major) + if self.Intermediate is not None: + showIndent(outfile, level) + outfile.write('Intermediate=%d,\n' % self.Intermediate) + if self.Minor is not None: + showIndent(outfile, level) + outfile.write('Minor=%d,\n' % self.Minor) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'ServiceId': + ServiceId_ = child_.text + ServiceId_ = self.gds_validate_string(ServiceId_, node, 'ServiceId') + self.ServiceId = ServiceId_ + elif nodeName_ == 'Major': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'Major') + self.Major = ival_ + elif nodeName_ == 'Intermediate': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'Intermediate') + self.Intermediate = ival_ + elif nodeName_ == 'Minor': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'Minor') + self.Minor = ival_ +# end class VersionId + + +USAGE_TEXT = """ +Usage: python .py [ -s ] +""" + +def usage(): + print USAGE_TEXT + sys.exit(1) + + +def get_root_tag(node): + tag = Tag_pattern_.match(node.tag).groups()[-1] + rootClass = globals().get(tag) + return tag, rootClass + + +def parse(inFileName): + doc = parsexml_(inFileName) + rootNode = doc.getroot() + rootTag, rootClass = get_root_tag(rootNode) + if rootClass is None: + rootTag = 'SignatureProofOfDeliveryFaxReply' + rootClass = SignatureProofOfDeliveryFaxReply + rootObj = rootClass.factory() + rootObj.build(rootNode) + # Enable Python to collect the space used by the DOM. + doc = None + sys.stdout.write('\n') + rootObj.export(sys.stdout, 0, name_=rootTag, + namespacedef_='') + return rootObj + + +def parseString(inString): + from StringIO import StringIO + doc = parsexml_(StringIO(inString)) + rootNode = doc.getroot() + rootTag, rootClass = get_root_tag(rootNode) + if rootClass is None: + rootTag = 'SignatureProofOfDeliveryFaxReply' + rootClass = SignatureProofOfDeliveryFaxReply + rootObj = rootClass.factory() + rootObj.build(rootNode) + # Enable Python to collect the space used by the DOM. + doc = None + sys.stdout.write('\n') + rootObj.export(sys.stdout, 0, name_="SignatureProofOfDeliveryFaxReply", + namespacedef_='') + return rootObj + + +def parseLiteral(inFileName): + doc = parsexml_(inFileName) + rootNode = doc.getroot() + rootTag, rootClass = get_root_tag(rootNode) + if rootClass is None: + rootTag = 'SignatureProofOfDeliveryFaxReply' + rootClass = SignatureProofOfDeliveryFaxReply + rootObj = rootClass.factory() + rootObj.build(rootNode) + # Enable Python to collect the space used by the DOM. + doc = None + sys.stdout.write('#from track import *\n\n') + sys.stdout.write('import track as model_\n\n') + sys.stdout.write('rootObj = model_.rootTag(\n') + rootObj.exportLiteral(sys.stdout, 0, name_=rootTag) + sys.stdout.write(')\n') + return rootObj + + +def main(): + args = sys.argv[1:] + if len(args) == 1: + parse(args[0]) + else: + usage() + + +if __name__ == '__main__': + #import pdb; pdb.set_trace() + main() + + +__all__ = [ + "Address", + "ClientDetail", + "Contact", + "ContactAndAddress", + "Dimensions", + "Distance", + "EMailNotificationDetail", + "EMailNotificationRecipient", + "Localization", + "Notification", + "NotificationParameter", + "QualifiedTrackingNumber", + "SignatureProofOfDeliveryFaxReply", + "SignatureProofOfDeliveryFaxRequest", + "SignatureProofOfDeliveryLetterReply", + "SignatureProofOfDeliveryLetterRequest", + "StringBarcode", + "TrackDetail", + "TrackEvent", + "TrackNotificationPackage", + "TrackNotificationRecipientDetail", + "TrackNotificationReply", + "TrackNotificationRequest", + "TrackPackageIdentifier", + "TrackReconciliation", + "TrackReply", + "TrackRequest", + "TrackSplitShipmentPart", + "TransactionDetail", + "VersionId", + "WebAuthenticationCredential", + "WebAuthenticationDetail", + "Weight" + ] diff --git a/webxml/fedex/upload.py b/webxml/fedex/upload.py new file mode 100644 index 0000000..c53e6ec --- /dev/null +++ b/webxml/fedex/upload.py @@ -0,0 +1,2488 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# +# Generated Mon Nov 28 15:45:34 2011 by generateDS.py version 2.6a. +# + +import sys +import getopt +import re as re_ + +etree_ = None +Verbose_import_ = False +( XMLParser_import_none, XMLParser_import_lxml, + XMLParser_import_elementtree + ) = range(3) +XMLParser_import_library = None +try: + # lxml + from lxml import etree as etree_ + XMLParser_import_library = XMLParser_import_lxml + if Verbose_import_: + print("running with lxml.etree") +except ImportError: + try: + # cElementTree from Python 2.5+ + import xml.etree.cElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with cElementTree on Python 2.5+") + except ImportError: + try: + # ElementTree from Python 2.5+ + import xml.etree.ElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with ElementTree on Python 2.5+") + except ImportError: + try: + # normal cElementTree install + import cElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with cElementTree") + except ImportError: + try: + # normal ElementTree install + import elementtree.ElementTree as etree_ + XMLParser_import_library = XMLParser_import_elementtree + if Verbose_import_: + print("running with ElementTree") + except ImportError: + raise ImportError("Failed to import ElementTree from any known place") + +def parsexml_(*args, **kwargs): + if (XMLParser_import_library == XMLParser_import_lxml and + 'parser' not in kwargs): + # Use the lxml ElementTree compatible parser so that, e.g., + # we ignore comments. + kwargs['parser'] = etree_.ETCompatXMLParser() + doc = etree_.parse(*args, **kwargs) + return doc + +# +# User methods +# +# Calls to the methods in these classes are generated by generateDS.py. +# You can replace these methods by re-implementing the following class +# in a module named generatedssuper.py. + +try: + from generatedssuper import GeneratedsSuper +except ImportError, exp: + + class GeneratedsSuper(object): + def gds_format_string(self, input_data, input_name=''): + return input_data + def gds_validate_string(self, input_data, node, input_name=''): + return input_data + def gds_format_integer(self, input_data, input_name=''): + return '%d' % input_data + def gds_validate_integer(self, input_data, node, input_name=''): + return input_data + def gds_format_integer_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_integer_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + try: + fvalue = float(value) + except (TypeError, ValueError), exp: + raise_parse_error(node, 'Requires sequence of integers') + return input_data + def gds_format_float(self, input_data, input_name=''): + return '%f' % input_data + def gds_validate_float(self, input_data, node, input_name=''): + return input_data + def gds_format_float_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_float_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + try: + fvalue = float(value) + except (TypeError, ValueError), exp: + raise_parse_error(node, 'Requires sequence of floats') + return input_data + def gds_format_double(self, input_data, input_name=''): + return '%e' % input_data + def gds_validate_double(self, input_data, node, input_name=''): + return input_data + def gds_format_double_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_double_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + try: + fvalue = float(value) + except (TypeError, ValueError), exp: + raise_parse_error(node, 'Requires sequence of doubles') + return input_data + def gds_format_boolean(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_boolean(self, input_data, node, input_name=''): + return input_data + def gds_format_boolean_list(self, input_data, input_name=''): + return '%s' % input_data + def gds_validate_boolean_list(self, input_data, node, input_name=''): + values = input_data.split() + for value in values: + if value not in ('true', '1', 'false', '0', ): + raise_parse_error(node, 'Requires sequence of booleans ("true", "1", "false", "0")') + return input_data + def gds_str_lower(self, instring): + return instring.lower() + def get_path_(self, node): + path_list = [] + self.get_path_list_(node, path_list) + path_list.reverse() + path = '/'.join(path_list) + return path + Tag_strip_pattern_ = re_.compile(r'\{.*\}') + def get_path_list_(self, node, path_list): + if node is None: + return + tag = GeneratedsSuper.Tag_strip_pattern_.sub('', node.tag) + if tag: + path_list.append(tag) + self.get_path_list_(node.getparent(), path_list) + def get_class_obj_(self, node, default_class=None): + class_obj1 = default_class + if 'xsi' in node.nsmap: + classname = node.get('{%s}type' % node.nsmap['xsi']) + if classname is not None: + names = classname.split(':') + if len(names) == 2: + classname = names[1] + class_obj2 = globals().get(classname) + if class_obj2 is not None: + class_obj1 = class_obj2 + return class_obj1 + + +# +# If you have installed IPython you can uncomment and use the following. +# IPython is available from http://ipython.scipy.org/. +# + +## from IPython.Shell import IPShellEmbed +## args = '' +## ipshell = IPShellEmbed(args, +## banner = 'Dropping into IPython', +## exit_msg = 'Leaving Interpreter, back to program.') + +# Then use the following line where and when you want to drop into the +# IPython shell: +# ipshell(' -- Entering ipshell.\nHit Ctrl-D to exit') + +# +# Globals +# + +ExternalEncoding = 'ascii' +Tag_pattern_ = re_.compile(r'({.*})?(.*)') +String_cleanup_pat_ = re_.compile(r"[\n\r\s]+") +Namespace_extract_pat_ = re_.compile(r'{(.*)}(.*)') + +# +# Support/utility functions. +# + +def showIndent(outfile, level): + for idx in range(level): + outfile.write(' ') + +def quote_xml(inStr): + if not inStr: + return '' + s1 = (isinstance(inStr, basestring) and inStr or + '%s' % inStr) + s1 = s1.replace('&', '&') + s1 = s1.replace('<', '<') + s1 = s1.replace('>', '>') + return s1 + +def quote_attrib(inStr): + s1 = (isinstance(inStr, basestring) and inStr or + '%s' % inStr) + s1 = s1.replace('&', '&') + s1 = s1.replace('<', '<') + s1 = s1.replace('>', '>') + if '"' in s1: + if "'" in s1: + s1 = '"%s"' % s1.replace('"', """) + else: + s1 = "'%s'" % s1 + else: + s1 = '"%s"' % s1 + return s1 + +def quote_python(inStr): + s1 = inStr + if s1.find("'") == -1: + if s1.find('\n') == -1: + return "'%s'" % s1 + else: + return "'''%s'''" % s1 + else: + if s1.find('"') != -1: + s1 = s1.replace('"', '\\"') + if s1.find('\n') == -1: + return '"%s"' % s1 + else: + return '"""%s"""' % s1 + +def get_all_text_(node): + if node.text is not None: + text = node.text + else: + text = '' + for child in node: + if child.tail is not None: + text += child.tail + return text + +def find_attr_value_(attr_name, node): + attrs = node.attrib + attr_parts = attr_name.split(':') + value = None + if len(attr_parts) == 1: + value = attrs.get(attr_name) + elif len(attr_parts) == 2: + prefix, name = attr_parts + namespace = node.nsmap.get(prefix) + if namespace is not None: + value = attrs.get('{%s}%s' % (namespace, name, )) + return value + + +class GDSParseError(Exception): + pass + +def raise_parse_error(node, msg): + if XMLParser_import_library == XMLParser_import_lxml: + msg = '%s (element %s/line %d)' % (msg, node.tag, node.sourceline, ) + else: + msg = '%s (element %s)' % (msg, node.tag, ) + raise GDSParseError(msg) + + +class MixedContainer: + # Constants for category: + CategoryNone = 0 + CategoryText = 1 + CategorySimple = 2 + CategoryComplex = 3 + # Constants for content_type: + TypeNone = 0 + TypeText = 1 + TypeString = 2 + TypeInteger = 3 + TypeFloat = 4 + TypeDecimal = 5 + TypeDouble = 6 + TypeBoolean = 7 + def __init__(self, category, content_type, name, value): + self.category = category + self.content_type = content_type + self.name = name + self.value = value + def getCategory(self): + return self.category + def getContenttype(self, content_type): + return self.content_type + def getValue(self): + return self.value + def getName(self): + return self.name + def export(self, outfile, level, name, namespace): + if self.category == MixedContainer.CategoryText: + # Prevent exporting empty content as empty lines. + if self.value.strip(): + outfile.write(self.value) + elif self.category == MixedContainer.CategorySimple: + self.exportSimple(outfile, level, name) + else: # category == MixedContainer.CategoryComplex + self.value.export(outfile, level, namespace,name) + def exportSimple(self, outfile, level, name): + if self.content_type == MixedContainer.TypeString: + outfile.write('<%s>%s' % (self.name, self.value, self.name)) + elif self.content_type == MixedContainer.TypeInteger or \ + self.content_type == MixedContainer.TypeBoolean: + outfile.write('<%s>%d' % (self.name, self.value, self.name)) + elif self.content_type == MixedContainer.TypeFloat or \ + self.content_type == MixedContainer.TypeDecimal: + outfile.write('<%s>%f' % (self.name, self.value, self.name)) + elif self.content_type == MixedContainer.TypeDouble: + outfile.write('<%s>%g' % (self.name, self.value, self.name)) + def exportLiteral(self, outfile, level, name): + if self.category == MixedContainer.CategoryText: + showIndent(outfile, level) + outfile.write('model_.MixedContainer(%d, %d, "%s", "%s"),\n' % \ + (self.category, self.content_type, self.name, self.value)) + elif self.category == MixedContainer.CategorySimple: + showIndent(outfile, level) + outfile.write('model_.MixedContainer(%d, %d, "%s", "%s"),\n' % \ + (self.category, self.content_type, self.name, self.value)) + else: # category == MixedContainer.CategoryComplex + showIndent(outfile, level) + outfile.write('model_.MixedContainer(%d, %d, "%s",\n' % \ + (self.category, self.content_type, self.name,)) + self.value.exportLiteral(outfile, level + 1) + showIndent(outfile, level) + outfile.write(')\n') + + +class MemberSpec_(object): + def __init__(self, name='', data_type='', container=0): + self.name = name + self.data_type = data_type + self.container = container + def set_name(self, name): self.name = name + def get_name(self): return self.name + def set_data_type(self, data_type): self.data_type = data_type + def get_data_type_chain(self): return self.data_type + def get_data_type(self): + if isinstance(self.data_type, list): + if len(self.data_type) > 0: + return self.data_type[-1] + else: + return 'xs:string' + else: + return self.data_type + def set_container(self, container): self.container = container + def get_container(self): return self.container + +def _cast(typ, value): + if typ is None or value is None: + return value + return typ(value) + +# +# Data representation classes. +# + +class ClientDetail(GeneratedsSuper): + """Descriptive data for the client submitting a transaction.""" + subclass = None + superclass = None + def __init__(self, AccountNumber=None, MeterNumber=None, IntegratorId=None, Localization=None): + self.AccountNumber = AccountNumber + self.MeterNumber = MeterNumber + self.IntegratorId = IntegratorId + self.Localization = Localization + def factory(*args_, **kwargs_): + if ClientDetail.subclass: + return ClientDetail.subclass(*args_, **kwargs_) + else: + return ClientDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_AccountNumber(self): return self.AccountNumber + def set_AccountNumber(self, AccountNumber): self.AccountNumber = AccountNumber + def get_MeterNumber(self): return self.MeterNumber + def set_MeterNumber(self, MeterNumber): self.MeterNumber = MeterNumber + def get_IntegratorId(self): return self.IntegratorId + def set_IntegratorId(self, IntegratorId): self.IntegratorId = IntegratorId + def get_Localization(self): return self.Localization + def set_Localization(self, Localization): self.Localization = Localization + def export(self, outfile, level, namespace_='ns:', name_='ClientDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ClientDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ClientDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ClientDetail', fromsubclass_=False): + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('<%sAccountNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.AccountNumber).encode(ExternalEncoding), input_name='AccountNumber'), namespace_)) + if self.MeterNumber is not None: + showIndent(outfile, level) + outfile.write('<%sMeterNumber>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.MeterNumber).encode(ExternalEncoding), input_name='MeterNumber'), namespace_)) + if self.IntegratorId is not None: + showIndent(outfile, level) + outfile.write('<%sIntegratorId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.IntegratorId).encode(ExternalEncoding), input_name='IntegratorId'), namespace_)) + if self.Localization: + self.Localization.export(outfile, level, namespace_, name_='Localization') + def hasContent_(self): + if ( + self.AccountNumber is not None or + self.MeterNumber is not None or + self.IntegratorId is not None or + self.Localization is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ClientDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.AccountNumber is not None: + showIndent(outfile, level) + outfile.write('AccountNumber=%s,\n' % quote_python(self.AccountNumber).encode(ExternalEncoding)) + if self.MeterNumber is not None: + showIndent(outfile, level) + outfile.write('MeterNumber=%s,\n' % quote_python(self.MeterNumber).encode(ExternalEncoding)) + if self.IntegratorId is not None: + showIndent(outfile, level) + outfile.write('IntegratorId=%s,\n' % quote_python(self.IntegratorId).encode(ExternalEncoding)) + if self.Localization is not None: + showIndent(outfile, level) + outfile.write('Localization=model_.Localization(\n') + self.Localization.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'AccountNumber': + AccountNumber_ = child_.text + AccountNumber_ = self.gds_validate_string(AccountNumber_, node, 'AccountNumber') + self.AccountNumber = AccountNumber_ + elif nodeName_ == 'MeterNumber': + MeterNumber_ = child_.text + MeterNumber_ = self.gds_validate_string(MeterNumber_, node, 'MeterNumber') + self.MeterNumber = MeterNumber_ + elif nodeName_ == 'IntegratorId': + IntegratorId_ = child_.text + IntegratorId_ = self.gds_validate_string(IntegratorId_, node, 'IntegratorId') + self.IntegratorId = IntegratorId_ + elif nodeName_ == 'Localization': + obj_ = Localization.factory() + obj_.build(child_) + self.set_Localization(obj_) +# end class ClientDetail + + +class ImageUploadStatusDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Id=None, Status=None, StatusInfo=None, Message=None): + self.Id = Id + self.Status = Status + self.StatusInfo = StatusInfo + self.Message = Message + def factory(*args_, **kwargs_): + if ImageUploadStatusDetail.subclass: + return ImageUploadStatusDetail.subclass(*args_, **kwargs_) + else: + return ImageUploadStatusDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Id(self): return self.Id + def set_Id(self, Id): self.Id = Id + def validate_ImageId(self, value): + # Validate type ImageId, a restriction on xs:string. + pass + def get_Status(self): return self.Status + def set_Status(self, Status): self.Status = Status + def validate_UploadImageStatusType(self, value): + # Validate type UploadImageStatusType, a restriction on xs:string. + pass + def get_StatusInfo(self): return self.StatusInfo + def set_StatusInfo(self, StatusInfo): self.StatusInfo = StatusInfo + def validate_UploadImageStatusInfoType(self, value): + # Validate type UploadImageStatusInfoType, a restriction on xs:string. + pass + def get_Message(self): return self.Message + def set_Message(self, Message): self.Message = Message + def export(self, outfile, level, namespace_='ns:', name_='ImageUploadStatusDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='ImageUploadStatusDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='ImageUploadStatusDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='ImageUploadStatusDetail', fromsubclass_=False): + if self.Id is not None: + showIndent(outfile, level) + outfile.write('<%sId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Id).encode(ExternalEncoding), input_name='Id'), namespace_)) + if self.Status is not None: + showIndent(outfile, level) + outfile.write('<%sStatus>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Status).encode(ExternalEncoding), input_name='Status'), namespace_)) + if self.StatusInfo is not None: + showIndent(outfile, level) + outfile.write('<%sStatusInfo>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.StatusInfo).encode(ExternalEncoding), input_name='StatusInfo'), namespace_)) + if self.Message is not None: + showIndent(outfile, level) + outfile.write('<%sMessage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Message).encode(ExternalEncoding), input_name='Message'), namespace_)) + def hasContent_(self): + if ( + self.Id is not None or + self.Status is not None or + self.StatusInfo is not None or + self.Message is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='ImageUploadStatusDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Id is not None: + showIndent(outfile, level) + outfile.write('Id=%s,\n' % quote_python(self.Id).encode(ExternalEncoding)) + if self.Status is not None: + showIndent(outfile, level) + outfile.write('Status=%s,\n' % quote_python(self.Status).encode(ExternalEncoding)) + if self.StatusInfo is not None: + showIndent(outfile, level) + outfile.write('StatusInfo=%s,\n' % quote_python(self.StatusInfo).encode(ExternalEncoding)) + if self.Message is not None: + showIndent(outfile, level) + outfile.write('Message=%s,\n' % quote_python(self.Message).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Id': + Id_ = child_.text + Id_ = self.gds_validate_string(Id_, node, 'Id') + self.Id = Id_ + self.validate_ImageId(self.Id) # validate type ImageId + elif nodeName_ == 'Status': + Status_ = child_.text + Status_ = self.gds_validate_string(Status_, node, 'Status') + self.Status = Status_ + self.validate_UploadImageStatusType(self.Status) # validate type UploadImageStatusType + elif nodeName_ == 'StatusInfo': + StatusInfo_ = child_.text + StatusInfo_ = self.gds_validate_string(StatusInfo_, node, 'StatusInfo') + self.StatusInfo = StatusInfo_ + self.validate_UploadImageStatusInfoType(self.StatusInfo) # validate type UploadImageStatusInfoType + elif nodeName_ == 'Message': + Message_ = child_.text + Message_ = self.gds_validate_string(Message_, node, 'Message') + self.Message = Message_ +# end class ImageUploadStatusDetail + + +class Localization(GeneratedsSuper): + """Governs any future language/translations used for human-readable + text.""" + subclass = None + superclass = None + def __init__(self, LanguageCode=None, LocaleCode=None): + self.LanguageCode = LanguageCode + self.LocaleCode = LocaleCode + def factory(*args_, **kwargs_): + if Localization.subclass: + return Localization.subclass(*args_, **kwargs_) + else: + return Localization(*args_, **kwargs_) + factory = staticmethod(factory) + def get_LanguageCode(self): return self.LanguageCode + def set_LanguageCode(self, LanguageCode): self.LanguageCode = LanguageCode + def get_LocaleCode(self): return self.LocaleCode + def set_LocaleCode(self, LocaleCode): self.LocaleCode = LocaleCode + def export(self, outfile, level, namespace_='ns:', name_='Localization', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Localization') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Localization'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Localization', fromsubclass_=False): + if self.LanguageCode is not None: + showIndent(outfile, level) + outfile.write('<%sLanguageCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LanguageCode).encode(ExternalEncoding), input_name='LanguageCode'), namespace_)) + if self.LocaleCode is not None: + showIndent(outfile, level) + outfile.write('<%sLocaleCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LocaleCode).encode(ExternalEncoding), input_name='LocaleCode'), namespace_)) + def hasContent_(self): + if ( + self.LanguageCode is not None or + self.LocaleCode is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Localization'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.LanguageCode is not None: + showIndent(outfile, level) + outfile.write('LanguageCode=%s,\n' % quote_python(self.LanguageCode).encode(ExternalEncoding)) + if self.LocaleCode is not None: + showIndent(outfile, level) + outfile.write('LocaleCode=%s,\n' % quote_python(self.LocaleCode).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'LanguageCode': + LanguageCode_ = child_.text + LanguageCode_ = self.gds_validate_string(LanguageCode_, node, 'LanguageCode') + self.LanguageCode = LanguageCode_ + elif nodeName_ == 'LocaleCode': + LocaleCode_ = child_.text + LocaleCode_ = self.gds_validate_string(LocaleCode_, node, 'LocaleCode') + self.LocaleCode = LocaleCode_ +# end class Localization + + +class Money(GeneratedsSuper): + """The descriptive data for the medium of exchange for FedEx services.""" + subclass = None + superclass = None + def __init__(self, Currency=None, Amount=None): + self.Currency = Currency + self.Amount = Amount + def factory(*args_, **kwargs_): + if Money.subclass: + return Money.subclass(*args_, **kwargs_) + else: + return Money(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Currency(self): return self.Currency + def set_Currency(self, Currency): self.Currency = Currency + def get_Amount(self): return self.Amount + def set_Amount(self, Amount): self.Amount = Amount + def export(self, outfile, level, namespace_='ns:', name_='Money', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Money') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Money'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Money', fromsubclass_=False): + if self.Currency is not None: + showIndent(outfile, level) + outfile.write('<%sCurrency>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Currency).encode(ExternalEncoding), input_name='Currency'), namespace_)) + if self.Amount is not None: + showIndent(outfile, level) + outfile.write('<%sAmount>%s\n' % (namespace_, self.gds_format_float(self.Amount, input_name='Amount'), namespace_)) + def hasContent_(self): + if ( + self.Currency is not None or + self.Amount is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Money'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Currency is not None: + showIndent(outfile, level) + outfile.write('Currency=%s,\n' % quote_python(self.Currency).encode(ExternalEncoding)) + if self.Amount is not None: + showIndent(outfile, level) + outfile.write('Amount=%f,\n' % self.Amount) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Currency': + Currency_ = child_.text + Currency_ = self.gds_validate_string(Currency_, node, 'Currency') + self.Currency = Currency_ + elif nodeName_ == 'Amount': + sval_ = child_.text + try: + fval_ = float(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires float or double: %s' % exp) + fval_ = self.gds_validate_float(fval_, node, 'Amount') + self.Amount = fval_ +# end class Money + + +class Notification(GeneratedsSuper): + """The descriptive data regarding the results of the submitted + transaction.""" + subclass = None + superclass = None + def __init__(self, Severity=None, Source=None, Code=None, Message=None, LocalizedMessage=None, MessageParameters=None): + self.Severity = Severity + self.Source = Source + self.Code = Code + self.Message = Message + self.LocalizedMessage = LocalizedMessage + if MessageParameters is None: + self.MessageParameters = [] + else: + self.MessageParameters = MessageParameters + def factory(*args_, **kwargs_): + if Notification.subclass: + return Notification.subclass(*args_, **kwargs_) + else: + return Notification(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Severity(self): return self.Severity + def set_Severity(self, Severity): self.Severity = Severity + def validate_NotificationSeverityType(self, value): + # Validate type NotificationSeverityType, a restriction on xs:string. + pass + def get_Source(self): return self.Source + def set_Source(self, Source): self.Source = Source + def get_Code(self): return self.Code + def set_Code(self, Code): self.Code = Code + def get_Message(self): return self.Message + def set_Message(self, Message): self.Message = Message + def get_LocalizedMessage(self): return self.LocalizedMessage + def set_LocalizedMessage(self, LocalizedMessage): self.LocalizedMessage = LocalizedMessage + def get_MessageParameters(self): return self.MessageParameters + def set_MessageParameters(self, MessageParameters): self.MessageParameters = MessageParameters + def add_MessageParameters(self, value): self.MessageParameters.append(value) + def insert_MessageParameters(self, index, value): self.MessageParameters[index] = value + def export(self, outfile, level, namespace_='ns:', name_='Notification', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='Notification') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='Notification'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='Notification', fromsubclass_=False): + if self.Severity is not None: + showIndent(outfile, level) + outfile.write('<%sSeverity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Severity).encode(ExternalEncoding), input_name='Severity'), namespace_)) + if self.Source is not None: + showIndent(outfile, level) + outfile.write('<%sSource>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Source).encode(ExternalEncoding), input_name='Source'), namespace_)) + if self.Code is not None: + showIndent(outfile, level) + outfile.write('<%sCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Code).encode(ExternalEncoding), input_name='Code'), namespace_)) + if self.Message is not None: + showIndent(outfile, level) + outfile.write('<%sMessage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Message).encode(ExternalEncoding), input_name='Message'), namespace_)) + if self.LocalizedMessage is not None: + showIndent(outfile, level) + outfile.write('<%sLocalizedMessage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.LocalizedMessage).encode(ExternalEncoding), input_name='LocalizedMessage'), namespace_)) + for MessageParameters_ in self.MessageParameters: + MessageParameters_.export(outfile, level, namespace_, name_='MessageParameters') + def hasContent_(self): + if ( + self.Severity is not None or + self.Source is not None or + self.Code is not None or + self.Message is not None or + self.LocalizedMessage is not None or + self.MessageParameters + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='Notification'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Severity is not None: + showIndent(outfile, level) + outfile.write('Severity=%s,\n' % quote_python(self.Severity).encode(ExternalEncoding)) + if self.Source is not None: + showIndent(outfile, level) + outfile.write('Source=%s,\n' % quote_python(self.Source).encode(ExternalEncoding)) + if self.Code is not None: + showIndent(outfile, level) + outfile.write('Code=%s,\n' % quote_python(self.Code).encode(ExternalEncoding)) + if self.Message is not None: + showIndent(outfile, level) + outfile.write('Message=%s,\n' % quote_python(self.Message).encode(ExternalEncoding)) + if self.LocalizedMessage is not None: + showIndent(outfile, level) + outfile.write('LocalizedMessage=%s,\n' % quote_python(self.LocalizedMessage).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('MessageParameters=[\n') + level += 1 + for MessageParameters_ in self.MessageParameters: + showIndent(outfile, level) + outfile.write('model_.NotificationParameter(\n') + MessageParameters_.exportLiteral(outfile, level, name_='NotificationParameter') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Severity': + Severity_ = child_.text + Severity_ = self.gds_validate_string(Severity_, node, 'Severity') + self.Severity = Severity_ + self.validate_NotificationSeverityType(self.Severity) # validate type NotificationSeverityType + elif nodeName_ == 'Source': + Source_ = child_.text + Source_ = self.gds_validate_string(Source_, node, 'Source') + self.Source = Source_ + elif nodeName_ == 'Code': + Code_ = child_.text + Code_ = self.gds_validate_string(Code_, node, 'Code') + self.Code = Code_ + elif nodeName_ == 'Message': + Message_ = child_.text + Message_ = self.gds_validate_string(Message_, node, 'Message') + self.Message = Message_ + elif nodeName_ == 'LocalizedMessage': + LocalizedMessage_ = child_.text + LocalizedMessage_ = self.gds_validate_string(LocalizedMessage_, node, 'LocalizedMessage') + self.LocalizedMessage = LocalizedMessage_ + elif nodeName_ == 'MessageParameters': + obj_ = NotificationParameter.factory() + obj_.build(child_) + self.MessageParameters.append(obj_) +# end class Notification + + +class NotificationParameter(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Id=None, Value=None): + self.Id = Id + self.Value = Value + def factory(*args_, **kwargs_): + if NotificationParameter.subclass: + return NotificationParameter.subclass(*args_, **kwargs_) + else: + return NotificationParameter(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Id(self): return self.Id + def set_Id(self, Id): self.Id = Id + def get_Value(self): return self.Value + def set_Value(self, Value): self.Value = Value + def export(self, outfile, level, namespace_='ns:', name_='NotificationParameter', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='NotificationParameter') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='NotificationParameter'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='NotificationParameter', fromsubclass_=False): + if self.Id is not None: + showIndent(outfile, level) + outfile.write('<%sId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Id).encode(ExternalEncoding), input_name='Id'), namespace_)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('<%sValue>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Value).encode(ExternalEncoding), input_name='Value'), namespace_)) + def hasContent_(self): + if ( + self.Id is not None or + self.Value is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='NotificationParameter'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Id is not None: + showIndent(outfile, level) + outfile.write('Id=%s,\n' % quote_python(self.Id).encode(ExternalEncoding)) + if self.Value is not None: + showIndent(outfile, level) + outfile.write('Value=%s,\n' % quote_python(self.Value).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Id': + Id_ = child_.text + Id_ = self.gds_validate_string(Id_, node, 'Id') + self.Id = Id_ + elif nodeName_ == 'Value': + Value_ = child_.text + Value_ = self.gds_validate_string(Value_, node, 'Value') + self.Value = Value_ +# end class NotificationParameter + + +class TransactionDetail(GeneratedsSuper): + """Descriptive data for this customer transaction. The + TransactionDetail from the request is echoed back to the caller + in the corresponding reply.""" + subclass = None + superclass = None + def __init__(self, CustomerTransactionId=None, Localization=None): + self.CustomerTransactionId = CustomerTransactionId + self.Localization = Localization + def factory(*args_, **kwargs_): + if TransactionDetail.subclass: + return TransactionDetail.subclass(*args_, **kwargs_) + else: + return TransactionDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_CustomerTransactionId(self): return self.CustomerTransactionId + def set_CustomerTransactionId(self, CustomerTransactionId): self.CustomerTransactionId = CustomerTransactionId + def get_Localization(self): return self.Localization + def set_Localization(self, Localization): self.Localization = Localization + def export(self, outfile, level, namespace_='ns:', name_='TransactionDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='TransactionDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='TransactionDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='TransactionDetail', fromsubclass_=False): + if self.CustomerTransactionId is not None: + showIndent(outfile, level) + outfile.write('<%sCustomerTransactionId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CustomerTransactionId).encode(ExternalEncoding), input_name='CustomerTransactionId'), namespace_)) + if self.Localization: + self.Localization.export(outfile, level, namespace_, name_='Localization') + def hasContent_(self): + if ( + self.CustomerTransactionId is not None or + self.Localization is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='TransactionDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.CustomerTransactionId is not None: + showIndent(outfile, level) + outfile.write('CustomerTransactionId=%s,\n' % quote_python(self.CustomerTransactionId).encode(ExternalEncoding)) + if self.Localization is not None: + showIndent(outfile, level) + outfile.write('Localization=model_.Localization(\n') + self.Localization.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'CustomerTransactionId': + CustomerTransactionId_ = child_.text + CustomerTransactionId_ = self.gds_validate_string(CustomerTransactionId_, node, 'CustomerTransactionId') + self.CustomerTransactionId = CustomerTransactionId_ + elif nodeName_ == 'Localization': + obj_ = Localization.factory() + obj_.build(child_) + self.set_Localization(obj_) +# end class TransactionDetail + + +class UploadDocumentDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, LineNumber=None, CustomerReference=None, DocumentType=None, FileName=None, DocumentContent=None): + self.LineNumber = LineNumber + self.CustomerReference = CustomerReference + self.DocumentType = DocumentType + self.FileName = FileName + self.DocumentContent = DocumentContent + def factory(*args_, **kwargs_): + if UploadDocumentDetail.subclass: + return UploadDocumentDetail.subclass(*args_, **kwargs_) + else: + return UploadDocumentDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_LineNumber(self): return self.LineNumber + def set_LineNumber(self, LineNumber): self.LineNumber = LineNumber + def get_CustomerReference(self): return self.CustomerReference + def set_CustomerReference(self, CustomerReference): self.CustomerReference = CustomerReference + def get_DocumentType(self): return self.DocumentType + def set_DocumentType(self, DocumentType): self.DocumentType = DocumentType + def validate_UploadDocumentType(self, value): + # Validate type UploadDocumentType, a restriction on xs:string. + pass + def get_FileName(self): return self.FileName + def set_FileName(self, FileName): self.FileName = FileName + def get_DocumentContent(self): return self.DocumentContent + def set_DocumentContent(self, DocumentContent): self.DocumentContent = DocumentContent + def export(self, outfile, level, namespace_='ns:', name_='UploadDocumentDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='UploadDocumentDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='UploadDocumentDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='UploadDocumentDetail', fromsubclass_=False): + if self.LineNumber is not None: + showIndent(outfile, level) + outfile.write('<%sLineNumber>%s\n' % (namespace_, self.gds_format_integer(self.LineNumber, input_name='LineNumber'), namespace_)) + if self.CustomerReference is not None: + showIndent(outfile, level) + outfile.write('<%sCustomerReference>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CustomerReference).encode(ExternalEncoding), input_name='CustomerReference'), namespace_)) + if self.DocumentType is not None: + showIndent(outfile, level) + outfile.write('<%sDocumentType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DocumentType).encode(ExternalEncoding), input_name='DocumentType'), namespace_)) + if self.FileName is not None: + showIndent(outfile, level) + outfile.write('<%sFileName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.FileName).encode(ExternalEncoding), input_name='FileName'), namespace_)) + if self.DocumentContent: + self.DocumentContent.export(outfile, level, namespace_, name_='DocumentContent') + def hasContent_(self): + if ( + self.LineNumber is not None or + self.CustomerReference is not None or + self.DocumentType is not None or + self.FileName is not None or + self.DocumentContent is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='UploadDocumentDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.LineNumber is not None: + showIndent(outfile, level) + outfile.write('LineNumber=%d,\n' % self.LineNumber) + if self.CustomerReference is not None: + showIndent(outfile, level) + outfile.write('CustomerReference=%s,\n' % quote_python(self.CustomerReference).encode(ExternalEncoding)) + if self.DocumentType is not None: + showIndent(outfile, level) + outfile.write('DocumentType=%s,\n' % quote_python(self.DocumentType).encode(ExternalEncoding)) + if self.FileName is not None: + showIndent(outfile, level) + outfile.write('FileName=%s,\n' % quote_python(self.FileName).encode(ExternalEncoding)) + if self.DocumentContent is not None: + showIndent(outfile, level) + outfile.write('DocumentContent=model_.xs_base64Binary(\n') + self.DocumentContent.exportLiteral(outfile, level, name_='DocumentContent') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'LineNumber': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'LineNumber') + self.LineNumber = ival_ + elif nodeName_ == 'CustomerReference': + CustomerReference_ = child_.text + CustomerReference_ = self.gds_validate_string(CustomerReference_, node, 'CustomerReference') + self.CustomerReference = CustomerReference_ + elif nodeName_ == 'DocumentType': + DocumentType_ = child_.text + DocumentType_ = self.gds_validate_string(DocumentType_, node, 'DocumentType') + self.DocumentType = DocumentType_ + self.validate_UploadDocumentType(self.DocumentType) # validate type UploadDocumentType + elif nodeName_ == 'FileName': + FileName_ = child_.text + FileName_ = self.gds_validate_string(FileName_, node, 'FileName') + self.FileName = FileName_ + elif nodeName_ == 'DocumentContent': + obj_ = xs_base64Binary.factory() + obj_.build(child_) + self.set_DocumentContent(obj_) +# end class UploadDocumentDetail + + +class UploadDocumentStatusDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, LineNumber=None, CustomerReference=None, DocumentProducer=None, DocumentType=None, FileName=None, Status=None, StatusInfo=None, Message=None, DocumentId=None, DocumentIdProducer=None): + self.LineNumber = LineNumber + self.CustomerReference = CustomerReference + self.DocumentProducer = DocumentProducer + self.DocumentType = DocumentType + self.FileName = FileName + self.Status = Status + self.StatusInfo = StatusInfo + self.Message = Message + self.DocumentId = DocumentId + self.DocumentIdProducer = DocumentIdProducer + def factory(*args_, **kwargs_): + if UploadDocumentStatusDetail.subclass: + return UploadDocumentStatusDetail.subclass(*args_, **kwargs_) + else: + return UploadDocumentStatusDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_LineNumber(self): return self.LineNumber + def set_LineNumber(self, LineNumber): self.LineNumber = LineNumber + def get_CustomerReference(self): return self.CustomerReference + def set_CustomerReference(self, CustomerReference): self.CustomerReference = CustomerReference + def get_DocumentProducer(self): return self.DocumentProducer + def set_DocumentProducer(self, DocumentProducer): self.DocumentProducer = DocumentProducer + def validate_UploadDocumentProducerType(self, value): + # Validate type UploadDocumentProducerType, a restriction on xs:string. + pass + def get_DocumentType(self): return self.DocumentType + def set_DocumentType(self, DocumentType): self.DocumentType = DocumentType + def validate_UploadDocumentType(self, value): + # Validate type UploadDocumentType, a restriction on xs:string. + pass + def get_FileName(self): return self.FileName + def set_FileName(self, FileName): self.FileName = FileName + def get_Status(self): return self.Status + def set_Status(self, Status): self.Status = Status + def validate_UploadDocumentStatusType(self, value): + # Validate type UploadDocumentStatusType, a restriction on xs:string. + pass + def get_StatusInfo(self): return self.StatusInfo + def set_StatusInfo(self, StatusInfo): self.StatusInfo = StatusInfo + def validate_UploadDocumentStatusInfoType(self, value): + # Validate type UploadDocumentStatusInfoType, a restriction on xs:string. + pass + def get_Message(self): return self.Message + def set_Message(self, Message): self.Message = Message + def get_DocumentId(self): return self.DocumentId + def set_DocumentId(self, DocumentId): self.DocumentId = DocumentId + def get_DocumentIdProducer(self): return self.DocumentIdProducer + def set_DocumentIdProducer(self, DocumentIdProducer): self.DocumentIdProducer = DocumentIdProducer + def validate_UploadDocumentIdProducer(self, value): + # Validate type UploadDocumentIdProducer, a restriction on xs:string. + pass + def export(self, outfile, level, namespace_='ns:', name_='UploadDocumentStatusDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='UploadDocumentStatusDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='UploadDocumentStatusDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='UploadDocumentStatusDetail', fromsubclass_=False): + if self.LineNumber is not None: + showIndent(outfile, level) + outfile.write('<%sLineNumber>%s\n' % (namespace_, self.gds_format_integer(self.LineNumber, input_name='LineNumber'), namespace_)) + if self.CustomerReference is not None: + showIndent(outfile, level) + outfile.write('<%sCustomerReference>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.CustomerReference).encode(ExternalEncoding), input_name='CustomerReference'), namespace_)) + if self.DocumentProducer is not None: + showIndent(outfile, level) + outfile.write('<%sDocumentProducer>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DocumentProducer).encode(ExternalEncoding), input_name='DocumentProducer'), namespace_)) + if self.DocumentType is not None: + showIndent(outfile, level) + outfile.write('<%sDocumentType>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DocumentType).encode(ExternalEncoding), input_name='DocumentType'), namespace_)) + if self.FileName is not None: + showIndent(outfile, level) + outfile.write('<%sFileName>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.FileName).encode(ExternalEncoding), input_name='FileName'), namespace_)) + if self.Status is not None: + showIndent(outfile, level) + outfile.write('<%sStatus>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Status).encode(ExternalEncoding), input_name='Status'), namespace_)) + if self.StatusInfo is not None: + showIndent(outfile, level) + outfile.write('<%sStatusInfo>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.StatusInfo).encode(ExternalEncoding), input_name='StatusInfo'), namespace_)) + if self.Message is not None: + showIndent(outfile, level) + outfile.write('<%sMessage>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Message).encode(ExternalEncoding), input_name='Message'), namespace_)) + if self.DocumentId is not None: + showIndent(outfile, level) + outfile.write('<%sDocumentId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DocumentId).encode(ExternalEncoding), input_name='DocumentId'), namespace_)) + if self.DocumentIdProducer is not None: + showIndent(outfile, level) + outfile.write('<%sDocumentIdProducer>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DocumentIdProducer).encode(ExternalEncoding), input_name='DocumentIdProducer'), namespace_)) + def hasContent_(self): + if ( + self.LineNumber is not None or + self.CustomerReference is not None or + self.DocumentProducer is not None or + self.DocumentType is not None or + self.FileName is not None or + self.Status is not None or + self.StatusInfo is not None or + self.Message is not None or + self.DocumentId is not None or + self.DocumentIdProducer is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='UploadDocumentStatusDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.LineNumber is not None: + showIndent(outfile, level) + outfile.write('LineNumber=%d,\n' % self.LineNumber) + if self.CustomerReference is not None: + showIndent(outfile, level) + outfile.write('CustomerReference=%s,\n' % quote_python(self.CustomerReference).encode(ExternalEncoding)) + if self.DocumentProducer is not None: + showIndent(outfile, level) + outfile.write('DocumentProducer=%s,\n' % quote_python(self.DocumentProducer).encode(ExternalEncoding)) + if self.DocumentType is not None: + showIndent(outfile, level) + outfile.write('DocumentType=%s,\n' % quote_python(self.DocumentType).encode(ExternalEncoding)) + if self.FileName is not None: + showIndent(outfile, level) + outfile.write('FileName=%s,\n' % quote_python(self.FileName).encode(ExternalEncoding)) + if self.Status is not None: + showIndent(outfile, level) + outfile.write('Status=%s,\n' % quote_python(self.Status).encode(ExternalEncoding)) + if self.StatusInfo is not None: + showIndent(outfile, level) + outfile.write('StatusInfo=%s,\n' % quote_python(self.StatusInfo).encode(ExternalEncoding)) + if self.Message is not None: + showIndent(outfile, level) + outfile.write('Message=%s,\n' % quote_python(self.Message).encode(ExternalEncoding)) + if self.DocumentId is not None: + showIndent(outfile, level) + outfile.write('DocumentId=%s,\n' % quote_python(self.DocumentId).encode(ExternalEncoding)) + if self.DocumentIdProducer is not None: + showIndent(outfile, level) + outfile.write('DocumentIdProducer=%s,\n' % quote_python(self.DocumentIdProducer).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'LineNumber': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + if ival_ < 0: + raise_parse_error(child_, 'requires nonNegativeInteger') + ival_ = self.gds_validate_integer(ival_, node, 'LineNumber') + self.LineNumber = ival_ + elif nodeName_ == 'CustomerReference': + CustomerReference_ = child_.text + CustomerReference_ = self.gds_validate_string(CustomerReference_, node, 'CustomerReference') + self.CustomerReference = CustomerReference_ + elif nodeName_ == 'DocumentProducer': + DocumentProducer_ = child_.text + DocumentProducer_ = self.gds_validate_string(DocumentProducer_, node, 'DocumentProducer') + self.DocumentProducer = DocumentProducer_ + self.validate_UploadDocumentProducerType(self.DocumentProducer) # validate type UploadDocumentProducerType + elif nodeName_ == 'DocumentType': + DocumentType_ = child_.text + DocumentType_ = self.gds_validate_string(DocumentType_, node, 'DocumentType') + self.DocumentType = DocumentType_ + self.validate_UploadDocumentType(self.DocumentType) # validate type UploadDocumentType + elif nodeName_ == 'FileName': + FileName_ = child_.text + FileName_ = self.gds_validate_string(FileName_, node, 'FileName') + self.FileName = FileName_ + elif nodeName_ == 'Status': + Status_ = child_.text + Status_ = self.gds_validate_string(Status_, node, 'Status') + self.Status = Status_ + self.validate_UploadDocumentStatusType(self.Status) # validate type UploadDocumentStatusType + elif nodeName_ == 'StatusInfo': + StatusInfo_ = child_.text + StatusInfo_ = self.gds_validate_string(StatusInfo_, node, 'StatusInfo') + self.StatusInfo = StatusInfo_ + self.validate_UploadDocumentStatusInfoType(self.StatusInfo) # validate type UploadDocumentStatusInfoType + elif nodeName_ == 'Message': + Message_ = child_.text + Message_ = self.gds_validate_string(Message_, node, 'Message') + self.Message = Message_ + elif nodeName_ == 'DocumentId': + DocumentId_ = child_.text + DocumentId_ = self.gds_validate_string(DocumentId_, node, 'DocumentId') + self.DocumentId = DocumentId_ + elif nodeName_ == 'DocumentIdProducer': + DocumentIdProducer_ = child_.text + DocumentIdProducer_ = self.gds_validate_string(DocumentIdProducer_, node, 'DocumentIdProducer') + self.DocumentIdProducer = DocumentIdProducer_ + self.validate_UploadDocumentIdProducer(self.DocumentIdProducer) # validate type UploadDocumentIdProducer +# end class UploadDocumentStatusDetail + + +class UploadDocumentsReply(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, HighestSeverity=None, Notifications=None, TransactionDetail=None, Version=None, DocumentStatuses=None): + self.HighestSeverity = HighestSeverity + if Notifications is None: + self.Notifications = [] + else: + self.Notifications = Notifications + self.TransactionDetail = TransactionDetail + self.Version = Version + if DocumentStatuses is None: + self.DocumentStatuses = [] + else: + self.DocumentStatuses = DocumentStatuses + def factory(*args_, **kwargs_): + if UploadDocumentsReply.subclass: + return UploadDocumentsReply.subclass(*args_, **kwargs_) + else: + return UploadDocumentsReply(*args_, **kwargs_) + factory = staticmethod(factory) + def get_HighestSeverity(self): return self.HighestSeverity + def set_HighestSeverity(self, HighestSeverity): self.HighestSeverity = HighestSeverity + def validate_NotificationSeverityType(self, value): + # Validate type NotificationSeverityType, a restriction on xs:string. + pass + def get_Notifications(self): return self.Notifications + def set_Notifications(self, Notifications): self.Notifications = Notifications + def add_Notifications(self, value): self.Notifications.append(value) + def insert_Notifications(self, index, value): self.Notifications[index] = value + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_DocumentStatuses(self): return self.DocumentStatuses + def set_DocumentStatuses(self, DocumentStatuses): self.DocumentStatuses = DocumentStatuses + def add_DocumentStatuses(self, value): self.DocumentStatuses.append(value) + def insert_DocumentStatuses(self, index, value): self.DocumentStatuses[index] = value + def export(self, outfile, level, namespace_='ns:', name_='UploadDocumentsReply', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='UploadDocumentsReply') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='UploadDocumentsReply'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='UploadDocumentsReply', fromsubclass_=False): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('<%sHighestSeverity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HighestSeverity).encode(ExternalEncoding), input_name='HighestSeverity'), namespace_)) + for Notifications_ in self.Notifications: + Notifications_.export(outfile, level, namespace_, name_='Notifications') + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + for DocumentStatuses_ in self.DocumentStatuses: + DocumentStatuses_.export(outfile, level, namespace_, name_='DocumentStatuses') + def hasContent_(self): + if ( + self.HighestSeverity is not None or + self.Notifications or + self.TransactionDetail is not None or + self.Version is not None or + self.DocumentStatuses + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='UploadDocumentsReply'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('HighestSeverity=%s,\n' % quote_python(self.HighestSeverity).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Notifications=[\n') + level += 1 + for Notifications_ in self.Notifications: + showIndent(outfile, level) + outfile.write('model_.Notification(\n') + Notifications_.exportLiteral(outfile, level, name_='Notification') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('DocumentStatuses=[\n') + level += 1 + for DocumentStatuses_ in self.DocumentStatuses: + showIndent(outfile, level) + outfile.write('model_.UploadDocumentStatusDetail(\n') + DocumentStatuses_.exportLiteral(outfile, level, name_='UploadDocumentStatusDetail') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'HighestSeverity': + HighestSeverity_ = child_.text + HighestSeverity_ = self.gds_validate_string(HighestSeverity_, node, 'HighestSeverity') + self.HighestSeverity = HighestSeverity_ + self.validate_NotificationSeverityType(self.HighestSeverity) # validate type NotificationSeverityType + elif nodeName_ == 'Notifications': + obj_ = Notification.factory() + obj_.build(child_) + self.Notifications.append(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'DocumentStatuses': + obj_ = UploadDocumentStatusDetail.factory() + obj_.build(child_) + self.DocumentStatuses.append(obj_) +# end class UploadDocumentsReply + + +class UploadDocumentsRequest(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, WebAuthenticationDetail=None, ClientDetail=None, TransactionDetail=None, Version=None, OriginCountryCode=None, DestinationCountryCode=None, Documents=None): + self.WebAuthenticationDetail = WebAuthenticationDetail + self.ClientDetail = ClientDetail + self.TransactionDetail = TransactionDetail + self.Version = Version + self.OriginCountryCode = OriginCountryCode + self.DestinationCountryCode = DestinationCountryCode + if Documents is None: + self.Documents = [] + else: + self.Documents = Documents + def factory(*args_, **kwargs_): + if UploadDocumentsRequest.subclass: + return UploadDocumentsRequest.subclass(*args_, **kwargs_) + else: + return UploadDocumentsRequest(*args_, **kwargs_) + factory = staticmethod(factory) + def get_WebAuthenticationDetail(self): return self.WebAuthenticationDetail + def set_WebAuthenticationDetail(self, WebAuthenticationDetail): self.WebAuthenticationDetail = WebAuthenticationDetail + def get_ClientDetail(self): return self.ClientDetail + def set_ClientDetail(self, ClientDetail): self.ClientDetail = ClientDetail + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_OriginCountryCode(self): return self.OriginCountryCode + def set_OriginCountryCode(self, OriginCountryCode): self.OriginCountryCode = OriginCountryCode + def get_DestinationCountryCode(self): return self.DestinationCountryCode + def set_DestinationCountryCode(self, DestinationCountryCode): self.DestinationCountryCode = DestinationCountryCode + def get_Documents(self): return self.Documents + def set_Documents(self, Documents): self.Documents = Documents + def add_Documents(self, value): self.Documents.append(value) + def insert_Documents(self, index, value): self.Documents[index] = value + def export(self, outfile, level, namespace_='ns:', name_='UploadDocumentsRequest', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='UploadDocumentsRequest') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='UploadDocumentsRequest'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='UploadDocumentsRequest', fromsubclass_=False): + if self.WebAuthenticationDetail: + self.WebAuthenticationDetail.export(outfile, level, namespace_, name_='WebAuthenticationDetail', ) + if self.ClientDetail: + self.ClientDetail.export(outfile, level, namespace_, name_='ClientDetail', ) + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + if self.OriginCountryCode is not None: + showIndent(outfile, level) + outfile.write('<%sOriginCountryCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.OriginCountryCode).encode(ExternalEncoding), input_name='OriginCountryCode'), namespace_)) + if self.DestinationCountryCode is not None: + showIndent(outfile, level) + outfile.write('<%sDestinationCountryCode>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.DestinationCountryCode).encode(ExternalEncoding), input_name='DestinationCountryCode'), namespace_)) + for Documents_ in self.Documents: + Documents_.export(outfile, level, namespace_, name_='Documents') + def hasContent_(self): + if ( + self.WebAuthenticationDetail is not None or + self.ClientDetail is not None or + self.TransactionDetail is not None or + self.Version is not None or + self.OriginCountryCode is not None or + self.DestinationCountryCode is not None or + self.Documents + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='UploadDocumentsRequest'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.WebAuthenticationDetail is not None: + showIndent(outfile, level) + outfile.write('WebAuthenticationDetail=model_.WebAuthenticationDetail(\n') + self.WebAuthenticationDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ClientDetail is not None: + showIndent(outfile, level) + outfile.write('ClientDetail=model_.ClientDetail(\n') + self.ClientDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + if self.OriginCountryCode is not None: + showIndent(outfile, level) + outfile.write('OriginCountryCode=%s,\n' % quote_python(self.OriginCountryCode).encode(ExternalEncoding)) + if self.DestinationCountryCode is not None: + showIndent(outfile, level) + outfile.write('DestinationCountryCode=%s,\n' % quote_python(self.DestinationCountryCode).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Documents=[\n') + level += 1 + for Documents_ in self.Documents: + showIndent(outfile, level) + outfile.write('model_.UploadDocumentDetail(\n') + Documents_.exportLiteral(outfile, level, name_='UploadDocumentDetail') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'WebAuthenticationDetail': + obj_ = WebAuthenticationDetail.factory() + obj_.build(child_) + self.set_WebAuthenticationDetail(obj_) + elif nodeName_ == 'ClientDetail': + obj_ = ClientDetail.factory() + obj_.build(child_) + self.set_ClientDetail(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'OriginCountryCode': + OriginCountryCode_ = child_.text + OriginCountryCode_ = self.gds_validate_string(OriginCountryCode_, node, 'OriginCountryCode') + self.OriginCountryCode = OriginCountryCode_ + elif nodeName_ == 'DestinationCountryCode': + DestinationCountryCode_ = child_.text + DestinationCountryCode_ = self.gds_validate_string(DestinationCountryCode_, node, 'DestinationCountryCode') + self.DestinationCountryCode = DestinationCountryCode_ + elif nodeName_ == 'Documents': + obj_ = UploadDocumentDetail.factory() + obj_.build(child_) + self.Documents.append(obj_) +# end class UploadDocumentsRequest + + +class UploadImageDetail(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, Id=None, Image=None): + self.Id = Id + self.Image = Image + def factory(*args_, **kwargs_): + if UploadImageDetail.subclass: + return UploadImageDetail.subclass(*args_, **kwargs_) + else: + return UploadImageDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Id(self): return self.Id + def set_Id(self, Id): self.Id = Id + def validate_ImageId(self, value): + # Validate type ImageId, a restriction on xs:string. + pass + def get_Image(self): return self.Image + def set_Image(self, Image): self.Image = Image + def export(self, outfile, level, namespace_='ns:', name_='UploadImageDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='UploadImageDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='UploadImageDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='UploadImageDetail', fromsubclass_=False): + if self.Id is not None: + showIndent(outfile, level) + outfile.write('<%sId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Id).encode(ExternalEncoding), input_name='Id'), namespace_)) + if self.Image: + self.Image.export(outfile, level, namespace_, name_='Image') + def hasContent_(self): + if ( + self.Id is not None or + self.Image is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='UploadImageDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Id is not None: + showIndent(outfile, level) + outfile.write('Id=%s,\n' % quote_python(self.Id).encode(ExternalEncoding)) + if self.Image is not None: + showIndent(outfile, level) + outfile.write('Image=model_.xs_base64Binary(\n') + self.Image.exportLiteral(outfile, level, name_='Image') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Id': + Id_ = child_.text + Id_ = self.gds_validate_string(Id_, node, 'Id') + self.Id = Id_ + self.validate_ImageId(self.Id) # validate type ImageId + elif nodeName_ == 'Image': + obj_ = xs_base64Binary.factory() + obj_.build(child_) + self.set_Image(obj_) +# end class UploadImageDetail + + +class UploadImagesReply(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, HighestSeverity=None, Notifications=None, TransactionDetail=None, Version=None, ImageStatuses=None): + self.HighestSeverity = HighestSeverity + if Notifications is None: + self.Notifications = [] + else: + self.Notifications = Notifications + self.TransactionDetail = TransactionDetail + self.Version = Version + if ImageStatuses is None: + self.ImageStatuses = [] + else: + self.ImageStatuses = ImageStatuses + def factory(*args_, **kwargs_): + if UploadImagesReply.subclass: + return UploadImagesReply.subclass(*args_, **kwargs_) + else: + return UploadImagesReply(*args_, **kwargs_) + factory = staticmethod(factory) + def get_HighestSeverity(self): return self.HighestSeverity + def set_HighestSeverity(self, HighestSeverity): self.HighestSeverity = HighestSeverity + def validate_NotificationSeverityType(self, value): + # Validate type NotificationSeverityType, a restriction on xs:string. + pass + def get_Notifications(self): return self.Notifications + def set_Notifications(self, Notifications): self.Notifications = Notifications + def add_Notifications(self, value): self.Notifications.append(value) + def insert_Notifications(self, index, value): self.Notifications[index] = value + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_ImageStatuses(self): return self.ImageStatuses + def set_ImageStatuses(self, ImageStatuses): self.ImageStatuses = ImageStatuses + def add_ImageStatuses(self, value): self.ImageStatuses.append(value) + def insert_ImageStatuses(self, index, value): self.ImageStatuses[index] = value + def export(self, outfile, level, namespace_='ns:', name_='UploadImagesReply', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='UploadImagesReply') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='UploadImagesReply'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='UploadImagesReply', fromsubclass_=False): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('<%sHighestSeverity>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.HighestSeverity).encode(ExternalEncoding), input_name='HighestSeverity'), namespace_)) + for Notifications_ in self.Notifications: + Notifications_.export(outfile, level, namespace_, name_='Notifications') + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + for ImageStatuses_ in self.ImageStatuses: + ImageStatuses_.export(outfile, level, namespace_, name_='ImageStatuses') + def hasContent_(self): + if ( + self.HighestSeverity is not None or + self.Notifications or + self.TransactionDetail is not None or + self.Version is not None or + self.ImageStatuses + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='UploadImagesReply'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.HighestSeverity is not None: + showIndent(outfile, level) + outfile.write('HighestSeverity=%s,\n' % quote_python(self.HighestSeverity).encode(ExternalEncoding)) + showIndent(outfile, level) + outfile.write('Notifications=[\n') + level += 1 + for Notifications_ in self.Notifications: + showIndent(outfile, level) + outfile.write('model_.Notification(\n') + Notifications_.exportLiteral(outfile, level, name_='Notification') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('ImageStatuses=[\n') + level += 1 + for ImageStatuses_ in self.ImageStatuses: + showIndent(outfile, level) + outfile.write('model_.ImageUploadStatusDetail(\n') + ImageStatuses_.exportLiteral(outfile, level, name_='ImageUploadStatusDetail') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'HighestSeverity': + HighestSeverity_ = child_.text + HighestSeverity_ = self.gds_validate_string(HighestSeverity_, node, 'HighestSeverity') + self.HighestSeverity = HighestSeverity_ + self.validate_NotificationSeverityType(self.HighestSeverity) # validate type NotificationSeverityType + elif nodeName_ == 'Notifications': + obj_ = Notification.factory() + obj_.build(child_) + self.Notifications.append(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'ImageStatuses': + obj_ = ImageUploadStatusDetail.factory() + obj_.build(child_) + self.ImageStatuses.append(obj_) +# end class UploadImagesReply + + +class UploadImagesRequest(GeneratedsSuper): + subclass = None + superclass = None + def __init__(self, WebAuthenticationDetail=None, ClientDetail=None, TransactionDetail=None, Version=None, Images=None): + self.WebAuthenticationDetail = WebAuthenticationDetail + self.ClientDetail = ClientDetail + self.TransactionDetail = TransactionDetail + self.Version = Version + if Images is None: + self.Images = [] + else: + self.Images = Images + def factory(*args_, **kwargs_): + if UploadImagesRequest.subclass: + return UploadImagesRequest.subclass(*args_, **kwargs_) + else: + return UploadImagesRequest(*args_, **kwargs_) + factory = staticmethod(factory) + def get_WebAuthenticationDetail(self): return self.WebAuthenticationDetail + def set_WebAuthenticationDetail(self, WebAuthenticationDetail): self.WebAuthenticationDetail = WebAuthenticationDetail + def get_ClientDetail(self): return self.ClientDetail + def set_ClientDetail(self, ClientDetail): self.ClientDetail = ClientDetail + def get_TransactionDetail(self): return self.TransactionDetail + def set_TransactionDetail(self, TransactionDetail): self.TransactionDetail = TransactionDetail + def get_Version(self): return self.Version + def set_Version(self, Version): self.Version = Version + def get_Images(self): return self.Images + def set_Images(self, Images): self.Images = Images + def add_Images(self, value): self.Images.append(value) + def insert_Images(self, index, value): self.Images[index] = value + def export(self, outfile, level, namespace_='ns:', name_='UploadImagesRequest', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='UploadImagesRequest') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='UploadImagesRequest'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='UploadImagesRequest', fromsubclass_=False): + if self.WebAuthenticationDetail: + self.WebAuthenticationDetail.export(outfile, level, namespace_, name_='WebAuthenticationDetail', ) + if self.ClientDetail: + self.ClientDetail.export(outfile, level, namespace_, name_='ClientDetail', ) + if self.TransactionDetail: + self.TransactionDetail.export(outfile, level, namespace_, name_='TransactionDetail') + if self.Version: + self.Version.export(outfile, level, namespace_, name_='Version', ) + for Images_ in self.Images: + Images_.export(outfile, level, namespace_, name_='Images') + def hasContent_(self): + if ( + self.WebAuthenticationDetail is not None or + self.ClientDetail is not None or + self.TransactionDetail is not None or + self.Version is not None or + self.Images + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='UploadImagesRequest'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.WebAuthenticationDetail is not None: + showIndent(outfile, level) + outfile.write('WebAuthenticationDetail=model_.WebAuthenticationDetail(\n') + self.WebAuthenticationDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.ClientDetail is not None: + showIndent(outfile, level) + outfile.write('ClientDetail=model_.ClientDetail(\n') + self.ClientDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.TransactionDetail is not None: + showIndent(outfile, level) + outfile.write('TransactionDetail=model_.TransactionDetail(\n') + self.TransactionDetail.exportLiteral(outfile, level) + showIndent(outfile, level) + outfile.write('),\n') + if self.Version is not None: + showIndent(outfile, level) + outfile.write('Version=model_.VersionId(\n') + self.Version.exportLiteral(outfile, level, name_='Version') + showIndent(outfile, level) + outfile.write('),\n') + showIndent(outfile, level) + outfile.write('Images=[\n') + level += 1 + for Images_ in self.Images: + showIndent(outfile, level) + outfile.write('model_.UploadImageDetail(\n') + Images_.exportLiteral(outfile, level, name_='UploadImageDetail') + showIndent(outfile, level) + outfile.write('),\n') + level -= 1 + showIndent(outfile, level) + outfile.write('],\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'WebAuthenticationDetail': + obj_ = WebAuthenticationDetail.factory() + obj_.build(child_) + self.set_WebAuthenticationDetail(obj_) + elif nodeName_ == 'ClientDetail': + obj_ = ClientDetail.factory() + obj_.build(child_) + self.set_ClientDetail(obj_) + elif nodeName_ == 'TransactionDetail': + obj_ = TransactionDetail.factory() + obj_.build(child_) + self.set_TransactionDetail(obj_) + elif nodeName_ == 'Version': + obj_ = VersionId.factory() + obj_.build(child_) + self.set_Version(obj_) + elif nodeName_ == 'Images': + obj_ = UploadImageDetail.factory() + obj_.build(child_) + self.Images.append(obj_) +# end class UploadImagesRequest + + +class VersionId(GeneratedsSuper): + """Identifies the version/level of a service operation expected by a + caller (in each request) and performed by the callee (in each + reply).""" + subclass = None + superclass = None + def __init__(self, ServiceId=None, Major=None, Intermediate=None, Minor=None): + self.ServiceId = ServiceId + self.Major = Major + self.Intermediate = Intermediate + self.Minor = Minor + def factory(*args_, **kwargs_): + if VersionId.subclass: + return VersionId.subclass(*args_, **kwargs_) + else: + return VersionId(*args_, **kwargs_) + factory = staticmethod(factory) + def get_ServiceId(self): return self.ServiceId + def set_ServiceId(self, ServiceId): self.ServiceId = ServiceId + def get_Major(self): return self.Major + def set_Major(self, Major): self.Major = Major + def get_Intermediate(self): return self.Intermediate + def set_Intermediate(self, Intermediate): self.Intermediate = Intermediate + def get_Minor(self): return self.Minor + def set_Minor(self, Minor): self.Minor = Minor + def export(self, outfile, level, namespace_='ns:', name_='VersionId', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='VersionId') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='VersionId'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='VersionId', fromsubclass_=False): + if self.ServiceId is not None: + showIndent(outfile, level) + outfile.write('<%sServiceId>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.ServiceId).encode(ExternalEncoding), input_name='ServiceId'), namespace_)) + if self.Major is not None: + showIndent(outfile, level) + outfile.write('<%sMajor>%s\n' % (namespace_, self.gds_format_integer(self.Major, input_name='Major'), namespace_)) + if self.Intermediate is not None: + showIndent(outfile, level) + outfile.write('<%sIntermediate>%s\n' % (namespace_, self.gds_format_integer(self.Intermediate, input_name='Intermediate'), namespace_)) + if self.Minor is not None: + showIndent(outfile, level) + outfile.write('<%sMinor>%s\n' % (namespace_, self.gds_format_integer(self.Minor, input_name='Minor'), namespace_)) + def hasContent_(self): + if ( + self.ServiceId is not None or + self.Major is not None or + self.Intermediate is not None or + self.Minor is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='VersionId'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.ServiceId is not None: + showIndent(outfile, level) + outfile.write('ServiceId=%s,\n' % quote_python(self.ServiceId).encode(ExternalEncoding)) + if self.Major is not None: + showIndent(outfile, level) + outfile.write('Major=%d,\n' % self.Major) + if self.Intermediate is not None: + showIndent(outfile, level) + outfile.write('Intermediate=%d,\n' % self.Intermediate) + if self.Minor is not None: + showIndent(outfile, level) + outfile.write('Minor=%d,\n' % self.Minor) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'ServiceId': + ServiceId_ = child_.text + ServiceId_ = self.gds_validate_string(ServiceId_, node, 'ServiceId') + self.ServiceId = ServiceId_ + elif nodeName_ == 'Major': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'Major') + self.Major = ival_ + elif nodeName_ == 'Intermediate': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'Intermediate') + self.Intermediate = ival_ + elif nodeName_ == 'Minor': + sval_ = child_.text + try: + ival_ = int(sval_) + except (TypeError, ValueError), exp: + raise_parse_error(child_, 'requires integer: %s' % exp) + ival_ = self.gds_validate_integer(ival_, node, 'Minor') + self.Minor = ival_ +# end class VersionId + + +class WebAuthenticationDetail(GeneratedsSuper): + """The descriptive data to be used in authentication of the sender's + identity (and right to use FedEx web services).""" + subclass = None + superclass = None + def __init__(self, UserCredential=None): + self.UserCredential = UserCredential + def factory(*args_, **kwargs_): + if WebAuthenticationDetail.subclass: + return WebAuthenticationDetail.subclass(*args_, **kwargs_) + else: + return WebAuthenticationDetail(*args_, **kwargs_) + factory = staticmethod(factory) + def get_UserCredential(self): return self.UserCredential + def set_UserCredential(self, UserCredential): self.UserCredential = UserCredential + def export(self, outfile, level, namespace_='ns:', name_='WebAuthenticationDetail', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='WebAuthenticationDetail') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='WebAuthenticationDetail'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='WebAuthenticationDetail', fromsubclass_=False): + if self.UserCredential: + self.UserCredential.export(outfile, level, namespace_, name_='UserCredential', ) + def hasContent_(self): + if ( + self.UserCredential is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='WebAuthenticationDetail'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.UserCredential is not None: + showIndent(outfile, level) + outfile.write('UserCredential=model_.WebAuthenticationCredential(\n') + self.UserCredential.exportLiteral(outfile, level, name_='UserCredential') + showIndent(outfile, level) + outfile.write('),\n') + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'UserCredential': + obj_ = WebAuthenticationCredential.factory() + obj_.build(child_) + self.set_UserCredential(obj_) +# end class WebAuthenticationDetail + + +class WebAuthenticationCredential(GeneratedsSuper): + """Two part authentication string used for the sender's identity.""" + subclass = None + superclass = None + def __init__(self, Key=None, Password=None): + self.Key = Key + self.Password = Password + def factory(*args_, **kwargs_): + if WebAuthenticationCredential.subclass: + return WebAuthenticationCredential.subclass(*args_, **kwargs_) + else: + return WebAuthenticationCredential(*args_, **kwargs_) + factory = staticmethod(factory) + def get_Key(self): return self.Key + def set_Key(self, Key): self.Key = Key + def get_Password(self): return self.Password + def set_Password(self, Password): self.Password = Password + def export(self, outfile, level, namespace_='ns:', name_='WebAuthenticationCredential', namespacedef_=''): + showIndent(outfile, level) + outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) + already_processed = [] + self.exportAttributes(outfile, level, already_processed, namespace_, name_='WebAuthenticationCredential') + if self.hasContent_(): + outfile.write('>\n') + self.exportChildren(outfile, level + 1, namespace_, name_) + showIndent(outfile, level) + outfile.write('\n' % (namespace_, name_)) + else: + outfile.write('/>\n') + def exportAttributes(self, outfile, level, already_processed, namespace_='ns:', name_='WebAuthenticationCredential'): + pass + def exportChildren(self, outfile, level, namespace_='ns:', name_='WebAuthenticationCredential', fromsubclass_=False): + if self.Key is not None: + showIndent(outfile, level) + outfile.write('<%sKey>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Key).encode(ExternalEncoding), input_name='Key'), namespace_)) + if self.Password is not None: + showIndent(outfile, level) + outfile.write('<%sPassword>%s\n' % (namespace_, self.gds_format_string(quote_xml(self.Password).encode(ExternalEncoding), input_name='Password'), namespace_)) + def hasContent_(self): + if ( + self.Key is not None or + self.Password is not None + ): + return True + else: + return False + def exportLiteral(self, outfile, level, name_='WebAuthenticationCredential'): + level += 1 + self.exportLiteralAttributes(outfile, level, [], name_) + if self.hasContent_(): + self.exportLiteralChildren(outfile, level, name_) + def exportLiteralAttributes(self, outfile, level, already_processed, name_): + pass + def exportLiteralChildren(self, outfile, level, name_): + if self.Key is not None: + showIndent(outfile, level) + outfile.write('Key=%s,\n' % quote_python(self.Key).encode(ExternalEncoding)) + if self.Password is not None: + showIndent(outfile, level) + outfile.write('Password=%s,\n' % quote_python(self.Password).encode(ExternalEncoding)) + def build(self, node): + self.buildAttributes(node, node.attrib, []) + for child in node: + nodeName_ = Tag_pattern_.match(child.tag).groups()[-1] + self.buildChildren(child, node, nodeName_) + def buildAttributes(self, node, attrs, already_processed): + pass + def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): + if nodeName_ == 'Key': + Key_ = child_.text + Key_ = self.gds_validate_string(Key_, node, 'Key') + self.Key = Key_ + elif nodeName_ == 'Password': + Password_ = child_.text + Password_ = self.gds_validate_string(Password_, node, 'Password') + self.Password = Password_ +# end class WebAuthenticationCredential + + +USAGE_TEXT = """ +Usage: python .py [ -s ] +""" + +def usage(): + print USAGE_TEXT + sys.exit(1) + + +def get_root_tag(node): + tag = Tag_pattern_.match(node.tag).groups()[-1] + rootClass = globals().get(tag) + return tag, rootClass + + +def parse(inFileName): + doc = parsexml_(inFileName) + rootNode = doc.getroot() + rootTag, rootClass = get_root_tag(rootNode) + if rootClass is None: + rootTag = 'UploadDocumentsRequest' + rootClass = UploadDocumentsRequest + rootObj = rootClass.factory() + rootObj.build(rootNode) + # Enable Python to collect the space used by the DOM. + doc = None + sys.stdout.write('\n') + rootObj.export(sys.stdout, 0, name_=rootTag, + namespacedef_='') + return rootObj + + +def parseString(inString): + from StringIO import StringIO + doc = parsexml_(StringIO(inString)) + rootNode = doc.getroot() + rootTag, rootClass = get_root_tag(rootNode) + if rootClass is None: + rootTag = 'UploadDocumentsRequest' + rootClass = UploadDocumentsRequest + rootObj = rootClass.factory() + rootObj.build(rootNode) + # Enable Python to collect the space used by the DOM. + doc = None + sys.stdout.write('\n') + rootObj.export(sys.stdout, 0, name_="UploadDocumentsRequest", + namespacedef_='') + return rootObj + + +def parseLiteral(inFileName): + doc = parsexml_(inFileName) + rootNode = doc.getroot() + rootTag, rootClass = get_root_tag(rootNode) + if rootClass is None: + rootTag = 'UploadDocumentsRequest' + rootClass = UploadDocumentsRequest + rootObj = rootClass.factory() + rootObj.build(rootNode) + # Enable Python to collect the space used by the DOM. + doc = None + sys.stdout.write('#from upload import *\n\n') + sys.stdout.write('import upload as model_\n\n') + sys.stdout.write('rootObj = model_.rootTag(\n') + rootObj.exportLiteral(sys.stdout, 0, name_=rootTag) + sys.stdout.write(')\n') + return rootObj + + +def main(): + args = sys.argv[1:] + if len(args) == 1: + parse(args[0]) + else: + usage() + + +if __name__ == '__main__': + #import pdb; pdb.set_trace() + main() + + +__all__ = [ + "ClientDetail", + "ImageUploadStatusDetail", + "Localization", + "Money", + "Notification", + "NotificationParameter", + "TransactionDetail", + "UploadDocumentDetail", + "UploadDocumentStatusDetail", + "UploadDocumentsReply", + "UploadDocumentsRequest", + "UploadImageDetail", + "UploadImagesReply", + "UploadImagesRequest", + "VersionId", + "WebAuthenticationCredential", + "WebAuthenticationDetail" + ]