/*
 * Portions of this file Copyright 1999-2005 University of Chicago
 * Portions of this file Copyright 1999-2005 The University of Southern California.
 *
 * This file or a portion of this file is licensed under the
 * terms of the Globus Toolkit Public License, found at
 * http://www.globus.org/toolkit/download/license.html.
 * If you redistribute this file, with or without
 * modifications, you must include this notice in the file.
 */


/*
 * This file is automatically generated by the Globus WSDLtoC converter
 */

#ifndef _WSGRAM_FAULTTYPE_H_
#define _WSGRAM_FAULTTYPE_H_

#include "globus_common.h"
#include "globus_xsd_type_info.h"

#ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
EXTERN_C_BEGIN
#endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */

/**
 * The wsgram_FaultType complex type, which represents the
 * {http://www.globus.org/namespaces/2004/10/gram/job/faults}FaultType element.
 * @ingroup wsgram_FaultType
 */
typedef struct wsgram_FaultType_s wsgram_FaultType;
/**
 * The wsgram_FaultType_o complex type, which represents an optional instance
 * of a
 * {http://www.globus.org/namespaces/2004/10/gram/job/faults}FaultType element.
 * @ingroup wsgram_FaultType
 */
typedef wsgram_FaultType * wsgram_FaultType_o;

/**
 * Namespace of the wsgram_FaultType complex type
 * @ingroup wsgram_FaultType
 */
#define WSGRAM_FAULTTYPE_NS "http://www.globus.org/namespaces/2004/10/gram/job/faults"
/**
 * Local part of the QName of the wsgram_FaultType complex type
 * @ingroup wsgram_FaultType
 */
#define WSGRAM_FAULTTYPE_LOCAL "FaultType"

/**
 * QName of the wsgram_FaultType complex type
 * @ingroup wsgram_FaultType
 */
extern xsd_QName wsgram_FaultType_qname;
/**
 * Type information for serializing and deserializing wsgram_FaultType elements
 * @ingroup wsgram_FaultType
 */
extern struct globus_xsd_type_info_s wsgram_FaultType_info;
/**
 * Type information for serializing and deserializing arrays of wsgram_FaultType
 * elements
 * @ingroup wsgram_FaultType
 */
extern struct globus_xsd_type_info_s wsgram_FaultType_array_info;
/**
 * Type information for serializing and deserializing the contents of
 * wsgram_FaultType without surrounding elements
 * @ingroup wsgram_FaultType
 */
extern struct globus_xsd_type_info_s wsgram_FaultType_contents_info;


#include "xsd_dateTime.h"
#include "wsa_EndpointReferenceType.h"
#include "wsbf_ErrorCodeType.h"
#include "wsbf_DescriptionType_array.h"
#include "wsbf_BaseFaultType_array.h"
#include "wsgram_StateEnumeration.h"
#include "xsd_string.h"
#include "xsd_int.h"
#include "wsgram_FaultType_array.h"

/**
 * @defgroup wsgram_FaultType Complex type: wsgram_FaultType
 * @ingroup types
 */

/**
 * C structure for the wsgram_FaultType complex type
 * @ingroup wsgram_FaultType
 */
struct wsgram_FaultType_s
{
    /** xsd_dateTime subelement */
    xsd_dateTime Timestamp;
   /** Optional wsa_EndpointReferenceType subelement */
    wsa_EndpointReferenceType_o Originator;
   /** Optional wsbf_ErrorCodeType subelement */
    wsbf_ErrorCodeType_o ErrorCode;
   /** Array of [0 .. Infinity] wsbf_DescriptionType elements */
    wsbf_DescriptionType_array Description;
   /** Array of [0 .. Infinity] wsbf_BaseFaultType elements */
    wsbf_BaseFaultType_array FaultCause;
    /** wsgram_StateEnumeration subelement */
    wsgram_StateEnumeration stateWhenFailureOccurred;
    /** xsd_string subelement */
    xsd_string command;
    /** xsd_int subelement */
    xsd_int gt2ErrorCode;

};

/**
 * Initialize a wsgram_FaultType
 * @ingroup wsgram_FaultType
 *
 * Allocates a new wsgram_FaultType and initializes its contents. When the
 * structure is no longer needed, it should be freed by calling 
 * wsgram_FaultType_destroy(). 
 *
 * @param inst
 *     Pointer to set to a newly allocated instance.
 */
globus_result_t
wsgram_FaultType_init(
    wsgram_FaultType ** inst);

/**
 * Destroy a wsgram_FaultType
 * @ingroup wsgram_FaultType
 *
 * Frees a wsgram_FaultType. All subelements and attributes will be destroyed
 * (and freed if they are optional).
 *
 * @param inst
 *     Pointer to the instance to destroy.
 */
void
wsgram_FaultType_destroy(
    wsgram_FaultType * inst);

/**
 * Copy a wsgram_FaultType
 * @ingroup wsgram_FaultType
 *
 * Perform a deep copy of a wsgram_FaultType.
 * The @a dest structure will be allocated, and then a copy of the contents
 * of @a src and its subelements and attributes will be made to @a dest.
 * 
 * @param dest
 *     The wsgram_FaultType structure to be initialized with a copy of the
 *     contents of the @a src structure.
 * @param src
 *     Source wsgram_FaultType to be copied.
 */
globus_result_t
wsgram_FaultType_copy(
    wsgram_FaultType ** dest,
    const wsgram_FaultType * src);

/**
 * Initialize the contents of a wsgram_FaultType
 * @ingroup wsgram_FaultType
 *
 * Initialize the contents of a wsgram_FaultType. This should be used
 * when the structure is allocated on the stack or by a some allocator besides
 * wsgram_FaultType_init(). The contents may be freed
 * by calling wsgram_FaultType_destroy_contents().
 *
 * @param instance
 *     Pointer to an allocated but uninitialized wsgram_FaultType.
 */
globus_result_t
wsgram_FaultType_init_contents(
    wsgram_FaultType * instance);

/**
 * Destroy the contents of a wsgram_FaultType
 * @ingroup wsgram_FaultType
 *
 * Destroy the subelements and attributes of the given wsgram_FaultType. 
 *
 * @param inst
 *     Pointer to a wsgram_FaultType instance to destroy.
 */
void
wsgram_FaultType_destroy_contents(
    wsgram_FaultType * inst);

/**
 * Copy the contents of a wsgram_FaultType
 * @ingroup wsgram_FaultType
 *
 * Perform a deep copy of the contents of a wsgram_FaultType.
 * The @a dest strcuture must be allocated before making this call.
 * A copy of the subelements and attributes of @ src will be made to
 * @a dest.
 * 
 * @param dest
 *     Structure to be initialized with copies of the contents of @a src.
 * @param src
 *     Source wsgram_FaultType to be copied.
 */
globus_result_t
wsgram_FaultType_copy_contents(
    wsgram_FaultType * dest,
    const wsgram_FaultType * src);

/**
 * Serialize a wsgram_FaultType
 * @ingroup wsgram_FaultType_array
 * Serialize a wsgram_FaultType structure.
 *
 * @param element_name
 *     The name of the element which will contain the wsgram_FaultType.
 * @param val
 *     The wsgram_FaultType to serialize.
 * @param message_handle
 *     The handle to serialize the element on.
 * @param options
 *     Serialization options.
 */
globus_result_t
wsgram_FaultType_serialize(
    xsd_QName *                         element_name,
    wsgram_FaultType * val,
    globus_soap_message_handle_t        message_handle,
    globus_xsd_element_options_t        options);

/**
 * Serialize the contents of a wsgram_FaultType
 * @ingroup wsgram_FaultType_array
 * Serialize a wsgram_FaultType structure without an enclosing element.
 *
 * @param element_name
 *     Ignored parameter.
 * @param val
 *     The wsgram_FaultType to serialize.
 * @param message_handle
 *     The handle to serialize the contents on.
 * @param options
 *     Serialization options.
 */
globus_result_t
wsgram_FaultType_serialize_contents(
    xsd_QName *                         element_name,
    wsgram_FaultType * val,
    globus_soap_message_handle_t        message_handle,
    globus_xsd_element_options_t        options);

/**
 * Deserialize a wsgram_FaultType
 * @ingroup wsgram_FaultType
 * Deserialize an element containing a wsgram_FaultType element.
 *
 * @param element_name
 *     The name of the element which should enclose the wsgram_FaultType.
 * @param val
 *     Pointer to the wsgram_FaultType which will be initialized with the
 *     value of the element.
 * @param message_handle
 *     The handle to deserialize the element from.
 * @param options
 *     Deserialization options.
 */
globus_result_t
wsgram_FaultType_deserialize(
    xsd_QName *                         element_name,
    wsgram_FaultType * val,
    globus_soap_message_handle_t        message_handle,
    globus_xsd_element_options_t        options);

/**
 * Deserialize a wsgram_FaultType
 * @ingroup wsgram_FaultType
 * Deserialize a wsgram_FaultType whose enclosing element has already been
 * deserialized.
 *
 * @param element_name
 *     Ignored.
 * @param val
 *     Pointer to the wsgram_FaultType which will be initialized with the
 *     value of the current element.
 * @param message_handle
 *     The handle to deserialize the element from.
 * @param options
 *     Deserialization options.
 */
globus_result_t
wsgram_FaultType_deserialize_contents(
    xsd_QName *                         element_name,
    wsgram_FaultType * val,
    globus_soap_message_handle_t        message_handle,
    globus_xsd_element_options_t        options);

/**
 * Deserialize an optional wsgram_FaultType
 * @ingroup wsgram_FaultType
 * Deserialize the next element if it contains a wsgram_FaultType.
 *
 * @param element_name
 *     The name of the element which should enclose the wsgram_FaultType.
 * @param instance
 *     Pointer to the <code>wsgram_FaultType *</code> which will be allocated
 *     and initialized with the value of the element if it is present.
 * @param message_handle
 *     The handle to deserialize the element from.
 * @param options
 *     Deserialization options.
 */
globus_result_t
wsgram_FaultType_deserialize_pointer(
    xsd_QName *                         element_name,
    wsgram_FaultType ** instance,
    globus_soap_message_handle_t        message_handle,
    globus_xsd_element_options_t        options);

#ifndef GLOBUS_DONT_DOCUMENT_INTERNAL

globus_result_t
wsgram_FaultType_init_wrapper(
    void **                             object);
    
void
wsgram_FaultType_destroy_wrapper(
    void *                              object);
    
globus_result_t
wsgram_FaultType_copy_wrapper(
    void **                             dest_obj,
    void *                              src_obj);

globus_result_t
wsgram_FaultType_init_contents_wrapper(
    void *                              object);
    
void
wsgram_FaultType_destroy_contents_wrapper(
    void *                              object);
    
globus_result_t
wsgram_FaultType_copy_contents_wrapper(
    void *                              dest_obj,
    void *                              src_obj);

globus_result_t
wsgram_FaultType_serialize_wrapper(
    xsd_QName *                         element_qname,
    void *                              instance,
    globus_soap_message_handle_t        message_handle,
    globus_xsd_element_options_t        options);
    
globus_result_t
wsgram_FaultType_serialize_contents_wrapper(
    xsd_QName *                         element_qname,
    void *                              instance,
    globus_soap_message_handle_t        message_handle,
    globus_xsd_element_options_t        options);
    
globus_result_t
wsgram_FaultType_deserialize_contents_wrapper(
    xsd_QName *                         element_qname,
    void **                             instance,
    globus_soap_message_handle_t        message_handle,
    globus_xsd_element_options_t        options);

globus_result_t
wsgram_FaultType_deserialize_pointer_wrapper(
    xsd_QName *                         element_qname,
    void **                             ip,
    globus_soap_message_handle_t        message_handle,
    globus_xsd_element_options_t        options);
#endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */

#ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
EXTERN_C_END
#endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */

#endif
