diff --git a/changelog.txt b/changelog.txt index 95ef045..0c50e2e 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,14 @@ *** Xero Integration *** +2024-10-14 - version 1.9.0 +* Fix - Use a separate country list for the report tax type when creating a tax rate in Xero. +* Dev - Update secret key encryption to use the Sodium library for token encryption. +* Dev - Upgrade the `xeroapi/xero-php-oauth2` SDK from version 2.20.0 to version 7.2.0. +* Dev - Bump WooCommerce "tested up to" version 9.4. +* Dev - Bump WooCommerce minimum supported version to 9.2. +* Dev - Bump WordPress minimum supported version to 6.5. +* Dev - Remove Xero OAuth 1.0 Authentication as it is fully deprecated. + 2024-08-19 - version 1.8.9 * Fix - PHPCompatibility errors reported by the QIT test. * Dev - Bump WooCommerce "tested up to" version 9.2. diff --git a/includes/class-wc-xr-data-encryption.php b/includes/class-wc-xr-data-encryption.php index 99d9b38..55db825 100644 --- a/includes/class-wc-xr-data-encryption.php +++ b/includes/class-wc-xr-data-encryption.php @@ -118,32 +118,72 @@ private function get_default_salt(): string { * * @param string $value Value to encryption. * + * @since 1.9.0 Updated to use sodium_crypto_secretbox. * @since 1.7.51 + * + * @return string|bool Encrypted value. If encryption fails, returns the original value or false under certain conditions. */ public function encrypt( string $value ): string { - if ( ! extension_loaded( 'openssl' ) ) { + try { + $key = sodium_crypto_generichash( $this->key, '', SODIUM_CRYPTO_SECRETBOX_KEYBYTES ); + $nonce = random_bytes( SODIUM_CRYPTO_SECRETBOX_NONCEBYTES ); + } catch ( Exception $e ) { + // Return the original value if fail to generate nonce and key. return $value; } - $method = 'aes-256-ctr'; - $ivlen = openssl_cipher_iv_length( $method ); - $iv = openssl_random_pseudo_bytes( $ivlen ); - - $raw_value = openssl_encrypt( $value . $this->salt, $method, $this->key, 0, $iv ); - if ( ! $raw_value ) { + try { + $encrypted = sodium_crypto_secretbox( $value . $this->salt, $nonce, $key ); + return sodium_bin2base64( $nonce . $encrypted, SODIUM_BASE64_VARIANT_ORIGINAL ); + } catch ( Exception $e ) { + // Return false if encryption fails. return false; } - - return base64_encode( $iv . $raw_value ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode } /** * The decryption method. * - * @param string $raw_value Encrypted value for decryption. + * @param string $encrypted Encrypted value for decryption. + * + * @since 1.9.0 Updated to use sodium_crypto_secretbox_open. * @since 1.7.51 + * + * @return string|false Decrypted value. If decryption fails, returns the original value or false under certain conditions. + */ + public function decrypt( string $encrypted ): string { + try { + $decoded = sodium_base642bin( $encrypted, SODIUM_BASE64_VARIANT_ORIGINAL ); + $key = sodium_crypto_generichash( $this->key, '', SODIUM_CRYPTO_SECRETBOX_KEYBYTES ); + + $nonce = mb_substr( $decoded, 0, SODIUM_CRYPTO_SECRETBOX_NONCEBYTES, '8bit' ); + $encrypted_result = mb_substr( $decoded, SODIUM_CRYPTO_SECRETBOX_NONCEBYTES, null, '8bit' ); + } catch ( Exception $e ) { + // Return the original value if fail to get decoded value or nonce and key. + return $encrypted; + } + + try { + $value = sodium_crypto_secretbox_open( $encrypted_result, $nonce, $key ); + if ( ! $value || substr( $value, - strlen( $this->salt ) ) !== $this->salt ) { + return false; + } + return substr( $value, 0, - strlen( $this->salt ) ); + } catch ( Exception $e ) { + return false; + } + } + + /** + * The Legacy decryption method. + * + * @param string $raw_value Encrypted value for decryption. + * + * @since 1.9.0 + * + * @return string|false */ - public function decrypt( string $raw_value ): string { + public function legacy_decrypt( string $raw_value ): string { if ( ! extension_loaded( 'openssl' ) ) { return $raw_value; } diff --git a/includes/class-wc-xr-encrypt-legacy-tokens-migration.php b/includes/class-wc-xr-encrypt-legacy-tokens-migration.php index 63f42f8..3dd1ac4 100644 --- a/includes/class-wc-xr-encrypt-legacy-tokens-migration.php +++ b/includes/class-wc-xr-encrypt-legacy-tokens-migration.php @@ -17,6 +17,14 @@ * @since 1.7.51 */ class WC_XR_Encrypt_Legacy_Tokens_Migration { + + /** + * Token data option name. + * + * @var string + */ + private $token_data_option_name = 'xero_oauth_options'; + /** * Migration id. * @@ -25,6 +33,13 @@ class WC_XR_Encrypt_Legacy_Tokens_Migration { */ private $migration_id = 'wc_xr_encrypt_legacy_tokens_migration'; + /** + * Encryption migration id. + * + * @var string + */ + private $encryption_migration_id = 'wc_xr_legacy_encrypted_tokens_migration'; + /** * Register migration. * @@ -33,6 +48,7 @@ class WC_XR_Encrypt_Legacy_Tokens_Migration { */ public function setup_hook() { add_action( 'init', array( $this, 'run' ) ); + add_action( 'init', array( $this, 'migrate_legacy_encrypted_tokens' ), 20 ); } /** @@ -47,8 +63,7 @@ public function run() { return; } - $token_data_option_name = 'xero_oauth_options'; - $tokens_data = get_option( $token_data_option_name, false ); + $tokens_data = get_option( $this->token_data_option_name, false ); // Encrypt token only if token data exist. if ( $tokens_data ) { @@ -65,11 +80,83 @@ public function run() { } // Store token data with encrypted token values. - update_option( $token_data_option_name, $tokens_data, false ); + update_option( $this->token_data_option_name, $tokens_data, false ); + } + + // Complete migration. + update_option( $this->migration_id, 1, true ); + } + + /** + * Migrate legacy encrypted tokens to new encryption. + * + * @since 1.9.0 + * @return void + */ + public function migrate_legacy_encrypted_tokens() { + // Exit if migration completed. + if ( get_option( $this->encryption_migration_id, false ) ) { + return; + } + + $tokens_data = get_option( $this->token_data_option_name, false ); + + /* + * Migrate encrypted tokens only if token data exist and openssl extension is loaded, + * openssl extension is required for the decryption of legacy encrypted tokens. + */ + if ( $tokens_data && extension_loaded( 'openssl' ) ) { + $wc_xr_data_encryption = new WC_XR_Data_Encryption(); + + // Encrypt token only if value is non-empty after the legacy decryption. + if ( $tokens_data['token'] ) { + $token = $wc_xr_data_encryption->legacy_decrypt( $tokens_data['token'] ); + if ( $token ) { + $tokens_data['token'] = $wc_xr_data_encryption->encrypt( $token ); + } + } + + // Encrypt refresh_token only if value is non-empty after the legacy decryption. + if ( $tokens_data['refresh_token'] ) { + $refresh_token = $wc_xr_data_encryption->legacy_decrypt( $tokens_data['refresh_token'] ); + if ( $refresh_token ) { + $tokens_data['refresh_token'] = $wc_xr_data_encryption->encrypt( $refresh_token ); + } + } + + // Store token data with encrypted token values. + update_option( $this->token_data_option_name, $tokens_data, false ); + } elseif ( $tokens_data && ! extension_loaded( 'openssl' ) ) { + /* + * Handle token encryption for the sites where openssl extension is not installed. + * + * Legacy encryption was dependent on openssl extension and if openssl extension is not installed + * there is a possibility that the tokens are not encrypted, so this migration will encrypt the tokens. + */ + $wc_xr_data_encryption = new WC_XR_Data_Encryption(); + + // Encrypt token only if it is not-empty and not already encrypted. + if ( $tokens_data['token'] ) { + $decrypted_token = $wc_xr_data_encryption->decrypt( $tokens_data['token'] ); + if ( $tokens_data['token'] === $decrypted_token || ! $decrypted_token ) { + $tokens_data['token'] = $wc_xr_data_encryption->encrypt( $tokens_data['token'] ); + } + } + + // Encrypt token only if it is not-empty and not already encrypted. + if ( $tokens_data['refresh_token'] ) { + $decrypted_refresh_token = $wc_xr_data_encryption->decrypt( $tokens_data['refresh_token'] ); + if ( $tokens_data['refresh_token'] === $decrypted_refresh_token || ! $decrypted_refresh_token ) { + $tokens_data['refresh_token'] = $wc_xr_data_encryption->encrypt( $tokens_data['refresh_token'] ); + } + } + + // Store token data with encrypted token values. + update_option( $this->token_data_option_name, $tokens_data, false ); } // Complete migration. - update_option( $this->migration_id, 1, 'no' ); + update_option( $this->encryption_migration_id, 1, true ); } /** diff --git a/includes/class-wc-xr-line-item.php b/includes/class-wc-xr-line-item.php index 419fcda..00ae5c4 100644 --- a/includes/class-wc-xr-line-item.php +++ b/includes/class-wc-xr-line-item.php @@ -196,7 +196,7 @@ public function set_is_digital_good( $is_digital_good ) { /** * @version 1.7.38 - * + * * @return float */ public function get_discount_rate() { @@ -209,7 +209,7 @@ public function get_discount_rate() { /** * Get the discount amount of current line item. * @since 1.7.38 - * + * * @return float */ public function get_discount_amount() { @@ -218,7 +218,7 @@ public function get_discount_amount() { /** * @version 1.7.38 - * + * * @param float $discount_rate */ public function set_discount_rate( $discount_rate ) { @@ -227,7 +227,7 @@ public function set_discount_rate( $discount_rate ) { /** * Set the discount amount of current line item. - * + * * @since 1.7.38 * * @param float $discount_amount Discount ammount. @@ -375,9 +375,10 @@ public function get_tax_type() { // If no tax rate was found, ask Xero to add one for us // First, see if we need a ReportTaxType - if ( ! empty( $report_tax_type ) ) { - $tax_rate['report_tax_type'] = $report_tax_type; - $logger->write( " - Setting ReportTaxType to ($report_tax_type)" ); + $report_tax_type_for_create = $this->get_report_tax_type_for_base_country( true ); + if ( ! empty( $report_tax_type_for_create ) ) { + $tax_rate['report_tax_type'] = $report_tax_type_for_create; + $logger->write( " - Setting ReportTaxType to ($report_tax_type_for_create)" ); } $tax_type_create_request = new WC_XR_Request_Create_Tax_Rate( $this->settings, $tax_rate ); @@ -475,9 +476,11 @@ protected function get_tax_exempt_type_for_base_country() { * @since 1.7.7 * @version 1.7.39 * + * @param bool $create_tax_rate Whether to return the report tax type for creating a tax rate in Xero. + * * @return string (empty) | OUTPUT | INPUT | MOSSSALES | (filtered report tax type) */ - protected function get_report_tax_type_for_base_country() { + protected function get_report_tax_type_for_base_country( $create_tax_rate = false ) { $tax_rate = $this->get_tax_rate(); $is_shipping_line_item = array_key_exists( 'is_shipping_line_item', $tax_rate ) && $tax_rate['is_shipping_line_item']; @@ -485,16 +488,29 @@ protected function get_report_tax_type_for_base_country() { $base_country = WC()->countries->get_base_country(); - /** - * Filter the countries list for the report tax type. - * - * @since 1.8.5 - * - * @param array $countries_list The countries list. - * - * @return array The countries list for the report tax type. - */ - $countries_list = apply_filters( 'woocommerce_xero_report_tax_type_countries', array( 'AU', 'NZ', 'GB', 'US', 'ZA', 'MT' ) ); + if ( $create_tax_rate ) { + /** + * Filter the countries list for the report tax type for creating tax rate in the Xero. + * + * @since 1.9.0 + * + * @param array $countries_list The countries list. + * + * @return array The countries list for the report tax type for creating tax rate in the Xero. + */ + $countries_list = apply_filters( 'woocommerce_xero_report_tax_type_countries_for_create_tax_rate', array( 'AU', 'NZ', 'GB' ) ); + } else { + /** + * Filter the countries list for the report tax type. + * + * @since 1.8.5 + * + * @param array $countries_list The countries list. + * + * @return array The countries list for the report tax type. + */ + $countries_list = apply_filters( 'woocommerce_xero_report_tax_type_countries', array( 'AU', 'NZ', 'GB', 'US', 'ZA', 'MT' ) ); + } $report_tax_type = ''; if ( in_array( $base_country, $countries_list, true ) ) { diff --git a/includes/class-wc-xr-oauth-simple.php b/includes/class-wc-xr-oauth-simple.php deleted file mode 100644 index d83b085..0000000 --- a/includes/class-wc-xr-oauth-simple.php +++ /dev/null @@ -1,471 +0,0 @@ -ing uses OAuth without that minimal set of - * signatures. - * - * If you want to use the higher order security that comes from the - * OAuth token (sorry, I don't provide the functions to fetch that because - * sites aren't horribly consistent about how they offer that), you need to - * pass those in either with .signatures() or as an argument to the - * .sign() or .getHeaderString() functions. - * - * Example: - - sign(Array('path'=>'http://example.com/rest/', - 'parameters'=> 'foo=bar&gorp=banana', - 'signatures'=> Array( - 'api_key'=>'12345abcd', - 'shared_secret'=>'xyz-5309' - ))); - ?> - Some Link; - - * - * that will sign as a "GET" using "SHA1-MAC" the url. If you need more than - * that, read on, McDuff. - */ - - /** OAuthSimple creator - * - * Create an instance of OAuthSimple - * - * @param api_key {string} The API Key (sometimes referred to as the consumer key) This value is usually supplied by the site you wish to use. - * @param shared_secret (string) The shared secret. This value is also usually provided by the site you wish to use. - */ - public function __construct ($APIKey = "",$sharedSecret=""){ - if (!empty($APIKey)) - $this->_secrets['consumer_key']=$APIKey; - if (!empty($sharedSecret)) - $this->_secrets['shared_secret']=$sharedSecret; - $this->_default_signature_method="HMAC-SHA1"; - $this->_action="GET"; - $this->_nonce_chars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; - return $this; - } - - /** reset the parameters and url - * - */ - function reset() { - $this->_parameters=null; - $this->path=null; - $this->sbs=null; - return $this; - } - - /** set the parameters either from a hash or a string - * - * @param {string,object} List of parameters for the call, this can either be a URI string (e.g. "foo=bar&gorp=banana" or an object/hash) - */ - function setParameters ($parameters=Array()) { - - if (is_string($parameters)) - $parameters = $this->_parseParameterString($parameters); - if (empty($this->_parameters)) - $this->_parameters = $parameters; - elseif (!empty($parameters)) - $this->_parameters = array_merge($this->_parameters,$parameters); - if (empty($this->_parameters['oauth_nonce'])) - $this->_getNonce(); - if (empty($this->_parameters['oauth_timestamp'])) - $this->_getTimeStamp(); - if (empty($this->_parameters['oauth_consumer_key'])) - $this->_getApiKey(); - if (empty($this->_parameters['oauth_token'])) - $this->_getAccessToken(); - if (empty($this->_parameters['oauth_signature_method'])) - $this->setSignatureMethod(); - if (empty($this->_parameters['oauth_version'])) - $this->_parameters['oauth_version']="1.0"; - return $this; - } - - // convienence method for setParameters - function setQueryString ($parameters) { - return $this->setParameters($parameters); - } - - /** Set the target URL (does not include the parameters) - * - * @param path {string} the fully qualified URI (excluding query arguments) (e.g "http://example.org/foo") - */ - function setURL ($path) { - if (empty($path)) - throw new WC_XR_OAuthSimpleException('No path specified for OAuthSimple.setURL'); - $this->_path=$path; - return $this; - } - - /** convienence method for setURL - * - * @param path {string} see .setURL - */ - function setPath ($path) { - return $this->_path=$path; - } - - /** set the "action" for the url, (e.g. GET,POST, DELETE, etc.) - * - * @param action {string} HTTP Action word. - */ - function setAction ($action) { - if (empty($action)) - $action = 'GET'; - $action = strtoupper($action); - if (preg_match('/[^A-Z]/',$action)) - throw new WC_XR_OAuthSimpleException('Invalid action specified for OAuthSimple.setAction'); - $this->_action = $action; - return $this; - } - - /** set the signatures (as well as validate the ones you have) - * - * @param signatures {object} object/hash of the token/signature pairs {api_key:, shared_secret:, oauth_token: oauth_secret:} - */ - function signatures ($signatures) { - if (!empty($signatures) && !is_array($signatures)) - throw new WC_XR_OAuthSimpleException('Must pass dictionary array to OAuthSimple.signatures'); - if (!empty($signatures)){ - if (empty($this->_secrets)) { - $this->_secrets=Array(); - } - $this->_secrets=array_merge($this->_secrets,$signatures); - } - // Aliases - if (isset($this->_secrets['api_key'])) - $this->_secrets['consumer_key'] = $this->_secrets['api_key']; - if (isset($this->_secrets['access_token'])) - $this->_secrets['oauth_token'] = $this->_secrets['access_token']; - if (isset($this->_secrets['access_secret'])) - $this->_secrets['oauth_secret'] = $this->_secrets['access_secret']; - if (isset($this->_secrets['access_token_secret'])) - $this->_secrets['oauth_secret'] = $this->_secrets['access_token_secret']; - if (isset($this->_secrets['rsa_private_key'])) - $this->_secrets['private_key'] = $this->_secrets['rsa_private_key']; - if (isset($this->_secrets['rsa_public_key'])) - $this->_secrets['public_key'] = $this->_secrets['rsa_public_key']; - // Gauntlet - if (empty($this->_secrets['consumer_key'])) - throw new WC_XR_OAuthSimpleException('Missing required consumer_key in OAuthSimple.signatures'); - if (empty($this->_secrets['shared_secret'])) - throw new WC_XR_OAuthSimpleException('Missing requires shared_secret in OAuthSimple.signatures'); - if (!empty($this->_secrets['oauth_token']) && empty($this->_secrets['oauth_secret'])) - throw new WC_XR_OAuthSimpleException('Missing oauth_secret for supplied oauth_token in OAuthSimple.signatures'); - return $this; - } - - function setTokensAndSecrets($signatures) { - return $this->signatures($signatures); - } - - /** set the signature method (currently only Plaintext or SHA-MAC1) - * - * @param method {string} Method of signing the transaction (only PLAINTEXT and SHA-MAC1 allowed for now) - */ - function setSignatureMethod ($method="") { - if (empty($method)) - $method = $this->_default_signature_method; - $method = strtoupper($method); - switch($method) - { - case 'RSA-SHA1': - $this->_parameters['oauth_signature_method']=$method; - break; - case 'PLAINTEXT': - case 'HMAC-SHA1': - $this->_parameters['oauth_signature_method']=$method; - break; - default: - throw new WC_XR_OAuthSimpleException ("Unknown signing method $method specified for OAuthSimple.setSignatureMethod"); - } - return $this; - } - - /** sign the request - * - * note: all arguments are optional, provided you've set them using the - * other helper functions. - * - * @param args {object} hash of arguments for the call - * {action, path, parameters (array), method, signatures (array)} - * all arguments are optional. - */ - function sign($args=array()) { - if (!empty($args['action'])) - $this->setAction($args['action']); - if (!empty($args['path'])) - $this->setPath($args['path']); - if (!empty($args['method'])) - $this->setSignatureMethod($args['method']); - if (!empty($args['signatures'])) - $this->signatures($args['signatures']); - if (empty($args['parameters'])) - $args['parameters']=array(); // squelch the warning. - - $this->setParameters($args['parameters']); - $normParams = $this->_normalizedParameters(); - - $this->_parameters['oauth_signature'] = $this->_generateSignature($normParams); - - return Array( - 'parameters' => $this->_parameters, - 'signature' => $this->_oauthEscape($this->_parameters['oauth_signature']), - 'signed_url' => $this->_path . '?' . $this->_normalizedParameters('true'), - 'header' => $this->getHeaderString(), - 'sbs'=> $this->sbs - ); - } - - /** Return a formatted "header" string - * - * NOTE: This doesn't set the "Authorization: " prefix, which is required. - * I don't set it because various set header functions prefer different - * ways to do that. - * - * @param args {object} see .sign - */ - function getHeaderString ($args=array()) { - //if (empty($this->_parameters['oauth_signature'])) - // $this->sign($args); - - $result = 'OAuth '; - - foreach ($this->_parameters as $pName=>$pValue) - { - if (strpos($pName,'oauth_') !== 0) - continue; - if (is_array($pValue)) - { - foreach ($pValue as $val) - { - $result .= $pName .'="' . $this->_oauthEscape($val) . '", '; - } - } - else - { - $result .= $pName . '="' . $this->_oauthEscape($pValue) . '", '; - } - } - return preg_replace('/, $/','',$result); - } - - // Start private methods. Here be Dragons. - // No promises are kept that any of these functions will continue to exist - // in future versions. - function _parseParameterString ($paramString) { - $elements = explode('&',$paramString); - $result = array(); - foreach ($elements as $element) - { - list ($key,$token) = explode('=',$element); - if ($token) - $token = urldecode($token); - if (!empty($result[$key])) - { - if (!is_array($result[$key])) - $result[$key] = array($result[$key],$token); - else - array_push($result[$key],$token); - } - else - $result[$key]=$token; - } - //error_log('Parse parameters : '.print_r($result,1)); - return $result; - } - - function _oauthEscape($string) { - if ($string === 0) - return 0; - if (empty($string)) - return ''; - if (is_array($string)) - throw new WC_XR_OAuthSimpleException('Array passed to _oauthEscape'); - $string = rawurlencode($string); - $string = str_replace('+','%20',$string); - $string = str_replace('!','%21',$string); - $string = str_replace('*','%2A',$string); - $string = str_replace('\'','%27',$string); - $string = str_replace('(','%28',$string); - $string = str_replace(')','%29',$string); - return $string; - } - - function _getNonce($length=5) { - $result = ''; - $cLength = strlen($this->_nonce_chars); - for ($i=0; $i < $length; $i++) - { - $rnum = rand(0,$cLength); - $result .= substr($this->_nonce_chars,$rnum,1); - } - $this->_parameters['oauth_nonce'] = $result; - return $result; - } - - function _getApiKey() { - if (empty($this->_secrets['consumer_key'])) - { - throw new WC_XR_OAuthSimpleException('No consumer_key set for OAuthSimple'); - } - $this->_parameters['oauth_consumer_key']=$this->_secrets['consumer_key']; - return $this->_parameters['oauth_consumer_key']; - } - - function _getAccessToken() { - if (!isset($this->_secrets['oauth_secret'])) - return ''; - if (!isset($this->_secrets['oauth_token'])) - throw new WC_XR_OAuthSimpleException('No access token (oauth_token) set for OAuthSimple.'); - $this->_parameters['oauth_token'] = $this->_secrets['oauth_token']; - return $this->_parameters['oauth_token']; - } - - function _getTimeStamp() { - return $this->_parameters['oauth_timestamp'] = time(); - } - - function _normalizedParameters($filter='false') { - $elements = array(); - $ra = 0; - ksort($this->_parameters); - foreach ( $this->_parameters as $paramName=>$paramValue) { - if($paramName=='xml'){ - if($filter=="true") - continue; - } - if (preg_match('/\w+_secret/',$paramName)) - continue; - if (is_array($paramValue)) - { - sort($paramValue); - foreach($paramValue as $element) - array_push($elements,$this->_oauthEscape($paramName).'='.$this->_oauthEscape($element)); - continue; - } - array_push($elements,$this->_oauthEscape($paramName).'='.$this->_oauthEscape($paramValue)); - - } - return join('&',$elements); - } - - /** - * Generate the signature. - * - * @throws WC_XR_OAuthSimpleException If the signature method is unknown. - * - * @return string The signature. - */ - public function generate_signature() { - $secret_key = ''; - - if ( isset( $this->_secrets['shared_secret'] ) ) { - $secret_key .= $this->_oauth_escape( $this->_secrets['shared_secret'] ); - } - - $secret_key .= '&'; - - if ( isset( $this->_secrets['oauth_secret'] ) ) { - $secret_key .= $this->_oauth_escape( $this->_secrets['oauth_secret'] ); - } - - switch ( $this->_parameters['oauth_signature_method'] ) { - case 'RSA-SHA1': - // Fetch the public key. - $public_key = openssl_get_publickey( $this->_secrets['public_key'] ); - - if ( false === $public_key ) { - throw new WC_XR_OAuthSimpleException( 'Unable to retrieve public key.' ); - } - - // Fetch the private key. - $private_key_id = openssl_get_privatekey( $this->_secrets['private_key'] ); - - if ( false === $private_key_id ) { - throw new WC_XR_OAuthSimpleException( 'Unable to retrieve private key.' ); - } - - // Sign using the key. - $this->sbs = $this->_oauth_escape( $this->_action ) . '&' . $this->_oauth_escape( $this->_path ) . '&' . $this->_oauth_escape( $this->_normalized_parameters() ); - - $ok = openssl_sign( $this->sbs, $signature, $private_key_id ); - - if ( false === $ok ) { - throw new WC_XR_OAuthSimpleException( 'Error generating signature.' ); - } - - // Release the key resource. - unset( $private_key_id ); - - return base64_encode( $signature ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode - - case 'PLAINTEXT': - return urlencode( $secret_key ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.urlencode_urlencode - - case 'HMAC-SHA1': - $this->sbs = $this->_oauth_escape( $this->_action ) . '&' . $this->_oauth_escape( $this->_path ) . '&' . $this->_oauth_escape( $this->_normalized_parameters() ); - return base64_encode( hash_hmac( 'sha1', $this->sbs, $secret_key, true ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode - - default: - throw new WC_XR_OAuthSimpleException( 'Unknown signature method for OAuthSimple' ); - } - } -} diff --git a/includes/class-wc-xr-settings.php b/includes/class-wc-xr-settings.php index accfb60..0ee7203 100644 --- a/includes/class-wc-xr-settings.php +++ b/includes/class-wc-xr-settings.php @@ -1,4 +1,9 @@ 'text/plain', - 'pem' => 'text/plain', - 'cer' => 'text/plain', - 'pub' => 'text/plain', - 'ppk' => 'text/plain', - ); /** - * Allow txt/pem/cer/pub/ppk to be uploaded. - * - * @param $t array Array of mime types keyed by the file extension regex corresponding to those types. + * Override settings. * - * @return array + * @var array */ - public function override_upload_mimes( $t ) { - return array_merge( $t, $this->valid_filetypes ); - } + private $override = array(); + /** + * WC_XR_Settings constructor. + * + * @param array|null $override Override settings. + */ public function __construct( $override = null ) { add_filter( 'option_page_capability_woocommerce_xero', array( $this, 'add_save_capability' ) ); @@ -51,225 +46,179 @@ public function __construct( $override = null ) { $this->override = $override; } - // Set the settings + // Prepare branding theme list items. + $branding_themes_list = array(); + $branding_themes_list[''] = __( 'Select', 'woocommerce-xero' ); + $branding_themes = get_option( 'xero_branding_themes' ); + if ( $branding_themes ) { + $branding_themes_list = array_merge( $branding_themes_list, $branding_themes ); + } + + // Set the settings. $this->settings = array( // OAuth data. - 'client_id' => array( + 'client_id' => array( 'title' => __( 'Client ID', 'woocommerce-xero' ), 'default' => '', 'type' => 'text_oauth', 'description' => __( 'OAuth Credential retrieved from Xero Developer My Apps Centre.', 'woocommerce-xero' ), ), - 'client_secret' => array( + 'client_secret' => array( 'title' => __( 'Client Secret', 'woocommerce-xero' ), 'default' => '', 'type' => 'password', 'description' => __( 'OAuth Credential retrieved from Xero Developer My Apps Centre.', 'woocommerce-xero' ), ), // Connect to Xero button. - 'oauth_20' => array( + 'oauth_20' => array( 'title' => __( 'Authenticate', 'woocommerce-xero' ), 'default' => '', 'type' => 'oauth', 'description' => __( 'Use this button to authenticate your Xero integration', 'woocommerce-xero' ), ), - ); - - if ( ! WC_XR_OAuth20::can_use_oauth20() && $this->oauth10_setup_params_exist() ) { - $this->settings = array_merge( - $this->settings, - array( - // API keys. - 'consumer_key' => array( - 'title' => __( 'Consumer Key', 'woocommerce-xero' ), - 'default' => '', - 'type' => 'text', - 'description' => __( 'OAuth Credential retrieved from Xero Developer Centre.', 'woocommerce-xero' ), - ), - 'consumer_secret' => array( - 'title' => __( 'Consumer Secret', 'woocommerce-xero' ), - 'default' => '', - 'type' => 'text', - 'description' => __( 'OAuth Credential retrieved from Xero Developer Centre.', 'woocommerce-xero' ), - ), - // SSH key files. - 'public_key_content' => array( - 'title' => __( 'Public Key', 'woocommerce-xero' ), - 'default' => '', - 'type' => 'key_file', - 'key_type' => 'public', - 'file_ext' => '.cer', - 'description' => __( 'Public key file created to authenticate this site with Xero.', 'woocommerce-xero' ), - ), - 'private_key_content' => array( - 'title' => __( 'Private Key', 'woocommerce-xero' ), - 'default' => '', - 'type' => 'key_file', - 'key_type' => 'private', - 'file_ext' => '.pem', - 'description' => __( 'Private key file created to authenticate this site with Xero.', 'woocommerce-xero' ), - ), - ) - ); - } - - // Prepare branding theme list items. - $branding_themes_list = array(); - $branding_themes_list[''] = __( 'Select', 'woocommerce-xero' ); - $branding_themes = get_option( 'xero_branding_themes' ); - if ( $branding_themes ) { - $branding_themes_list = array_merge( $branding_themes_list, $branding_themes ); - } - - $this->settings = array_merge( - $this->settings, - array( - // Invoice Prefix. - 'invoice_prefix' => array( - 'title' => __( 'Invoice Prefix', 'woocommerce-xero' ), - 'default' => '', - 'type' => 'text', - 'description' => __( 'Allow you to prefix all your invoices.', 'woocommerce-xero' ), - ), - // Accounts. - 'sales_account' => array( - 'title' => __( 'Sales Account', 'woocommerce-xero' ), - 'default' => '', - 'type' => 'text', - 'description' => __( 'Code for Xero account to track sales.', 'woocommerce-xero' ), - 'mandatory' => true, - ), - 'shipping_account' => array( - 'title' => __( 'Shipping Account', 'woocommerce-xero' ), - 'default' => '', - 'type' => 'text', - 'description' => __( 'Code for Xero account to track shipping charges.', 'woocommerce-xero' ), - 'mandatory' => true, - ), - 'fees_account' => array( - 'title' => __( 'Fees Account', 'woocommerce-xero' ), - 'default' => '', - 'type' => 'text', - /* translators: Placeholders %1$s - opening HTML link tag, closing HTML link tag */ - 'description' => sprintf( __( 'Code for Xero account to allow fees. This account represents the fees created by the %1$sWooCommerce Fees API%2$s.', 'woocommerce-xero' ), '', '' ), - 'mandatory' => true, - ), - 'payment_account' => array( - 'title' => __( 'Payment Account', 'woocommerce-xero' ), - 'default' => '', - 'type' => 'text', - 'description' => __( 'Code for Xero account to track payments received.', 'woocommerce-xero' ), - 'mandatory' => true, - ), - 'rounding_account' => array( - 'title' => __( 'Rounding Account', 'woocommerce-xero' ), - 'default' => '', - 'type' => 'text', - 'description' => __( 'Code for Xero account to allow an adjustment entry for rounding.', 'woocommerce-xero' ), - 'mandatory' => true, - ), - // Misc settings - 'send_invoices' => array( - 'title' => __( 'Send Invoices', 'woocommerce-xero' ), - 'default' => 'manual', - 'type' => 'select', - 'description' => __( 'Send Invoices manually (from the order\'s action menu), on creation (when the order is created), or on completion (when order status is changed to completed).', 'woocommerce-xero' ), - 'options' => array( - 'manual' => __( 'Manually', 'woocommerce-xero' ), - 'creation' => __( 'On Order Creation', 'woocommerce-xero' ), - 'payment_completion' => __( 'On Payment Completion', 'woocommerce-xero' ), - 'on' => __( 'On Order Completion', 'woocommerce-xero' ), - ), - ), - 'send_payments' => array( - 'title' => __( 'Send Payments', 'woocommerce-xero' ), - 'default' => 'off', - 'type' => 'select', - 'description' => __( 'Send Payments manually or automatically when order is completed. This may need to be turned off if you sync via a separate integration such as PayPal.', 'woocommerce-xero' ), - 'options' => array( - 'manual' => __( 'Manually', 'woocommerce-xero' ), - 'payment_completion' => __( 'On Payment Completion', 'woocommerce-xero' ), - 'on' => __( 'On Order Completion', 'woocommerce-xero' ), - ), - ), - 'treat_shipping_as' => array( - 'title' => __( 'Treat Shipping As', 'woocommerce-xero' ), - 'default' => 'expense', - 'type' => 'select', - 'description' => __( 'Set this to correspond to your Xero shipping account\'s type.', 'woocommerce-xero' ), - 'options' => array( - 'income' => __( 'Income / Revenue / Sales', 'woocommerce-xero' ), - 'expense' => __( 'Expense', 'woocommerce-xero' ), - ), - ), - 'treat_fees_as' => array( - 'title' => __( 'Treat Fees As', 'woocommerce-xero' ), - 'default' => 'expense', - 'type' => 'select', - 'description' => __( 'Set this to correspond to your Xero fees account\'s type.', 'woocommerce-xero' ), - 'options' => array( - 'income' => __( 'Income / Revenue / Sales', 'woocommerce-xero' ), - 'expense' => __( 'Expense', 'woocommerce-xero' ), - ), - ), - 'branding_theme' => array( - 'title' => __( 'Xero Branding theme', 'woocommerce-xero' ), - 'default' => '', - 'type' => 'select', - 'description' => __( 'Set a default branding theme for Xero invoices. Refresh the page to see updated list.', 'woocommerce-xero' ), - 'options' => $branding_themes_list, - ), - 'match_zero_vat_tax_rates' => array( - 'title' => __( 'Match zero value tax rates', 'woocommerce-xero' ), - 'default' => 'off', - 'type' => 'checkbox', - 'description' => __( 'If the integration is having trouble matching up your tax exempt line items with a tax exempt Xero tax rate, enable this and follow the instructions to force match the WooCommerce tax exempt rates to Xero tax exempt rates.', 'woocommerce-xero' ), - ), - 'four_decimals' => array( - 'title' => __( 'Four Decimal Places', 'woocommerce-xero' ), - 'default' => 'off', - 'type' => 'checkbox', - 'description' => __( 'Use four decimal places for unit prices instead of two.', 'woocommerce-xero' ), + // Invoice Prefix. + 'invoice_prefix' => array( + 'title' => __( 'Invoice Prefix', 'woocommerce-xero' ), + 'default' => '', + 'type' => 'text', + 'description' => __( 'Allow you to prefix all your invoices.', 'woocommerce-xero' ), + ), + // Accounts. + 'sales_account' => array( + 'title' => __( 'Sales Account', 'woocommerce-xero' ), + 'default' => '', + 'type' => 'text', + 'description' => __( 'Code for Xero account to track sales.', 'woocommerce-xero' ), + 'mandatory' => true, + ), + 'shipping_account' => array( + 'title' => __( 'Shipping Account', 'woocommerce-xero' ), + 'default' => '', + 'type' => 'text', + 'description' => __( 'Code for Xero account to track shipping charges.', 'woocommerce-xero' ), + 'mandatory' => true, + ), + 'fees_account' => array( + 'title' => __( 'Fees Account', 'woocommerce-xero' ), + 'default' => '', + 'type' => 'text', + /* translators: Placeholders %1$s - opening HTML link tag, closing HTML link tag */ + 'description' => sprintf( __( 'Code for Xero account to allow fees. This account represents the fees created by the %1$sWooCommerce Fees API%2$s.', 'woocommerce-xero' ), '', '' ), + 'mandatory' => true, + ), + 'payment_account' => array( + 'title' => __( 'Payment Account', 'woocommerce-xero' ), + 'default' => '', + 'type' => 'text', + 'description' => __( 'Code for Xero account to track payments received.', 'woocommerce-xero' ), + 'mandatory' => true, + ), + 'rounding_account' => array( + 'title' => __( 'Rounding Account', 'woocommerce-xero' ), + 'default' => '', + 'type' => 'text', + 'description' => __( 'Code for Xero account to allow an adjustment entry for rounding.', 'woocommerce-xero' ), + 'mandatory' => true, + ), + // Misc settings. + 'send_invoices' => array( + 'title' => __( 'Send Invoices', 'woocommerce-xero' ), + 'default' => 'manual', + 'type' => 'select', + 'description' => __( 'Send Invoices manually (from the order\'s action menu), on creation (when the order is created), or on completion (when order status is changed to completed).', 'woocommerce-xero' ), + 'options' => array( + 'manual' => __( 'Manually', 'woocommerce-xero' ), + 'creation' => __( 'On Order Creation', 'woocommerce-xero' ), + 'payment_completion' => __( 'On Payment Completion', 'woocommerce-xero' ), + 'on' => __( 'On Order Completion', 'woocommerce-xero' ), ), - 'export_zero_amount' => array( - 'title' => __( 'Orders with zero total', 'woocommerce-xero' ), - 'default' => 'off', - 'type' => 'checkbox', - 'description' => __( 'Export orders with zero total.', 'woocommerce-xero' ), + ), + 'send_payments' => array( + 'title' => __( 'Send Payments', 'woocommerce-xero' ), + 'default' => 'off', + 'type' => 'select', + 'description' => __( 'Send Payments manually or automatically when order is completed. This may need to be turned off if you sync via a separate integration such as PayPal.', 'woocommerce-xero' ), + 'options' => array( + 'manual' => __( 'Manually', 'woocommerce-xero' ), + 'payment_completion' => __( 'On Payment Completion', 'woocommerce-xero' ), + 'on' => __( 'On Order Completion', 'woocommerce-xero' ), ), - 'send_inventory' => array( - 'title' => __( 'Send Inventory Items', 'woocommerce-xero' ), - 'default' => 'off', - 'type' => 'checkbox', - 'description' => __( 'Send Item Code field with invoices. If this is enabled then each product must have a SKU defined and be setup as an inventory item in Xero.', 'woocommerce-xero' ), + ), + 'treat_shipping_as' => array( + 'title' => __( 'Treat Shipping As', 'woocommerce-xero' ), + 'default' => 'expense', + 'type' => 'select', + 'description' => __( 'Set this to correspond to your Xero shipping account\'s type.', 'woocommerce-xero' ), + 'options' => array( + 'income' => __( 'Income / Revenue / Sales', 'woocommerce-xero' ), + 'expense' => __( 'Expense', 'woocommerce-xero' ), ), - 'append_email_to_contact' => array( - 'title' => esc_html__( 'Use customer email in contact name', 'woocommerce-xero' ), - 'default' => 'on', - 'type' => 'checkbox', - 'description' => esc_html__( 'Append customer email to contact name to ensure uniqueness and prevent duplicates. Email will be appended only if a contact with the same name exists.', 'woocommerce-xero' ), + ), + 'treat_fees_as' => array( + 'title' => __( 'Treat Fees As', 'woocommerce-xero' ), + 'default' => 'expense', + 'type' => 'select', + 'description' => __( 'Set this to correspond to your Xero fees account\'s type.', 'woocommerce-xero' ), + 'options' => array( + 'income' => __( 'Income / Revenue / Sales', 'woocommerce-xero' ), + 'expense' => __( 'Expense', 'woocommerce-xero' ), ), - 'debug' => array( - 'title' => __( 'Debug', 'woocommerce-xero' ), - 'default' => 'off', - 'type' => 'checkbox', - 'description' => sprintf( - // translators: %1$s - opening HTML link tag, %2$s - closing HTML link tag, line break and opening HTML tag %3$s - closing HTML tag. - __( - 'Log debug messages to the %1$sWooCommerce status log%2$s Note: this may log personal information. We recommend using this for debugging purposes only and deleting the logs when finished.%3$s', - 'woocommerce-xero' - ), - '', - '
', - '' + ), + 'branding_theme' => array( + 'title' => __( 'Xero Branding theme', 'woocommerce-xero' ), + 'default' => '', + 'type' => 'select', + 'description' => __( 'Set a default branding theme for Xero invoices. Refresh the page to see updated list.', 'woocommerce-xero' ), + 'options' => $branding_themes_list, + ), + 'match_zero_vat_tax_rates' => array( + 'title' => __( 'Match zero value tax rates', 'woocommerce-xero' ), + 'default' => 'off', + 'type' => 'checkbox', + 'description' => __( 'If the integration is having trouble matching up your tax exempt line items with a tax exempt Xero tax rate, enable this and follow the instructions to force match the WooCommerce tax exempt rates to Xero tax exempt rates.', 'woocommerce-xero' ), + ), + 'four_decimals' => array( + 'title' => __( 'Four Decimal Places', 'woocommerce-xero' ), + 'default' => 'off', + 'type' => 'checkbox', + 'description' => __( 'Use four decimal places for unit prices instead of two.', 'woocommerce-xero' ), + ), + 'export_zero_amount' => array( + 'title' => __( 'Orders with zero total', 'woocommerce-xero' ), + 'default' => 'off', + 'type' => 'checkbox', + 'description' => __( 'Export orders with zero total.', 'woocommerce-xero' ), + ), + 'send_inventory' => array( + 'title' => __( 'Send Inventory Items', 'woocommerce-xero' ), + 'default' => 'off', + 'type' => 'checkbox', + 'description' => __( 'Send Item Code field with invoices. If this is enabled then each product must have a SKU defined and be setup as an inventory item in Xero.', 'woocommerce-xero' ), + ), + 'append_email_to_contact' => array( + 'title' => esc_html__( 'Use customer email in contact name', 'woocommerce-xero' ), + 'default' => 'on', + 'type' => 'checkbox', + 'description' => esc_html__( 'Append customer email to contact name to ensure uniqueness and prevent duplicates. Email will be appended only if a contact with the same name exists.', 'woocommerce-xero' ), + ), + 'debug' => array( + 'title' => __( 'Debug', 'woocommerce-xero' ), + 'default' => 'off', + 'type' => 'checkbox', + 'description' => sprintf( + // translators: %1$s - opening HTML link tag, %2$s - closing HTML link tag, line break and opening HTML tag %3$s - closing HTML tag. + __( + 'Log debug messages to the %1$sWooCommerce status log%2$s Note: this may log personal information. We recommend using this for debugging purposes only and deleting the logs when finished.%3$s', + 'woocommerce-xero' ), + '', + '
', + '' ), - ) + ), ); - $this->migrate_existing_keys(); $this->maybe_disconnect_from_xero(); - $this->key_file_delete_result = $this->delete_old_key_file(); if ( WC_XR_OAuth20::can_use_oauth20() ) { $this->cleanup_old_options(); } @@ -302,132 +251,6 @@ private function oauth10_setup_params_exist() { return false; } - /** - * Migrate key file(s) contents to option database. - * - * Copies key content into DB from the files pointed to by - * 'private_key' and 'public_key'. Key content is placed in - * new option entries: 'private_key_content' and 'public_key_content'. - * 'private_key' and 'public_key' keys will be deleted only - * if they do not point to a valid key file. Key files - * are deleted in {@see delete_old_key_files()}. - * - * @since 1.7.13 - * - * @return void - */ - public function migrate_existing_keys() { - foreach ( array( 'private_key', 'public_key' ) as $key_postfix ) { - $old_key_name = self::OPTION_PREFIX . $key_postfix; - $content_key_name = $old_key_name . '_content'; - $new_key_content = get_option( $content_key_name ); - $key_file_path = get_option( $old_key_name ); - - if ( false !== $key_file_path ) { - if ( file_exists( $key_file_path ) ) { - // If new {@since 1.7.13} key has been set yet. - if ( false === $new_key_content ) { - $key_file_content = $this->read_key_file( $key_file_path ); - if ( ! empty( $key_file_content ) && empty( $new_key_content ) ) { - // Save key content from file to db. - update_option( $content_key_name, $key_file_content ); - $this->set_upload_info( $content_key_name, basename( $key_file_path ) ); - } - } - } else { - // Just delete the option, since the file it's pointing to does not exist. - delete_option( $old_key_name ); - } - } - } - } - - /** - * Saves upload info to options db. - * - * Saves key file name and upload timestamp to options db so it can be reported back to user. - * - * @since 1.7.13 - * - * @param string $content_key_name key name where content of key is saved (e.g. 'wc_private_key_content'). - * @param string $filename filename of uploaded file. - * - * @return void - */ - public function set_upload_info( $content_key_name, $filename ) { - $upload_info_key = $content_key_name . self::UPLOAD_INFO_POSTFIX; - - update_option( - $upload_info_key, - array( - 'upload_timestamp' => current_time( 'timestamp' ), - 'upload_filename' => $filename, - ) - ); - } - - /** - * Get formatted string for upload info. - * - * Returns a human-readable string for what filename was uploaded and when. - * - * @since 1.7.13 - * - * @param string $content_key_name key name where content of key is saved (e.g. 'wc_private_key_content'). - * - * @return string Filename and upload datetime. - */ - public function get_upload_info_string( $content_key_name ) { - $upload_info_key = $content_key_name . self::UPLOAD_INFO_POSTFIX; - $upload_info = get_option( $upload_info_key ); - - if ( ! empty( $upload_info ) ) { - $format = get_option( 'time_format' ) . ', ' . get_option( 'date_format' ); - $upload_date_time = date_i18n( $format, $upload_info['upload_timestamp'] ); - return sprintf( __( 'Using %1$s uploaded at %2$s', 'woocommerce-xero' ), $upload_info['upload_filename'], $upload_date_time ); - } - return ''; - } - - /** - * Handle delete requests from Delete button push. - * - * Deletes key file. Once key file is deleted, the option - * field will be cleaned up in {@see migrate_existing_keys}. - * - * @see key_migration_notice() - * @since 1.7.13 - * - * @return array { - * Key file deletion result. - * - * @type string $result Result of delete ('error' / 'success'). - * @type string $key_file Full file path of key file to be deleted. - * } - */ - public function delete_old_key_file() { - $key_file_path = ''; - $result = ''; - $key_name = sanitize_text_field( wp_unslash( $_POST['delete_key_file'] ?? '' ) ); - - if ( $key_name && in_array( $key_name, array( 'wc_xero_public_key', 'wc_xero_private_key' ), true ) && current_user_can( 'manage_options' ) ) { - $key_file_path = get_option( $key_name ); - if ( ! empty( $key_file_path ) ) { - // nosemgrep:audit.php.lang.security.file.read-write-delete,audit.php.lang.security.file.phar-deserialization -- $key_name is checked to be known to WC Xero. - $delete_result = unlink( $key_file_path ); - if ( false === $delete_result ) { - $result = 'error'; - } else { - $result = 'success'; - } - } - } - return array( - 'result' => $result, - 'key_file' => $key_file_path, - ); - } - /** * Disconnect from Xero. * @@ -447,21 +270,6 @@ public function maybe_disconnect_from_xero() { } } - /** - * Reads key file contents. - * - * @since 1.7.13 - * - * @param string Path to key file. - * @return string Key content. - */ - public function read_key_file( $file_path ) { - $fp = fopen( $file_path, 'r' ); - $file_contents = fread( $fp, 8192 ); - fclose( $fp ); - return $file_contents; - } - /** * Adds manage_woocommerce capability to settings so that * any roles with this capabilitity will be able to save the settings @@ -477,7 +285,6 @@ public function setup_hooks() { add_action( 'admin_init', array( $this, 'register_settings' ) ); add_action( 'admin_menu', array( $this, 'add_menu_item' ) ); add_action( 'admin_menu', array( $this, 'add_menu_item_oauth' ) ); - add_action( 'admin_notices', array( $this, 'key_migration_notice' ) ); add_action( 'admin_notices', array( $this, 'oauth20_migration_notice' ) ); add_action( 'admin_notices', array( $this, 'show_auth_keys_changed_notice' ) ); @@ -543,10 +350,6 @@ public function register_settings() { ) ); - if ( 'key_file' === $option['type'] ) { - add_filter( 'pre_update_option_' . self::OPTION_PREFIX . $key, array( $this, 'handle_key_file_upload' ), 10, 3 ); - } - // Register setting register_setting( 'woocommerce_xero', self::OPTION_PREFIX . $key ); @@ -732,7 +535,7 @@ public function oauth_redirect() { public function options_page() { ?>
-
+

@@ -784,30 +587,6 @@ public function settings_intro() { echo '

'; } - /** - * Key file input field. - * - * Generates file input for key file upload. - * - * @param $args - */ - public function input_key_file( $args ) { - $input_name = self::OPTION_PREFIX . $args['key']; - $file_ext = $args['option']['file_ext']; - - // File input field. - echo ''; - - echo '

' . wp_kses_post( $args['option']['description'] ) . '

'; - - $key_content = $this->get_option( $args['key'] ); - if ( ! empty( $key_content ) ) { - echo '

' . esc_html( $this->get_upload_info_string( $input_name ) ) . '

'; - } else { - echo '

' . esc_html__( 'Key not set', 'woocommerce-xero' ) . '

'; - } - } - /** * Key file input field. * @@ -992,99 +771,6 @@ public function maybe_clear_oauth20_settings( $new_value, $old_value ) { } } - /** - * Handle key file upload. - * - * Retrieves key content from user uploaded as string - * and returns it so that's stored as the option value - * instead of just the file name. This should be hooked - * into the 'pre_update_option_' hook for 'key_file' - * inputs so key data can be retrieved. - * - * @since 1.7.13 - * - * @param string $new_value filename of uploaded file - * @param string $old_value original value of key. - * @param string $option_name full name of option. - * - * @return string key content to directly store in option db. - */ - public function handle_key_file_upload( $new_value, $old_value, $option_name ) { - if ( ! isset( $_FILES[ $option_name ] ) ) { - return $old_value; - } - add_filter( 'upload_mimes', array( $this, 'override_upload_mimes' ), 10, 1 ); - - $overrides = array( - 'test_form' => false, - 'mimes' => $this->valid_filetypes, - ); - $import = $_FILES[ $option_name ]; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized,WordPress.Security.ValidatedSanitizedInput.MissingUnslash - $upload = wp_handle_upload( $import, $overrides ); - - if ( isset( $upload['error'] ) ) { - return $old_value; - } - - $key_content = $this->read_key_file( $upload['file'] ); - if ( empty( $key_content ) ) { - return $old_value; - } - - $this->set_upload_info( $option_name, $import['name'] ); - return $key_content; - } - - /** - * Notify user is key file(s) still exists. - * - * @since 1.7.13 - * - * @return void - */ - public function key_migration_notice() { - if ( current_user_can( 'manage_options' ) ) { - foreach ( array( 'wc_xero_public_key', 'wc_xero_private_key' ) as $key_name ) { - $key_file_path = esc_html( get_option( $key_name ) ); - if ( false !== $key_file_path && file_exists( $key_file_path ) ) { - $filename = basename( $key_file_path ); - ?> -
-

- - - -
- key_file_delete_result['result'] ) ) { - $key_file_path = $this->key_file_delete_result['key_file']; - if ( 'error' === $this->key_file_delete_result['result'] ) { - ?> -
-

- -

-
- key_file_delete_result['result'] ) { - ?> -
-

- -

-
- oauth10_setup_params_exist() ) { ?>
-


+


' . esc_html__( 'Go to Xero settings page', 'woocommerce-xero' ) . '.'; ?>

diff --git a/includes/requests/class-wc-xr-request.php b/includes/requests/class-wc-xr-request.php index 006de03..f7ff16e 100644 --- a/includes/requests/class-wc-xr-request.php +++ b/includes/requests/class-wc-xr-request.php @@ -21,20 +21,6 @@ abstract class WC_XR_Request { */ const API_URL = 'https://api.xero.com/api.xro/2.0/'; - /** - * Signature Method - * - * @var String - */ - const signature_method = 'RSA-SHA1'; // phpcs:ignore Generic.NamingConventions.UpperCaseConstantName.ClassConstantNotUpperCase - - /** - * Signed URL - * - * @var String - */ - private $signed_url = null; - /** * The request endpoint * @@ -213,155 +199,22 @@ private function clear_response() { return true; } - /** - * Check local settings required for request - * - * @return bool - */ - private function are_settings_set() { - - // Check required settings. - if ( - ( '' === $this->settings->get_option( 'consumer_key' ) ) || - ( '' === $this->settings->get_option( 'consumer_secret' ) ) || - ( '' === $this->settings->get_option( 'private_key_content' ) ) || - ( '' === $this->settings->get_option( 'public_key_content' ) ) || - ( '' === $this->settings->get_option( 'sales_account' ) ) || - ( '' === $this->settings->get_option( 'shipping_account' ) ) || - ( '' === $this->settings->get_option( 'payment_account' ) ) - ) { - return false; - } - - return true; - } - - /** - * Check if key files exist - * - * @return bool - */ - private function do_keys_exist() { - - // Check keys. - if ( ! empty( 'private_key_content' ) && ! empty( $this->settings->get_option( 'public_key_content' ) ) ) { - return true; - } - - return false; - } - - /** - * Get the signed URL. - * The signed URL is fetched by doing an OAuth request. - * - * @return string - */ - private function get_signed_url() { - if ( null === $this->signed_url ) { - - // Setup OAuth object. - $oauth_object = new WC_XR_OAuth_Simple(); - - // Reset, start clean. - $oauth_object->reset(); - - $parameters = array( 'oauth_signature_method' => 'RSA-SHA1' ); - $query = $this->get_query(); - if ( ! empty( $query ) ) { - $parameters = array_merge( $query, $parameters ); - } - - // Do the OAuth sign request. - $oauth_result = $oauth_object->sign( - array( - 'path' => self::API_URL . $this->get_endpoint() . '/', - 'action' => $this->get_method(), - 'parameters' => $parameters, - 'signatures' => array( - 'consumer_key' => $this->settings->get_option( 'consumer_key' ), - 'shared_secret' => $this->settings->get_option( 'consumer_secret' ), - 'rsa_private_key' => $this->settings->get_option( 'private_key_content' ), - 'rsa_public_key' => $this->settings->get_option( 'public_key_content' ), - 'oauth_secret' => $this->settings->get_option( 'consumer_secret' ), - 'oauth_token' => $this->settings->get_option( 'consumer_key' ), - ), - ) - ); - - // Set the signed URL. - $this->signed_url = $oauth_result['signed_url']; - } - - return $this->signed_url; - } - /** * Decide which authorization method to use. */ public function do_request() { - if ( WC_XR_OAuth20::can_use_oauth20() ) { - $this->do_request_oauth20(); - } else { - $this->do_request_legacy(); - } + $this->do_request_oauth20(); } /** * Do the request, legacy style OAuth1 * - * @throws Exception If unable to perform a request. - * - * @return bool + * @deprecated 1.9.0 + * @return WP_Error */ public function do_request_legacy() { - - // Check if required settings are set. - if ( false === $this->are_settings_set() ) { - throw new Exception( "Can't do XERO API request because not all required settings are entered." ); - } - - // Check if key files exist. - if ( false === $this->do_keys_exist() ) { - throw new Exception( 'Xero private and/or public key not set.' ); - } - - // Do the request. - $this->response = wp_remote_request( - $this->get_signed_url(), - array( - 'method' => $this->get_method(), - 'headers' => array( - 'Accept' => 'application/xml', - 'Content-Type' => 'application/binary', - 'Content-Length' => strlen( $this->get_body() ), - ), - 'timeout' => 70, - 'body' => $this->get_body(), - 'user-agent' => 'WooCommerce ' . WC()->version, - ) - ); - - // Check if request is an error. - if ( is_wp_error( $this->response ) ) { - $this->clear_response(); - throw new Exception( 'There was a problem connecting to the API.' ); - } - - // Check for OAuth error. - if ( isset( $this->response['body'] ) && 0 === strpos( $this->response['body'], 'oauth_problem=' ) ) { - - // Parse error string. - parse_str( $this->response['body'], $oauth_error ); - - // Find OAuth advise. - $oauth_advise = ( ( isset( $oauth_error['oauth_problem_advice'] ) ) ? $oauth_error['oauth_problem_advice'] : '' ); - - // Throw new exception. - throw new Exception( sprintf( 'Request failed due OAuth error: %s | %s', $oauth_error['oauth_problem'], $oauth_advise ) ); - } - - return true; + wc_deprecated_function( __METHOD__, '1.9.0', 'WC_XR_Request::do_request' ); + return new WP_Error( 'deprecated', 'This method is deprecated, please use WC_XR_Request::do_request instead.' ); } /** diff --git a/languages/woocommerce-xero.pot b/languages/woocommerce-xero.pot index f3831c2..1a71bfa 100644 --- a/languages/woocommerce-xero.pot +++ b/languages/woocommerce-xero.pot @@ -2,9 +2,9 @@ # This file is distributed under the same license as the WooCommerce Xero Integration package. msgid "" msgstr "" -"Project-Id-Version: WooCommerce Xero Integration 1.8.9\n" +"Project-Id-Version: WooCommerce Xero Integration 1.9.0\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-xero\n" -"POT-Creation-Date: 2024-08-19 14:03:55+00:00\n" +"POT-Creation-Date: 2024-10-14 14:39:56+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -137,8 +137,8 @@ msgstr "" msgid "HTTPS for WordPress page" msgstr "" -#: includes/class-wc-xr-privacy.php:22 includes/class-wc-xr-settings.php:600 -#: includes/class-wc-xr-settings.php:601 includes/class-wc-xr-settings.php:632 +#: includes/class-wc-xr-privacy.php:22 includes/class-wc-xr-settings.php:403 +#: includes/class-wc-xr-settings.php:404 includes/class-wc-xr-settings.php:435 msgid "Xero" msgstr "" @@ -192,92 +192,62 @@ msgstr "" msgid "Xero personal data erased." msgstr "" -#: includes/class-wc-xr-settings.php:58 +#: includes/class-wc-xr-settings.php:51 +msgid "Select" +msgstr "" + +#: includes/class-wc-xr-settings.php:61 msgid "Client ID" msgstr "" -#: includes/class-wc-xr-settings.php:61 includes/class-wc-xr-settings.php:67 +#: includes/class-wc-xr-settings.php:64 includes/class-wc-xr-settings.php:70 msgid "" "OAuth Credential retrieved from Xero " "Developer My Apps Centre." msgstr "" -#: includes/class-wc-xr-settings.php:64 +#: includes/class-wc-xr-settings.php:67 msgid "Client Secret" msgstr "" -#: includes/class-wc-xr-settings.php:71 +#: includes/class-wc-xr-settings.php:74 msgid "Authenticate" msgstr "" -#: includes/class-wc-xr-settings.php:74 +#: includes/class-wc-xr-settings.php:77 msgid "Use this button to authenticate your Xero integration" msgstr "" -#: includes/class-wc-xr-settings.php:84 -msgid "Consumer Key" -msgstr "" - -#: includes/class-wc-xr-settings.php:87 includes/class-wc-xr-settings.php:93 -msgid "" -"OAuth Credential retrieved from Xero Developer Centre." -msgstr "" - -#: includes/class-wc-xr-settings.php:90 -msgid "Consumer Secret" -msgstr "" - -#: includes/class-wc-xr-settings.php:97 -msgid "Public Key" -msgstr "" - -#: includes/class-wc-xr-settings.php:102 -msgid "Public key file created to authenticate this site with Xero." -msgstr "" - -#: includes/class-wc-xr-settings.php:105 -msgid "Private Key" -msgstr "" - -#: includes/class-wc-xr-settings.php:110 -msgid "Private key file created to authenticate this site with Xero." -msgstr "" - -#: includes/class-wc-xr-settings.php:118 -msgid "Select" -msgstr "" - -#: includes/class-wc-xr-settings.php:129 +#: includes/class-wc-xr-settings.php:81 msgid "Invoice Prefix" msgstr "" -#: includes/class-wc-xr-settings.php:132 +#: includes/class-wc-xr-settings.php:84 msgid "Allow you to prefix all your invoices." msgstr "" -#: includes/class-wc-xr-settings.php:136 +#: includes/class-wc-xr-settings.php:88 msgid "Sales Account" msgstr "" -#: includes/class-wc-xr-settings.php:139 +#: includes/class-wc-xr-settings.php:91 msgid "Code for Xero account to track sales." msgstr "" -#: includes/class-wc-xr-settings.php:143 +#: includes/class-wc-xr-settings.php:95 msgid "Shipping Account" msgstr "" -#: includes/class-wc-xr-settings.php:146 +#: includes/class-wc-xr-settings.php:98 msgid "Code for Xero account to track shipping charges." msgstr "" -#: includes/class-wc-xr-settings.php:150 +#: includes/class-wc-xr-settings.php:102 msgid "Fees Account" msgstr "" -#: includes/class-wc-xr-settings.php:154 +#: includes/class-wc-xr-settings.php:106 #. translators: Placeholders %1$s - opening HTML link tag, closing HTML #. link tag msgid "" @@ -285,98 +255,98 @@ msgid "" "created by the %1$sWooCommerce Fees API%2$s." msgstr "" -#: includes/class-wc-xr-settings.php:158 +#: includes/class-wc-xr-settings.php:110 msgid "Payment Account" msgstr "" -#: includes/class-wc-xr-settings.php:161 +#: includes/class-wc-xr-settings.php:113 msgid "Code for Xero account to track payments received." msgstr "" -#: includes/class-wc-xr-settings.php:165 +#: includes/class-wc-xr-settings.php:117 msgid "Rounding Account" msgstr "" -#: includes/class-wc-xr-settings.php:168 +#: includes/class-wc-xr-settings.php:120 msgid "Code for Xero account to allow an adjustment entry for rounding." msgstr "" -#: includes/class-wc-xr-settings.php:173 +#: includes/class-wc-xr-settings.php:125 msgid "Send Invoices" msgstr "" -#: includes/class-wc-xr-settings.php:176 +#: includes/class-wc-xr-settings.php:128 msgid "" "Send Invoices manually (from the order's action menu), on creation (when " "the order is created), or on completion (when order status is changed to " "completed)." msgstr "" -#: includes/class-wc-xr-settings.php:178 includes/class-wc-xr-settings.php:190 +#: includes/class-wc-xr-settings.php:130 includes/class-wc-xr-settings.php:142 msgid "Manually" msgstr "" -#: includes/class-wc-xr-settings.php:179 +#: includes/class-wc-xr-settings.php:131 msgid "On Order Creation" msgstr "" -#: includes/class-wc-xr-settings.php:180 includes/class-wc-xr-settings.php:191 +#: includes/class-wc-xr-settings.php:132 includes/class-wc-xr-settings.php:143 msgid "On Payment Completion" msgstr "" -#: includes/class-wc-xr-settings.php:181 includes/class-wc-xr-settings.php:192 +#: includes/class-wc-xr-settings.php:133 includes/class-wc-xr-settings.php:144 msgid "On Order Completion" msgstr "" -#: includes/class-wc-xr-settings.php:185 +#: includes/class-wc-xr-settings.php:137 msgid "Send Payments" msgstr "" -#: includes/class-wc-xr-settings.php:188 +#: includes/class-wc-xr-settings.php:140 msgid "" "Send Payments manually or automatically when order is completed. This may " "need to be turned off if you sync via a separate integration such as PayPal." msgstr "" -#: includes/class-wc-xr-settings.php:196 +#: includes/class-wc-xr-settings.php:148 msgid "Treat Shipping As" msgstr "" -#: includes/class-wc-xr-settings.php:199 +#: includes/class-wc-xr-settings.php:151 msgid "Set this to correspond to your Xero shipping account's type." msgstr "" -#: includes/class-wc-xr-settings.php:201 includes/class-wc-xr-settings.php:211 +#: includes/class-wc-xr-settings.php:153 includes/class-wc-xr-settings.php:163 msgid "Income / Revenue / Sales" msgstr "" -#: includes/class-wc-xr-settings.php:202 includes/class-wc-xr-settings.php:212 +#: includes/class-wc-xr-settings.php:154 includes/class-wc-xr-settings.php:164 msgid "Expense" msgstr "" -#: includes/class-wc-xr-settings.php:206 +#: includes/class-wc-xr-settings.php:158 msgid "Treat Fees As" msgstr "" -#: includes/class-wc-xr-settings.php:209 +#: includes/class-wc-xr-settings.php:161 msgid "Set this to correspond to your Xero fees account's type." msgstr "" -#: includes/class-wc-xr-settings.php:216 +#: includes/class-wc-xr-settings.php:168 msgid "Xero Branding theme" msgstr "" -#: includes/class-wc-xr-settings.php:219 +#: includes/class-wc-xr-settings.php:171 msgid "" "Set a default branding theme for Xero invoices. Refresh the page to see " "updated list." msgstr "" -#: includes/class-wc-xr-settings.php:223 +#: includes/class-wc-xr-settings.php:175 msgid "Match zero value tax rates" msgstr "" -#: includes/class-wc-xr-settings.php:226 +#: includes/class-wc-xr-settings.php:178 msgid "" "If the integration is having trouble matching up your tax exempt line items " "with a tax exempt Xero tax rate, enable this and follow the " msgstr "" -#: includes/class-wc-xr-settings.php:229 +#: includes/class-wc-xr-settings.php:181 msgid "Four Decimal Places" msgstr "" -#: includes/class-wc-xr-settings.php:232 +#: includes/class-wc-xr-settings.php:184 msgid "Use four decimal places for unit prices instead of two." msgstr "" -#: includes/class-wc-xr-settings.php:235 +#: includes/class-wc-xr-settings.php:187 msgid "Orders with zero total" msgstr "" -#: includes/class-wc-xr-settings.php:238 +#: includes/class-wc-xr-settings.php:190 msgid "Export orders with zero total." msgstr "" -#: includes/class-wc-xr-settings.php:241 +#: includes/class-wc-xr-settings.php:193 msgid "Send Inventory Items" msgstr "" -#: includes/class-wc-xr-settings.php:244 +#: includes/class-wc-xr-settings.php:196 msgid "" "Send Item Code field with invoices. If this is enabled then each product " "must have a SKU defined and be setup as an inventory item in Xero." msgstr "" -#: includes/class-wc-xr-settings.php:247 +#: includes/class-wc-xr-settings.php:199 msgid "Use customer email in contact name" msgstr "" -#: includes/class-wc-xr-settings.php:250 +#: includes/class-wc-xr-settings.php:202 msgid "" "Append customer email to contact name to ensure uniqueness and prevent " "duplicates. Email will be appended only if a contact with the same name " "exists." msgstr "" -#: includes/class-wc-xr-settings.php:253 +#: includes/class-wc-xr-settings.php:205 msgid "Debug" msgstr "" -#: includes/class-wc-xr-settings.php:258 +#: includes/class-wc-xr-settings.php:210 #. translators: %1$s - opening HTML link tag, %2$s - closing HTML link #. tag, line break and opening HTML tag %3$s - closing HTML #. tag. @@ -439,69 +409,61 @@ msgid "" "and deleting the logs when finished.%3$s" msgstr "" -#: includes/class-wc-xr-settings.php:387 -msgid "Using %1$s uploaded at %2$s" -msgstr "" - -#: includes/class-wc-xr-settings.php:442 +#: includes/class-wc-xr-settings.php:265 msgid "Nonce verification failed!" msgstr "" -#: includes/class-wc-xr-settings.php:519 +#: includes/class-wc-xr-settings.php:326 msgid "Xero Settings" msgstr "" -#: includes/class-wc-xr-settings.php:654 includes/class-wc-xr-settings.php:655 -#: includes/class-wc-xr-settings.php:685 includes/class-wc-xr-settings.php:694 -#: includes/class-wc-xr-settings.php:717 +#: includes/class-wc-xr-settings.php:457 includes/class-wc-xr-settings.php:458 +#: includes/class-wc-xr-settings.php:488 includes/class-wc-xr-settings.php:497 +#: includes/class-wc-xr-settings.php:520 msgid "Xero OAuth" msgstr "" -#: includes/class-wc-xr-settings.php:737 +#: includes/class-wc-xr-settings.php:540 msgid "Xero for WooCommerce" msgstr "" -#: includes/class-wc-xr-settings.php:741 +#: includes/class-wc-xr-settings.php:544 msgid "Your settings have been saved." msgstr "" -#: includes/class-wc-xr-settings.php:754 +#: includes/class-wc-xr-settings.php:557 msgid "Missing required fields" msgstr "" -#: includes/class-wc-xr-settings.php:760 +#: includes/class-wc-xr-settings.php:563 msgid "There was an error saving your settings." msgstr "" -#: includes/class-wc-xr-settings.php:777 +#: includes/class-wc-xr-settings.php:580 msgid "" "Settings for your Xero account including security keys and default account " "numbers." msgstr "" -#: includes/class-wc-xr-settings.php:780 +#: includes/class-wc-xr-settings.php:583 #. translators: %1$s: opening anchor tag; %2$s: closing anchor tag msgid "Please ensure you're following all %1$srequirements%2$s prior to setup." msgstr "" -#: includes/class-wc-xr-settings.php:783 +#: includes/class-wc-xr-settings.php:586 #. translators: %1$s: opening strong tag; %2$s: closing strong tag msgid "%1$sAll%2$s text fields are required for the integration to work properly." msgstr "" -#: includes/class-wc-xr-settings.php:807 -msgid "Key not set" -msgstr "" - -#: includes/class-wc-xr-settings.php:845 +#: includes/class-wc-xr-settings.php:624 msgid "Disconnect from Xero" msgstr "" -#: includes/class-wc-xr-settings.php:853 +#: includes/class-wc-xr-settings.php:632 msgid "Sign in with Xero" msgstr "" -#: includes/class-wc-xr-settings.php:858 +#: includes/class-wc-xr-settings.php:637 #. translators: %1$s: line break tag; %2$s: opening anchor tag; %3$s: closing #. anchor tag; msgid "" @@ -510,59 +472,39 @@ msgid "" "%2$srequirements%3$s prior to setup." msgstr "" -#: includes/class-wc-xr-settings.php:894 +#: includes/class-wc-xr-settings.php:673 msgid "" "Please use the following url as your redirect url when creating a Xero " "application:" msgstr "" -#: includes/class-wc-xr-settings.php:1053 -msgid "" -"Xero has securely saved the contents of key file %s to the database and no " -"longer requires it." -msgstr "" - -#: includes/class-wc-xr-settings.php:1056 -msgid "Delete %s" -msgstr "" - -#: includes/class-wc-xr-settings.php:1071 -msgid "Xero could not delete %s. Check permissions and try again." +#: includes/class-wc-xr-settings.php:787 +msgid "Xero authentication using keys is deprecated and no longer works." msgstr "" -#: includes/class-wc-xr-settings.php:1079 -msgid "Xero successfully deleted %s." -msgstr "" - -#: includes/class-wc-xr-settings.php:1101 -msgid "" -"Xero authentication using keys is in the process of being deprecated and " -"new private apps can no longer be created." -msgstr "" - -#: includes/class-wc-xr-settings.php:1102 +#: includes/class-wc-xr-settings.php:788 msgid "" "Please use new flow and the button available in Xero settings to authorize " "your application." msgstr "" -#: includes/class-wc-xr-settings.php:1104 +#: includes/class-wc-xr-settings.php:790 msgid "Go to Xero settings page" msgstr "" -#: includes/class-wc-xr-settings.php:1121 +#: includes/class-wc-xr-settings.php:807 msgid "" "Unable to fetch the Branding Theme details. Please ensure your Xero " "connection is properly authenticated." msgstr "" -#: includes/class-wc-xr-settings.php:1141 +#: includes/class-wc-xr-settings.php:827 msgid "" "Xero account was disconnected because authentication keys were changed. " "Please connect again." msgstr "" -#: includes/requests/class-wc-xr-request.php:465 +#: includes/requests/class-wc-xr-request.php:318 #. translators: %1$d - response code, %2$s - response message. msgid "Xero request failed due to error: %1$d (%2$s)" msgstr "" diff --git a/lib/packages/autoload-classmap.php b/lib/packages/autoload-classmap.php index a864cca..8b32e88 100644 --- a/lib/packages/autoload-classmap.php +++ b/lib/packages/autoload-classmap.php @@ -137,6 +137,7 @@ 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ExpenseClaims' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/ExpenseClaims.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ReportWithRows' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/ReportWithRows.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ImportSummaryOrganisation' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/ImportSummaryOrganisation.php', + 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PageInfo' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/PageInfo.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\RepeatingInvoices' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/RepeatingInvoices.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\RowType' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/RowType.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\LineAmountTypes' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/LineAmountTypes.php', @@ -156,6 +157,7 @@ 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentService' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/PaymentService.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\RepeatingInvoice' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/RepeatingInvoice.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ReportRow' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/ReportRow.php', + 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\GetOverpaymentsResponse' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetOverpaymentsResponse.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Balances' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/Balances.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Actions' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/Actions.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CISSettings' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/CISSettings.php', @@ -172,7 +174,9 @@ 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Reports' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/Reports.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ImportSummary' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/ImportSummary.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Action' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/Action.php', + 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Pagination' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/Pagination.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransaction' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/BankTransaction.php', + 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\GetInvoicesResponse' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetInvoicesResponse.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BudgetLine' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/BudgetLine.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentTerm' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/PaymentTerm.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Address' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/Address.php', @@ -183,6 +187,7 @@ 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingCategory' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/TrackingCategory.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Organisation' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/Organisation.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/Attachments.php', + 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\GetPrepaymentsResponse' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetPrepaymentsResponse.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\AccountType' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/AccountType.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TaxType' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/TaxType.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayments' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/BatchPayments.php', @@ -191,12 +196,14 @@ 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Account' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/Account.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\SetupConversionDate' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/SetupConversionDate.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ConversionBalances' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/ConversionBalances.php', + 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\GetPurchaseOrdersResponse' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetPurchaseOrdersResponse.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/HistoryRecords.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\OnlineInvoices' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/OnlineInvoices.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingOptions' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/TrackingOptions.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\LineItemTracking' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/LineItemTracking.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ManualJournalLine' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/ManualJournalLine.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PurchaseOrder' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/PurchaseOrder.php', + 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\GetBankTransactionsResponse' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetBankTransactionsResponse.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contact' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/Contact.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CreditNote' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/CreditNote.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Receipt' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/Receipt.php', @@ -225,6 +232,7 @@ 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ModelInterface' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/ModelInterface.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Prepayments' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/Prepayments.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Payments' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/Payments.php', + 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\GetContactsResponse' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetContactsResponse.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Overpayment' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/Overpayment.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingCategories' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/TrackingCategories.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ContactGroups' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/ContactGroups.php', @@ -239,6 +247,7 @@ 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingOption' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/TrackingOption.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\LinkedTransaction' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/LinkedTransaction.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Setup' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/Setup.php', + 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\GetManualJournalsResponse' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetManualJournalsResponse.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Phone' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/Phone.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\AccountsPayable' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/AccountsPayable.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Item' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/Item.php', @@ -249,6 +258,8 @@ 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayment' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/BatchPayment.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ReportCell' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/ReportCell.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/BankTransactions.php', + 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\GetPaymentsResponse' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetPaymentsResponse.php', + 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\GetCreditNotesResponse' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetCreditNotesResponse.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ContactGroup' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/ContactGroup.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/Contacts.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\AccountsReceivable' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/Accounting/AccountsReceivable.php', @@ -289,11 +300,13 @@ 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PaySlipObject' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PaySlipObject.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLineObject' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TimesheetLineObject.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeObject' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeObject.php', + 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPatternWithWorkingWeeksRequest' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeWorkingPatternWithWorkingWeeksRequest.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\ReimbursementObject' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/ReimbursementObject.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveSetup' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaveSetup.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Settings' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Settings.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\StatutoryDeduction' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/StatutoryDeduction.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplate' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsTemplate.php', + 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPattern' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeWorkingPattern.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Pagination' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Pagination.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeStatutorySickLeaves' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeStatutorySickLeaves.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveTypeObject' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaveTypeObject.php', @@ -301,6 +314,7 @@ 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Address' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Address.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeStatutoryLeaveSummary' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeStatutoryLeaveSummary.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TrackingCategory' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TrackingCategory.php', + 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPatternWithWorkingWeeksObject' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeWorkingPatternWithWorkingWeeksObject.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsOrders' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsOrders.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeePayTemplates' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeePayTemplates.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveTypes' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaveTypes.php', @@ -309,6 +323,8 @@ 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Account' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Account.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TaxCode' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TaxCode.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Employment' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Employment.php', + 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPatternWithWorkingWeeks' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeWorkingPatternWithWorkingWeeks.php', + 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\WorkingWeek' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/WorkingWeek.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaves' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaves.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\ReimbursementLine' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/ReimbursementLine.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\GrossEarningsHistory' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/GrossEarningsHistory.php', @@ -356,6 +372,7 @@ 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRun' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PayRun.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Reimbursements' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Reimbursements.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\BankAccount' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/BankAccount.php', + 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPatternsObject' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeWorkingPatternsObject.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsOrderObject' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsOrderObject.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Deductions' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Deductions.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\InvalidField' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/InvalidField.php', @@ -486,6 +503,7 @@ 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\ModelInterface' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/ModelInterface.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\SuperannuationContributionType' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperannuationContributionType.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\SuperFunds' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperFunds.php', + 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PaidLeaveEarningsLine' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PaidLeaveEarningsLine.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\TaxLine' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/TaxLine.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\SuperannuationLine' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperannuationLine.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\TaxDeclaration' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/TaxDeclaration.php', @@ -504,6 +522,7 @@ 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayRunStatus' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayRunStatus.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplication' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveApplication.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayTemplate' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayTemplate.php', + 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayOutType' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayOutType.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\CountryOfResidence' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/CountryOfResidence.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\TimesheetStatus' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/TimesheetStatus.php', 'Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\DeductionType' => $strauss_src . '/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/DeductionType.php', diff --git a/lib/packages/firebase/php-jwt/src/BeforeValidException.php b/lib/packages/firebase/php-jwt/src/BeforeValidException.php index f39463b..8a05006 100644 --- a/lib/packages/firebase/php-jwt/src/BeforeValidException.php +++ b/lib/packages/firebase/php-jwt/src/BeforeValidException.php @@ -2,7 +2,7 @@ /** * @license BSD-3-Clause * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/firebase/php-jwt/src/CachedKeySet.php b/lib/packages/firebase/php-jwt/src/CachedKeySet.php index cc00855..dd88c35 100644 --- a/lib/packages/firebase/php-jwt/src/CachedKeySet.php +++ b/lib/packages/firebase/php-jwt/src/CachedKeySet.php @@ -2,7 +2,7 @@ /** * @license BSD-3-Clause * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/firebase/php-jwt/src/ExpiredException.php b/lib/packages/firebase/php-jwt/src/ExpiredException.php index 9951d88..ad465d5 100644 --- a/lib/packages/firebase/php-jwt/src/ExpiredException.php +++ b/lib/packages/firebase/php-jwt/src/ExpiredException.php @@ -2,7 +2,7 @@ /** * @license BSD-3-Clause * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/firebase/php-jwt/src/JWK.php b/lib/packages/firebase/php-jwt/src/JWK.php index 1875574..6c87586 100644 --- a/lib/packages/firebase/php-jwt/src/JWK.php +++ b/lib/packages/firebase/php-jwt/src/JWK.php @@ -2,7 +2,7 @@ /** * @license BSD-3-Clause * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/firebase/php-jwt/src/JWT.php b/lib/packages/firebase/php-jwt/src/JWT.php index 03198e9..6ed7cd5 100644 --- a/lib/packages/firebase/php-jwt/src/JWT.php +++ b/lib/packages/firebase/php-jwt/src/JWT.php @@ -2,7 +2,7 @@ /** * @license BSD-3-Clause * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/firebase/php-jwt/src/JWTExceptionWithPayloadInterface.php b/lib/packages/firebase/php-jwt/src/JWTExceptionWithPayloadInterface.php index 087e342..dd95afb 100644 --- a/lib/packages/firebase/php-jwt/src/JWTExceptionWithPayloadInterface.php +++ b/lib/packages/firebase/php-jwt/src/JWTExceptionWithPayloadInterface.php @@ -2,7 +2,7 @@ /** * @license BSD-3-Clause * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ namespace Automattic\WooCommerce\Xero\Vendor\Firebase\JWT; diff --git a/lib/packages/firebase/php-jwt/src/Key.php b/lib/packages/firebase/php-jwt/src/Key.php index 8431efd..76bf181 100644 --- a/lib/packages/firebase/php-jwt/src/Key.php +++ b/lib/packages/firebase/php-jwt/src/Key.php @@ -2,7 +2,7 @@ /** * @license BSD-3-Clause * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/firebase/php-jwt/src/SignatureInvalidException.php b/lib/packages/firebase/php-jwt/src/SignatureInvalidException.php index 2c4126a..9a8fe6f 100644 --- a/lib/packages/firebase/php-jwt/src/SignatureInvalidException.php +++ b/lib/packages/firebase/php-jwt/src/SignatureInvalidException.php @@ -2,7 +2,7 @@ /** * @license BSD-3-Clause * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/guzzle/src/BodySummarizer.php b/lib/packages/guzzlehttp/guzzle/src/BodySummarizer.php index e97dccf..69e975b 100644 --- a/lib/packages/guzzlehttp/guzzle/src/BodySummarizer.php +++ b/lib/packages/guzzlehttp/guzzle/src/BodySummarizer.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -17,7 +17,7 @@ final class BodySummarizer implements BodySummarizerInterface */ private $truncateAt; - public function __construct(int $truncateAt = null) + public function __construct(?int $truncateAt = null) { $this->truncateAt = $truncateAt; } @@ -28,7 +28,7 @@ public function __construct(int $truncateAt = null) public function summarize(MessageInterface $message): ?string { return $this->truncateAt === null - ? \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Message::bodySummary($message) - : \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Message::bodySummary($message, $this->truncateAt); + ? Psr7\Message::bodySummary($message) + : Psr7\Message::bodySummary($message, $this->truncateAt); } } diff --git a/lib/packages/guzzlehttp/guzzle/src/BodySummarizerInterface.php b/lib/packages/guzzlehttp/guzzle/src/BodySummarizerInterface.php index f40f480..e6c86a7 100644 --- a/lib/packages/guzzlehttp/guzzle/src/BodySummarizerInterface.php +++ b/lib/packages/guzzlehttp/guzzle/src/BodySummarizerInterface.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/guzzle/src/Client.php b/lib/packages/guzzlehttp/guzzle/src/Client.php index 5a015cb..5260414 100644 --- a/lib/packages/guzzlehttp/guzzle/src/Client.php +++ b/lib/packages/guzzlehttp/guzzle/src/Client.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -58,7 +58,7 @@ class Client implements ClientInterface, \Psr\Http\Client\ClientInterface * * @param array $config Client configuration settings. * - * @see \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\RequestOptions for a list of available request options. + * @see RequestOptions for a list of available request options. */ public function __construct(array $config = []) { @@ -208,7 +208,7 @@ public function request(string $method, $uri = '', array $options = []): Respons * * @deprecated Client::getConfig will be removed in guzzlehttp/guzzle:8.0. */ - public function getConfig(string $option = null) + public function getConfig(?string $option = null) { return $option === null ? $this->config diff --git a/lib/packages/guzzlehttp/guzzle/src/ClientInterface.php b/lib/packages/guzzlehttp/guzzle/src/ClientInterface.php index c4c4ab9..b48bdfd 100644 --- a/lib/packages/guzzlehttp/guzzle/src/ClientInterface.php +++ b/lib/packages/guzzlehttp/guzzle/src/ClientInterface.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -86,5 +86,5 @@ public function requestAsync(string $method, $uri, array $options = []): Promise * * @deprecated ClientInterface::getConfig will be removed in guzzlehttp/guzzle:8.0. */ - public function getConfig(string $option = null); + public function getConfig(?string $option = null); } diff --git a/lib/packages/guzzlehttp/guzzle/src/ClientTrait.php b/lib/packages/guzzlehttp/guzzle/src/ClientTrait.php index 11cb1d4..ca990f3 100644 --- a/lib/packages/guzzlehttp/guzzle/src/ClientTrait.php +++ b/lib/packages/guzzlehttp/guzzle/src/ClientTrait.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/guzzle/src/Cookie/CookieJar.php b/lib/packages/guzzlehttp/guzzle/src/Cookie/CookieJar.php index f435699..f3c18e0 100644 --- a/lib/packages/guzzlehttp/guzzle/src/Cookie/CookieJar.php +++ b/lib/packages/guzzlehttp/guzzle/src/Cookie/CookieJar.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -109,7 +109,7 @@ public function toArray(): array }, $this->getIterator()->getArrayCopy()); } - public function clear(string $domain = null, string $path = null, string $name = null): void + public function clear(?string $domain = null, ?string $path = null, ?string $name = null): void { if (!$domain) { $this->cookies = []; diff --git a/lib/packages/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php b/lib/packages/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php index 9401379..d79d0c0 100644 --- a/lib/packages/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php +++ b/lib/packages/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -68,7 +68,7 @@ public function setCookie(SetCookie $cookie): bool; * @param string|null $path Clears cookies matching a domain and path * @param string|null $name Clears cookies matching a domain, path, and name */ - public function clear(string $domain = null, string $path = null, string $name = null): void; + public function clear(?string $domain = null, ?string $path = null, ?string $name = null): void; /** * Discard all sessions cookies. diff --git a/lib/packages/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php b/lib/packages/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php index a59ec76..45bf0fb 100644 --- a/lib/packages/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php +++ b/lib/packages/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php b/lib/packages/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php index 025444c..142d47b 100644 --- a/lib/packages/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php +++ b/lib/packages/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/guzzle/src/Cookie/SetCookie.php b/lib/packages/guzzlehttp/guzzle/src/Cookie/SetCookie.php index b06affc..816edb8 100644 --- a/lib/packages/guzzlehttp/guzzle/src/Cookie/SetCookie.php +++ b/lib/packages/guzzlehttp/guzzle/src/Cookie/SetCookie.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/guzzle/src/Exception/BadResponseException.php b/lib/packages/guzzlehttp/guzzle/src/Exception/BadResponseException.php index acf27d0..19fb667 100644 --- a/lib/packages/guzzlehttp/guzzle/src/Exception/BadResponseException.php +++ b/lib/packages/guzzlehttp/guzzle/src/Exception/BadResponseException.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -20,7 +20,7 @@ public function __construct( string $message, RequestInterface $request, ResponseInterface $response, - \Throwable $previous = null, + ?\Throwable $previous = null, array $handlerContext = [] ) { parent::__construct($message, $request, $response, $previous, $handlerContext); diff --git a/lib/packages/guzzlehttp/guzzle/src/Exception/ClientException.php b/lib/packages/guzzlehttp/guzzle/src/Exception/ClientException.php index 0783518..d4d6816 100644 --- a/lib/packages/guzzlehttp/guzzle/src/Exception/ClientException.php +++ b/lib/packages/guzzlehttp/guzzle/src/Exception/ClientException.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/guzzle/src/Exception/ConnectException.php b/lib/packages/guzzlehttp/guzzle/src/Exception/ConnectException.php index 5d5f503..00b2bd9 100644 --- a/lib/packages/guzzlehttp/guzzle/src/Exception/ConnectException.php +++ b/lib/packages/guzzlehttp/guzzle/src/Exception/ConnectException.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -31,7 +31,7 @@ class ConnectException extends TransferException implements NetworkExceptionInte public function __construct( string $message, RequestInterface $request, - \Throwable $previous = null, + ?\Throwable $previous = null, array $handlerContext = [] ) { parent::__construct($message, 0, $previous); diff --git a/lib/packages/guzzlehttp/guzzle/src/Exception/GuzzleException.php b/lib/packages/guzzlehttp/guzzle/src/Exception/GuzzleException.php index 5d6b7b2..950a20e 100644 --- a/lib/packages/guzzlehttp/guzzle/src/Exception/GuzzleException.php +++ b/lib/packages/guzzlehttp/guzzle/src/Exception/GuzzleException.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/guzzle/src/Exception/InvalidArgumentException.php b/lib/packages/guzzlehttp/guzzle/src/Exception/InvalidArgumentException.php index eedc91c..d50f190 100644 --- a/lib/packages/guzzlehttp/guzzle/src/Exception/InvalidArgumentException.php +++ b/lib/packages/guzzlehttp/guzzle/src/Exception/InvalidArgumentException.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/guzzle/src/Exception/RequestException.php b/lib/packages/guzzlehttp/guzzle/src/Exception/RequestException.php index 7405c89..31bb296 100644 --- a/lib/packages/guzzlehttp/guzzle/src/Exception/RequestException.php +++ b/lib/packages/guzzlehttp/guzzle/src/Exception/RequestException.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -13,7 +13,6 @@ use Psr\Http\Client\RequestExceptionInterface; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; -use Psr\Http\Message\UriInterface; /** * HTTP Request exception @@ -38,8 +37,8 @@ class RequestException extends TransferException implements RequestExceptionInte public function __construct( string $message, RequestInterface $request, - ResponseInterface $response = null, - \Throwable $previous = null, + ?ResponseInterface $response = null, + ?\Throwable $previous = null, array $handlerContext = [] ) { // Set the code of the exception if the response is set and not future. @@ -69,10 +68,10 @@ public static function wrapException(RequestInterface $request, \Throwable $e): */ public static function create( RequestInterface $request, - ResponseInterface $response = null, - \Throwable $previous = null, + ?ResponseInterface $response = null, + ?\Throwable $previous = null, array $handlerContext = [], - BodySummarizerInterface $bodySummarizer = null + ?BodySummarizerInterface $bodySummarizer = null ): self { if (!$response) { return new self( @@ -96,8 +95,7 @@ public static function create( $className = __CLASS__; } - $uri = $request->getUri(); - $uri = static::obfuscateUri($uri); + $uri = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Utils::redactUserInfo($request->getUri()); // Client Error: `GET /` resulted in a `404 Not Found` response: // ... (truncated) @@ -119,20 +117,6 @@ public static function create( return new $className($message, $request, $response, $previous, $handlerContext); } - /** - * Obfuscates URI if there is a username and a password present - */ - private static function obfuscateUri(UriInterface $uri): UriInterface - { - $userInfo = $uri->getUserInfo(); - - if (false !== ($pos = \strpos($userInfo, ':'))) { - return $uri->withUserInfo(\substr($userInfo, 0, $pos), '***'); - } - - return $uri; - } - /** * Get the request that caused the exception */ diff --git a/lib/packages/guzzlehttp/guzzle/src/Exception/ServerException.php b/lib/packages/guzzlehttp/guzzle/src/Exception/ServerException.php index 9734a18..a2a7463 100644 --- a/lib/packages/guzzlehttp/guzzle/src/Exception/ServerException.php +++ b/lib/packages/guzzlehttp/guzzle/src/Exception/ServerException.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php b/lib/packages/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php index 718d675..daccde8 100644 --- a/lib/packages/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php +++ b/lib/packages/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/guzzle/src/Exception/TransferException.php b/lib/packages/guzzlehttp/guzzle/src/Exception/TransferException.php index e97c1a0..79bb0b7 100644 --- a/lib/packages/guzzlehttp/guzzle/src/Exception/TransferException.php +++ b/lib/packages/guzzlehttp/guzzle/src/Exception/TransferException.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/guzzle/src/Handler/CurlFactory.php b/lib/packages/guzzlehttp/guzzle/src/Handler/CurlFactory.php index 3509442..f61a0ca 100644 --- a/lib/packages/guzzlehttp/guzzle/src/Handler/CurlFactory.php +++ b/lib/packages/guzzlehttp/guzzle/src/Handler/CurlFactory.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -17,6 +17,7 @@ use Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\TransferStats; use Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Utils; use Psr\Http\Message\RequestInterface; +use Psr\Http\Message\UriInterface; /** * Creates curl resources from a request @@ -52,6 +53,16 @@ public function __construct(int $maxHandles) public function create(RequestInterface $request, array $options): EasyHandle { + $protocolVersion = $request->getProtocolVersion(); + + if ('2' === $protocolVersion || '2.0' === $protocolVersion) { + if (!self::supportsHttp2()) { + throw new ConnectException('HTTP/2 is supported by the cURL handler, however libcurl is built without HTTP/2 support.', $request); + } + } elseif ('1.0' !== $protocolVersion && '1.1' !== $protocolVersion) { + throw new ConnectException(sprintf('HTTP/%s is not supported by the cURL handler.', $protocolVersion), $request); + } + if (isset($options['curl']['body_as_string'])) { $options['_body_as_string'] = $options['curl']['body_as_string']; unset($options['curl']['body_as_string']); @@ -78,6 +89,42 @@ public function create(RequestInterface $request, array $options): EasyHandle return $easy; } + private static function supportsHttp2(): bool + { + static $supportsHttp2 = null; + + if (null === $supportsHttp2) { + $supportsHttp2 = self::supportsTls12() + && defined('CURL_VERSION_HTTP2') + && (\CURL_VERSION_HTTP2 & \curl_version()['features']); + } + + return $supportsHttp2; + } + + private static function supportsTls12(): bool + { + static $supportsTls12 = null; + + if (null === $supportsTls12) { + $supportsTls12 = \CURL_SSLVERSION_TLSv1_2 & \curl_version()['features']; + } + + return $supportsTls12; + } + + private static function supportsTls13(): bool + { + static $supportsTls13 = null; + + if (null === $supportsTls13) { + $supportsTls13 = defined('CURL_SSLVERSION_TLSv1_3') + && (\CURL_SSLVERSION_TLSv1_3 & \curl_version()['features']); + } + + return $supportsTls13; + } + public function release(EasyHandle $easy): void { $resource = $easy->handle; @@ -153,7 +200,7 @@ private static function finishError(callable $handler, EasyHandle $easy, CurlFac 'error' => \curl_error($easy->handle), 'appconnect_time' => \curl_getinfo($easy->handle, \CURLINFO_APPCONNECT_TIME), ] + \curl_getinfo($easy->handle); - $ctx[self::CURL_VERSION_STR] = \curl_version()['version']; + $ctx[self::CURL_VERSION_STR] = self::getCurlVersion(); $factory->release($easy); // Retry when nothing is present or when curl failed to rewind. @@ -164,6 +211,17 @@ private static function finishError(callable $handler, EasyHandle $easy, CurlFac return self::createRejection($easy, $ctx); } + private static function getCurlVersion(): string + { + static $curlVersion = null; + + if (null === $curlVersion) { + $curlVersion = \curl_version()['version']; + } + + return $curlVersion; + } + private static function createRejection(EasyHandle $easy, array $ctx): PromiseInterface { static $connectionErrors = [ @@ -200,15 +258,22 @@ private static function createRejection(EasyHandle $easy, array $ctx): PromiseIn ); } + $uri = $easy->request->getUri(); + + $sanitizedError = self::sanitizeCurlError($ctx['error'] ?? '', $uri); + $message = \sprintf( 'cURL error %s: %s (%s)', $ctx['errno'], - $ctx['error'], + $sanitizedError, 'see https://curl.haxx.se/libcurl/c/libcurl-errors.html' ); - $uriString = (string) $easy->request->getUri(); - if ($uriString !== '' && false === \strpos($ctx['error'], $uriString)) { - $message .= \sprintf(' for %s', $uriString); + + if ('' !== $sanitizedError) { + $redactedUriString = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Utils::redactUserInfo($uri)->__toString(); + if ($redactedUriString !== '' && false === \strpos($sanitizedError, $redactedUriString)) { + $message .= \sprintf(' for %s', $redactedUriString); + } } // Create a connection exception if it was a specific error code. @@ -219,6 +284,24 @@ private static function createRejection(EasyHandle $easy, array $ctx): PromiseIn return P\Create::rejectionFor($error); } + private static function sanitizeCurlError(string $error, UriInterface $uri): string + { + if ('' === $error) { + return $error; + } + + $baseUri = $uri->withQuery('')->withFragment(''); + $baseUriString = $baseUri->__toString(); + + if ('' === $baseUriString) { + return $error; + } + + $redactedUriString = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Utils::redactUserInfo($baseUri)->__toString(); + + return str_replace($baseUriString, $redactedUriString, $error); + } + /** * @return array */ @@ -238,10 +321,11 @@ private function getDefaultConf(EasyHandle $easy): array } $version = $easy->request->getProtocolVersion(); - if ($version == 1.1) { - $conf[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_1_1; - } elseif ($version == 2.0) { + + if ('2' === $version || '2.0' === $version) { $conf[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_2_0; + } elseif ('1.1' === $version) { + $conf[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_1_1; } else { $conf[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_1_0; } @@ -396,8 +480,10 @@ private function applyHandlerOptions(EasyHandle $easy, array &$conf): void // The empty string enables all available decoders and implicitly // sets a matching 'Accept-Encoding' header. $conf[\CURLOPT_ENCODING] = ''; - // But as the user did not specify any acceptable encodings we need - // to overwrite this implicit header with an empty one. + // But as the user did not specify any encoding preference, + // let's leave it up to server by preventing curl from sending + // the header, which will be interpreted as 'Accept-Encoding: *'. + // https://www.rfc-editor.org/rfc/rfc9110#field.accept-encoding $conf[\CURLOPT_HTTPHEADER][] = 'Accept-Encoding:'; } } @@ -461,23 +547,35 @@ private function applyHandlerOptions(EasyHandle $easy, array &$conf): void } if (isset($options['crypto_method'])) { - if (\STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT === $options['crypto_method']) { - if (!defined('CURL_SSLVERSION_TLSv1_0')) { - throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.0 not supported by your version of cURL'); + $protocolVersion = $easy->request->getProtocolVersion(); + + // If HTTP/2, upgrade TLS 1.0 and 1.1 to 1.2 + if ('2' === $protocolVersion || '2.0' === $protocolVersion) { + if ( + \STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT === $options['crypto_method'] + || \STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT === $options['crypto_method'] + || \STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT === $options['crypto_method'] + ) { + $conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_2; + } elseif (defined('STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT') && \STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT === $options['crypto_method']) { + if (!self::supportsTls13()) { + throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.3 not supported by your version of cURL'); + } + $conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_3; + } else { + throw new \InvalidArgumentException('Invalid crypto_method request option: unknown version provided'); } + } elseif (\STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT === $options['crypto_method']) { $conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_0; } elseif (\STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT === $options['crypto_method']) { - if (!defined('CURL_SSLVERSION_TLSv1_1')) { - throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.1 not supported by your version of cURL'); - } $conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_1; } elseif (\STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT === $options['crypto_method']) { - if (!defined('CURL_SSLVERSION_TLSv1_2')) { + if (!self::supportsTls12()) { throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.2 not supported by your version of cURL'); } $conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_2; } elseif (defined('STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT') && \STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT === $options['crypto_method']) { - if (!defined('CURL_SSLVERSION_TLSv1_3')) { + if (!self::supportsTls13()) { throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.3 not supported by your version of cURL'); } $conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_3; diff --git a/lib/packages/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php b/lib/packages/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php index 0bf81e9..59f3172 100644 --- a/lib/packages/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php +++ b/lib/packages/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/guzzle/src/Handler/CurlHandler.php b/lib/packages/guzzlehttp/guzzle/src/Handler/CurlHandler.php index 09d0c75..9d81488 100644 --- a/lib/packages/guzzlehttp/guzzle/src/Handler/CurlHandler.php +++ b/lib/packages/guzzlehttp/guzzle/src/Handler/CurlHandler.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php b/lib/packages/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php index 08abde5..7783f46 100644 --- a/lib/packages/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php +++ b/lib/packages/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php @@ -2,12 +2,13 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ namespace Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Handler; +use Closure; use Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise as P; use Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\Promise; use Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface; @@ -165,6 +166,9 @@ public function tick(): void } } + // Run curl_multi_exec in the queue to enable other async tasks to run + P\Utils::queue()->add(Closure::fromCallable([$this, 'tickInQueue'])); + // Step through the task queue which may add additional requests. P\Utils::queue()->run(); @@ -175,11 +179,24 @@ public function tick(): void } while (\curl_multi_exec($this->_mh, $this->active) === \CURLM_CALL_MULTI_PERFORM) { + // Prevent busy looping for slow HTTP requests. + \curl_multi_select($this->_mh, $this->selectTimeout); } $this->processMessages(); } + /** + * Runs \curl_multi_exec() inside the event loop, to prevent busy looping + */ + private function tickInQueue(): void + { + if (\curl_multi_exec($this->_mh, $this->active) === \CURLM_CALL_MULTI_PERFORM) { + \curl_multi_select($this->_mh, 0); + P\Utils::queue()->add(Closure::fromCallable([$this, 'tickInQueue'])); + } + } + /** * Runs until all outstanding connections have completed. */ diff --git a/lib/packages/guzzlehttp/guzzle/src/Handler/EasyHandle.php b/lib/packages/guzzlehttp/guzzle/src/Handler/EasyHandle.php index 8a8debe..66d54fd 100644 --- a/lib/packages/guzzlehttp/guzzle/src/Handler/EasyHandle.php +++ b/lib/packages/guzzlehttp/guzzle/src/Handler/EasyHandle.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php b/lib/packages/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php index 934a674..f4cd22c 100644 --- a/lib/packages/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php +++ b/lib/packages/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/guzzle/src/Handler/MockHandler.php b/lib/packages/guzzlehttp/guzzle/src/Handler/MockHandler.php index 31ea99f..553a9cc 100644 --- a/lib/packages/guzzlehttp/guzzle/src/Handler/MockHandler.php +++ b/lib/packages/guzzlehttp/guzzle/src/Handler/MockHandler.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -58,21 +58,21 @@ class MockHandler implements \Countable * @param callable|null $onFulfilled Callback to invoke when the return value is fulfilled. * @param callable|null $onRejected Callback to invoke when the return value is rejected. */ - public static function createWithMiddleware(array $queue = null, callable $onFulfilled = null, callable $onRejected = null): HandlerStack + public static function createWithMiddleware(?array $queue = null, ?callable $onFulfilled = null, ?callable $onRejected = null): HandlerStack { return HandlerStack::create(new self($queue, $onFulfilled, $onRejected)); } /** * The passed in value must be an array of - * {@see \Psr\Http\Message\ResponseInterface} objects, Exceptions, + * {@see ResponseInterface} objects, Exceptions, * callables, or Promises. * * @param array|null $queue The parameters to be passed to the append function, as an indexed array. * @param callable|null $onFulfilled Callback to invoke when the return value is fulfilled. * @param callable|null $onRejected Callback to invoke when the return value is rejected. */ - public function __construct(array $queue = null, callable $onFulfilled = null, callable $onRejected = null) + public function __construct(?array $queue = null, ?callable $onFulfilled = null, ?callable $onRejected = null) { $this->onFulfilled = $onFulfilled; $this->onRejected = $onRejected; @@ -206,7 +206,7 @@ public function reset(): void private function invokeStats( RequestInterface $request, array $options, - ResponseInterface $response = null, + ?ResponseInterface $response = null, $reason = null ): void { if (isset($options['on_stats'])) { diff --git a/lib/packages/guzzlehttp/guzzle/src/Handler/Proxy.php b/lib/packages/guzzlehttp/guzzle/src/Handler/Proxy.php index 28289dc..f17b7a5 100644 --- a/lib/packages/guzzlehttp/guzzle/src/Handler/Proxy.php +++ b/lib/packages/guzzlehttp/guzzle/src/Handler/Proxy.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/guzzle/src/Handler/StreamHandler.php b/lib/packages/guzzlehttp/guzzle/src/Handler/StreamHandler.php index c889bb3..27f1db5 100644 --- a/lib/packages/guzzlehttp/guzzle/src/Handler/StreamHandler.php +++ b/lib/packages/guzzlehttp/guzzle/src/Handler/StreamHandler.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -46,6 +46,12 @@ public function __invoke(RequestInterface $request, array $options): PromiseInte \usleep($options['delay'] * 1000); } + $protocolVersion = $request->getProtocolVersion(); + + if ('1.0' !== $protocolVersion && '1.1' !== $protocolVersion) { + throw new ConnectException(sprintf('HTTP/%s is not supported by the stream handler.', $protocolVersion), $request); + } + $startTime = isset($options['on_stats']) ? Utils::currentTime() : null; try { @@ -89,8 +95,8 @@ private function invokeStats( array $options, RequestInterface $request, ?float $startTime, - ResponseInterface $response = null, - \Throwable $error = null + ?ResponseInterface $response = null, + ?\Throwable $error = null ): void { if (isset($options['on_stats'])) { $stats = new TransferStats($request, $response, Utils::currentTime() - $startTime, $error, []); @@ -279,7 +285,7 @@ private function createStream(RequestInterface $request, array $options) // HTTP/1.1 streams using the PHP stream wrapper require a // Connection: close header - if ($request->getProtocolVersion() == '1.1' + if ($request->getProtocolVersion() === '1.1' && !$request->hasHeader('Connection') ) { $request = $request->withHeader('Connection', 'close'); diff --git a/lib/packages/guzzlehttp/guzzle/src/HandlerStack.php b/lib/packages/guzzlehttp/guzzle/src/HandlerStack.php index ac7f61b..2e3ea92 100644 --- a/lib/packages/guzzlehttp/guzzle/src/HandlerStack.php +++ b/lib/packages/guzzlehttp/guzzle/src/HandlerStack.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -50,7 +50,7 @@ class HandlerStack * handler is provided, the best handler for your * system will be utilized. */ - public static function create(callable $handler = null): self + public static function create(?callable $handler = null): self { $stack = new self($handler ?: Utils::chooseHandler()); $stack->push(Middleware::httpErrors(), 'http_errors'); @@ -64,7 +64,7 @@ public static function create(callable $handler = null): self /** * @param (callable(RequestInterface, array): PromiseInterface)|null $handler Underlying HTTP handler. */ - public function __construct(callable $handler = null) + public function __construct(?callable $handler = null) { $this->handler = $handler; } @@ -137,7 +137,7 @@ public function hasHandler(): bool * @param callable(callable): callable $middleware Middleware function * @param string $name Name to register for this middleware. */ - public function unshift(callable $middleware, string $name = null): void + public function unshift(callable $middleware, ?string $name = null): void { \array_unshift($this->stack, [$middleware, $name]); $this->cached = null; diff --git a/lib/packages/guzzlehttp/guzzle/src/MessageFormatter.php b/lib/packages/guzzlehttp/guzzle/src/MessageFormatter.php index 42e5d94..b560acf 100644 --- a/lib/packages/guzzlehttp/guzzle/src/MessageFormatter.php +++ b/lib/packages/guzzlehttp/guzzle/src/MessageFormatter.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -74,7 +74,7 @@ public function __construct(?string $template = self::CLF) * @param ResponseInterface|null $response Response that was received * @param \Throwable|null $error Exception that was received */ - public function format(RequestInterface $request, ResponseInterface $response = null, \Throwable $error = null): string + public function format(RequestInterface $request, ?ResponseInterface $response = null, ?\Throwable $error = null): string { $cache = []; diff --git a/lib/packages/guzzlehttp/guzzle/src/MessageFormatterInterface.php b/lib/packages/guzzlehttp/guzzle/src/MessageFormatterInterface.php index 881cd9c..2dfe34d 100644 --- a/lib/packages/guzzlehttp/guzzle/src/MessageFormatterInterface.php +++ b/lib/packages/guzzlehttp/guzzle/src/MessageFormatterInterface.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -20,5 +20,5 @@ interface MessageFormatterInterface * @param ResponseInterface|null $response Response that was received * @param \Throwable|null $error Exception that was received */ - public function format(RequestInterface $request, ResponseInterface $response = null, \Throwable $error = null): string; + public function format(RequestInterface $request, ?ResponseInterface $response = null, ?\Throwable $error = null): string; } diff --git a/lib/packages/guzzlehttp/guzzle/src/Middleware.php b/lib/packages/guzzlehttp/guzzle/src/Middleware.php index 394c5c6..82fd1b8 100644 --- a/lib/packages/guzzlehttp/guzzle/src/Middleware.php +++ b/lib/packages/guzzlehttp/guzzle/src/Middleware.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -61,7 +61,7 @@ static function (ResponseInterface $response) use ($cookieJar, $request): Respon * * @return callable(callable): callable Returns a function that accepts the next handler. */ - public static function httpErrors(BodySummarizerInterface $bodySummarizer = null): callable + public static function httpErrors(?BodySummarizerInterface $bodySummarizer = null): callable { return static function (callable $handler) use ($bodySummarizer): callable { return static function ($request, array $options) use ($handler, $bodySummarizer) { @@ -138,7 +138,7 @@ static function ($reason) use ($request, &$container, $options) { * * @return callable Returns a function that accepts the next handler. */ - public static function tap(callable $before = null, callable $after = null): callable + public static function tap(?callable $before = null, ?callable $after = null): callable { return static function (callable $handler) use ($before, $after): callable { return static function (RequestInterface $request, array $options) use ($handler, $before, $after) { @@ -182,7 +182,7 @@ public static function redirect(): callable * * @return callable Returns a function that accepts the next handler. */ - public static function retry(callable $decider, callable $delay = null): callable + public static function retry(callable $decider, ?callable $delay = null): callable { return static function (callable $handler) use ($decider, $delay): RetryMiddleware { return new RetryMiddleware($decider, $handler, $delay); diff --git a/lib/packages/guzzlehttp/guzzle/src/Pool.php b/lib/packages/guzzlehttp/guzzle/src/Pool.php index d628c29..83edd91 100644 --- a/lib/packages/guzzlehttp/guzzle/src/Pool.php +++ b/lib/packages/guzzlehttp/guzzle/src/Pool.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php b/lib/packages/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php index 2925e98..c6e4a52 100644 --- a/lib/packages/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php +++ b/lib/packages/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -82,8 +82,8 @@ private function addExpectHeader(RequestInterface $request, array $options, arra $expect = $options['expect'] ?? null; - // Return if disabled or if you're not using HTTP/1.1 or HTTP/2.0 - if ($expect === false || $request->getProtocolVersion() < 1.1) { + // Return if disabled or using HTTP/1.0 + if ($expect === false || $request->getProtocolVersion() === '1.0') { return; } diff --git a/lib/packages/guzzlehttp/guzzle/src/RedirectMiddleware.php b/lib/packages/guzzlehttp/guzzle/src/RedirectMiddleware.php index 1132a0a..3af4a71 100644 --- a/lib/packages/guzzlehttp/guzzle/src/RedirectMiddleware.php +++ b/lib/packages/guzzlehttp/guzzle/src/RedirectMiddleware.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/guzzle/src/RequestOptions.php b/lib/packages/guzzlehttp/guzzle/src/RequestOptions.php index f105c58..e7c9b2b 100644 --- a/lib/packages/guzzlehttp/guzzle/src/RequestOptions.php +++ b/lib/packages/guzzlehttp/guzzle/src/RequestOptions.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -67,7 +67,7 @@ final class RequestOptions * Specifies whether or not cookies are used in a request or what cookie * jar to use or what cookies to send. This option only works if your * handler has the `cookie` middleware. Valid values are `false` and - * an instance of {@see \GuzzleHttp\Cookie\CookieJarInterface}. + * an instance of {@see Cookie\CookieJarInterface}. */ public const COOKIES = 'cookies'; diff --git a/lib/packages/guzzlehttp/guzzle/src/RetryMiddleware.php b/lib/packages/guzzlehttp/guzzle/src/RetryMiddleware.php index 32894d8..aa67ff8 100644 --- a/lib/packages/guzzlehttp/guzzle/src/RetryMiddleware.php +++ b/lib/packages/guzzlehttp/guzzle/src/RetryMiddleware.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -46,7 +46,7 @@ class RetryMiddleware * and returns the number of * milliseconds to delay. */ - public function __construct(callable $decider, callable $nextHandler, callable $delay = null) + public function __construct(callable $decider, callable $nextHandler, ?callable $delay = null) { $this->decider = $decider; $this->nextHandler = $nextHandler; @@ -116,7 +116,7 @@ private function onRejected(RequestInterface $req, array $options): callable }; } - private function doRetry(RequestInterface $request, array $options, ResponseInterface $response = null): PromiseInterface + private function doRetry(RequestInterface $request, array $options, ?ResponseInterface $response = null): PromiseInterface { $options['delay'] = ($this->delay)(++$options['retries'], $response, $request); diff --git a/lib/packages/guzzlehttp/guzzle/src/TransferStats.php b/lib/packages/guzzlehttp/guzzle/src/TransferStats.php index acef77b..248d6c1 100644 --- a/lib/packages/guzzlehttp/guzzle/src/TransferStats.php +++ b/lib/packages/guzzlehttp/guzzle/src/TransferStats.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -52,8 +52,8 @@ final class TransferStats */ public function __construct( RequestInterface $request, - ResponseInterface $response = null, - float $transferTime = null, + ?ResponseInterface $response = null, + ?float $transferTime = null, $handlerErrorData = null, array $handlerStats = [] ) { diff --git a/lib/packages/guzzlehttp/guzzle/src/Utils.php b/lib/packages/guzzlehttp/guzzle/src/Utils.php index b472ff9..24ee488 100644 --- a/lib/packages/guzzlehttp/guzzle/src/Utils.php +++ b/lib/packages/guzzlehttp/guzzle/src/Utils.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -77,7 +77,7 @@ public static function debugResource($value = null) return \STDOUT; } - return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Utils::tryFopen('php://output', 'w'); + return Psr7\Utils::tryFopen('php://output', 'w'); } /** @@ -93,7 +93,7 @@ public static function chooseHandler(): callable { $handler = null; - if (\defined('CURLOPT_CUSTOMREQUEST')) { + if (\defined('CURLOPT_CUSTOMREQUEST') && \function_exists('curl_version') && version_compare(curl_version()['version'], '7.21.2') >= 0) { if (\function_exists('curl_multi_exec') && \function_exists('curl_exec')) { $handler = Proxy::wrapSync(new CurlMultiHandler(), new CurlHandler()); } elseif (\function_exists('curl_exec')) { diff --git a/lib/packages/guzzlehttp/guzzle/src/functions.php b/lib/packages/guzzlehttp/guzzle/src/functions.php index 5385db4..129a0cf 100644 --- a/lib/packages/guzzlehttp/guzzle/src/functions.php +++ b/lib/packages/guzzlehttp/guzzle/src/functions.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/promises/src/AggregateException.php b/lib/packages/guzzlehttp/promises/src/AggregateException.php index d547d0a..9f251f5 100644 --- a/lib/packages/guzzlehttp/promises/src/AggregateException.php +++ b/lib/packages/guzzlehttp/promises/src/AggregateException.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/promises/src/CancellationException.php b/lib/packages/guzzlehttp/promises/src/CancellationException.php index 1128ec3..bda1637 100644 --- a/lib/packages/guzzlehttp/promises/src/CancellationException.php +++ b/lib/packages/guzzlehttp/promises/src/CancellationException.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/promises/src/Coroutine.php b/lib/packages/guzzlehttp/promises/src/Coroutine.php index 1a78bc8..63ba125 100644 --- a/lib/packages/guzzlehttp/promises/src/Coroutine.php +++ b/lib/packages/guzzlehttp/promises/src/Coroutine.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -90,8 +90,8 @@ public static function of(callable $generatorFn): self } public function then( - callable $onFulfilled = null, - callable $onRejected = null + ?callable $onFulfilled = null, + ?callable $onRejected = null ): PromiseInterface { return $this->result->then($onFulfilled, $onRejected); } diff --git a/lib/packages/guzzlehttp/promises/src/Create.php b/lib/packages/guzzlehttp/promises/src/Create.php index de5e439..1a26f5f 100644 --- a/lib/packages/guzzlehttp/promises/src/Create.php +++ b/lib/packages/guzzlehttp/promises/src/Create.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/promises/src/Each.php b/lib/packages/guzzlehttp/promises/src/Each.php index 900cb7f..d7b35bd 100644 --- a/lib/packages/guzzlehttp/promises/src/Each.php +++ b/lib/packages/guzzlehttp/promises/src/Each.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -29,8 +29,8 @@ final class Each */ public static function of( $iterable, - callable $onFulfilled = null, - callable $onRejected = null + ?callable $onFulfilled = null, + ?callable $onRejected = null ): PromiseInterface { return (new EachPromise($iterable, [ 'fulfilled' => $onFulfilled, @@ -52,8 +52,8 @@ public static function of( public static function ofLimit( $iterable, $concurrency, - callable $onFulfilled = null, - callable $onRejected = null + ?callable $onFulfilled = null, + ?callable $onRejected = null ): PromiseInterface { return (new EachPromise($iterable, [ 'fulfilled' => $onFulfilled, @@ -73,7 +73,7 @@ public static function ofLimit( public static function ofLimitAll( $iterable, $concurrency, - callable $onFulfilled = null + ?callable $onFulfilled = null ): PromiseInterface { return self::ofLimit( $iterable, diff --git a/lib/packages/guzzlehttp/promises/src/EachPromise.php b/lib/packages/guzzlehttp/promises/src/EachPromise.php index 85113a5..419c204 100644 --- a/lib/packages/guzzlehttp/promises/src/EachPromise.php +++ b/lib/packages/guzzlehttp/promises/src/EachPromise.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/promises/src/FulfilledPromise.php b/lib/packages/guzzlehttp/promises/src/FulfilledPromise.php index 4dde3cb..00612a2 100644 --- a/lib/packages/guzzlehttp/promises/src/FulfilledPromise.php +++ b/lib/packages/guzzlehttp/promises/src/FulfilledPromise.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -37,8 +37,8 @@ public function __construct($value) } public function then( - callable $onFulfilled = null, - callable $onRejected = null + ?callable $onFulfilled = null, + ?callable $onRejected = null ): PromiseInterface { // Return itself if there is no onFulfilled function. if (!$onFulfilled) { diff --git a/lib/packages/guzzlehttp/promises/src/Is.php b/lib/packages/guzzlehttp/promises/src/Is.php index 85a9829..afbabaf 100644 --- a/lib/packages/guzzlehttp/promises/src/Is.php +++ b/lib/packages/guzzlehttp/promises/src/Is.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/promises/src/Promise.php b/lib/packages/guzzlehttp/promises/src/Promise.php index 579d0b0..d719fbf 100644 --- a/lib/packages/guzzlehttp/promises/src/Promise.php +++ b/lib/packages/guzzlehttp/promises/src/Promise.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -31,16 +31,16 @@ class Promise implements PromiseInterface * @param callable $cancelFn Fn that when invoked cancels the promise. */ public function __construct( - callable $waitFn = null, - callable $cancelFn = null + ?callable $waitFn = null, + ?callable $cancelFn = null ) { $this->waitFn = $waitFn; $this->cancelFn = $cancelFn; } public function then( - callable $onFulfilled = null, - callable $onRejected = null + ?callable $onFulfilled = null, + ?callable $onRejected = null ): PromiseInterface { if ($this->state === self::PENDING) { $p = new Promise(null, [$this, 'cancel']); diff --git a/lib/packages/guzzlehttp/promises/src/PromiseInterface.php b/lib/packages/guzzlehttp/promises/src/PromiseInterface.php index 2398b00..3171abd 100644 --- a/lib/packages/guzzlehttp/promises/src/PromiseInterface.php +++ b/lib/packages/guzzlehttp/promises/src/PromiseInterface.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -33,8 +33,8 @@ interface PromiseInterface * @param callable $onRejected Invoked when the promise is rejected. */ public function then( - callable $onFulfilled = null, - callable $onRejected = null + ?callable $onFulfilled = null, + ?callable $onRejected = null ): PromiseInterface; /** diff --git a/lib/packages/guzzlehttp/promises/src/PromisorInterface.php b/lib/packages/guzzlehttp/promises/src/PromisorInterface.php index ef6b053..cecd3aa 100644 --- a/lib/packages/guzzlehttp/promises/src/PromisorInterface.php +++ b/lib/packages/guzzlehttp/promises/src/PromisorInterface.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/promises/src/RejectedPromise.php b/lib/packages/guzzlehttp/promises/src/RejectedPromise.php index 7f698f9..6a2d592 100644 --- a/lib/packages/guzzlehttp/promises/src/RejectedPromise.php +++ b/lib/packages/guzzlehttp/promises/src/RejectedPromise.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -37,8 +37,8 @@ public function __construct($reason) } public function then( - callable $onFulfilled = null, - callable $onRejected = null + ?callable $onFulfilled = null, + ?callable $onRejected = null ): PromiseInterface { // If there's no onRejected callback then just return self. if (!$onRejected) { diff --git a/lib/packages/guzzlehttp/promises/src/RejectionException.php b/lib/packages/guzzlehttp/promises/src/RejectionException.php index ddd2d08..c331f62 100644 --- a/lib/packages/guzzlehttp/promises/src/RejectionException.php +++ b/lib/packages/guzzlehttp/promises/src/RejectionException.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -24,7 +24,7 @@ class RejectionException extends \RuntimeException * @param mixed $reason Rejection reason. * @param string|null $description Optional description. */ - public function __construct($reason, string $description = null) + public function __construct($reason, ?string $description = null) { $this->reason = $reason; diff --git a/lib/packages/guzzlehttp/promises/src/TaskQueue.php b/lib/packages/guzzlehttp/promises/src/TaskQueue.php index c07007a..03448b9 100644 --- a/lib/packages/guzzlehttp/promises/src/TaskQueue.php +++ b/lib/packages/guzzlehttp/promises/src/TaskQueue.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/promises/src/TaskQueueInterface.php b/lib/packages/guzzlehttp/promises/src/TaskQueueInterface.php index 4efa25b..445366e 100644 --- a/lib/packages/guzzlehttp/promises/src/TaskQueueInterface.php +++ b/lib/packages/guzzlehttp/promises/src/TaskQueueInterface.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/promises/src/Utils.php b/lib/packages/guzzlehttp/promises/src/Utils.php index 49eaba6..30b7214 100644 --- a/lib/packages/guzzlehttp/promises/src/Utils.php +++ b/lib/packages/guzzlehttp/promises/src/Utils.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -27,7 +27,7 @@ final class Utils * * @param TaskQueueInterface|null $assign Optionally specify a new queue instance. */ - public static function queue(TaskQueueInterface $assign = null): TaskQueueInterface + public static function queue(?TaskQueueInterface $assign = null): TaskQueueInterface { static $queue; diff --git a/lib/packages/guzzlehttp/psr7/src/AppendStream.php b/lib/packages/guzzlehttp/psr7/src/AppendStream.php index 5234c8a..7d56d4a 100644 --- a/lib/packages/guzzlehttp/psr7/src/AppendStream.php +++ b/lib/packages/guzzlehttp/psr7/src/AppendStream.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/psr7/src/BufferStream.php b/lib/packages/guzzlehttp/psr7/src/BufferStream.php index 8d9cf94..a77acb8 100644 --- a/lib/packages/guzzlehttp/psr7/src/BufferStream.php +++ b/lib/packages/guzzlehttp/psr7/src/BufferStream.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/psr7/src/CachingStream.php b/lib/packages/guzzlehttp/psr7/src/CachingStream.php index 1d87c20..5d6c7fe 100644 --- a/lib/packages/guzzlehttp/psr7/src/CachingStream.php +++ b/lib/packages/guzzlehttp/psr7/src/CachingStream.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -39,7 +39,7 @@ final class CachingStream implements StreamInterface */ public function __construct( StreamInterface $stream, - StreamInterface $target = null + ?StreamInterface $target = null ) { $this->remoteStream = $stream; $this->stream = $target ?: new Stream(Utils::tryFopen('php://temp', 'r+')); diff --git a/lib/packages/guzzlehttp/psr7/src/DroppingStream.php b/lib/packages/guzzlehttp/psr7/src/DroppingStream.php index 95c4730..78a65b9 100644 --- a/lib/packages/guzzlehttp/psr7/src/DroppingStream.php +++ b/lib/packages/guzzlehttp/psr7/src/DroppingStream.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/psr7/src/Exception/MalformedUriException.php b/lib/packages/guzzlehttp/psr7/src/Exception/MalformedUriException.php index 5bf1c1e..e32fb2d 100644 --- a/lib/packages/guzzlehttp/psr7/src/Exception/MalformedUriException.php +++ b/lib/packages/guzzlehttp/psr7/src/Exception/MalformedUriException.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/psr7/src/FnStream.php b/lib/packages/guzzlehttp/psr7/src/FnStream.php index ea53f9d..983317e 100644 --- a/lib/packages/guzzlehttp/psr7/src/FnStream.php +++ b/lib/packages/guzzlehttp/psr7/src/FnStream.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/psr7/src/Header.php b/lib/packages/guzzlehttp/psr7/src/Header.php index 20c041f..28a0a10 100644 --- a/lib/packages/guzzlehttp/psr7/src/Header.php +++ b/lib/packages/guzzlehttp/psr7/src/Header.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/psr7/src/HttpFactory.php b/lib/packages/guzzlehttp/psr7/src/HttpFactory.php index d85c186..0cc4c4c 100644 --- a/lib/packages/guzzlehttp/psr7/src/HttpFactory.php +++ b/lib/packages/guzzlehttp/psr7/src/HttpFactory.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -33,10 +33,10 @@ final class HttpFactory implements RequestFactoryInterface, ResponseFactoryInter { public function createUploadedFile( StreamInterface $stream, - int $size = null, + ?int $size = null, int $error = \UPLOAD_ERR_OK, - string $clientFilename = null, - string $clientMediaType = null + ?string $clientFilename = null, + ?string $clientMediaType = null ): UploadedFileInterface { if ($size === null) { $size = $stream->getSize(); diff --git a/lib/packages/guzzlehttp/psr7/src/InflateStream.php b/lib/packages/guzzlehttp/psr7/src/InflateStream.php index f1d23b9..0670b39 100644 --- a/lib/packages/guzzlehttp/psr7/src/InflateStream.php +++ b/lib/packages/guzzlehttp/psr7/src/InflateStream.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/psr7/src/LazyOpenStream.php b/lib/packages/guzzlehttp/psr7/src/LazyOpenStream.php index 177cde4..94da4af 100644 --- a/lib/packages/guzzlehttp/psr7/src/LazyOpenStream.php +++ b/lib/packages/guzzlehttp/psr7/src/LazyOpenStream.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/psr7/src/LimitStream.php b/lib/packages/guzzlehttp/psr7/src/LimitStream.php index 60a1927..46885c8 100644 --- a/lib/packages/guzzlehttp/psr7/src/LimitStream.php +++ b/lib/packages/guzzlehttp/psr7/src/LimitStream.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/psr7/src/Message.php b/lib/packages/guzzlehttp/psr7/src/Message.php index 4564c5e..d569dc2 100644 --- a/lib/packages/guzzlehttp/psr7/src/Message.php +++ b/lib/packages/guzzlehttp/psr7/src/Message.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/psr7/src/MessageTrait.php b/lib/packages/guzzlehttp/psr7/src/MessageTrait.php index 5b33d76..804584b 100644 --- a/lib/packages/guzzlehttp/psr7/src/MessageTrait.php +++ b/lib/packages/guzzlehttp/psr7/src/MessageTrait.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/psr7/src/MimeType.php b/lib/packages/guzzlehttp/psr7/src/MimeType.php index e31fd80..3137a40 100644 --- a/lib/packages/guzzlehttp/psr7/src/MimeType.php +++ b/lib/packages/guzzlehttp/psr7/src/MimeType.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/psr7/src/MultipartStream.php b/lib/packages/guzzlehttp/psr7/src/MultipartStream.php index 8cbeec4..a659bca 100644 --- a/lib/packages/guzzlehttp/psr7/src/MultipartStream.php +++ b/lib/packages/guzzlehttp/psr7/src/MultipartStream.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -38,7 +38,7 @@ final class MultipartStream implements StreamInterface * * @throws \InvalidArgumentException */ - public function __construct(array $elements = [], string $boundary = null) + public function __construct(array $elements = [], ?string $boundary = null) { $this->boundary = $boundary ?: bin2hex(random_bytes(20)); $this->stream = $this->createStream($elements); diff --git a/lib/packages/guzzlehttp/psr7/src/NoSeekStream.php b/lib/packages/guzzlehttp/psr7/src/NoSeekStream.php index 6f78884..1fc3093 100644 --- a/lib/packages/guzzlehttp/psr7/src/NoSeekStream.php +++ b/lib/packages/guzzlehttp/psr7/src/NoSeekStream.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/psr7/src/PumpStream.php b/lib/packages/guzzlehttp/psr7/src/PumpStream.php index 81cf4b7..36ce0c0 100644 --- a/lib/packages/guzzlehttp/psr7/src/PumpStream.php +++ b/lib/packages/guzzlehttp/psr7/src/PumpStream.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/psr7/src/Query.php b/lib/packages/guzzlehttp/psr7/src/Query.php index e7d8a19..2075a9a 100644 --- a/lib/packages/guzzlehttp/psr7/src/Query.php +++ b/lib/packages/guzzlehttp/psr7/src/Query.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -69,12 +69,15 @@ public static function parse(string $str, $urlEncoding = true): array * string. This function does not modify the provided keys when an array is * encountered (like `http_build_query()` would). * - * @param array $params Query string parameters. - * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 - * to encode using RFC3986, or PHP_QUERY_RFC1738 - * to encode using RFC1738. + * @param array $params Query string parameters. + * @param int|false $encoding Set to false to not encode, + * PHP_QUERY_RFC3986 to encode using + * RFC3986, or PHP_QUERY_RFC1738 to + * encode using RFC1738. + * @param bool $treatBoolsAsInts Set to true to encode as 0/1, and + * false as false/true. */ - public static function build(array $params, $encoding = PHP_QUERY_RFC3986): string + public static function build(array $params, $encoding = PHP_QUERY_RFC3986, bool $treatBoolsAsInts = true): string { if (!$params) { return ''; @@ -92,12 +95,14 @@ public static function build(array $params, $encoding = PHP_QUERY_RFC3986): stri throw new \InvalidArgumentException('Invalid type'); } + $castBool = $treatBoolsAsInts ? static function ($v) { return (int) $v; } : static function ($v) { return $v ? 'true' : 'false'; }; + $qs = ''; foreach ($params as $k => $v) { $k = $encoder((string) $k); if (!is_array($v)) { $qs .= $k; - $v = is_bool($v) ? (int) $v : $v; + $v = is_bool($v) ? $castBool($v) : $v; if ($v !== null) { $qs .= '='.$encoder((string) $v); } @@ -105,7 +110,7 @@ public static function build(array $params, $encoding = PHP_QUERY_RFC3986): stri } else { foreach ($v as $vv) { $qs .= $k; - $vv = is_bool($vv) ? (int) $vv : $vv; + $vv = is_bool($vv) ? $castBool($vv) : $vv; if ($vv !== null) { $qs .= '='.$encoder((string) $vv); } diff --git a/lib/packages/guzzlehttp/psr7/src/Request.php b/lib/packages/guzzlehttp/psr7/src/Request.php index e032518..d1934ba 100644 --- a/lib/packages/guzzlehttp/psr7/src/Request.php +++ b/lib/packages/guzzlehttp/psr7/src/Request.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/psr7/src/Response.php b/lib/packages/guzzlehttp/psr7/src/Response.php index f4b4cf2..260fe35 100644 --- a/lib/packages/guzzlehttp/psr7/src/Response.php +++ b/lib/packages/guzzlehttp/psr7/src/Response.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -102,7 +102,7 @@ public function __construct( array $headers = [], $body = null, string $version = '1.1', - string $reason = null + ?string $reason = null ) { $this->assertStatusCodeRange($status); diff --git a/lib/packages/guzzlehttp/psr7/src/Rfc7230.php b/lib/packages/guzzlehttp/psr7/src/Rfc7230.php index 0a0ebbc..b74c4f8 100644 --- a/lib/packages/guzzlehttp/psr7/src/Rfc7230.php +++ b/lib/packages/guzzlehttp/psr7/src/Rfc7230.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/psr7/src/ServerRequest.php b/lib/packages/guzzlehttp/psr7/src/ServerRequest.php index 3be3a82..ac2490f 100644 --- a/lib/packages/guzzlehttp/psr7/src/ServerRequest.php +++ b/lib/packages/guzzlehttp/psr7/src/ServerRequest.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/psr7/src/Stream.php b/lib/packages/guzzlehttp/psr7/src/Stream.php index 915288e..8c9d712 100644 --- a/lib/packages/guzzlehttp/psr7/src/Stream.php +++ b/lib/packages/guzzlehttp/psr7/src/Stream.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/psr7/src/StreamDecoratorTrait.php b/lib/packages/guzzlehttp/psr7/src/StreamDecoratorTrait.php index 084a8f4..a97ea7b 100644 --- a/lib/packages/guzzlehttp/psr7/src/StreamDecoratorTrait.php +++ b/lib/packages/guzzlehttp/psr7/src/StreamDecoratorTrait.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/psr7/src/StreamWrapper.php b/lib/packages/guzzlehttp/psr7/src/StreamWrapper.php index f8a7d89..0340107 100644 --- a/lib/packages/guzzlehttp/psr7/src/StreamWrapper.php +++ b/lib/packages/guzzlehttp/psr7/src/StreamWrapper.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -75,7 +75,7 @@ public static function register(): void } } - public function stream_open(string $path, string $mode, int $options, string &$opened_path = null): bool + public function stream_open(string $path, string $mode, int $options, ?string &$opened_path = null): bool { $options = stream_context_get_options($this->context); @@ -142,10 +142,14 @@ public function stream_cast(int $cast_as) * ctime: int, * blksize: int, * blocks: int - * } + * }|false */ - public function stream_stat(): array + public function stream_stat() { + if ($this->stream->getSize() === null) { + return false; + } + static $modeMap = [ 'r' => 33060, 'rb' => 33060, diff --git a/lib/packages/guzzlehttp/psr7/src/UploadedFile.php b/lib/packages/guzzlehttp/psr7/src/UploadedFile.php index ec2fb1f..d9a1104 100644 --- a/lib/packages/guzzlehttp/psr7/src/UploadedFile.php +++ b/lib/packages/guzzlehttp/psr7/src/UploadedFile.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -70,8 +70,8 @@ public function __construct( $streamOrFile, ?int $size, int $errorStatus, - string $clientFilename = null, - string $clientMediaType = null + ?string $clientFilename = null, + ?string $clientMediaType = null ) { $this->setError($errorStatus); $this->size = $size; diff --git a/lib/packages/guzzlehttp/psr7/src/Uri.php b/lib/packages/guzzlehttp/psr7/src/Uri.php index abd3986..656ed38 100644 --- a/lib/packages/guzzlehttp/psr7/src/Uri.php +++ b/lib/packages/guzzlehttp/psr7/src/Uri.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -285,7 +285,7 @@ public static function isRelativePathReference(UriInterface $uri): bool * * @see https://datatracker.ietf.org/doc/html/rfc3986#section-4.4 */ - public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null): bool + public static function isSameDocumentReference(UriInterface $uri, ?UriInterface $base = null): bool { if ($base !== null) { $uri = UriResolver::resolve($base, $uri); diff --git a/lib/packages/guzzlehttp/psr7/src/UriComparator.php b/lib/packages/guzzlehttp/psr7/src/UriComparator.php index 6c7e318..85b537d 100644 --- a/lib/packages/guzzlehttp/psr7/src/UriComparator.php +++ b/lib/packages/guzzlehttp/psr7/src/UriComparator.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/psr7/src/UriNormalizer.php b/lib/packages/guzzlehttp/psr7/src/UriNormalizer.php index 42c6064..30810d2 100644 --- a/lib/packages/guzzlehttp/psr7/src/UriNormalizer.php +++ b/lib/packages/guzzlehttp/psr7/src/UriNormalizer.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/psr7/src/UriResolver.php b/lib/packages/guzzlehttp/psr7/src/UriResolver.php index 5ef11cd..cff21df 100644 --- a/lib/packages/guzzlehttp/psr7/src/UriResolver.php +++ b/lib/packages/guzzlehttp/psr7/src/UriResolver.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/guzzlehttp/psr7/src/Utils.php b/lib/packages/guzzlehttp/psr7/src/Utils.php index 38d325e..eca2a1f 100644 --- a/lib/packages/guzzlehttp/psr7/src/Utils.php +++ b/lib/packages/guzzlehttp/psr7/src/Utils.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -237,7 +237,7 @@ public static function modifyRequest(RequestInterface $request, array $changes): * @param StreamInterface $stream Stream to read from * @param int|null $maxLength Maximum buffer length */ - public static function readLine(StreamInterface $stream, int $maxLength = null): string + public static function readLine(StreamInterface $stream, ?int $maxLength = null): string { $buffer = ''; $size = 0; @@ -256,6 +256,20 @@ public static function readLine(StreamInterface $stream, int $maxLength = null): return $buffer; } + /** + * Redact the password in the user info part of a URI. + */ + public static function redactUserInfo(UriInterface $uri): UriInterface + { + $userInfo = $uri->getUserInfo(); + + if (false !== ($pos = \strpos($userInfo, ':'))) { + return $uri->withUserInfo(\substr($userInfo, 0, $pos), '***'); + } + + return $uri; + } + /** * Create a new stream based on the input type. * diff --git a/lib/packages/league/oauth2-client/src/Grant/AbstractGrant.php b/lib/packages/league/oauth2-client/src/Grant/AbstractGrant.php index 1abc16b..8a2fcc4 100644 --- a/lib/packages/league/oauth2-client/src/Grant/AbstractGrant.php +++ b/lib/packages/league/oauth2-client/src/Grant/AbstractGrant.php @@ -11,7 +11,7 @@ * @link https://packagist.org/packages/league/oauth2-client Packagist * @link https://github.com/thephpleague/oauth2-client GitHub * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/league/oauth2-client/src/Grant/AuthorizationCode.php b/lib/packages/league/oauth2-client/src/Grant/AuthorizationCode.php index e5187f3..884dc92 100644 --- a/lib/packages/league/oauth2-client/src/Grant/AuthorizationCode.php +++ b/lib/packages/league/oauth2-client/src/Grant/AuthorizationCode.php @@ -11,7 +11,7 @@ * @link https://packagist.org/packages/league/oauth2-client Packagist * @link https://github.com/thephpleague/oauth2-client GitHub * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/league/oauth2-client/src/Grant/ClientCredentials.php b/lib/packages/league/oauth2-client/src/Grant/ClientCredentials.php index 282906f..57a0994 100644 --- a/lib/packages/league/oauth2-client/src/Grant/ClientCredentials.php +++ b/lib/packages/league/oauth2-client/src/Grant/ClientCredentials.php @@ -11,7 +11,7 @@ * @link https://packagist.org/packages/league/oauth2-client Packagist * @link https://github.com/thephpleague/oauth2-client GitHub * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/league/oauth2-client/src/Grant/Exception/InvalidGrantException.php b/lib/packages/league/oauth2-client/src/Grant/Exception/InvalidGrantException.php index 891bd41..838d951 100644 --- a/lib/packages/league/oauth2-client/src/Grant/Exception/InvalidGrantException.php +++ b/lib/packages/league/oauth2-client/src/Grant/Exception/InvalidGrantException.php @@ -11,7 +11,7 @@ * @link https://packagist.org/packages/league/oauth2-client Packagist * @link https://github.com/thephpleague/oauth2-client GitHub * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/league/oauth2-client/src/Grant/GrantFactory.php b/lib/packages/league/oauth2-client/src/Grant/GrantFactory.php index d3deb54..5ba340d 100644 --- a/lib/packages/league/oauth2-client/src/Grant/GrantFactory.php +++ b/lib/packages/league/oauth2-client/src/Grant/GrantFactory.php @@ -11,7 +11,7 @@ * @link https://packagist.org/packages/league/oauth2-client Packagist * @link https://github.com/thephpleague/oauth2-client GitHub * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/league/oauth2-client/src/Grant/Password.php b/lib/packages/league/oauth2-client/src/Grant/Password.php index 91e27f1..489f745 100644 --- a/lib/packages/league/oauth2-client/src/Grant/Password.php +++ b/lib/packages/league/oauth2-client/src/Grant/Password.php @@ -11,7 +11,7 @@ * @link https://packagist.org/packages/league/oauth2-client Packagist * @link https://github.com/thephpleague/oauth2-client GitHub * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/league/oauth2-client/src/Grant/RefreshToken.php b/lib/packages/league/oauth2-client/src/Grant/RefreshToken.php index 20b62e6..f0c16d2 100644 --- a/lib/packages/league/oauth2-client/src/Grant/RefreshToken.php +++ b/lib/packages/league/oauth2-client/src/Grant/RefreshToken.php @@ -11,7 +11,7 @@ * @link https://packagist.org/packages/league/oauth2-client Packagist * @link https://github.com/thephpleague/oauth2-client GitHub * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/league/oauth2-client/src/OptionProvider/HttpBasicAuthOptionProvider.php b/lib/packages/league/oauth2-client/src/OptionProvider/HttpBasicAuthOptionProvider.php index 66ea0b4..50f979b 100644 --- a/lib/packages/league/oauth2-client/src/OptionProvider/HttpBasicAuthOptionProvider.php +++ b/lib/packages/league/oauth2-client/src/OptionProvider/HttpBasicAuthOptionProvider.php @@ -11,7 +11,7 @@ * @link https://packagist.org/packages/league/oauth2-client Packagist * @link https://github.com/thephpleague/oauth2-client GitHub * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/league/oauth2-client/src/OptionProvider/OptionProviderInterface.php b/lib/packages/league/oauth2-client/src/OptionProvider/OptionProviderInterface.php index c0e5762..866a115 100644 --- a/lib/packages/league/oauth2-client/src/OptionProvider/OptionProviderInterface.php +++ b/lib/packages/league/oauth2-client/src/OptionProvider/OptionProviderInterface.php @@ -11,7 +11,7 @@ * @link https://packagist.org/packages/league/oauth2-client Packagist * @link https://github.com/thephpleague/oauth2-client GitHub * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/league/oauth2-client/src/OptionProvider/PostAuthOptionProvider.php b/lib/packages/league/oauth2-client/src/OptionProvider/PostAuthOptionProvider.php index 6daebd6..462eecf 100644 --- a/lib/packages/league/oauth2-client/src/OptionProvider/PostAuthOptionProvider.php +++ b/lib/packages/league/oauth2-client/src/OptionProvider/PostAuthOptionProvider.php @@ -11,7 +11,7 @@ * @link https://packagist.org/packages/league/oauth2-client Packagist * @link https://github.com/thephpleague/oauth2-client GitHub * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/league/oauth2-client/src/Provider/AbstractProvider.php b/lib/packages/league/oauth2-client/src/Provider/AbstractProvider.php index 0d1e66a..f8ce3c2 100644 --- a/lib/packages/league/oauth2-client/src/Provider/AbstractProvider.php +++ b/lib/packages/league/oauth2-client/src/Provider/AbstractProvider.php @@ -11,7 +11,7 @@ * @link https://packagist.org/packages/league/oauth2-client Packagist * @link https://github.com/thephpleague/oauth2-client GitHub * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/league/oauth2-client/src/Provider/Exception/IdentityProviderException.php b/lib/packages/league/oauth2-client/src/Provider/Exception/IdentityProviderException.php index 02376ba..9a3390c 100644 --- a/lib/packages/league/oauth2-client/src/Provider/Exception/IdentityProviderException.php +++ b/lib/packages/league/oauth2-client/src/Provider/Exception/IdentityProviderException.php @@ -11,7 +11,7 @@ * @link https://packagist.org/packages/league/oauth2-client Packagist * @link https://github.com/thephpleague/oauth2-client GitHub * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/league/oauth2-client/src/Provider/GenericProvider.php b/lib/packages/league/oauth2-client/src/Provider/GenericProvider.php index e834fd1..2a8dd69 100644 --- a/lib/packages/league/oauth2-client/src/Provider/GenericProvider.php +++ b/lib/packages/league/oauth2-client/src/Provider/GenericProvider.php @@ -11,7 +11,7 @@ * @link https://packagist.org/packages/league/oauth2-client Packagist * @link https://github.com/thephpleague/oauth2-client GitHub * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/league/oauth2-client/src/Provider/GenericResourceOwner.php b/lib/packages/league/oauth2-client/src/Provider/GenericResourceOwner.php index 74f3e40..2429052 100644 --- a/lib/packages/league/oauth2-client/src/Provider/GenericResourceOwner.php +++ b/lib/packages/league/oauth2-client/src/Provider/GenericResourceOwner.php @@ -11,7 +11,7 @@ * @link https://packagist.org/packages/league/oauth2-client Packagist * @link https://github.com/thephpleague/oauth2-client GitHub * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/league/oauth2-client/src/Provider/ResourceOwnerInterface.php b/lib/packages/league/oauth2-client/src/Provider/ResourceOwnerInterface.php index 236cf08..c51b305 100644 --- a/lib/packages/league/oauth2-client/src/Provider/ResourceOwnerInterface.php +++ b/lib/packages/league/oauth2-client/src/Provider/ResourceOwnerInterface.php @@ -11,7 +11,7 @@ * @link https://packagist.org/packages/league/oauth2-client Packagist * @link https://github.com/thephpleague/oauth2-client GitHub * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/league/oauth2-client/src/Token/AccessToken.php b/lib/packages/league/oauth2-client/src/Token/AccessToken.php index cc04de7..4d089ca 100644 --- a/lib/packages/league/oauth2-client/src/Token/AccessToken.php +++ b/lib/packages/league/oauth2-client/src/Token/AccessToken.php @@ -11,7 +11,7 @@ * @link https://packagist.org/packages/league/oauth2-client Packagist * @link https://github.com/thephpleague/oauth2-client GitHub * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/league/oauth2-client/src/Token/AccessTokenInterface.php b/lib/packages/league/oauth2-client/src/Token/AccessTokenInterface.php index 24d48bb..85cc1cc 100644 --- a/lib/packages/league/oauth2-client/src/Token/AccessTokenInterface.php +++ b/lib/packages/league/oauth2-client/src/Token/AccessTokenInterface.php @@ -11,7 +11,7 @@ * @link https://packagist.org/packages/league/oauth2-client Packagist * @link https://github.com/thephpleague/oauth2-client GitHub * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/league/oauth2-client/src/Token/ResourceOwnerAccessTokenInterface.php b/lib/packages/league/oauth2-client/src/Token/ResourceOwnerAccessTokenInterface.php index 30608e2..bcfd5a3 100644 --- a/lib/packages/league/oauth2-client/src/Token/ResourceOwnerAccessTokenInterface.php +++ b/lib/packages/league/oauth2-client/src/Token/ResourceOwnerAccessTokenInterface.php @@ -11,7 +11,7 @@ * @link https://packagist.org/packages/league/oauth2-client Packagist * @link https://github.com/thephpleague/oauth2-client GitHub * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/league/oauth2-client/src/Tool/ArrayAccessorTrait.php b/lib/packages/league/oauth2-client/src/Tool/ArrayAccessorTrait.php index 3c8d97f..044064d 100644 --- a/lib/packages/league/oauth2-client/src/Tool/ArrayAccessorTrait.php +++ b/lib/packages/league/oauth2-client/src/Tool/ArrayAccessorTrait.php @@ -11,7 +11,7 @@ * @link https://packagist.org/packages/league/oauth2-client Packagist * @link https://github.com/thephpleague/oauth2-client GitHub * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/league/oauth2-client/src/Tool/BearerAuthorizationTrait.php b/lib/packages/league/oauth2-client/src/Tool/BearerAuthorizationTrait.php index c67d49c..b1fc0a4 100644 --- a/lib/packages/league/oauth2-client/src/Tool/BearerAuthorizationTrait.php +++ b/lib/packages/league/oauth2-client/src/Tool/BearerAuthorizationTrait.php @@ -11,7 +11,7 @@ * @link https://packagist.org/packages/league/oauth2-client Packagist * @link https://github.com/thephpleague/oauth2-client GitHub * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/league/oauth2-client/src/Tool/GuardedPropertyTrait.php b/lib/packages/league/oauth2-client/src/Tool/GuardedPropertyTrait.php index 3679288..94bd0b4 100644 --- a/lib/packages/league/oauth2-client/src/Tool/GuardedPropertyTrait.php +++ b/lib/packages/league/oauth2-client/src/Tool/GuardedPropertyTrait.php @@ -11,7 +11,7 @@ * @link https://packagist.org/packages/league/oauth2-client Packagist * @link https://github.com/thephpleague/oauth2-client GitHub * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/league/oauth2-client/src/Tool/MacAuthorizationTrait.php b/lib/packages/league/oauth2-client/src/Tool/MacAuthorizationTrait.php index 6c26fa3..2a4c16b 100644 --- a/lib/packages/league/oauth2-client/src/Tool/MacAuthorizationTrait.php +++ b/lib/packages/league/oauth2-client/src/Tool/MacAuthorizationTrait.php @@ -11,7 +11,7 @@ * @link https://packagist.org/packages/league/oauth2-client Packagist * @link https://github.com/thephpleague/oauth2-client GitHub * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/league/oauth2-client/src/Tool/ProviderRedirectTrait.php b/lib/packages/league/oauth2-client/src/Tool/ProviderRedirectTrait.php index 907e1d1..45467d5 100644 --- a/lib/packages/league/oauth2-client/src/Tool/ProviderRedirectTrait.php +++ b/lib/packages/league/oauth2-client/src/Tool/ProviderRedirectTrait.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/league/oauth2-client/src/Tool/QueryBuilderTrait.php b/lib/packages/league/oauth2-client/src/Tool/QueryBuilderTrait.php index 3e13415..c6ac6b8 100644 --- a/lib/packages/league/oauth2-client/src/Tool/QueryBuilderTrait.php +++ b/lib/packages/league/oauth2-client/src/Tool/QueryBuilderTrait.php @@ -11,7 +11,7 @@ * @link https://packagist.org/packages/league/oauth2-client Packagist * @link https://github.com/thephpleague/oauth2-client GitHub * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/league/oauth2-client/src/Tool/RequestFactory.php b/lib/packages/league/oauth2-client/src/Tool/RequestFactory.php index 58cfbd9..d831bc8 100644 --- a/lib/packages/league/oauth2-client/src/Tool/RequestFactory.php +++ b/lib/packages/league/oauth2-client/src/Tool/RequestFactory.php @@ -11,7 +11,7 @@ * @link https://packagist.org/packages/league/oauth2-client Packagist * @link https://github.com/thephpleague/oauth2-client GitHub * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/league/oauth2-client/src/Tool/RequiredParameterTrait.php b/lib/packages/league/oauth2-client/src/Tool/RequiredParameterTrait.php index 957befc..1c26192 100644 --- a/lib/packages/league/oauth2-client/src/Tool/RequiredParameterTrait.php +++ b/lib/packages/league/oauth2-client/src/Tool/RequiredParameterTrait.php @@ -11,7 +11,7 @@ * @link https://packagist.org/packages/league/oauth2-client Packagist * @link https://github.com/thephpleague/oauth2-client GitHub * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/AccountingObjectSerializer.php b/lib/packages/xeroapi/xero-php-oauth2/lib/AccountingObjectSerializer.php index e6d5499..910ca25 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/AccountingObjectSerializer.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/AccountingObjectSerializer.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Api/AccountingApi.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Api/AccountingApi.php index eb534cf..00961a5 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Api/AccountingApi.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Api/AccountingApi.php @@ -9,7 +9,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -18,7 +18,7 @@ * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * OpenAPI spec version: 2.35.0 + * OpenAPI spec version: 6.2.0 * Contact: api@xero.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 5.4.0 @@ -94,13 +94,14 @@ public function getConfig() * Creates a new chart of accounts * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Account $account Account object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Accounts|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createAccount($xero_tenant_id, $account) + public function createAccount($xero_tenant_id, $account, $idempotency_key = null) { - list($response) = $this->createAccountWithHttpInfo($xero_tenant_id, $account); + list($response) = $this->createAccountWithHttpInfo($xero_tenant_id, $account, $idempotency_key); return $response; } /** @@ -108,13 +109,14 @@ public function createAccount($xero_tenant_id, $account) * Creates a new chart of accounts * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Account $account Account object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Accounts|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createAccountWithHttpInfo($xero_tenant_id, $account) + public function createAccountWithHttpInfo($xero_tenant_id, $account, $idempotency_key = null) { - $request = $this->createAccountRequest($xero_tenant_id, $account); + $request = $this->createAccountRequest($xero_tenant_id, $account, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -204,12 +206,13 @@ public function createAccountWithHttpInfo($xero_tenant_id, $account) * Creates a new chart of accounts * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Account $account Account object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createAccountAsync($xero_tenant_id, $account) + public function createAccountAsync($xero_tenant_id, $account, $idempotency_key = null) { - return $this->createAccountAsyncWithHttpInfo($xero_tenant_id, $account) + return $this->createAccountAsyncWithHttpInfo($xero_tenant_id, $account, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -221,12 +224,13 @@ function ($response) { * Creates a new chart of accounts * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Account $account Account object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createAccountAsyncWithHttpInfo($xero_tenant_id, $account) + public function createAccountAsyncWithHttpInfo($xero_tenant_id, $account, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Accounts'; - $request = $this->createAccountRequest($xero_tenant_id, $account); + $request = $this->createAccountRequest($xero_tenant_id, $account, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -264,9 +268,10 @@ function ($exception) { * Create request for operation 'createAccount' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Account $account Account object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createAccountRequest($xero_tenant_id, $account) + protected function createAccountRequest($xero_tenant_id, $account, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -290,6 +295,10 @@ protected function createAccountRequest($xero_tenant_id, $account) if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($account)) { @@ -360,13 +369,14 @@ protected function createAccountRequest($xero_tenant_id, $account) * @param string $account_id Unique identifier for Account object (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createAccountAttachmentByFileName($xero_tenant_id, $account_id, $file_name, $body) + public function createAccountAttachmentByFileName($xero_tenant_id, $account_id, $file_name, $body, $idempotency_key = null) { - list($response) = $this->createAccountAttachmentByFileNameWithHttpInfo($xero_tenant_id, $account_id, $file_name, $body); + list($response) = $this->createAccountAttachmentByFileNameWithHttpInfo($xero_tenant_id, $account_id, $file_name, $body, $idempotency_key); return $response; } /** @@ -376,13 +386,14 @@ public function createAccountAttachmentByFileName($xero_tenant_id, $account_id, * @param string $account_id Unique identifier for Account object (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createAccountAttachmentByFileNameWithHttpInfo($xero_tenant_id, $account_id, $file_name, $body) + public function createAccountAttachmentByFileNameWithHttpInfo($xero_tenant_id, $account_id, $file_name, $body, $idempotency_key = null) { - $request = $this->createAccountAttachmentByFileNameRequest($xero_tenant_id, $account_id, $file_name, $body); + $request = $this->createAccountAttachmentByFileNameRequest($xero_tenant_id, $account_id, $file_name, $body, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -474,12 +485,13 @@ public function createAccountAttachmentByFileNameWithHttpInfo($xero_tenant_id, $ * @param string $account_id Unique identifier for Account object (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createAccountAttachmentByFileNameAsync($xero_tenant_id, $account_id, $file_name, $body) + public function createAccountAttachmentByFileNameAsync($xero_tenant_id, $account_id, $file_name, $body, $idempotency_key = null) { - return $this->createAccountAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $account_id, $file_name, $body) + return $this->createAccountAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $account_id, $file_name, $body, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -493,12 +505,13 @@ function ($response) { * @param string $account_id Unique identifier for Account object (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createAccountAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $account_id, $file_name, $body) + public function createAccountAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $account_id, $file_name, $body, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; - $request = $this->createAccountAttachmentByFileNameRequest($xero_tenant_id, $account_id, $file_name, $body); + $request = $this->createAccountAttachmentByFileNameRequest($xero_tenant_id, $account_id, $file_name, $body, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -538,9 +551,10 @@ function ($exception) { * @param string $account_id Unique identifier for Account object (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createAccountAttachmentByFileNameRequest($xero_tenant_id, $account_id, $file_name, $body) + protected function createAccountAttachmentByFileNameRequest($xero_tenant_id, $account_id, $file_name, $body, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -576,6 +590,10 @@ protected function createAccountAttachmentByFileNameRequest($xero_tenant_id, $ac if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($account_id !== null) { $resourcePath = str_replace( @@ -662,13 +680,14 @@ protected function createAccountAttachmentByFileNameRequest($xero_tenant_id, $ac * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createBankTransactionAttachmentByFileName($xero_tenant_id, $bank_transaction_id, $file_name, $body) + public function createBankTransactionAttachmentByFileName($xero_tenant_id, $bank_transaction_id, $file_name, $body, $idempotency_key = null) { - list($response) = $this->createBankTransactionAttachmentByFileNameWithHttpInfo($xero_tenant_id, $bank_transaction_id, $file_name, $body); + list($response) = $this->createBankTransactionAttachmentByFileNameWithHttpInfo($xero_tenant_id, $bank_transaction_id, $file_name, $body, $idempotency_key); return $response; } /** @@ -678,13 +697,14 @@ public function createBankTransactionAttachmentByFileName($xero_tenant_id, $bank * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createBankTransactionAttachmentByFileNameWithHttpInfo($xero_tenant_id, $bank_transaction_id, $file_name, $body) + public function createBankTransactionAttachmentByFileNameWithHttpInfo($xero_tenant_id, $bank_transaction_id, $file_name, $body, $idempotency_key = null) { - $request = $this->createBankTransactionAttachmentByFileNameRequest($xero_tenant_id, $bank_transaction_id, $file_name, $body); + $request = $this->createBankTransactionAttachmentByFileNameRequest($xero_tenant_id, $bank_transaction_id, $file_name, $body, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -776,12 +796,13 @@ public function createBankTransactionAttachmentByFileNameWithHttpInfo($xero_tena * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createBankTransactionAttachmentByFileNameAsync($xero_tenant_id, $bank_transaction_id, $file_name, $body) + public function createBankTransactionAttachmentByFileNameAsync($xero_tenant_id, $bank_transaction_id, $file_name, $body, $idempotency_key = null) { - return $this->createBankTransactionAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $bank_transaction_id, $file_name, $body) + return $this->createBankTransactionAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $bank_transaction_id, $file_name, $body, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -795,12 +816,13 @@ function ($response) { * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createBankTransactionAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $bank_transaction_id, $file_name, $body) + public function createBankTransactionAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $bank_transaction_id, $file_name, $body, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; - $request = $this->createBankTransactionAttachmentByFileNameRequest($xero_tenant_id, $bank_transaction_id, $file_name, $body); + $request = $this->createBankTransactionAttachmentByFileNameRequest($xero_tenant_id, $bank_transaction_id, $file_name, $body, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -840,9 +862,10 @@ function ($exception) { * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createBankTransactionAttachmentByFileNameRequest($xero_tenant_id, $bank_transaction_id, $file_name, $body) + protected function createBankTransactionAttachmentByFileNameRequest($xero_tenant_id, $bank_transaction_id, $file_name, $body, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -878,6 +901,10 @@ protected function createBankTransactionAttachmentByFileNameRequest($xero_tenant if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($bank_transaction_id !== null) { $resourcePath = str_replace( @@ -963,13 +990,14 @@ protected function createBankTransactionAttachmentByFileNameRequest($xero_tenant * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createBankTransactionHistoryRecord($xero_tenant_id, $bank_transaction_id, $history_records) + public function createBankTransactionHistoryRecord($xero_tenant_id, $bank_transaction_id, $history_records, $idempotency_key = null) { - list($response) = $this->createBankTransactionHistoryRecordWithHttpInfo($xero_tenant_id, $bank_transaction_id, $history_records); + list($response) = $this->createBankTransactionHistoryRecordWithHttpInfo($xero_tenant_id, $bank_transaction_id, $history_records, $idempotency_key); return $response; } /** @@ -978,13 +1006,14 @@ public function createBankTransactionHistoryRecord($xero_tenant_id, $bank_transa * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\HistoryRecords|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createBankTransactionHistoryRecordWithHttpInfo($xero_tenant_id, $bank_transaction_id, $history_records) + public function createBankTransactionHistoryRecordWithHttpInfo($xero_tenant_id, $bank_transaction_id, $history_records, $idempotency_key = null) { - $request = $this->createBankTransactionHistoryRecordRequest($xero_tenant_id, $bank_transaction_id, $history_records); + $request = $this->createBankTransactionHistoryRecordRequest($xero_tenant_id, $bank_transaction_id, $history_records, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -1075,12 +1104,13 @@ public function createBankTransactionHistoryRecordWithHttpInfo($xero_tenant_id, * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createBankTransactionHistoryRecordAsync($xero_tenant_id, $bank_transaction_id, $history_records) + public function createBankTransactionHistoryRecordAsync($xero_tenant_id, $bank_transaction_id, $history_records, $idempotency_key = null) { - return $this->createBankTransactionHistoryRecordAsyncWithHttpInfo($xero_tenant_id, $bank_transaction_id, $history_records) + return $this->createBankTransactionHistoryRecordAsyncWithHttpInfo($xero_tenant_id, $bank_transaction_id, $history_records, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -1093,12 +1123,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createBankTransactionHistoryRecordAsyncWithHttpInfo($xero_tenant_id, $bank_transaction_id, $history_records) + public function createBankTransactionHistoryRecordAsyncWithHttpInfo($xero_tenant_id, $bank_transaction_id, $history_records, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords'; - $request = $this->createBankTransactionHistoryRecordRequest($xero_tenant_id, $bank_transaction_id, $history_records); + $request = $this->createBankTransactionHistoryRecordRequest($xero_tenant_id, $bank_transaction_id, $history_records, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -1137,9 +1168,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createBankTransactionHistoryRecordRequest($xero_tenant_id, $bank_transaction_id, $history_records) + protected function createBankTransactionHistoryRecordRequest($xero_tenant_id, $bank_transaction_id, $history_records, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -1169,6 +1201,10 @@ protected function createBankTransactionHistoryRecordRequest($xero_tenant_id, $b if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($bank_transaction_id !== null) { $resourcePath = str_replace( @@ -1247,13 +1283,14 @@ protected function createBankTransactionHistoryRecordRequest($xero_tenant_id, $b * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions $bank_transactions BankTransactions with an array of BankTransaction objects in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createBankTransactions($xero_tenant_id, $bank_transactions, $summarize_errors = false, $unitdp = null) + public function createBankTransactions($xero_tenant_id, $bank_transactions, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { - list($response) = $this->createBankTransactionsWithHttpInfo($xero_tenant_id, $bank_transactions, $summarize_errors, $unitdp); + list($response) = $this->createBankTransactionsWithHttpInfo($xero_tenant_id, $bank_transactions, $summarize_errors, $unitdp, $idempotency_key); return $response; } /** @@ -1263,13 +1300,14 @@ public function createBankTransactions($xero_tenant_id, $bank_transactions, $sum * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions $bank_transactions BankTransactions with an array of BankTransaction objects in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\BankTransactions|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createBankTransactionsWithHttpInfo($xero_tenant_id, $bank_transactions, $summarize_errors = false, $unitdp = null) + public function createBankTransactionsWithHttpInfo($xero_tenant_id, $bank_transactions, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { - $request = $this->createBankTransactionsRequest($xero_tenant_id, $bank_transactions, $summarize_errors, $unitdp); + $request = $this->createBankTransactionsRequest($xero_tenant_id, $bank_transactions, $summarize_errors, $unitdp, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -1361,12 +1399,13 @@ public function createBankTransactionsWithHttpInfo($xero_tenant_id, $bank_transa * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions $bank_transactions BankTransactions with an array of BankTransaction objects in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createBankTransactionsAsync($xero_tenant_id, $bank_transactions, $summarize_errors = false, $unitdp = null) + public function createBankTransactionsAsync($xero_tenant_id, $bank_transactions, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { - return $this->createBankTransactionsAsyncWithHttpInfo($xero_tenant_id, $bank_transactions, $summarize_errors, $unitdp) + return $this->createBankTransactionsAsyncWithHttpInfo($xero_tenant_id, $bank_transactions, $summarize_errors, $unitdp, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -1380,12 +1419,13 @@ function ($response) { * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions $bank_transactions BankTransactions with an array of BankTransaction objects in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createBankTransactionsAsyncWithHttpInfo($xero_tenant_id, $bank_transactions, $summarize_errors = false, $unitdp = null) + public function createBankTransactionsAsyncWithHttpInfo($xero_tenant_id, $bank_transactions, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions'; - $request = $this->createBankTransactionsRequest($xero_tenant_id, $bank_transactions, $summarize_errors, $unitdp); + $request = $this->createBankTransactionsRequest($xero_tenant_id, $bank_transactions, $summarize_errors, $unitdp, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -1425,9 +1465,10 @@ function ($exception) { * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions $bank_transactions BankTransactions with an array of BankTransaction objects in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createBankTransactionsRequest($xero_tenant_id, $bank_transactions, $summarize_errors = false, $unitdp = null) + protected function createBankTransactionsRequest($xero_tenant_id, $bank_transactions, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -1459,6 +1500,10 @@ protected function createBankTransactionsRequest($xero_tenant_id, $bank_transact if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($bank_transactions)) { @@ -1527,13 +1572,14 @@ protected function createBankTransactionsRequest($xero_tenant_id, $bank_transact * Creates a bank transfer * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransfers $bank_transfers BankTransfers with array of BankTransfer objects in request body (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransfers|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createBankTransfer($xero_tenant_id, $bank_transfers) + public function createBankTransfer($xero_tenant_id, $bank_transfers, $idempotency_key = null) { - list($response) = $this->createBankTransferWithHttpInfo($xero_tenant_id, $bank_transfers); + list($response) = $this->createBankTransferWithHttpInfo($xero_tenant_id, $bank_transfers, $idempotency_key); return $response; } /** @@ -1541,13 +1587,14 @@ public function createBankTransfer($xero_tenant_id, $bank_transfers) * Creates a bank transfer * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransfers $bank_transfers BankTransfers with array of BankTransfer objects in request body (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\BankTransfers|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createBankTransferWithHttpInfo($xero_tenant_id, $bank_transfers) + public function createBankTransferWithHttpInfo($xero_tenant_id, $bank_transfers, $idempotency_key = null) { - $request = $this->createBankTransferRequest($xero_tenant_id, $bank_transfers); + $request = $this->createBankTransferRequest($xero_tenant_id, $bank_transfers, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -1637,12 +1684,13 @@ public function createBankTransferWithHttpInfo($xero_tenant_id, $bank_transfers) * Creates a bank transfer * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransfers $bank_transfers BankTransfers with array of BankTransfer objects in request body (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createBankTransferAsync($xero_tenant_id, $bank_transfers) + public function createBankTransferAsync($xero_tenant_id, $bank_transfers, $idempotency_key = null) { - return $this->createBankTransferAsyncWithHttpInfo($xero_tenant_id, $bank_transfers) + return $this->createBankTransferAsyncWithHttpInfo($xero_tenant_id, $bank_transfers, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -1654,12 +1702,13 @@ function ($response) { * Creates a bank transfer * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransfers $bank_transfers BankTransfers with array of BankTransfer objects in request body (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createBankTransferAsyncWithHttpInfo($xero_tenant_id, $bank_transfers) + public function createBankTransferAsyncWithHttpInfo($xero_tenant_id, $bank_transfers, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransfers'; - $request = $this->createBankTransferRequest($xero_tenant_id, $bank_transfers); + $request = $this->createBankTransferRequest($xero_tenant_id, $bank_transfers, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -1697,9 +1746,10 @@ function ($exception) { * Create request for operation 'createBankTransfer' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransfers $bank_transfers BankTransfers with array of BankTransfer objects in request body (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createBankTransferRequest($xero_tenant_id, $bank_transfers) + protected function createBankTransferRequest($xero_tenant_id, $bank_transfers, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -1723,6 +1773,10 @@ protected function createBankTransferRequest($xero_tenant_id, $bank_transfers) if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($bank_transfers)) { @@ -1792,13 +1846,14 @@ protected function createBankTransferRequest($xero_tenant_id, $bank_transfers) * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createBankTransferAttachmentByFileName($xero_tenant_id, $bank_transfer_id, $file_name, $body) + public function createBankTransferAttachmentByFileName($xero_tenant_id, $bank_transfer_id, $file_name, $body, $idempotency_key = null) { - list($response) = $this->createBankTransferAttachmentByFileNameWithHttpInfo($xero_tenant_id, $bank_transfer_id, $file_name, $body); + list($response) = $this->createBankTransferAttachmentByFileNameWithHttpInfo($xero_tenant_id, $bank_transfer_id, $file_name, $body, $idempotency_key); return $response; } /** @@ -1807,13 +1862,14 @@ public function createBankTransferAttachmentByFileName($xero_tenant_id, $bank_tr * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createBankTransferAttachmentByFileNameWithHttpInfo($xero_tenant_id, $bank_transfer_id, $file_name, $body) + public function createBankTransferAttachmentByFileNameWithHttpInfo($xero_tenant_id, $bank_transfer_id, $file_name, $body, $idempotency_key = null) { - $request = $this->createBankTransferAttachmentByFileNameRequest($xero_tenant_id, $bank_transfer_id, $file_name, $body); + $request = $this->createBankTransferAttachmentByFileNameRequest($xero_tenant_id, $bank_transfer_id, $file_name, $body, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -1905,12 +1961,13 @@ public function createBankTransferAttachmentByFileNameWithHttpInfo($xero_tenant_ * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createBankTransferAttachmentByFileNameAsync($xero_tenant_id, $bank_transfer_id, $file_name, $body) + public function createBankTransferAttachmentByFileNameAsync($xero_tenant_id, $bank_transfer_id, $file_name, $body, $idempotency_key = null) { - return $this->createBankTransferAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $bank_transfer_id, $file_name, $body) + return $this->createBankTransferAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $bank_transfer_id, $file_name, $body, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -1924,12 +1981,13 @@ function ($response) { * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createBankTransferAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $bank_transfer_id, $file_name, $body) + public function createBankTransferAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $bank_transfer_id, $file_name, $body, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; - $request = $this->createBankTransferAttachmentByFileNameRequest($xero_tenant_id, $bank_transfer_id, $file_name, $body); + $request = $this->createBankTransferAttachmentByFileNameRequest($xero_tenant_id, $bank_transfer_id, $file_name, $body, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -1969,9 +2027,10 @@ function ($exception) { * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createBankTransferAttachmentByFileNameRequest($xero_tenant_id, $bank_transfer_id, $file_name, $body) + protected function createBankTransferAttachmentByFileNameRequest($xero_tenant_id, $bank_transfer_id, $file_name, $body, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -2007,6 +2066,10 @@ protected function createBankTransferAttachmentByFileNameRequest($xero_tenant_id if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($bank_transfer_id !== null) { $resourcePath = str_replace( @@ -2092,13 +2155,14 @@ protected function createBankTransferAttachmentByFileNameRequest($xero_tenant_id * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createBankTransferHistoryRecord($xero_tenant_id, $bank_transfer_id, $history_records) + public function createBankTransferHistoryRecord($xero_tenant_id, $bank_transfer_id, $history_records, $idempotency_key = null) { - list($response) = $this->createBankTransferHistoryRecordWithHttpInfo($xero_tenant_id, $bank_transfer_id, $history_records); + list($response) = $this->createBankTransferHistoryRecordWithHttpInfo($xero_tenant_id, $bank_transfer_id, $history_records, $idempotency_key); return $response; } /** @@ -2107,13 +2171,14 @@ public function createBankTransferHistoryRecord($xero_tenant_id, $bank_transfer_ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\HistoryRecords|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createBankTransferHistoryRecordWithHttpInfo($xero_tenant_id, $bank_transfer_id, $history_records) + public function createBankTransferHistoryRecordWithHttpInfo($xero_tenant_id, $bank_transfer_id, $history_records, $idempotency_key = null) { - $request = $this->createBankTransferHistoryRecordRequest($xero_tenant_id, $bank_transfer_id, $history_records); + $request = $this->createBankTransferHistoryRecordRequest($xero_tenant_id, $bank_transfer_id, $history_records, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -2204,12 +2269,13 @@ public function createBankTransferHistoryRecordWithHttpInfo($xero_tenant_id, $ba * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createBankTransferHistoryRecordAsync($xero_tenant_id, $bank_transfer_id, $history_records) + public function createBankTransferHistoryRecordAsync($xero_tenant_id, $bank_transfer_id, $history_records, $idempotency_key = null) { - return $this->createBankTransferHistoryRecordAsyncWithHttpInfo($xero_tenant_id, $bank_transfer_id, $history_records) + return $this->createBankTransferHistoryRecordAsyncWithHttpInfo($xero_tenant_id, $bank_transfer_id, $history_records, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -2222,12 +2288,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createBankTransferHistoryRecordAsyncWithHttpInfo($xero_tenant_id, $bank_transfer_id, $history_records) + public function createBankTransferHistoryRecordAsyncWithHttpInfo($xero_tenant_id, $bank_transfer_id, $history_records, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords'; - $request = $this->createBankTransferHistoryRecordRequest($xero_tenant_id, $bank_transfer_id, $history_records); + $request = $this->createBankTransferHistoryRecordRequest($xero_tenant_id, $bank_transfer_id, $history_records, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -2266,9 +2333,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createBankTransferHistoryRecordRequest($xero_tenant_id, $bank_transfer_id, $history_records) + protected function createBankTransferHistoryRecordRequest($xero_tenant_id, $bank_transfer_id, $history_records, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -2298,6 +2366,10 @@ protected function createBankTransferHistoryRecordRequest($xero_tenant_id, $bank if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($bank_transfer_id !== null) { $resourcePath = str_replace( @@ -2375,13 +2447,14 @@ protected function createBankTransferHistoryRecordRequest($xero_tenant_id, $bank * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayments $batch_payments BatchPayments with an array of Payments in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createBatchPayment($xero_tenant_id, $batch_payments, $summarize_errors = false) + public function createBatchPayment($xero_tenant_id, $batch_payments, $summarize_errors = false, $idempotency_key = null) { - list($response) = $this->createBatchPaymentWithHttpInfo($xero_tenant_id, $batch_payments, $summarize_errors); + list($response) = $this->createBatchPaymentWithHttpInfo($xero_tenant_id, $batch_payments, $summarize_errors, $idempotency_key); return $response; } /** @@ -2390,13 +2463,14 @@ public function createBatchPayment($xero_tenant_id, $batch_payments, $summarize_ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayments $batch_payments BatchPayments with an array of Payments in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\BatchPayments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createBatchPaymentWithHttpInfo($xero_tenant_id, $batch_payments, $summarize_errors = false) + public function createBatchPaymentWithHttpInfo($xero_tenant_id, $batch_payments, $summarize_errors = false, $idempotency_key = null) { - $request = $this->createBatchPaymentRequest($xero_tenant_id, $batch_payments, $summarize_errors); + $request = $this->createBatchPaymentRequest($xero_tenant_id, $batch_payments, $summarize_errors, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -2487,12 +2561,13 @@ public function createBatchPaymentWithHttpInfo($xero_tenant_id, $batch_payments, * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayments $batch_payments BatchPayments with an array of Payments in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createBatchPaymentAsync($xero_tenant_id, $batch_payments, $summarize_errors = false) + public function createBatchPaymentAsync($xero_tenant_id, $batch_payments, $summarize_errors = false, $idempotency_key = null) { - return $this->createBatchPaymentAsyncWithHttpInfo($xero_tenant_id, $batch_payments, $summarize_errors) + return $this->createBatchPaymentAsyncWithHttpInfo($xero_tenant_id, $batch_payments, $summarize_errors, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -2505,12 +2580,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayments $batch_payments BatchPayments with an array of Payments in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createBatchPaymentAsyncWithHttpInfo($xero_tenant_id, $batch_payments, $summarize_errors = false) + public function createBatchPaymentAsyncWithHttpInfo($xero_tenant_id, $batch_payments, $summarize_errors = false, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayments'; - $request = $this->createBatchPaymentRequest($xero_tenant_id, $batch_payments, $summarize_errors); + $request = $this->createBatchPaymentRequest($xero_tenant_id, $batch_payments, $summarize_errors, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -2549,9 +2625,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayments $batch_payments BatchPayments with an array of Payments in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createBatchPaymentRequest($xero_tenant_id, $batch_payments, $summarize_errors = false) + protected function createBatchPaymentRequest($xero_tenant_id, $batch_payments, $summarize_errors = false, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -2579,6 +2656,10 @@ protected function createBatchPaymentRequest($xero_tenant_id, $batch_payments, $ if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($batch_payments)) { @@ -2648,13 +2729,14 @@ protected function createBatchPaymentRequest($xero_tenant_id, $batch_payments, $ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $batch_payment_id Unique identifier for BatchPayment (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createBatchPaymentHistoryRecord($xero_tenant_id, $batch_payment_id, $history_records) + public function createBatchPaymentHistoryRecord($xero_tenant_id, $batch_payment_id, $history_records, $idempotency_key = null) { - list($response) = $this->createBatchPaymentHistoryRecordWithHttpInfo($xero_tenant_id, $batch_payment_id, $history_records); + list($response) = $this->createBatchPaymentHistoryRecordWithHttpInfo($xero_tenant_id, $batch_payment_id, $history_records, $idempotency_key); return $response; } /** @@ -2663,13 +2745,14 @@ public function createBatchPaymentHistoryRecord($xero_tenant_id, $batch_payment_ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $batch_payment_id Unique identifier for BatchPayment (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\HistoryRecords|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createBatchPaymentHistoryRecordWithHttpInfo($xero_tenant_id, $batch_payment_id, $history_records) + public function createBatchPaymentHistoryRecordWithHttpInfo($xero_tenant_id, $batch_payment_id, $history_records, $idempotency_key = null) { - $request = $this->createBatchPaymentHistoryRecordRequest($xero_tenant_id, $batch_payment_id, $history_records); + $request = $this->createBatchPaymentHistoryRecordRequest($xero_tenant_id, $batch_payment_id, $history_records, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -2760,12 +2843,13 @@ public function createBatchPaymentHistoryRecordWithHttpInfo($xero_tenant_id, $ba * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $batch_payment_id Unique identifier for BatchPayment (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createBatchPaymentHistoryRecordAsync($xero_tenant_id, $batch_payment_id, $history_records) + public function createBatchPaymentHistoryRecordAsync($xero_tenant_id, $batch_payment_id, $history_records, $idempotency_key = null) { - return $this->createBatchPaymentHistoryRecordAsyncWithHttpInfo($xero_tenant_id, $batch_payment_id, $history_records) + return $this->createBatchPaymentHistoryRecordAsyncWithHttpInfo($xero_tenant_id, $batch_payment_id, $history_records, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -2778,12 +2862,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $batch_payment_id Unique identifier for BatchPayment (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createBatchPaymentHistoryRecordAsyncWithHttpInfo($xero_tenant_id, $batch_payment_id, $history_records) + public function createBatchPaymentHistoryRecordAsyncWithHttpInfo($xero_tenant_id, $batch_payment_id, $history_records, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords'; - $request = $this->createBatchPaymentHistoryRecordRequest($xero_tenant_id, $batch_payment_id, $history_records); + $request = $this->createBatchPaymentHistoryRecordRequest($xero_tenant_id, $batch_payment_id, $history_records, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -2822,9 +2907,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $batch_payment_id Unique identifier for BatchPayment (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createBatchPaymentHistoryRecordRequest($xero_tenant_id, $batch_payment_id, $history_records) + protected function createBatchPaymentHistoryRecordRequest($xero_tenant_id, $batch_payment_id, $history_records, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -2854,6 +2940,10 @@ protected function createBatchPaymentHistoryRecordRequest($xero_tenant_id, $batc if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($batch_payment_id !== null) { $resourcePath = str_replace( @@ -2931,13 +3021,14 @@ protected function createBatchPaymentHistoryRecordRequest($xero_tenant_id, $batc * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $branding_theme_id Unique identifier for a Branding Theme (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentServices $payment_services PaymentServices array with PaymentService object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentServices|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createBrandingThemePaymentServices($xero_tenant_id, $branding_theme_id, $payment_services) + public function createBrandingThemePaymentServices($xero_tenant_id, $branding_theme_id, $payment_services, $idempotency_key = null) { - list($response) = $this->createBrandingThemePaymentServicesWithHttpInfo($xero_tenant_id, $branding_theme_id, $payment_services); + list($response) = $this->createBrandingThemePaymentServicesWithHttpInfo($xero_tenant_id, $branding_theme_id, $payment_services, $idempotency_key); return $response; } /** @@ -2946,13 +3037,14 @@ public function createBrandingThemePaymentServices($xero_tenant_id, $branding_th * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $branding_theme_id Unique identifier for a Branding Theme (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentServices $payment_services PaymentServices array with PaymentService object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\PaymentServices|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createBrandingThemePaymentServicesWithHttpInfo($xero_tenant_id, $branding_theme_id, $payment_services) + public function createBrandingThemePaymentServicesWithHttpInfo($xero_tenant_id, $branding_theme_id, $payment_services, $idempotency_key = null) { - $request = $this->createBrandingThemePaymentServicesRequest($xero_tenant_id, $branding_theme_id, $payment_services); + $request = $this->createBrandingThemePaymentServicesRequest($xero_tenant_id, $branding_theme_id, $payment_services, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -3043,12 +3135,13 @@ public function createBrandingThemePaymentServicesWithHttpInfo($xero_tenant_id, * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $branding_theme_id Unique identifier for a Branding Theme (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentServices $payment_services PaymentServices array with PaymentService object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createBrandingThemePaymentServicesAsync($xero_tenant_id, $branding_theme_id, $payment_services) + public function createBrandingThemePaymentServicesAsync($xero_tenant_id, $branding_theme_id, $payment_services, $idempotency_key = null) { - return $this->createBrandingThemePaymentServicesAsyncWithHttpInfo($xero_tenant_id, $branding_theme_id, $payment_services) + return $this->createBrandingThemePaymentServicesAsyncWithHttpInfo($xero_tenant_id, $branding_theme_id, $payment_services, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -3061,12 +3154,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $branding_theme_id Unique identifier for a Branding Theme (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentServices $payment_services PaymentServices array with PaymentService object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createBrandingThemePaymentServicesAsyncWithHttpInfo($xero_tenant_id, $branding_theme_id, $payment_services) + public function createBrandingThemePaymentServicesAsyncWithHttpInfo($xero_tenant_id, $branding_theme_id, $payment_services, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentServices'; - $request = $this->createBrandingThemePaymentServicesRequest($xero_tenant_id, $branding_theme_id, $payment_services); + $request = $this->createBrandingThemePaymentServicesRequest($xero_tenant_id, $branding_theme_id, $payment_services, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -3105,9 +3199,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $branding_theme_id Unique identifier for a Branding Theme (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentServices $payment_services PaymentServices array with PaymentService object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createBrandingThemePaymentServicesRequest($xero_tenant_id, $branding_theme_id, $payment_services) + protected function createBrandingThemePaymentServicesRequest($xero_tenant_id, $branding_theme_id, $payment_services, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -3137,6 +3232,10 @@ protected function createBrandingThemePaymentServicesRequest($xero_tenant_id, $b if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($branding_theme_id !== null) { $resourcePath = str_replace( @@ -3214,13 +3313,14 @@ protected function createBrandingThemePaymentServicesRequest($xero_tenant_id, $b * @param string $contact_id Unique identifier for a Contact (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createContactAttachmentByFileName($xero_tenant_id, $contact_id, $file_name, $body) + public function createContactAttachmentByFileName($xero_tenant_id, $contact_id, $file_name, $body, $idempotency_key = null) { - list($response) = $this->createContactAttachmentByFileNameWithHttpInfo($xero_tenant_id, $contact_id, $file_name, $body); + list($response) = $this->createContactAttachmentByFileNameWithHttpInfo($xero_tenant_id, $contact_id, $file_name, $body, $idempotency_key); return $response; } /** @@ -3229,13 +3329,14 @@ public function createContactAttachmentByFileName($xero_tenant_id, $contact_id, * @param string $contact_id Unique identifier for a Contact (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createContactAttachmentByFileNameWithHttpInfo($xero_tenant_id, $contact_id, $file_name, $body) + public function createContactAttachmentByFileNameWithHttpInfo($xero_tenant_id, $contact_id, $file_name, $body, $idempotency_key = null) { - $request = $this->createContactAttachmentByFileNameRequest($xero_tenant_id, $contact_id, $file_name, $body); + $request = $this->createContactAttachmentByFileNameRequest($xero_tenant_id, $contact_id, $file_name, $body, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -3327,12 +3428,13 @@ public function createContactAttachmentByFileNameWithHttpInfo($xero_tenant_id, $ * @param string $contact_id Unique identifier for a Contact (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createContactAttachmentByFileNameAsync($xero_tenant_id, $contact_id, $file_name, $body) + public function createContactAttachmentByFileNameAsync($xero_tenant_id, $contact_id, $file_name, $body, $idempotency_key = null) { - return $this->createContactAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $contact_id, $file_name, $body) + return $this->createContactAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $contact_id, $file_name, $body, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -3346,12 +3448,13 @@ function ($response) { * @param string $contact_id Unique identifier for a Contact (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createContactAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $contact_id, $file_name, $body) + public function createContactAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $contact_id, $file_name, $body, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; - $request = $this->createContactAttachmentByFileNameRequest($xero_tenant_id, $contact_id, $file_name, $body); + $request = $this->createContactAttachmentByFileNameRequest($xero_tenant_id, $contact_id, $file_name, $body, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -3391,9 +3494,10 @@ function ($exception) { * @param string $contact_id Unique identifier for a Contact (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createContactAttachmentByFileNameRequest($xero_tenant_id, $contact_id, $file_name, $body) + protected function createContactAttachmentByFileNameRequest($xero_tenant_id, $contact_id, $file_name, $body, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -3429,6 +3533,10 @@ protected function createContactAttachmentByFileNameRequest($xero_tenant_id, $co if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($contact_id !== null) { $resourcePath = str_replace( @@ -3513,13 +3621,14 @@ protected function createContactAttachmentByFileNameRequest($xero_tenant_id, $co * Creates a contact group * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ContactGroups $contact_groups ContactGroups with an array of names in request body (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ContactGroups|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createContactGroup($xero_tenant_id, $contact_groups) + public function createContactGroup($xero_tenant_id, $contact_groups, $idempotency_key = null) { - list($response) = $this->createContactGroupWithHttpInfo($xero_tenant_id, $contact_groups); + list($response) = $this->createContactGroupWithHttpInfo($xero_tenant_id, $contact_groups, $idempotency_key); return $response; } /** @@ -3527,13 +3636,14 @@ public function createContactGroup($xero_tenant_id, $contact_groups) * Creates a contact group * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ContactGroups $contact_groups ContactGroups with an array of names in request body (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\ContactGroups|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createContactGroupWithHttpInfo($xero_tenant_id, $contact_groups) + public function createContactGroupWithHttpInfo($xero_tenant_id, $contact_groups, $idempotency_key = null) { - $request = $this->createContactGroupRequest($xero_tenant_id, $contact_groups); + $request = $this->createContactGroupRequest($xero_tenant_id, $contact_groups, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -3623,12 +3733,13 @@ public function createContactGroupWithHttpInfo($xero_tenant_id, $contact_groups) * Creates a contact group * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ContactGroups $contact_groups ContactGroups with an array of names in request body (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createContactGroupAsync($xero_tenant_id, $contact_groups) + public function createContactGroupAsync($xero_tenant_id, $contact_groups, $idempotency_key = null) { - return $this->createContactGroupAsyncWithHttpInfo($xero_tenant_id, $contact_groups) + return $this->createContactGroupAsyncWithHttpInfo($xero_tenant_id, $contact_groups, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -3640,12 +3751,13 @@ function ($response) { * Creates a contact group * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ContactGroups $contact_groups ContactGroups with an array of names in request body (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createContactGroupAsyncWithHttpInfo($xero_tenant_id, $contact_groups) + public function createContactGroupAsyncWithHttpInfo($xero_tenant_id, $contact_groups, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ContactGroups'; - $request = $this->createContactGroupRequest($xero_tenant_id, $contact_groups); + $request = $this->createContactGroupRequest($xero_tenant_id, $contact_groups, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -3683,9 +3795,10 @@ function ($exception) { * Create request for operation 'createContactGroup' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ContactGroups $contact_groups ContactGroups with an array of names in request body (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createContactGroupRequest($xero_tenant_id, $contact_groups) + protected function createContactGroupRequest($xero_tenant_id, $contact_groups, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -3709,6 +3822,10 @@ protected function createContactGroupRequest($xero_tenant_id, $contact_groups) if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($contact_groups)) { @@ -3778,13 +3895,14 @@ protected function createContactGroupRequest($xero_tenant_id, $contact_groups) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $contact_group_id Unique identifier for a Contact Group (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts $contacts Contacts with array of contacts specifying the ContactID to be added to ContactGroup in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createContactGroupContacts($xero_tenant_id, $contact_group_id, $contacts) + public function createContactGroupContacts($xero_tenant_id, $contact_group_id, $contacts, $idempotency_key = null) { - list($response) = $this->createContactGroupContactsWithHttpInfo($xero_tenant_id, $contact_group_id, $contacts); + list($response) = $this->createContactGroupContactsWithHttpInfo($xero_tenant_id, $contact_group_id, $contacts, $idempotency_key); return $response; } /** @@ -3793,13 +3911,14 @@ public function createContactGroupContacts($xero_tenant_id, $contact_group_id, $ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $contact_group_id Unique identifier for a Contact Group (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts $contacts Contacts with array of contacts specifying the ContactID to be added to ContactGroup in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Contacts|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createContactGroupContactsWithHttpInfo($xero_tenant_id, $contact_group_id, $contacts) + public function createContactGroupContactsWithHttpInfo($xero_tenant_id, $contact_group_id, $contacts, $idempotency_key = null) { - $request = $this->createContactGroupContactsRequest($xero_tenant_id, $contact_group_id, $contacts); + $request = $this->createContactGroupContactsRequest($xero_tenant_id, $contact_group_id, $contacts, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -3890,12 +4009,13 @@ public function createContactGroupContactsWithHttpInfo($xero_tenant_id, $contact * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $contact_group_id Unique identifier for a Contact Group (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts $contacts Contacts with array of contacts specifying the ContactID to be added to ContactGroup in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createContactGroupContactsAsync($xero_tenant_id, $contact_group_id, $contacts) + public function createContactGroupContactsAsync($xero_tenant_id, $contact_group_id, $contacts, $idempotency_key = null) { - return $this->createContactGroupContactsAsyncWithHttpInfo($xero_tenant_id, $contact_group_id, $contacts) + return $this->createContactGroupContactsAsyncWithHttpInfo($xero_tenant_id, $contact_group_id, $contacts, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -3908,12 +4028,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $contact_group_id Unique identifier for a Contact Group (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts $contacts Contacts with array of contacts specifying the ContactID to be added to ContactGroup in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createContactGroupContactsAsyncWithHttpInfo($xero_tenant_id, $contact_group_id, $contacts) + public function createContactGroupContactsAsyncWithHttpInfo($xero_tenant_id, $contact_group_id, $contacts, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts'; - $request = $this->createContactGroupContactsRequest($xero_tenant_id, $contact_group_id, $contacts); + $request = $this->createContactGroupContactsRequest($xero_tenant_id, $contact_group_id, $contacts, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -3952,9 +4073,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $contact_group_id Unique identifier for a Contact Group (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts $contacts Contacts with array of contacts specifying the ContactID to be added to ContactGroup in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createContactGroupContactsRequest($xero_tenant_id, $contact_group_id, $contacts) + protected function createContactGroupContactsRequest($xero_tenant_id, $contact_group_id, $contacts, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -3984,6 +4106,10 @@ protected function createContactGroupContactsRequest($xero_tenant_id, $contact_g if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($contact_group_id !== null) { $resourcePath = str_replace( @@ -4061,13 +4187,14 @@ protected function createContactGroupContactsRequest($xero_tenant_id, $contact_g * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $contact_id Unique identifier for a Contact (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createContactHistory($xero_tenant_id, $contact_id, $history_records) + public function createContactHistory($xero_tenant_id, $contact_id, $history_records, $idempotency_key = null) { - list($response) = $this->createContactHistoryWithHttpInfo($xero_tenant_id, $contact_id, $history_records); + list($response) = $this->createContactHistoryWithHttpInfo($xero_tenant_id, $contact_id, $history_records, $idempotency_key); return $response; } /** @@ -4076,13 +4203,14 @@ public function createContactHistory($xero_tenant_id, $contact_id, $history_reco * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $contact_id Unique identifier for a Contact (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\HistoryRecords|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createContactHistoryWithHttpInfo($xero_tenant_id, $contact_id, $history_records) + public function createContactHistoryWithHttpInfo($xero_tenant_id, $contact_id, $history_records, $idempotency_key = null) { - $request = $this->createContactHistoryRequest($xero_tenant_id, $contact_id, $history_records); + $request = $this->createContactHistoryRequest($xero_tenant_id, $contact_id, $history_records, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -4173,12 +4301,13 @@ public function createContactHistoryWithHttpInfo($xero_tenant_id, $contact_id, $ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $contact_id Unique identifier for a Contact (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createContactHistoryAsync($xero_tenant_id, $contact_id, $history_records) + public function createContactHistoryAsync($xero_tenant_id, $contact_id, $history_records, $idempotency_key = null) { - return $this->createContactHistoryAsyncWithHttpInfo($xero_tenant_id, $contact_id, $history_records) + return $this->createContactHistoryAsyncWithHttpInfo($xero_tenant_id, $contact_id, $history_records, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -4191,12 +4320,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $contact_id Unique identifier for a Contact (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createContactHistoryAsyncWithHttpInfo($xero_tenant_id, $contact_id, $history_records) + public function createContactHistoryAsyncWithHttpInfo($xero_tenant_id, $contact_id, $history_records, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords'; - $request = $this->createContactHistoryRequest($xero_tenant_id, $contact_id, $history_records); + $request = $this->createContactHistoryRequest($xero_tenant_id, $contact_id, $history_records, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -4235,9 +4365,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $contact_id Unique identifier for a Contact (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createContactHistoryRequest($xero_tenant_id, $contact_id, $history_records) + protected function createContactHistoryRequest($xero_tenant_id, $contact_id, $history_records, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -4267,6 +4398,10 @@ protected function createContactHistoryRequest($xero_tenant_id, $contact_id, $hi if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($contact_id !== null) { $resourcePath = str_replace( @@ -4344,13 +4479,14 @@ protected function createContactHistoryRequest($xero_tenant_id, $contact_id, $hi * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts $contacts Contacts with an array of Contact objects to create in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createContacts($xero_tenant_id, $contacts, $summarize_errors = false) + public function createContacts($xero_tenant_id, $contacts, $summarize_errors = false, $idempotency_key = null) { - list($response) = $this->createContactsWithHttpInfo($xero_tenant_id, $contacts, $summarize_errors); + list($response) = $this->createContactsWithHttpInfo($xero_tenant_id, $contacts, $summarize_errors, $idempotency_key); return $response; } /** @@ -4359,13 +4495,14 @@ public function createContacts($xero_tenant_id, $contacts, $summarize_errors = f * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts $contacts Contacts with an array of Contact objects to create in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Contacts|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createContactsWithHttpInfo($xero_tenant_id, $contacts, $summarize_errors = false) + public function createContactsWithHttpInfo($xero_tenant_id, $contacts, $summarize_errors = false, $idempotency_key = null) { - $request = $this->createContactsRequest($xero_tenant_id, $contacts, $summarize_errors); + $request = $this->createContactsRequest($xero_tenant_id, $contacts, $summarize_errors, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -4456,12 +4593,13 @@ public function createContactsWithHttpInfo($xero_tenant_id, $contacts, $summariz * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts $contacts Contacts with an array of Contact objects to create in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createContactsAsync($xero_tenant_id, $contacts, $summarize_errors = false) + public function createContactsAsync($xero_tenant_id, $contacts, $summarize_errors = false, $idempotency_key = null) { - return $this->createContactsAsyncWithHttpInfo($xero_tenant_id, $contacts, $summarize_errors) + return $this->createContactsAsyncWithHttpInfo($xero_tenant_id, $contacts, $summarize_errors, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -4474,12 +4612,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts $contacts Contacts with an array of Contact objects to create in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createContactsAsyncWithHttpInfo($xero_tenant_id, $contacts, $summarize_errors = false) + public function createContactsAsyncWithHttpInfo($xero_tenant_id, $contacts, $summarize_errors = false, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts'; - $request = $this->createContactsRequest($xero_tenant_id, $contacts, $summarize_errors); + $request = $this->createContactsRequest($xero_tenant_id, $contacts, $summarize_errors, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -4518,9 +4657,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts $contacts Contacts with an array of Contact objects to create in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createContactsRequest($xero_tenant_id, $contacts, $summarize_errors = false) + protected function createContactsRequest($xero_tenant_id, $contacts, $summarize_errors = false, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -4548,6 +4688,10 @@ protected function createContactsRequest($xero_tenant_id, $contacts, $summarize_ if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($contacts)) { @@ -4618,13 +4762,14 @@ protected function createContactsRequest($xero_tenant_id, $contacts, $summarize_ * @param string $credit_note_id Unique identifier for a Credit Note (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocations $allocations Allocations with array of Allocation object in body of request. (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocations|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createCreditNoteAllocation($xero_tenant_id, $credit_note_id, $allocations, $summarize_errors = false) + public function createCreditNoteAllocation($xero_tenant_id, $credit_note_id, $allocations, $summarize_errors = false, $idempotency_key = null) { - list($response) = $this->createCreditNoteAllocationWithHttpInfo($xero_tenant_id, $credit_note_id, $allocations, $summarize_errors); + list($response) = $this->createCreditNoteAllocationWithHttpInfo($xero_tenant_id, $credit_note_id, $allocations, $summarize_errors, $idempotency_key); return $response; } /** @@ -4634,13 +4779,14 @@ public function createCreditNoteAllocation($xero_tenant_id, $credit_note_id, $al * @param string $credit_note_id Unique identifier for a Credit Note (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocations $allocations Allocations with array of Allocation object in body of request. (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Allocations|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createCreditNoteAllocationWithHttpInfo($xero_tenant_id, $credit_note_id, $allocations, $summarize_errors = false) + public function createCreditNoteAllocationWithHttpInfo($xero_tenant_id, $credit_note_id, $allocations, $summarize_errors = false, $idempotency_key = null) { - $request = $this->createCreditNoteAllocationRequest($xero_tenant_id, $credit_note_id, $allocations, $summarize_errors); + $request = $this->createCreditNoteAllocationRequest($xero_tenant_id, $credit_note_id, $allocations, $summarize_errors, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -4732,12 +4878,13 @@ public function createCreditNoteAllocationWithHttpInfo($xero_tenant_id, $credit_ * @param string $credit_note_id Unique identifier for a Credit Note (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocations $allocations Allocations with array of Allocation object in body of request. (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createCreditNoteAllocationAsync($xero_tenant_id, $credit_note_id, $allocations, $summarize_errors = false) + public function createCreditNoteAllocationAsync($xero_tenant_id, $credit_note_id, $allocations, $summarize_errors = false, $idempotency_key = null) { - return $this->createCreditNoteAllocationAsyncWithHttpInfo($xero_tenant_id, $credit_note_id, $allocations, $summarize_errors) + return $this->createCreditNoteAllocationAsyncWithHttpInfo($xero_tenant_id, $credit_note_id, $allocations, $summarize_errors, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -4751,12 +4898,13 @@ function ($response) { * @param string $credit_note_id Unique identifier for a Credit Note (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocations $allocations Allocations with array of Allocation object in body of request. (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createCreditNoteAllocationAsyncWithHttpInfo($xero_tenant_id, $credit_note_id, $allocations, $summarize_errors = false) + public function createCreditNoteAllocationAsyncWithHttpInfo($xero_tenant_id, $credit_note_id, $allocations, $summarize_errors = false, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocations'; - $request = $this->createCreditNoteAllocationRequest($xero_tenant_id, $credit_note_id, $allocations, $summarize_errors); + $request = $this->createCreditNoteAllocationRequest($xero_tenant_id, $credit_note_id, $allocations, $summarize_errors, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -4796,9 +4944,10 @@ function ($exception) { * @param string $credit_note_id Unique identifier for a Credit Note (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocations $allocations Allocations with array of Allocation object in body of request. (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createCreditNoteAllocationRequest($xero_tenant_id, $credit_note_id, $allocations, $summarize_errors = false) + protected function createCreditNoteAllocationRequest($xero_tenant_id, $credit_note_id, $allocations, $summarize_errors = false, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -4832,6 +4981,10 @@ protected function createCreditNoteAllocationRequest($xero_tenant_id, $credit_no if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($credit_note_id !== null) { $resourcePath = str_replace( @@ -4911,13 +5064,14 @@ protected function createCreditNoteAllocationRequest($xero_tenant_id, $credit_no * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) * @param bool $include_online Allows an attachment to be seen by the end customer within their online invoice (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createCreditNoteAttachmentByFileName($xero_tenant_id, $credit_note_id, $file_name, $body, $include_online = false) + public function createCreditNoteAttachmentByFileName($xero_tenant_id, $credit_note_id, $file_name, $body, $include_online = false, $idempotency_key = null) { - list($response) = $this->createCreditNoteAttachmentByFileNameWithHttpInfo($xero_tenant_id, $credit_note_id, $file_name, $body, $include_online); + list($response) = $this->createCreditNoteAttachmentByFileNameWithHttpInfo($xero_tenant_id, $credit_note_id, $file_name, $body, $include_online, $idempotency_key); return $response; } /** @@ -4928,13 +5082,14 @@ public function createCreditNoteAttachmentByFileName($xero_tenant_id, $credit_no * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) * @param bool $include_online Allows an attachment to be seen by the end customer within their online invoice (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createCreditNoteAttachmentByFileNameWithHttpInfo($xero_tenant_id, $credit_note_id, $file_name, $body, $include_online = false) + public function createCreditNoteAttachmentByFileNameWithHttpInfo($xero_tenant_id, $credit_note_id, $file_name, $body, $include_online = false, $idempotency_key = null) { - $request = $this->createCreditNoteAttachmentByFileNameRequest($xero_tenant_id, $credit_note_id, $file_name, $body, $include_online); + $request = $this->createCreditNoteAttachmentByFileNameRequest($xero_tenant_id, $credit_note_id, $file_name, $body, $include_online, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -5027,12 +5182,13 @@ public function createCreditNoteAttachmentByFileNameWithHttpInfo($xero_tenant_id * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) * @param bool $include_online Allows an attachment to be seen by the end customer within their online invoice (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createCreditNoteAttachmentByFileNameAsync($xero_tenant_id, $credit_note_id, $file_name, $body, $include_online = false) + public function createCreditNoteAttachmentByFileNameAsync($xero_tenant_id, $credit_note_id, $file_name, $body, $include_online = false, $idempotency_key = null) { - return $this->createCreditNoteAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $credit_note_id, $file_name, $body, $include_online) + return $this->createCreditNoteAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $credit_note_id, $file_name, $body, $include_online, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -5047,12 +5203,13 @@ function ($response) { * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) * @param bool $include_online Allows an attachment to be seen by the end customer within their online invoice (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createCreditNoteAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $credit_note_id, $file_name, $body, $include_online = false) + public function createCreditNoteAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $credit_note_id, $file_name, $body, $include_online = false, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; - $request = $this->createCreditNoteAttachmentByFileNameRequest($xero_tenant_id, $credit_note_id, $file_name, $body, $include_online); + $request = $this->createCreditNoteAttachmentByFileNameRequest($xero_tenant_id, $credit_note_id, $file_name, $body, $include_online, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -5093,9 +5250,10 @@ function ($exception) { * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) * @param bool $include_online Allows an attachment to be seen by the end customer within their online invoice (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createCreditNoteAttachmentByFileNameRequest($xero_tenant_id, $credit_note_id, $file_name, $body, $include_online = false) + protected function createCreditNoteAttachmentByFileNameRequest($xero_tenant_id, $credit_note_id, $file_name, $body, $include_online = false, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -5135,6 +5293,10 @@ protected function createCreditNoteAttachmentByFileNameRequest($xero_tenant_id, if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($credit_note_id !== null) { $resourcePath = str_replace( @@ -5220,13 +5382,14 @@ protected function createCreditNoteAttachmentByFileNameRequest($xero_tenant_id, * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $credit_note_id Unique identifier for a Credit Note (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createCreditNoteHistory($xero_tenant_id, $credit_note_id, $history_records) + public function createCreditNoteHistory($xero_tenant_id, $credit_note_id, $history_records, $idempotency_key = null) { - list($response) = $this->createCreditNoteHistoryWithHttpInfo($xero_tenant_id, $credit_note_id, $history_records); + list($response) = $this->createCreditNoteHistoryWithHttpInfo($xero_tenant_id, $credit_note_id, $history_records, $idempotency_key); return $response; } /** @@ -5235,13 +5398,14 @@ public function createCreditNoteHistory($xero_tenant_id, $credit_note_id, $histo * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $credit_note_id Unique identifier for a Credit Note (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\HistoryRecords|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createCreditNoteHistoryWithHttpInfo($xero_tenant_id, $credit_note_id, $history_records) + public function createCreditNoteHistoryWithHttpInfo($xero_tenant_id, $credit_note_id, $history_records, $idempotency_key = null) { - $request = $this->createCreditNoteHistoryRequest($xero_tenant_id, $credit_note_id, $history_records); + $request = $this->createCreditNoteHistoryRequest($xero_tenant_id, $credit_note_id, $history_records, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -5332,12 +5496,13 @@ public function createCreditNoteHistoryWithHttpInfo($xero_tenant_id, $credit_not * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $credit_note_id Unique identifier for a Credit Note (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createCreditNoteHistoryAsync($xero_tenant_id, $credit_note_id, $history_records) + public function createCreditNoteHistoryAsync($xero_tenant_id, $credit_note_id, $history_records, $idempotency_key = null) { - return $this->createCreditNoteHistoryAsyncWithHttpInfo($xero_tenant_id, $credit_note_id, $history_records) + return $this->createCreditNoteHistoryAsyncWithHttpInfo($xero_tenant_id, $credit_note_id, $history_records, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -5350,12 +5515,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $credit_note_id Unique identifier for a Credit Note (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createCreditNoteHistoryAsyncWithHttpInfo($xero_tenant_id, $credit_note_id, $history_records) + public function createCreditNoteHistoryAsyncWithHttpInfo($xero_tenant_id, $credit_note_id, $history_records, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords'; - $request = $this->createCreditNoteHistoryRequest($xero_tenant_id, $credit_note_id, $history_records); + $request = $this->createCreditNoteHistoryRequest($xero_tenant_id, $credit_note_id, $history_records, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -5394,9 +5560,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $credit_note_id Unique identifier for a Credit Note (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createCreditNoteHistoryRequest($xero_tenant_id, $credit_note_id, $history_records) + protected function createCreditNoteHistoryRequest($xero_tenant_id, $credit_note_id, $history_records, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -5426,6 +5593,10 @@ protected function createCreditNoteHistoryRequest($xero_tenant_id, $credit_note_ if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($credit_note_id !== null) { $resourcePath = str_replace( @@ -5504,13 +5675,14 @@ protected function createCreditNoteHistoryRequest($xero_tenant_id, $credit_note_ * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CreditNotes $credit_notes Credit Notes with array of CreditNote object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CreditNotes|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createCreditNotes($xero_tenant_id, $credit_notes, $summarize_errors = false, $unitdp = null) + public function createCreditNotes($xero_tenant_id, $credit_notes, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { - list($response) = $this->createCreditNotesWithHttpInfo($xero_tenant_id, $credit_notes, $summarize_errors, $unitdp); + list($response) = $this->createCreditNotesWithHttpInfo($xero_tenant_id, $credit_notes, $summarize_errors, $unitdp, $idempotency_key); return $response; } /** @@ -5520,13 +5692,14 @@ public function createCreditNotes($xero_tenant_id, $credit_notes, $summarize_err * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CreditNotes $credit_notes Credit Notes with array of CreditNote object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\CreditNotes|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createCreditNotesWithHttpInfo($xero_tenant_id, $credit_notes, $summarize_errors = false, $unitdp = null) + public function createCreditNotesWithHttpInfo($xero_tenant_id, $credit_notes, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { - $request = $this->createCreditNotesRequest($xero_tenant_id, $credit_notes, $summarize_errors, $unitdp); + $request = $this->createCreditNotesRequest($xero_tenant_id, $credit_notes, $summarize_errors, $unitdp, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -5618,12 +5791,13 @@ public function createCreditNotesWithHttpInfo($xero_tenant_id, $credit_notes, $s * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CreditNotes $credit_notes Credit Notes with array of CreditNote object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createCreditNotesAsync($xero_tenant_id, $credit_notes, $summarize_errors = false, $unitdp = null) + public function createCreditNotesAsync($xero_tenant_id, $credit_notes, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { - return $this->createCreditNotesAsyncWithHttpInfo($xero_tenant_id, $credit_notes, $summarize_errors, $unitdp) + return $this->createCreditNotesAsyncWithHttpInfo($xero_tenant_id, $credit_notes, $summarize_errors, $unitdp, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -5637,12 +5811,13 @@ function ($response) { * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CreditNotes $credit_notes Credit Notes with array of CreditNote object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createCreditNotesAsyncWithHttpInfo($xero_tenant_id, $credit_notes, $summarize_errors = false, $unitdp = null) + public function createCreditNotesAsyncWithHttpInfo($xero_tenant_id, $credit_notes, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CreditNotes'; - $request = $this->createCreditNotesRequest($xero_tenant_id, $credit_notes, $summarize_errors, $unitdp); + $request = $this->createCreditNotesRequest($xero_tenant_id, $credit_notes, $summarize_errors, $unitdp, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -5682,9 +5857,10 @@ function ($exception) { * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CreditNotes $credit_notes Credit Notes with array of CreditNote object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createCreditNotesRequest($xero_tenant_id, $credit_notes, $summarize_errors = false, $unitdp = null) + protected function createCreditNotesRequest($xero_tenant_id, $credit_notes, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -5716,6 +5892,10 @@ protected function createCreditNotesRequest($xero_tenant_id, $credit_notes, $sum if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($credit_notes)) { @@ -5784,13 +5964,14 @@ protected function createCreditNotesRequest($xero_tenant_id, $credit_notes, $sum * Create a new currency for a Xero organisation * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Currency $currency Currency object in the body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Currencies */ - public function createCurrency($xero_tenant_id, $currency) + public function createCurrency($xero_tenant_id, $currency, $idempotency_key = null) { - list($response) = $this->createCurrencyWithHttpInfo($xero_tenant_id, $currency); + list($response) = $this->createCurrencyWithHttpInfo($xero_tenant_id, $currency, $idempotency_key); return $response; } /** @@ -5798,13 +5979,14 @@ public function createCurrency($xero_tenant_id, $currency) * Create a new currency for a Xero organisation * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Currency $currency Currency object in the body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Currencies, HTTP status code, HTTP response headers (array of strings) */ - public function createCurrencyWithHttpInfo($xero_tenant_id, $currency) + public function createCurrencyWithHttpInfo($xero_tenant_id, $currency, $idempotency_key = null) { - $request = $this->createCurrencyRequest($xero_tenant_id, $currency); + $request = $this->createCurrencyRequest($xero_tenant_id, $currency, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -5875,12 +6057,13 @@ public function createCurrencyWithHttpInfo($xero_tenant_id, $currency) * Create a new currency for a Xero organisation * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Currency $currency Currency object in the body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createCurrencyAsync($xero_tenant_id, $currency) + public function createCurrencyAsync($xero_tenant_id, $currency, $idempotency_key = null) { - return $this->createCurrencyAsyncWithHttpInfo($xero_tenant_id, $currency) + return $this->createCurrencyAsyncWithHttpInfo($xero_tenant_id, $currency, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -5892,12 +6075,13 @@ function ($response) { * Create a new currency for a Xero organisation * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Currency $currency Currency object in the body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createCurrencyAsyncWithHttpInfo($xero_tenant_id, $currency) + public function createCurrencyAsyncWithHttpInfo($xero_tenant_id, $currency, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Currencies'; - $request = $this->createCurrencyRequest($xero_tenant_id, $currency); + $request = $this->createCurrencyRequest($xero_tenant_id, $currency, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -5935,9 +6119,10 @@ function ($exception) { * Create request for operation 'createCurrency' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Currency $currency Currency object in the body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createCurrencyRequest($xero_tenant_id, $currency) + protected function createCurrencyRequest($xero_tenant_id, $currency, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -5961,6 +6146,10 @@ protected function createCurrencyRequest($xero_tenant_id, $currency) if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($currency)) { @@ -6030,13 +6219,14 @@ protected function createCurrencyRequest($xero_tenant_id, $currency) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Employees $employees Employees with array of Employee object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Employees|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createEmployees($xero_tenant_id, $employees, $summarize_errors = false) + public function createEmployees($xero_tenant_id, $employees, $summarize_errors = false, $idempotency_key = null) { - list($response) = $this->createEmployeesWithHttpInfo($xero_tenant_id, $employees, $summarize_errors); + list($response) = $this->createEmployeesWithHttpInfo($xero_tenant_id, $employees, $summarize_errors, $idempotency_key); return $response; } /** @@ -6045,13 +6235,14 @@ public function createEmployees($xero_tenant_id, $employees, $summarize_errors = * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Employees $employees Employees with array of Employee object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Employees|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createEmployeesWithHttpInfo($xero_tenant_id, $employees, $summarize_errors = false) + public function createEmployeesWithHttpInfo($xero_tenant_id, $employees, $summarize_errors = false, $idempotency_key = null) { - $request = $this->createEmployeesRequest($xero_tenant_id, $employees, $summarize_errors); + $request = $this->createEmployeesRequest($xero_tenant_id, $employees, $summarize_errors, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -6142,12 +6333,13 @@ public function createEmployeesWithHttpInfo($xero_tenant_id, $employees, $summar * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Employees $employees Employees with array of Employee object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeesAsync($xero_tenant_id, $employees, $summarize_errors = false) + public function createEmployeesAsync($xero_tenant_id, $employees, $summarize_errors = false, $idempotency_key = null) { - return $this->createEmployeesAsyncWithHttpInfo($xero_tenant_id, $employees, $summarize_errors) + return $this->createEmployeesAsyncWithHttpInfo($xero_tenant_id, $employees, $summarize_errors, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -6160,12 +6352,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Employees $employees Employees with array of Employee object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeesAsyncWithHttpInfo($xero_tenant_id, $employees, $summarize_errors = false) + public function createEmployeesAsyncWithHttpInfo($xero_tenant_id, $employees, $summarize_errors = false, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Employees'; - $request = $this->createEmployeesRequest($xero_tenant_id, $employees, $summarize_errors); + $request = $this->createEmployeesRequest($xero_tenant_id, $employees, $summarize_errors, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -6204,9 +6397,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Employees $employees Employees with array of Employee object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createEmployeesRequest($xero_tenant_id, $employees, $summarize_errors = false) + protected function createEmployeesRequest($xero_tenant_id, $employees, $summarize_errors = false, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -6234,6 +6428,10 @@ protected function createEmployeesRequest($xero_tenant_id, $employees, $summariz if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($employees)) { @@ -6303,13 +6501,14 @@ protected function createEmployeesRequest($xero_tenant_id, $employees, $summariz * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $expense_claim_id Unique identifier for a ExpenseClaim (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords */ - public function createExpenseClaimHistory($xero_tenant_id, $expense_claim_id, $history_records) + public function createExpenseClaimHistory($xero_tenant_id, $expense_claim_id, $history_records, $idempotency_key = null) { - list($response) = $this->createExpenseClaimHistoryWithHttpInfo($xero_tenant_id, $expense_claim_id, $history_records); + list($response) = $this->createExpenseClaimHistoryWithHttpInfo($xero_tenant_id, $expense_claim_id, $history_records, $idempotency_key); return $response; } /** @@ -6318,13 +6517,14 @@ public function createExpenseClaimHistory($xero_tenant_id, $expense_claim_id, $h * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $expense_claim_id Unique identifier for a ExpenseClaim (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\HistoryRecords, HTTP status code, HTTP response headers (array of strings) */ - public function createExpenseClaimHistoryWithHttpInfo($xero_tenant_id, $expense_claim_id, $history_records) + public function createExpenseClaimHistoryWithHttpInfo($xero_tenant_id, $expense_claim_id, $history_records, $idempotency_key = null) { - $request = $this->createExpenseClaimHistoryRequest($xero_tenant_id, $expense_claim_id, $history_records); + $request = $this->createExpenseClaimHistoryRequest($xero_tenant_id, $expense_claim_id, $history_records, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -6396,12 +6596,13 @@ public function createExpenseClaimHistoryWithHttpInfo($xero_tenant_id, $expense_ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $expense_claim_id Unique identifier for a ExpenseClaim (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createExpenseClaimHistoryAsync($xero_tenant_id, $expense_claim_id, $history_records) + public function createExpenseClaimHistoryAsync($xero_tenant_id, $expense_claim_id, $history_records, $idempotency_key = null) { - return $this->createExpenseClaimHistoryAsyncWithHttpInfo($xero_tenant_id, $expense_claim_id, $history_records) + return $this->createExpenseClaimHistoryAsyncWithHttpInfo($xero_tenant_id, $expense_claim_id, $history_records, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -6414,12 +6615,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $expense_claim_id Unique identifier for a ExpenseClaim (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createExpenseClaimHistoryAsyncWithHttpInfo($xero_tenant_id, $expense_claim_id, $history_records) + public function createExpenseClaimHistoryAsyncWithHttpInfo($xero_tenant_id, $expense_claim_id, $history_records, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords'; - $request = $this->createExpenseClaimHistoryRequest($xero_tenant_id, $expense_claim_id, $history_records); + $request = $this->createExpenseClaimHistoryRequest($xero_tenant_id, $expense_claim_id, $history_records, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -6458,9 +6660,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $expense_claim_id Unique identifier for a ExpenseClaim (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createExpenseClaimHistoryRequest($xero_tenant_id, $expense_claim_id, $history_records) + protected function createExpenseClaimHistoryRequest($xero_tenant_id, $expense_claim_id, $history_records, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -6490,6 +6693,10 @@ protected function createExpenseClaimHistoryRequest($xero_tenant_id, $expense_cl if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($expense_claim_id !== null) { $resourcePath = str_replace( @@ -6566,13 +6773,14 @@ protected function createExpenseClaimHistoryRequest($xero_tenant_id, $expense_cl * Creates expense claims * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ExpenseClaims $expense_claims ExpenseClaims with array of ExpenseClaim object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ExpenseClaims|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createExpenseClaims($xero_tenant_id, $expense_claims) + public function createExpenseClaims($xero_tenant_id, $expense_claims, $idempotency_key = null) { - list($response) = $this->createExpenseClaimsWithHttpInfo($xero_tenant_id, $expense_claims); + list($response) = $this->createExpenseClaimsWithHttpInfo($xero_tenant_id, $expense_claims, $idempotency_key); return $response; } /** @@ -6580,13 +6788,14 @@ public function createExpenseClaims($xero_tenant_id, $expense_claims) * Creates expense claims * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ExpenseClaims $expense_claims ExpenseClaims with array of ExpenseClaim object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\ExpenseClaims|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createExpenseClaimsWithHttpInfo($xero_tenant_id, $expense_claims) + public function createExpenseClaimsWithHttpInfo($xero_tenant_id, $expense_claims, $idempotency_key = null) { - $request = $this->createExpenseClaimsRequest($xero_tenant_id, $expense_claims); + $request = $this->createExpenseClaimsRequest($xero_tenant_id, $expense_claims, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -6676,12 +6885,13 @@ public function createExpenseClaimsWithHttpInfo($xero_tenant_id, $expense_claims * Creates expense claims * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ExpenseClaims $expense_claims ExpenseClaims with array of ExpenseClaim object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createExpenseClaimsAsync($xero_tenant_id, $expense_claims) + public function createExpenseClaimsAsync($xero_tenant_id, $expense_claims, $idempotency_key = null) { - return $this->createExpenseClaimsAsyncWithHttpInfo($xero_tenant_id, $expense_claims) + return $this->createExpenseClaimsAsyncWithHttpInfo($xero_tenant_id, $expense_claims, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -6693,12 +6903,13 @@ function ($response) { * Creates expense claims * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ExpenseClaims $expense_claims ExpenseClaims with array of ExpenseClaim object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createExpenseClaimsAsyncWithHttpInfo($xero_tenant_id, $expense_claims) + public function createExpenseClaimsAsyncWithHttpInfo($xero_tenant_id, $expense_claims, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ExpenseClaims'; - $request = $this->createExpenseClaimsRequest($xero_tenant_id, $expense_claims); + $request = $this->createExpenseClaimsRequest($xero_tenant_id, $expense_claims, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -6736,9 +6947,10 @@ function ($exception) { * Create request for operation 'createExpenseClaims' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ExpenseClaims $expense_claims ExpenseClaims with array of ExpenseClaim object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createExpenseClaimsRequest($xero_tenant_id, $expense_claims) + protected function createExpenseClaimsRequest($xero_tenant_id, $expense_claims, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -6762,6 +6974,10 @@ protected function createExpenseClaimsRequest($xero_tenant_id, $expense_claims) if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($expense_claims)) { @@ -6833,13 +7049,14 @@ protected function createExpenseClaimsRequest($xero_tenant_id, $expense_claims) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) * @param bool $include_online Allows an attachment to be seen by the end customer within their online invoice (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createInvoiceAttachmentByFileName($xero_tenant_id, $invoice_id, $file_name, $body, $include_online = false) + public function createInvoiceAttachmentByFileName($xero_tenant_id, $invoice_id, $file_name, $body, $include_online = false, $idempotency_key = null) { - list($response) = $this->createInvoiceAttachmentByFileNameWithHttpInfo($xero_tenant_id, $invoice_id, $file_name, $body, $include_online); + list($response) = $this->createInvoiceAttachmentByFileNameWithHttpInfo($xero_tenant_id, $invoice_id, $file_name, $body, $include_online, $idempotency_key); return $response; } /** @@ -6850,13 +7067,14 @@ public function createInvoiceAttachmentByFileName($xero_tenant_id, $invoice_id, * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) * @param bool $include_online Allows an attachment to be seen by the end customer within their online invoice (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createInvoiceAttachmentByFileNameWithHttpInfo($xero_tenant_id, $invoice_id, $file_name, $body, $include_online = false) + public function createInvoiceAttachmentByFileNameWithHttpInfo($xero_tenant_id, $invoice_id, $file_name, $body, $include_online = false, $idempotency_key = null) { - $request = $this->createInvoiceAttachmentByFileNameRequest($xero_tenant_id, $invoice_id, $file_name, $body, $include_online); + $request = $this->createInvoiceAttachmentByFileNameRequest($xero_tenant_id, $invoice_id, $file_name, $body, $include_online, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -6949,12 +7167,13 @@ public function createInvoiceAttachmentByFileNameWithHttpInfo($xero_tenant_id, $ * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) * @param bool $include_online Allows an attachment to be seen by the end customer within their online invoice (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createInvoiceAttachmentByFileNameAsync($xero_tenant_id, $invoice_id, $file_name, $body, $include_online = false) + public function createInvoiceAttachmentByFileNameAsync($xero_tenant_id, $invoice_id, $file_name, $body, $include_online = false, $idempotency_key = null) { - return $this->createInvoiceAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $invoice_id, $file_name, $body, $include_online) + return $this->createInvoiceAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $invoice_id, $file_name, $body, $include_online, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -6969,12 +7188,13 @@ function ($response) { * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) * @param bool $include_online Allows an attachment to be seen by the end customer within their online invoice (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createInvoiceAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $invoice_id, $file_name, $body, $include_online = false) + public function createInvoiceAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $invoice_id, $file_name, $body, $include_online = false, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; - $request = $this->createInvoiceAttachmentByFileNameRequest($xero_tenant_id, $invoice_id, $file_name, $body, $include_online); + $request = $this->createInvoiceAttachmentByFileNameRequest($xero_tenant_id, $invoice_id, $file_name, $body, $include_online, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -7015,9 +7235,10 @@ function ($exception) { * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) * @param bool $include_online Allows an attachment to be seen by the end customer within their online invoice (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createInvoiceAttachmentByFileNameRequest($xero_tenant_id, $invoice_id, $file_name, $body, $include_online = false) + protected function createInvoiceAttachmentByFileNameRequest($xero_tenant_id, $invoice_id, $file_name, $body, $include_online = false, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -7057,6 +7278,10 @@ protected function createInvoiceAttachmentByFileNameRequest($xero_tenant_id, $in if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($invoice_id !== null) { $resourcePath = str_replace( @@ -7142,13 +7367,14 @@ protected function createInvoiceAttachmentByFileNameRequest($xero_tenant_id, $in * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $invoice_id Unique identifier for an Invoice (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createInvoiceHistory($xero_tenant_id, $invoice_id, $history_records) + public function createInvoiceHistory($xero_tenant_id, $invoice_id, $history_records, $idempotency_key = null) { - list($response) = $this->createInvoiceHistoryWithHttpInfo($xero_tenant_id, $invoice_id, $history_records); + list($response) = $this->createInvoiceHistoryWithHttpInfo($xero_tenant_id, $invoice_id, $history_records, $idempotency_key); return $response; } /** @@ -7157,13 +7383,14 @@ public function createInvoiceHistory($xero_tenant_id, $invoice_id, $history_reco * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $invoice_id Unique identifier for an Invoice (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\HistoryRecords|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createInvoiceHistoryWithHttpInfo($xero_tenant_id, $invoice_id, $history_records) + public function createInvoiceHistoryWithHttpInfo($xero_tenant_id, $invoice_id, $history_records, $idempotency_key = null) { - $request = $this->createInvoiceHistoryRequest($xero_tenant_id, $invoice_id, $history_records); + $request = $this->createInvoiceHistoryRequest($xero_tenant_id, $invoice_id, $history_records, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -7254,12 +7481,13 @@ public function createInvoiceHistoryWithHttpInfo($xero_tenant_id, $invoice_id, $ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $invoice_id Unique identifier for an Invoice (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createInvoiceHistoryAsync($xero_tenant_id, $invoice_id, $history_records) + public function createInvoiceHistoryAsync($xero_tenant_id, $invoice_id, $history_records, $idempotency_key = null) { - return $this->createInvoiceHistoryAsyncWithHttpInfo($xero_tenant_id, $invoice_id, $history_records) + return $this->createInvoiceHistoryAsyncWithHttpInfo($xero_tenant_id, $invoice_id, $history_records, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -7272,12 +7500,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $invoice_id Unique identifier for an Invoice (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createInvoiceHistoryAsyncWithHttpInfo($xero_tenant_id, $invoice_id, $history_records) + public function createInvoiceHistoryAsyncWithHttpInfo($xero_tenant_id, $invoice_id, $history_records, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords'; - $request = $this->createInvoiceHistoryRequest($xero_tenant_id, $invoice_id, $history_records); + $request = $this->createInvoiceHistoryRequest($xero_tenant_id, $invoice_id, $history_records, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -7316,9 +7545,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $invoice_id Unique identifier for an Invoice (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createInvoiceHistoryRequest($xero_tenant_id, $invoice_id, $history_records) + protected function createInvoiceHistoryRequest($xero_tenant_id, $invoice_id, $history_records, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -7348,6 +7578,10 @@ protected function createInvoiceHistoryRequest($xero_tenant_id, $invoice_id, $hi if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($invoice_id !== null) { $resourcePath = str_replace( @@ -7426,13 +7660,14 @@ protected function createInvoiceHistoryRequest($xero_tenant_id, $invoice_id, $hi * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Invoices $invoices Invoices with an array of invoice objects in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Invoices|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createInvoices($xero_tenant_id, $invoices, $summarize_errors = false, $unitdp = null) + public function createInvoices($xero_tenant_id, $invoices, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { - list($response) = $this->createInvoicesWithHttpInfo($xero_tenant_id, $invoices, $summarize_errors, $unitdp); + list($response) = $this->createInvoicesWithHttpInfo($xero_tenant_id, $invoices, $summarize_errors, $unitdp, $idempotency_key); return $response; } /** @@ -7442,13 +7677,14 @@ public function createInvoices($xero_tenant_id, $invoices, $summarize_errors = f * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Invoices $invoices Invoices with an array of invoice objects in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Invoices|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createInvoicesWithHttpInfo($xero_tenant_id, $invoices, $summarize_errors = false, $unitdp = null) + public function createInvoicesWithHttpInfo($xero_tenant_id, $invoices, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { - $request = $this->createInvoicesRequest($xero_tenant_id, $invoices, $summarize_errors, $unitdp); + $request = $this->createInvoicesRequest($xero_tenant_id, $invoices, $summarize_errors, $unitdp, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -7540,12 +7776,13 @@ public function createInvoicesWithHttpInfo($xero_tenant_id, $invoices, $summariz * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Invoices $invoices Invoices with an array of invoice objects in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createInvoicesAsync($xero_tenant_id, $invoices, $summarize_errors = false, $unitdp = null) + public function createInvoicesAsync($xero_tenant_id, $invoices, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { - return $this->createInvoicesAsyncWithHttpInfo($xero_tenant_id, $invoices, $summarize_errors, $unitdp) + return $this->createInvoicesAsyncWithHttpInfo($xero_tenant_id, $invoices, $summarize_errors, $unitdp, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -7559,12 +7796,13 @@ function ($response) { * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Invoices $invoices Invoices with an array of invoice objects in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createInvoicesAsyncWithHttpInfo($xero_tenant_id, $invoices, $summarize_errors = false, $unitdp = null) + public function createInvoicesAsyncWithHttpInfo($xero_tenant_id, $invoices, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Invoices'; - $request = $this->createInvoicesRequest($xero_tenant_id, $invoices, $summarize_errors, $unitdp); + $request = $this->createInvoicesRequest($xero_tenant_id, $invoices, $summarize_errors, $unitdp, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -7604,9 +7842,10 @@ function ($exception) { * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Invoices $invoices Invoices with an array of invoice objects in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createInvoicesRequest($xero_tenant_id, $invoices, $summarize_errors = false, $unitdp = null) + protected function createInvoicesRequest($xero_tenant_id, $invoices, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -7638,6 +7877,10 @@ protected function createInvoicesRequest($xero_tenant_id, $invoices, $summarize_ if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($invoices)) { @@ -7707,13 +7950,14 @@ protected function createInvoicesRequest($xero_tenant_id, $invoices, $summarize_ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $item_id Unique identifier for an Item (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords */ - public function createItemHistory($xero_tenant_id, $item_id, $history_records) + public function createItemHistory($xero_tenant_id, $item_id, $history_records, $idempotency_key = null) { - list($response) = $this->createItemHistoryWithHttpInfo($xero_tenant_id, $item_id, $history_records); + list($response) = $this->createItemHistoryWithHttpInfo($xero_tenant_id, $item_id, $history_records, $idempotency_key); return $response; } /** @@ -7722,13 +7966,14 @@ public function createItemHistory($xero_tenant_id, $item_id, $history_records) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $item_id Unique identifier for an Item (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\HistoryRecords, HTTP status code, HTTP response headers (array of strings) */ - public function createItemHistoryWithHttpInfo($xero_tenant_id, $item_id, $history_records) + public function createItemHistoryWithHttpInfo($xero_tenant_id, $item_id, $history_records, $idempotency_key = null) { - $request = $this->createItemHistoryRequest($xero_tenant_id, $item_id, $history_records); + $request = $this->createItemHistoryRequest($xero_tenant_id, $item_id, $history_records, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -7800,12 +8045,13 @@ public function createItemHistoryWithHttpInfo($xero_tenant_id, $item_id, $histor * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $item_id Unique identifier for an Item (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createItemHistoryAsync($xero_tenant_id, $item_id, $history_records) + public function createItemHistoryAsync($xero_tenant_id, $item_id, $history_records, $idempotency_key = null) { - return $this->createItemHistoryAsyncWithHttpInfo($xero_tenant_id, $item_id, $history_records) + return $this->createItemHistoryAsyncWithHttpInfo($xero_tenant_id, $item_id, $history_records, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -7818,12 +8064,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $item_id Unique identifier for an Item (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createItemHistoryAsyncWithHttpInfo($xero_tenant_id, $item_id, $history_records) + public function createItemHistoryAsyncWithHttpInfo($xero_tenant_id, $item_id, $history_records, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords'; - $request = $this->createItemHistoryRequest($xero_tenant_id, $item_id, $history_records); + $request = $this->createItemHistoryRequest($xero_tenant_id, $item_id, $history_records, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -7862,9 +8109,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $item_id Unique identifier for an Item (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createItemHistoryRequest($xero_tenant_id, $item_id, $history_records) + protected function createItemHistoryRequest($xero_tenant_id, $item_id, $history_records, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -7894,6 +8142,10 @@ protected function createItemHistoryRequest($xero_tenant_id, $item_id, $history_ if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($item_id !== null) { $resourcePath = str_replace( @@ -7972,13 +8224,14 @@ protected function createItemHistoryRequest($xero_tenant_id, $item_id, $history_ * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Items $items Items with an array of Item objects in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Items|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createItems($xero_tenant_id, $items, $summarize_errors = false, $unitdp = null) + public function createItems($xero_tenant_id, $items, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { - list($response) = $this->createItemsWithHttpInfo($xero_tenant_id, $items, $summarize_errors, $unitdp); + list($response) = $this->createItemsWithHttpInfo($xero_tenant_id, $items, $summarize_errors, $unitdp, $idempotency_key); return $response; } /** @@ -7988,13 +8241,14 @@ public function createItems($xero_tenant_id, $items, $summarize_errors = false, * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Items $items Items with an array of Item objects in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Items|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createItemsWithHttpInfo($xero_tenant_id, $items, $summarize_errors = false, $unitdp = null) + public function createItemsWithHttpInfo($xero_tenant_id, $items, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { - $request = $this->createItemsRequest($xero_tenant_id, $items, $summarize_errors, $unitdp); + $request = $this->createItemsRequest($xero_tenant_id, $items, $summarize_errors, $unitdp, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -8086,12 +8340,13 @@ public function createItemsWithHttpInfo($xero_tenant_id, $items, $summarize_erro * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Items $items Items with an array of Item objects in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createItemsAsync($xero_tenant_id, $items, $summarize_errors = false, $unitdp = null) + public function createItemsAsync($xero_tenant_id, $items, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { - return $this->createItemsAsyncWithHttpInfo($xero_tenant_id, $items, $summarize_errors, $unitdp) + return $this->createItemsAsyncWithHttpInfo($xero_tenant_id, $items, $summarize_errors, $unitdp, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -8105,12 +8360,13 @@ function ($response) { * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Items $items Items with an array of Item objects in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createItemsAsyncWithHttpInfo($xero_tenant_id, $items, $summarize_errors = false, $unitdp = null) + public function createItemsAsyncWithHttpInfo($xero_tenant_id, $items, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Items'; - $request = $this->createItemsRequest($xero_tenant_id, $items, $summarize_errors, $unitdp); + $request = $this->createItemsRequest($xero_tenant_id, $items, $summarize_errors, $unitdp, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -8150,9 +8406,10 @@ function ($exception) { * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Items $items Items with an array of Item objects in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createItemsRequest($xero_tenant_id, $items, $summarize_errors = false, $unitdp = null) + protected function createItemsRequest($xero_tenant_id, $items, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -8184,6 +8441,10 @@ protected function createItemsRequest($xero_tenant_id, $items, $summarize_errors if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($items)) { @@ -8252,13 +8513,14 @@ protected function createItemsRequest($xero_tenant_id, $items, $summarize_errors * Creates linked transactions (billable expenses) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\LinkedTransaction $linked_transaction LinkedTransaction object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\LinkedTransactions|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createLinkedTransaction($xero_tenant_id, $linked_transaction) + public function createLinkedTransaction($xero_tenant_id, $linked_transaction, $idempotency_key = null) { - list($response) = $this->createLinkedTransactionWithHttpInfo($xero_tenant_id, $linked_transaction); + list($response) = $this->createLinkedTransactionWithHttpInfo($xero_tenant_id, $linked_transaction, $idempotency_key); return $response; } /** @@ -8266,13 +8528,14 @@ public function createLinkedTransaction($xero_tenant_id, $linked_transaction) * Creates linked transactions (billable expenses) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\LinkedTransaction $linked_transaction LinkedTransaction object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\LinkedTransactions|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createLinkedTransactionWithHttpInfo($xero_tenant_id, $linked_transaction) + public function createLinkedTransactionWithHttpInfo($xero_tenant_id, $linked_transaction, $idempotency_key = null) { - $request = $this->createLinkedTransactionRequest($xero_tenant_id, $linked_transaction); + $request = $this->createLinkedTransactionRequest($xero_tenant_id, $linked_transaction, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -8362,12 +8625,13 @@ public function createLinkedTransactionWithHttpInfo($xero_tenant_id, $linked_tra * Creates linked transactions (billable expenses) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\LinkedTransaction $linked_transaction LinkedTransaction object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createLinkedTransactionAsync($xero_tenant_id, $linked_transaction) + public function createLinkedTransactionAsync($xero_tenant_id, $linked_transaction, $idempotency_key = null) { - return $this->createLinkedTransactionAsyncWithHttpInfo($xero_tenant_id, $linked_transaction) + return $this->createLinkedTransactionAsyncWithHttpInfo($xero_tenant_id, $linked_transaction, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -8379,12 +8643,13 @@ function ($response) { * Creates linked transactions (billable expenses) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\LinkedTransaction $linked_transaction LinkedTransaction object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createLinkedTransactionAsyncWithHttpInfo($xero_tenant_id, $linked_transaction) + public function createLinkedTransactionAsyncWithHttpInfo($xero_tenant_id, $linked_transaction, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\LinkedTransactions'; - $request = $this->createLinkedTransactionRequest($xero_tenant_id, $linked_transaction); + $request = $this->createLinkedTransactionRequest($xero_tenant_id, $linked_transaction, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -8422,9 +8687,10 @@ function ($exception) { * Create request for operation 'createLinkedTransaction' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\LinkedTransaction $linked_transaction LinkedTransaction object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createLinkedTransactionRequest($xero_tenant_id, $linked_transaction) + protected function createLinkedTransactionRequest($xero_tenant_id, $linked_transaction, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -8448,6 +8714,10 @@ protected function createLinkedTransactionRequest($xero_tenant_id, $linked_trans if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($linked_transaction)) { @@ -8518,13 +8788,14 @@ protected function createLinkedTransactionRequest($xero_tenant_id, $linked_trans * @param string $manual_journal_id Unique identifier for a ManualJournal (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createManualJournalAttachmentByFileName($xero_tenant_id, $manual_journal_id, $file_name, $body) + public function createManualJournalAttachmentByFileName($xero_tenant_id, $manual_journal_id, $file_name, $body, $idempotency_key = null) { - list($response) = $this->createManualJournalAttachmentByFileNameWithHttpInfo($xero_tenant_id, $manual_journal_id, $file_name, $body); + list($response) = $this->createManualJournalAttachmentByFileNameWithHttpInfo($xero_tenant_id, $manual_journal_id, $file_name, $body, $idempotency_key); return $response; } /** @@ -8534,13 +8805,14 @@ public function createManualJournalAttachmentByFileName($xero_tenant_id, $manual * @param string $manual_journal_id Unique identifier for a ManualJournal (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createManualJournalAttachmentByFileNameWithHttpInfo($xero_tenant_id, $manual_journal_id, $file_name, $body) + public function createManualJournalAttachmentByFileNameWithHttpInfo($xero_tenant_id, $manual_journal_id, $file_name, $body, $idempotency_key = null) { - $request = $this->createManualJournalAttachmentByFileNameRequest($xero_tenant_id, $manual_journal_id, $file_name, $body); + $request = $this->createManualJournalAttachmentByFileNameRequest($xero_tenant_id, $manual_journal_id, $file_name, $body, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -8632,12 +8904,13 @@ public function createManualJournalAttachmentByFileNameWithHttpInfo($xero_tenant * @param string $manual_journal_id Unique identifier for a ManualJournal (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createManualJournalAttachmentByFileNameAsync($xero_tenant_id, $manual_journal_id, $file_name, $body) + public function createManualJournalAttachmentByFileNameAsync($xero_tenant_id, $manual_journal_id, $file_name, $body, $idempotency_key = null) { - return $this->createManualJournalAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $manual_journal_id, $file_name, $body) + return $this->createManualJournalAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $manual_journal_id, $file_name, $body, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -8651,12 +8924,13 @@ function ($response) { * @param string $manual_journal_id Unique identifier for a ManualJournal (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createManualJournalAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $manual_journal_id, $file_name, $body) + public function createManualJournalAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $manual_journal_id, $file_name, $body, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; - $request = $this->createManualJournalAttachmentByFileNameRequest($xero_tenant_id, $manual_journal_id, $file_name, $body); + $request = $this->createManualJournalAttachmentByFileNameRequest($xero_tenant_id, $manual_journal_id, $file_name, $body, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -8696,9 +8970,10 @@ function ($exception) { * @param string $manual_journal_id Unique identifier for a ManualJournal (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createManualJournalAttachmentByFileNameRequest($xero_tenant_id, $manual_journal_id, $file_name, $body) + protected function createManualJournalAttachmentByFileNameRequest($xero_tenant_id, $manual_journal_id, $file_name, $body, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -8734,6 +9009,10 @@ protected function createManualJournalAttachmentByFileNameRequest($xero_tenant_i if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($manual_journal_id !== null) { $resourcePath = str_replace( @@ -8819,13 +9098,14 @@ protected function createManualJournalAttachmentByFileNameRequest($xero_tenant_i * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $manual_journal_id Unique identifier for a ManualJournal (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createManualJournalHistoryRecord($xero_tenant_id, $manual_journal_id, $history_records) + public function createManualJournalHistoryRecord($xero_tenant_id, $manual_journal_id, $history_records, $idempotency_key = null) { - list($response) = $this->createManualJournalHistoryRecordWithHttpInfo($xero_tenant_id, $manual_journal_id, $history_records); + list($response) = $this->createManualJournalHistoryRecordWithHttpInfo($xero_tenant_id, $manual_journal_id, $history_records, $idempotency_key); return $response; } /** @@ -8834,13 +9114,14 @@ public function createManualJournalHistoryRecord($xero_tenant_id, $manual_journa * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $manual_journal_id Unique identifier for a ManualJournal (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\HistoryRecords|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createManualJournalHistoryRecordWithHttpInfo($xero_tenant_id, $manual_journal_id, $history_records) + public function createManualJournalHistoryRecordWithHttpInfo($xero_tenant_id, $manual_journal_id, $history_records, $idempotency_key = null) { - $request = $this->createManualJournalHistoryRecordRequest($xero_tenant_id, $manual_journal_id, $history_records); + $request = $this->createManualJournalHistoryRecordRequest($xero_tenant_id, $manual_journal_id, $history_records, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -8931,12 +9212,13 @@ public function createManualJournalHistoryRecordWithHttpInfo($xero_tenant_id, $m * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $manual_journal_id Unique identifier for a ManualJournal (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createManualJournalHistoryRecordAsync($xero_tenant_id, $manual_journal_id, $history_records) + public function createManualJournalHistoryRecordAsync($xero_tenant_id, $manual_journal_id, $history_records, $idempotency_key = null) { - return $this->createManualJournalHistoryRecordAsyncWithHttpInfo($xero_tenant_id, $manual_journal_id, $history_records) + return $this->createManualJournalHistoryRecordAsyncWithHttpInfo($xero_tenant_id, $manual_journal_id, $history_records, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -8949,12 +9231,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $manual_journal_id Unique identifier for a ManualJournal (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createManualJournalHistoryRecordAsyncWithHttpInfo($xero_tenant_id, $manual_journal_id, $history_records) + public function createManualJournalHistoryRecordAsyncWithHttpInfo($xero_tenant_id, $manual_journal_id, $history_records, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords'; - $request = $this->createManualJournalHistoryRecordRequest($xero_tenant_id, $manual_journal_id, $history_records); + $request = $this->createManualJournalHistoryRecordRequest($xero_tenant_id, $manual_journal_id, $history_records, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -8993,9 +9276,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $manual_journal_id Unique identifier for a ManualJournal (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createManualJournalHistoryRecordRequest($xero_tenant_id, $manual_journal_id, $history_records) + protected function createManualJournalHistoryRecordRequest($xero_tenant_id, $manual_journal_id, $history_records, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -9025,6 +9309,10 @@ protected function createManualJournalHistoryRecordRequest($xero_tenant_id, $man if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($manual_journal_id !== null) { $resourcePath = str_replace( @@ -9102,13 +9390,14 @@ protected function createManualJournalHistoryRecordRequest($xero_tenant_id, $man * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ManualJournals $manual_journals ManualJournals array with ManualJournal object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ManualJournals|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createManualJournals($xero_tenant_id, $manual_journals, $summarize_errors = false) + public function createManualJournals($xero_tenant_id, $manual_journals, $summarize_errors = false, $idempotency_key = null) { - list($response) = $this->createManualJournalsWithHttpInfo($xero_tenant_id, $manual_journals, $summarize_errors); + list($response) = $this->createManualJournalsWithHttpInfo($xero_tenant_id, $manual_journals, $summarize_errors, $idempotency_key); return $response; } /** @@ -9117,13 +9406,14 @@ public function createManualJournals($xero_tenant_id, $manual_journals, $summari * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ManualJournals $manual_journals ManualJournals array with ManualJournal object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\ManualJournals|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createManualJournalsWithHttpInfo($xero_tenant_id, $manual_journals, $summarize_errors = false) + public function createManualJournalsWithHttpInfo($xero_tenant_id, $manual_journals, $summarize_errors = false, $idempotency_key = null) { - $request = $this->createManualJournalsRequest($xero_tenant_id, $manual_journals, $summarize_errors); + $request = $this->createManualJournalsRequest($xero_tenant_id, $manual_journals, $summarize_errors, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -9214,12 +9504,13 @@ public function createManualJournalsWithHttpInfo($xero_tenant_id, $manual_journa * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ManualJournals $manual_journals ManualJournals array with ManualJournal object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createManualJournalsAsync($xero_tenant_id, $manual_journals, $summarize_errors = false) + public function createManualJournalsAsync($xero_tenant_id, $manual_journals, $summarize_errors = false, $idempotency_key = null) { - return $this->createManualJournalsAsyncWithHttpInfo($xero_tenant_id, $manual_journals, $summarize_errors) + return $this->createManualJournalsAsyncWithHttpInfo($xero_tenant_id, $manual_journals, $summarize_errors, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -9232,12 +9523,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ManualJournals $manual_journals ManualJournals array with ManualJournal object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createManualJournalsAsyncWithHttpInfo($xero_tenant_id, $manual_journals, $summarize_errors = false) + public function createManualJournalsAsyncWithHttpInfo($xero_tenant_id, $manual_journals, $summarize_errors = false, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ManualJournals'; - $request = $this->createManualJournalsRequest($xero_tenant_id, $manual_journals, $summarize_errors); + $request = $this->createManualJournalsRequest($xero_tenant_id, $manual_journals, $summarize_errors, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -9276,9 +9568,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ManualJournals $manual_journals ManualJournals array with ManualJournal object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createManualJournalsRequest($xero_tenant_id, $manual_journals, $summarize_errors = false) + protected function createManualJournalsRequest($xero_tenant_id, $manual_journals, $summarize_errors = false, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -9306,6 +9599,10 @@ protected function createManualJournalsRequest($xero_tenant_id, $manual_journals if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($manual_journals)) { @@ -9376,13 +9673,14 @@ protected function createManualJournalsRequest($xero_tenant_id, $manual_journals * @param string $overpayment_id Unique identifier for a Overpayment (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocations $allocations Allocations array with Allocation object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocations|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createOverpaymentAllocations($xero_tenant_id, $overpayment_id, $allocations, $summarize_errors = false) + public function createOverpaymentAllocations($xero_tenant_id, $overpayment_id, $allocations, $summarize_errors = false, $idempotency_key = null) { - list($response) = $this->createOverpaymentAllocationsWithHttpInfo($xero_tenant_id, $overpayment_id, $allocations, $summarize_errors); + list($response) = $this->createOverpaymentAllocationsWithHttpInfo($xero_tenant_id, $overpayment_id, $allocations, $summarize_errors, $idempotency_key); return $response; } /** @@ -9392,13 +9690,14 @@ public function createOverpaymentAllocations($xero_tenant_id, $overpayment_id, $ * @param string $overpayment_id Unique identifier for a Overpayment (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocations $allocations Allocations array with Allocation object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Allocations|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createOverpaymentAllocationsWithHttpInfo($xero_tenant_id, $overpayment_id, $allocations, $summarize_errors = false) + public function createOverpaymentAllocationsWithHttpInfo($xero_tenant_id, $overpayment_id, $allocations, $summarize_errors = false, $idempotency_key = null) { - $request = $this->createOverpaymentAllocationsRequest($xero_tenant_id, $overpayment_id, $allocations, $summarize_errors); + $request = $this->createOverpaymentAllocationsRequest($xero_tenant_id, $overpayment_id, $allocations, $summarize_errors, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -9490,12 +9789,13 @@ public function createOverpaymentAllocationsWithHttpInfo($xero_tenant_id, $overp * @param string $overpayment_id Unique identifier for a Overpayment (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocations $allocations Allocations array with Allocation object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createOverpaymentAllocationsAsync($xero_tenant_id, $overpayment_id, $allocations, $summarize_errors = false) + public function createOverpaymentAllocationsAsync($xero_tenant_id, $overpayment_id, $allocations, $summarize_errors = false, $idempotency_key = null) { - return $this->createOverpaymentAllocationsAsyncWithHttpInfo($xero_tenant_id, $overpayment_id, $allocations, $summarize_errors) + return $this->createOverpaymentAllocationsAsyncWithHttpInfo($xero_tenant_id, $overpayment_id, $allocations, $summarize_errors, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -9509,12 +9809,13 @@ function ($response) { * @param string $overpayment_id Unique identifier for a Overpayment (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocations $allocations Allocations array with Allocation object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createOverpaymentAllocationsAsyncWithHttpInfo($xero_tenant_id, $overpayment_id, $allocations, $summarize_errors = false) + public function createOverpaymentAllocationsAsyncWithHttpInfo($xero_tenant_id, $overpayment_id, $allocations, $summarize_errors = false, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocations'; - $request = $this->createOverpaymentAllocationsRequest($xero_tenant_id, $overpayment_id, $allocations, $summarize_errors); + $request = $this->createOverpaymentAllocationsRequest($xero_tenant_id, $overpayment_id, $allocations, $summarize_errors, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -9554,9 +9855,10 @@ function ($exception) { * @param string $overpayment_id Unique identifier for a Overpayment (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocations $allocations Allocations array with Allocation object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createOverpaymentAllocationsRequest($xero_tenant_id, $overpayment_id, $allocations, $summarize_errors = false) + protected function createOverpaymentAllocationsRequest($xero_tenant_id, $overpayment_id, $allocations, $summarize_errors = false, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -9590,6 +9892,10 @@ protected function createOverpaymentAllocationsRequest($xero_tenant_id, $overpay if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($overpayment_id !== null) { $resourcePath = str_replace( @@ -9667,13 +9973,14 @@ protected function createOverpaymentAllocationsRequest($xero_tenant_id, $overpay * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $overpayment_id Unique identifier for a Overpayment (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createOverpaymentHistory($xero_tenant_id, $overpayment_id, $history_records) + public function createOverpaymentHistory($xero_tenant_id, $overpayment_id, $history_records, $idempotency_key = null) { - list($response) = $this->createOverpaymentHistoryWithHttpInfo($xero_tenant_id, $overpayment_id, $history_records); + list($response) = $this->createOverpaymentHistoryWithHttpInfo($xero_tenant_id, $overpayment_id, $history_records, $idempotency_key); return $response; } /** @@ -9682,13 +9989,14 @@ public function createOverpaymentHistory($xero_tenant_id, $overpayment_id, $hist * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $overpayment_id Unique identifier for a Overpayment (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\HistoryRecords|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createOverpaymentHistoryWithHttpInfo($xero_tenant_id, $overpayment_id, $history_records) + public function createOverpaymentHistoryWithHttpInfo($xero_tenant_id, $overpayment_id, $history_records, $idempotency_key = null) { - $request = $this->createOverpaymentHistoryRequest($xero_tenant_id, $overpayment_id, $history_records); + $request = $this->createOverpaymentHistoryRequest($xero_tenant_id, $overpayment_id, $history_records, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -9779,12 +10087,13 @@ public function createOverpaymentHistoryWithHttpInfo($xero_tenant_id, $overpayme * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $overpayment_id Unique identifier for a Overpayment (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createOverpaymentHistoryAsync($xero_tenant_id, $overpayment_id, $history_records) + public function createOverpaymentHistoryAsync($xero_tenant_id, $overpayment_id, $history_records, $idempotency_key = null) { - return $this->createOverpaymentHistoryAsyncWithHttpInfo($xero_tenant_id, $overpayment_id, $history_records) + return $this->createOverpaymentHistoryAsyncWithHttpInfo($xero_tenant_id, $overpayment_id, $history_records, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -9797,12 +10106,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $overpayment_id Unique identifier for a Overpayment (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createOverpaymentHistoryAsyncWithHttpInfo($xero_tenant_id, $overpayment_id, $history_records) + public function createOverpaymentHistoryAsyncWithHttpInfo($xero_tenant_id, $overpayment_id, $history_records, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords'; - $request = $this->createOverpaymentHistoryRequest($xero_tenant_id, $overpayment_id, $history_records); + $request = $this->createOverpaymentHistoryRequest($xero_tenant_id, $overpayment_id, $history_records, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -9841,9 +10151,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $overpayment_id Unique identifier for a Overpayment (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createOverpaymentHistoryRequest($xero_tenant_id, $overpayment_id, $history_records) + protected function createOverpaymentHistoryRequest($xero_tenant_id, $overpayment_id, $history_records, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -9873,6 +10184,10 @@ protected function createOverpaymentHistoryRequest($xero_tenant_id, $overpayment if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($overpayment_id !== null) { $resourcePath = str_replace( @@ -9949,13 +10264,14 @@ protected function createOverpaymentHistoryRequest($xero_tenant_id, $overpayment * Creates a single payment for invoice or credit notes * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Payment $payment Request body with a single Payment object (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Payments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createPayment($xero_tenant_id, $payment) + public function createPayment($xero_tenant_id, $payment, $idempotency_key = null) { - list($response) = $this->createPaymentWithHttpInfo($xero_tenant_id, $payment); + list($response) = $this->createPaymentWithHttpInfo($xero_tenant_id, $payment, $idempotency_key); return $response; } /** @@ -9963,13 +10279,14 @@ public function createPayment($xero_tenant_id, $payment) * Creates a single payment for invoice or credit notes * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Payment $payment Request body with a single Payment object (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Payments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createPaymentWithHttpInfo($xero_tenant_id, $payment) + public function createPaymentWithHttpInfo($xero_tenant_id, $payment, $idempotency_key = null) { - $request = $this->createPaymentRequest($xero_tenant_id, $payment); + $request = $this->createPaymentRequest($xero_tenant_id, $payment, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -10059,12 +10376,13 @@ public function createPaymentWithHttpInfo($xero_tenant_id, $payment) * Creates a single payment for invoice or credit notes * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Payment $payment Request body with a single Payment object (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createPaymentAsync($xero_tenant_id, $payment) + public function createPaymentAsync($xero_tenant_id, $payment, $idempotency_key = null) { - return $this->createPaymentAsyncWithHttpInfo($xero_tenant_id, $payment) + return $this->createPaymentAsyncWithHttpInfo($xero_tenant_id, $payment, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -10076,12 +10394,13 @@ function ($response) { * Creates a single payment for invoice or credit notes * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Payment $payment Request body with a single Payment object (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createPaymentAsyncWithHttpInfo($xero_tenant_id, $payment) + public function createPaymentAsyncWithHttpInfo($xero_tenant_id, $payment, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Payments'; - $request = $this->createPaymentRequest($xero_tenant_id, $payment); + $request = $this->createPaymentRequest($xero_tenant_id, $payment, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -10119,9 +10438,10 @@ function ($exception) { * Create request for operation 'createPayment' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Payment $payment Request body with a single Payment object (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createPaymentRequest($xero_tenant_id, $payment) + protected function createPaymentRequest($xero_tenant_id, $payment, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -10145,6 +10465,10 @@ protected function createPaymentRequest($xero_tenant_id, $payment) if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($payment)) { @@ -10214,13 +10538,14 @@ protected function createPaymentRequest($xero_tenant_id, $payment) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $payment_id Unique identifier for a Payment (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createPaymentHistory($xero_tenant_id, $payment_id, $history_records) + public function createPaymentHistory($xero_tenant_id, $payment_id, $history_records, $idempotency_key = null) { - list($response) = $this->createPaymentHistoryWithHttpInfo($xero_tenant_id, $payment_id, $history_records); + list($response) = $this->createPaymentHistoryWithHttpInfo($xero_tenant_id, $payment_id, $history_records, $idempotency_key); return $response; } /** @@ -10229,13 +10554,14 @@ public function createPaymentHistory($xero_tenant_id, $payment_id, $history_reco * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $payment_id Unique identifier for a Payment (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\HistoryRecords|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createPaymentHistoryWithHttpInfo($xero_tenant_id, $payment_id, $history_records) + public function createPaymentHistoryWithHttpInfo($xero_tenant_id, $payment_id, $history_records, $idempotency_key = null) { - $request = $this->createPaymentHistoryRequest($xero_tenant_id, $payment_id, $history_records); + $request = $this->createPaymentHistoryRequest($xero_tenant_id, $payment_id, $history_records, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -10326,12 +10652,13 @@ public function createPaymentHistoryWithHttpInfo($xero_tenant_id, $payment_id, $ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $payment_id Unique identifier for a Payment (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createPaymentHistoryAsync($xero_tenant_id, $payment_id, $history_records) + public function createPaymentHistoryAsync($xero_tenant_id, $payment_id, $history_records, $idempotency_key = null) { - return $this->createPaymentHistoryAsyncWithHttpInfo($xero_tenant_id, $payment_id, $history_records) + return $this->createPaymentHistoryAsyncWithHttpInfo($xero_tenant_id, $payment_id, $history_records, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -10344,12 +10671,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $payment_id Unique identifier for a Payment (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createPaymentHistoryAsyncWithHttpInfo($xero_tenant_id, $payment_id, $history_records) + public function createPaymentHistoryAsyncWithHttpInfo($xero_tenant_id, $payment_id, $history_records, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords'; - $request = $this->createPaymentHistoryRequest($xero_tenant_id, $payment_id, $history_records); + $request = $this->createPaymentHistoryRequest($xero_tenant_id, $payment_id, $history_records, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -10388,9 +10716,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $payment_id Unique identifier for a Payment (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createPaymentHistoryRequest($xero_tenant_id, $payment_id, $history_records) + protected function createPaymentHistoryRequest($xero_tenant_id, $payment_id, $history_records, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -10420,6 +10749,10 @@ protected function createPaymentHistoryRequest($xero_tenant_id, $payment_id, $hi if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($payment_id !== null) { $resourcePath = str_replace( @@ -10496,13 +10829,14 @@ protected function createPaymentHistoryRequest($xero_tenant_id, $payment_id, $hi * Creates a payment service * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentServices $payment_services PaymentServices array with PaymentService object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentServices|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createPaymentService($xero_tenant_id, $payment_services) + public function createPaymentService($xero_tenant_id, $payment_services, $idempotency_key = null) { - list($response) = $this->createPaymentServiceWithHttpInfo($xero_tenant_id, $payment_services); + list($response) = $this->createPaymentServiceWithHttpInfo($xero_tenant_id, $payment_services, $idempotency_key); return $response; } /** @@ -10510,13 +10844,14 @@ public function createPaymentService($xero_tenant_id, $payment_services) * Creates a payment service * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentServices $payment_services PaymentServices array with PaymentService object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\PaymentServices|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createPaymentServiceWithHttpInfo($xero_tenant_id, $payment_services) + public function createPaymentServiceWithHttpInfo($xero_tenant_id, $payment_services, $idempotency_key = null) { - $request = $this->createPaymentServiceRequest($xero_tenant_id, $payment_services); + $request = $this->createPaymentServiceRequest($xero_tenant_id, $payment_services, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -10606,12 +10941,13 @@ public function createPaymentServiceWithHttpInfo($xero_tenant_id, $payment_servi * Creates a payment service * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentServices $payment_services PaymentServices array with PaymentService object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createPaymentServiceAsync($xero_tenant_id, $payment_services) + public function createPaymentServiceAsync($xero_tenant_id, $payment_services, $idempotency_key = null) { - return $this->createPaymentServiceAsyncWithHttpInfo($xero_tenant_id, $payment_services) + return $this->createPaymentServiceAsyncWithHttpInfo($xero_tenant_id, $payment_services, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -10623,12 +10959,13 @@ function ($response) { * Creates a payment service * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentServices $payment_services PaymentServices array with PaymentService object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createPaymentServiceAsyncWithHttpInfo($xero_tenant_id, $payment_services) + public function createPaymentServiceAsyncWithHttpInfo($xero_tenant_id, $payment_services, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentServices'; - $request = $this->createPaymentServiceRequest($xero_tenant_id, $payment_services); + $request = $this->createPaymentServiceRequest($xero_tenant_id, $payment_services, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -10666,9 +11003,10 @@ function ($exception) { * Create request for operation 'createPaymentService' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentServices $payment_services PaymentServices array with PaymentService object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createPaymentServiceRequest($xero_tenant_id, $payment_services) + protected function createPaymentServiceRequest($xero_tenant_id, $payment_services, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -10692,6 +11030,10 @@ protected function createPaymentServiceRequest($xero_tenant_id, $payment_service if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($payment_services)) { @@ -10761,13 +11103,14 @@ protected function createPaymentServiceRequest($xero_tenant_id, $payment_service * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Payments $payments Payments array with Payment object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Payments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createPayments($xero_tenant_id, $payments, $summarize_errors = false) + public function createPayments($xero_tenant_id, $payments, $summarize_errors = false, $idempotency_key = null) { - list($response) = $this->createPaymentsWithHttpInfo($xero_tenant_id, $payments, $summarize_errors); + list($response) = $this->createPaymentsWithHttpInfo($xero_tenant_id, $payments, $summarize_errors, $idempotency_key); return $response; } /** @@ -10776,13 +11119,14 @@ public function createPayments($xero_tenant_id, $payments, $summarize_errors = f * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Payments $payments Payments array with Payment object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Payments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createPaymentsWithHttpInfo($xero_tenant_id, $payments, $summarize_errors = false) + public function createPaymentsWithHttpInfo($xero_tenant_id, $payments, $summarize_errors = false, $idempotency_key = null) { - $request = $this->createPaymentsRequest($xero_tenant_id, $payments, $summarize_errors); + $request = $this->createPaymentsRequest($xero_tenant_id, $payments, $summarize_errors, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -10873,12 +11217,13 @@ public function createPaymentsWithHttpInfo($xero_tenant_id, $payments, $summariz * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Payments $payments Payments array with Payment object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createPaymentsAsync($xero_tenant_id, $payments, $summarize_errors = false) + public function createPaymentsAsync($xero_tenant_id, $payments, $summarize_errors = false, $idempotency_key = null) { - return $this->createPaymentsAsyncWithHttpInfo($xero_tenant_id, $payments, $summarize_errors) + return $this->createPaymentsAsyncWithHttpInfo($xero_tenant_id, $payments, $summarize_errors, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -10891,12 +11236,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Payments $payments Payments array with Payment object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createPaymentsAsyncWithHttpInfo($xero_tenant_id, $payments, $summarize_errors = false) + public function createPaymentsAsyncWithHttpInfo($xero_tenant_id, $payments, $summarize_errors = false, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Payments'; - $request = $this->createPaymentsRequest($xero_tenant_id, $payments, $summarize_errors); + $request = $this->createPaymentsRequest($xero_tenant_id, $payments, $summarize_errors, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -10935,9 +11281,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Payments $payments Payments array with Payment object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createPaymentsRequest($xero_tenant_id, $payments, $summarize_errors = false) + protected function createPaymentsRequest($xero_tenant_id, $payments, $summarize_errors = false, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -10965,6 +11312,10 @@ protected function createPaymentsRequest($xero_tenant_id, $payments, $summarize_ if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($payments)) { @@ -11035,13 +11386,14 @@ protected function createPaymentsRequest($xero_tenant_id, $payments, $summarize_ * @param string $prepayment_id Unique identifier for a PrePayment (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocations $allocations Allocations with an array of Allocation object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocations|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createPrepaymentAllocations($xero_tenant_id, $prepayment_id, $allocations, $summarize_errors = false) + public function createPrepaymentAllocations($xero_tenant_id, $prepayment_id, $allocations, $summarize_errors = false, $idempotency_key = null) { - list($response) = $this->createPrepaymentAllocationsWithHttpInfo($xero_tenant_id, $prepayment_id, $allocations, $summarize_errors); + list($response) = $this->createPrepaymentAllocationsWithHttpInfo($xero_tenant_id, $prepayment_id, $allocations, $summarize_errors, $idempotency_key); return $response; } /** @@ -11051,13 +11403,14 @@ public function createPrepaymentAllocations($xero_tenant_id, $prepayment_id, $al * @param string $prepayment_id Unique identifier for a PrePayment (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocations $allocations Allocations with an array of Allocation object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Allocations|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createPrepaymentAllocationsWithHttpInfo($xero_tenant_id, $prepayment_id, $allocations, $summarize_errors = false) + public function createPrepaymentAllocationsWithHttpInfo($xero_tenant_id, $prepayment_id, $allocations, $summarize_errors = false, $idempotency_key = null) { - $request = $this->createPrepaymentAllocationsRequest($xero_tenant_id, $prepayment_id, $allocations, $summarize_errors); + $request = $this->createPrepaymentAllocationsRequest($xero_tenant_id, $prepayment_id, $allocations, $summarize_errors, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -11149,12 +11502,13 @@ public function createPrepaymentAllocationsWithHttpInfo($xero_tenant_id, $prepay * @param string $prepayment_id Unique identifier for a PrePayment (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocations $allocations Allocations with an array of Allocation object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createPrepaymentAllocationsAsync($xero_tenant_id, $prepayment_id, $allocations, $summarize_errors = false) + public function createPrepaymentAllocationsAsync($xero_tenant_id, $prepayment_id, $allocations, $summarize_errors = false, $idempotency_key = null) { - return $this->createPrepaymentAllocationsAsyncWithHttpInfo($xero_tenant_id, $prepayment_id, $allocations, $summarize_errors) + return $this->createPrepaymentAllocationsAsyncWithHttpInfo($xero_tenant_id, $prepayment_id, $allocations, $summarize_errors, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -11168,12 +11522,13 @@ function ($response) { * @param string $prepayment_id Unique identifier for a PrePayment (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocations $allocations Allocations with an array of Allocation object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createPrepaymentAllocationsAsyncWithHttpInfo($xero_tenant_id, $prepayment_id, $allocations, $summarize_errors = false) + public function createPrepaymentAllocationsAsyncWithHttpInfo($xero_tenant_id, $prepayment_id, $allocations, $summarize_errors = false, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocations'; - $request = $this->createPrepaymentAllocationsRequest($xero_tenant_id, $prepayment_id, $allocations, $summarize_errors); + $request = $this->createPrepaymentAllocationsRequest($xero_tenant_id, $prepayment_id, $allocations, $summarize_errors, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -11213,9 +11568,10 @@ function ($exception) { * @param string $prepayment_id Unique identifier for a PrePayment (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocations $allocations Allocations with an array of Allocation object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createPrepaymentAllocationsRequest($xero_tenant_id, $prepayment_id, $allocations, $summarize_errors = false) + protected function createPrepaymentAllocationsRequest($xero_tenant_id, $prepayment_id, $allocations, $summarize_errors = false, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -11249,6 +11605,10 @@ protected function createPrepaymentAllocationsRequest($xero_tenant_id, $prepayme if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($prepayment_id !== null) { $resourcePath = str_replace( @@ -11326,13 +11686,14 @@ protected function createPrepaymentAllocationsRequest($xero_tenant_id, $prepayme * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $prepayment_id Unique identifier for a PrePayment (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createPrepaymentHistory($xero_tenant_id, $prepayment_id, $history_records) + public function createPrepaymentHistory($xero_tenant_id, $prepayment_id, $history_records, $idempotency_key = null) { - list($response) = $this->createPrepaymentHistoryWithHttpInfo($xero_tenant_id, $prepayment_id, $history_records); + list($response) = $this->createPrepaymentHistoryWithHttpInfo($xero_tenant_id, $prepayment_id, $history_records, $idempotency_key); return $response; } /** @@ -11341,13 +11702,14 @@ public function createPrepaymentHistory($xero_tenant_id, $prepayment_id, $histor * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $prepayment_id Unique identifier for a PrePayment (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\HistoryRecords|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createPrepaymentHistoryWithHttpInfo($xero_tenant_id, $prepayment_id, $history_records) + public function createPrepaymentHistoryWithHttpInfo($xero_tenant_id, $prepayment_id, $history_records, $idempotency_key = null) { - $request = $this->createPrepaymentHistoryRequest($xero_tenant_id, $prepayment_id, $history_records); + $request = $this->createPrepaymentHistoryRequest($xero_tenant_id, $prepayment_id, $history_records, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -11438,12 +11800,13 @@ public function createPrepaymentHistoryWithHttpInfo($xero_tenant_id, $prepayment * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $prepayment_id Unique identifier for a PrePayment (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createPrepaymentHistoryAsync($xero_tenant_id, $prepayment_id, $history_records) + public function createPrepaymentHistoryAsync($xero_tenant_id, $prepayment_id, $history_records, $idempotency_key = null) { - return $this->createPrepaymentHistoryAsyncWithHttpInfo($xero_tenant_id, $prepayment_id, $history_records) + return $this->createPrepaymentHistoryAsyncWithHttpInfo($xero_tenant_id, $prepayment_id, $history_records, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -11456,12 +11819,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $prepayment_id Unique identifier for a PrePayment (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createPrepaymentHistoryAsyncWithHttpInfo($xero_tenant_id, $prepayment_id, $history_records) + public function createPrepaymentHistoryAsyncWithHttpInfo($xero_tenant_id, $prepayment_id, $history_records, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords'; - $request = $this->createPrepaymentHistoryRequest($xero_tenant_id, $prepayment_id, $history_records); + $request = $this->createPrepaymentHistoryRequest($xero_tenant_id, $prepayment_id, $history_records, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -11500,9 +11864,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $prepayment_id Unique identifier for a PrePayment (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createPrepaymentHistoryRequest($xero_tenant_id, $prepayment_id, $history_records) + protected function createPrepaymentHistoryRequest($xero_tenant_id, $prepayment_id, $history_records, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -11532,6 +11897,10 @@ protected function createPrepaymentHistoryRequest($xero_tenant_id, $prepayment_i if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($prepayment_id !== null) { $resourcePath = str_replace( @@ -11610,13 +11979,14 @@ protected function createPrepaymentHistoryRequest($xero_tenant_id, $prepayment_i * @param string $purchase_order_id Unique identifier for an Purchase Order (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createPurchaseOrderAttachmentByFileName($xero_tenant_id, $purchase_order_id, $file_name, $body) + public function createPurchaseOrderAttachmentByFileName($xero_tenant_id, $purchase_order_id, $file_name, $body, $idempotency_key = null) { - list($response) = $this->createPurchaseOrderAttachmentByFileNameWithHttpInfo($xero_tenant_id, $purchase_order_id, $file_name, $body); + list($response) = $this->createPurchaseOrderAttachmentByFileNameWithHttpInfo($xero_tenant_id, $purchase_order_id, $file_name, $body, $idempotency_key); return $response; } /** @@ -11626,13 +11996,14 @@ public function createPurchaseOrderAttachmentByFileName($xero_tenant_id, $purcha * @param string $purchase_order_id Unique identifier for an Purchase Order (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createPurchaseOrderAttachmentByFileNameWithHttpInfo($xero_tenant_id, $purchase_order_id, $file_name, $body) + public function createPurchaseOrderAttachmentByFileNameWithHttpInfo($xero_tenant_id, $purchase_order_id, $file_name, $body, $idempotency_key = null) { - $request = $this->createPurchaseOrderAttachmentByFileNameRequest($xero_tenant_id, $purchase_order_id, $file_name, $body); + $request = $this->createPurchaseOrderAttachmentByFileNameRequest($xero_tenant_id, $purchase_order_id, $file_name, $body, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -11724,12 +12095,13 @@ public function createPurchaseOrderAttachmentByFileNameWithHttpInfo($xero_tenant * @param string $purchase_order_id Unique identifier for an Purchase Order (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createPurchaseOrderAttachmentByFileNameAsync($xero_tenant_id, $purchase_order_id, $file_name, $body) + public function createPurchaseOrderAttachmentByFileNameAsync($xero_tenant_id, $purchase_order_id, $file_name, $body, $idempotency_key = null) { - return $this->createPurchaseOrderAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $purchase_order_id, $file_name, $body) + return $this->createPurchaseOrderAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $purchase_order_id, $file_name, $body, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -11743,12 +12115,13 @@ function ($response) { * @param string $purchase_order_id Unique identifier for an Purchase Order (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createPurchaseOrderAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $purchase_order_id, $file_name, $body) + public function createPurchaseOrderAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $purchase_order_id, $file_name, $body, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; - $request = $this->createPurchaseOrderAttachmentByFileNameRequest($xero_tenant_id, $purchase_order_id, $file_name, $body); + $request = $this->createPurchaseOrderAttachmentByFileNameRequest($xero_tenant_id, $purchase_order_id, $file_name, $body, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -11788,9 +12161,10 @@ function ($exception) { * @param string $purchase_order_id Unique identifier for an Purchase Order (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createPurchaseOrderAttachmentByFileNameRequest($xero_tenant_id, $purchase_order_id, $file_name, $body) + protected function createPurchaseOrderAttachmentByFileNameRequest($xero_tenant_id, $purchase_order_id, $file_name, $body, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -11826,6 +12200,10 @@ protected function createPurchaseOrderAttachmentByFileNameRequest($xero_tenant_i if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($purchase_order_id !== null) { $resourcePath = str_replace( @@ -11911,13 +12289,14 @@ protected function createPurchaseOrderAttachmentByFileNameRequest($xero_tenant_i * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $purchase_order_id Unique identifier for an Purchase Order (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createPurchaseOrderHistory($xero_tenant_id, $purchase_order_id, $history_records) + public function createPurchaseOrderHistory($xero_tenant_id, $purchase_order_id, $history_records, $idempotency_key = null) { - list($response) = $this->createPurchaseOrderHistoryWithHttpInfo($xero_tenant_id, $purchase_order_id, $history_records); + list($response) = $this->createPurchaseOrderHistoryWithHttpInfo($xero_tenant_id, $purchase_order_id, $history_records, $idempotency_key); return $response; } /** @@ -11926,13 +12305,14 @@ public function createPurchaseOrderHistory($xero_tenant_id, $purchase_order_id, * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $purchase_order_id Unique identifier for an Purchase Order (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\HistoryRecords|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createPurchaseOrderHistoryWithHttpInfo($xero_tenant_id, $purchase_order_id, $history_records) + public function createPurchaseOrderHistoryWithHttpInfo($xero_tenant_id, $purchase_order_id, $history_records, $idempotency_key = null) { - $request = $this->createPurchaseOrderHistoryRequest($xero_tenant_id, $purchase_order_id, $history_records); + $request = $this->createPurchaseOrderHistoryRequest($xero_tenant_id, $purchase_order_id, $history_records, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -12023,12 +12403,13 @@ public function createPurchaseOrderHistoryWithHttpInfo($xero_tenant_id, $purchas * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $purchase_order_id Unique identifier for an Purchase Order (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createPurchaseOrderHistoryAsync($xero_tenant_id, $purchase_order_id, $history_records) + public function createPurchaseOrderHistoryAsync($xero_tenant_id, $purchase_order_id, $history_records, $idempotency_key = null) { - return $this->createPurchaseOrderHistoryAsyncWithHttpInfo($xero_tenant_id, $purchase_order_id, $history_records) + return $this->createPurchaseOrderHistoryAsyncWithHttpInfo($xero_tenant_id, $purchase_order_id, $history_records, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -12041,12 +12422,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $purchase_order_id Unique identifier for an Purchase Order (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createPurchaseOrderHistoryAsyncWithHttpInfo($xero_tenant_id, $purchase_order_id, $history_records) + public function createPurchaseOrderHistoryAsyncWithHttpInfo($xero_tenant_id, $purchase_order_id, $history_records, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords'; - $request = $this->createPurchaseOrderHistoryRequest($xero_tenant_id, $purchase_order_id, $history_records); + $request = $this->createPurchaseOrderHistoryRequest($xero_tenant_id, $purchase_order_id, $history_records, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -12085,9 +12467,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $purchase_order_id Unique identifier for an Purchase Order (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createPurchaseOrderHistoryRequest($xero_tenant_id, $purchase_order_id, $history_records) + protected function createPurchaseOrderHistoryRequest($xero_tenant_id, $purchase_order_id, $history_records, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -12117,6 +12500,10 @@ protected function createPurchaseOrderHistoryRequest($xero_tenant_id, $purchase_ if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($purchase_order_id !== null) { $resourcePath = str_replace( @@ -12194,13 +12581,14 @@ protected function createPurchaseOrderHistoryRequest($xero_tenant_id, $purchase_ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PurchaseOrders $purchase_orders PurchaseOrders with an array of PurchaseOrder object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PurchaseOrders|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createPurchaseOrders($xero_tenant_id, $purchase_orders, $summarize_errors = false) + public function createPurchaseOrders($xero_tenant_id, $purchase_orders, $summarize_errors = false, $idempotency_key = null) { - list($response) = $this->createPurchaseOrdersWithHttpInfo($xero_tenant_id, $purchase_orders, $summarize_errors); + list($response) = $this->createPurchaseOrdersWithHttpInfo($xero_tenant_id, $purchase_orders, $summarize_errors, $idempotency_key); return $response; } /** @@ -12209,13 +12597,14 @@ public function createPurchaseOrders($xero_tenant_id, $purchase_orders, $summari * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PurchaseOrders $purchase_orders PurchaseOrders with an array of PurchaseOrder object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\PurchaseOrders|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createPurchaseOrdersWithHttpInfo($xero_tenant_id, $purchase_orders, $summarize_errors = false) + public function createPurchaseOrdersWithHttpInfo($xero_tenant_id, $purchase_orders, $summarize_errors = false, $idempotency_key = null) { - $request = $this->createPurchaseOrdersRequest($xero_tenant_id, $purchase_orders, $summarize_errors); + $request = $this->createPurchaseOrdersRequest($xero_tenant_id, $purchase_orders, $summarize_errors, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -12306,12 +12695,13 @@ public function createPurchaseOrdersWithHttpInfo($xero_tenant_id, $purchase_orde * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PurchaseOrders $purchase_orders PurchaseOrders with an array of PurchaseOrder object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createPurchaseOrdersAsync($xero_tenant_id, $purchase_orders, $summarize_errors = false) + public function createPurchaseOrdersAsync($xero_tenant_id, $purchase_orders, $summarize_errors = false, $idempotency_key = null) { - return $this->createPurchaseOrdersAsyncWithHttpInfo($xero_tenant_id, $purchase_orders, $summarize_errors) + return $this->createPurchaseOrdersAsyncWithHttpInfo($xero_tenant_id, $purchase_orders, $summarize_errors, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -12324,12 +12714,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PurchaseOrders $purchase_orders PurchaseOrders with an array of PurchaseOrder object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createPurchaseOrdersAsyncWithHttpInfo($xero_tenant_id, $purchase_orders, $summarize_errors = false) + public function createPurchaseOrdersAsyncWithHttpInfo($xero_tenant_id, $purchase_orders, $summarize_errors = false, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PurchaseOrders'; - $request = $this->createPurchaseOrdersRequest($xero_tenant_id, $purchase_orders, $summarize_errors); + $request = $this->createPurchaseOrdersRequest($xero_tenant_id, $purchase_orders, $summarize_errors, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -12368,9 +12759,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PurchaseOrders $purchase_orders PurchaseOrders with an array of PurchaseOrder object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createPurchaseOrdersRequest($xero_tenant_id, $purchase_orders, $summarize_errors = false) + protected function createPurchaseOrdersRequest($xero_tenant_id, $purchase_orders, $summarize_errors = false, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -12398,6 +12790,10 @@ protected function createPurchaseOrdersRequest($xero_tenant_id, $purchase_orders if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($purchase_orders)) { @@ -12468,13 +12864,14 @@ protected function createPurchaseOrdersRequest($xero_tenant_id, $purchase_orders * @param string $quote_id Unique identifier for an Quote (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createQuoteAttachmentByFileName($xero_tenant_id, $quote_id, $file_name, $body) + public function createQuoteAttachmentByFileName($xero_tenant_id, $quote_id, $file_name, $body, $idempotency_key = null) { - list($response) = $this->createQuoteAttachmentByFileNameWithHttpInfo($xero_tenant_id, $quote_id, $file_name, $body); + list($response) = $this->createQuoteAttachmentByFileNameWithHttpInfo($xero_tenant_id, $quote_id, $file_name, $body, $idempotency_key); return $response; } /** @@ -12484,13 +12881,14 @@ public function createQuoteAttachmentByFileName($xero_tenant_id, $quote_id, $fil * @param string $quote_id Unique identifier for an Quote (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createQuoteAttachmentByFileNameWithHttpInfo($xero_tenant_id, $quote_id, $file_name, $body) + public function createQuoteAttachmentByFileNameWithHttpInfo($xero_tenant_id, $quote_id, $file_name, $body, $idempotency_key = null) { - $request = $this->createQuoteAttachmentByFileNameRequest($xero_tenant_id, $quote_id, $file_name, $body); + $request = $this->createQuoteAttachmentByFileNameRequest($xero_tenant_id, $quote_id, $file_name, $body, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -12582,12 +12980,13 @@ public function createQuoteAttachmentByFileNameWithHttpInfo($xero_tenant_id, $qu * @param string $quote_id Unique identifier for an Quote (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createQuoteAttachmentByFileNameAsync($xero_tenant_id, $quote_id, $file_name, $body) + public function createQuoteAttachmentByFileNameAsync($xero_tenant_id, $quote_id, $file_name, $body, $idempotency_key = null) { - return $this->createQuoteAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $quote_id, $file_name, $body) + return $this->createQuoteAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $quote_id, $file_name, $body, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -12601,12 +13000,13 @@ function ($response) { * @param string $quote_id Unique identifier for an Quote (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createQuoteAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $quote_id, $file_name, $body) + public function createQuoteAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $quote_id, $file_name, $body, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; - $request = $this->createQuoteAttachmentByFileNameRequest($xero_tenant_id, $quote_id, $file_name, $body); + $request = $this->createQuoteAttachmentByFileNameRequest($xero_tenant_id, $quote_id, $file_name, $body, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -12646,9 +13046,10 @@ function ($exception) { * @param string $quote_id Unique identifier for an Quote (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createQuoteAttachmentByFileNameRequest($xero_tenant_id, $quote_id, $file_name, $body) + protected function createQuoteAttachmentByFileNameRequest($xero_tenant_id, $quote_id, $file_name, $body, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -12684,6 +13085,10 @@ protected function createQuoteAttachmentByFileNameRequest($xero_tenant_id, $quot if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($quote_id !== null) { $resourcePath = str_replace( @@ -12769,13 +13174,14 @@ protected function createQuoteAttachmentByFileNameRequest($xero_tenant_id, $quot * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $quote_id Unique identifier for an Quote (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createQuoteHistory($xero_tenant_id, $quote_id, $history_records) + public function createQuoteHistory($xero_tenant_id, $quote_id, $history_records, $idempotency_key = null) { - list($response) = $this->createQuoteHistoryWithHttpInfo($xero_tenant_id, $quote_id, $history_records); + list($response) = $this->createQuoteHistoryWithHttpInfo($xero_tenant_id, $quote_id, $history_records, $idempotency_key); return $response; } /** @@ -12784,13 +13190,14 @@ public function createQuoteHistory($xero_tenant_id, $quote_id, $history_records) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $quote_id Unique identifier for an Quote (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\HistoryRecords|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createQuoteHistoryWithHttpInfo($xero_tenant_id, $quote_id, $history_records) + public function createQuoteHistoryWithHttpInfo($xero_tenant_id, $quote_id, $history_records, $idempotency_key = null) { - $request = $this->createQuoteHistoryRequest($xero_tenant_id, $quote_id, $history_records); + $request = $this->createQuoteHistoryRequest($xero_tenant_id, $quote_id, $history_records, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -12881,12 +13288,13 @@ public function createQuoteHistoryWithHttpInfo($xero_tenant_id, $quote_id, $hist * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $quote_id Unique identifier for an Quote (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createQuoteHistoryAsync($xero_tenant_id, $quote_id, $history_records) + public function createQuoteHistoryAsync($xero_tenant_id, $quote_id, $history_records, $idempotency_key = null) { - return $this->createQuoteHistoryAsyncWithHttpInfo($xero_tenant_id, $quote_id, $history_records) + return $this->createQuoteHistoryAsyncWithHttpInfo($xero_tenant_id, $quote_id, $history_records, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -12899,12 +13307,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $quote_id Unique identifier for an Quote (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createQuoteHistoryAsyncWithHttpInfo($xero_tenant_id, $quote_id, $history_records) + public function createQuoteHistoryAsyncWithHttpInfo($xero_tenant_id, $quote_id, $history_records, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords'; - $request = $this->createQuoteHistoryRequest($xero_tenant_id, $quote_id, $history_records); + $request = $this->createQuoteHistoryRequest($xero_tenant_id, $quote_id, $history_records, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -12943,9 +13352,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $quote_id Unique identifier for an Quote (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createQuoteHistoryRequest($xero_tenant_id, $quote_id, $history_records) + protected function createQuoteHistoryRequest($xero_tenant_id, $quote_id, $history_records, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -12975,6 +13385,10 @@ protected function createQuoteHistoryRequest($xero_tenant_id, $quote_id, $histor if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($quote_id !== null) { $resourcePath = str_replace( @@ -13052,13 +13466,14 @@ protected function createQuoteHistoryRequest($xero_tenant_id, $quote_id, $histor * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Quotes $quotes Quotes with an array of Quote object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Quotes|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createQuotes($xero_tenant_id, $quotes, $summarize_errors = false) + public function createQuotes($xero_tenant_id, $quotes, $summarize_errors = false, $idempotency_key = null) { - list($response) = $this->createQuotesWithHttpInfo($xero_tenant_id, $quotes, $summarize_errors); + list($response) = $this->createQuotesWithHttpInfo($xero_tenant_id, $quotes, $summarize_errors, $idempotency_key); return $response; } /** @@ -13067,13 +13482,14 @@ public function createQuotes($xero_tenant_id, $quotes, $summarize_errors = false * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Quotes $quotes Quotes with an array of Quote object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Quotes|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createQuotesWithHttpInfo($xero_tenant_id, $quotes, $summarize_errors = false) + public function createQuotesWithHttpInfo($xero_tenant_id, $quotes, $summarize_errors = false, $idempotency_key = null) { - $request = $this->createQuotesRequest($xero_tenant_id, $quotes, $summarize_errors); + $request = $this->createQuotesRequest($xero_tenant_id, $quotes, $summarize_errors, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -13164,12 +13580,13 @@ public function createQuotesWithHttpInfo($xero_tenant_id, $quotes, $summarize_er * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Quotes $quotes Quotes with an array of Quote object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createQuotesAsync($xero_tenant_id, $quotes, $summarize_errors = false) + public function createQuotesAsync($xero_tenant_id, $quotes, $summarize_errors = false, $idempotency_key = null) { - return $this->createQuotesAsyncWithHttpInfo($xero_tenant_id, $quotes, $summarize_errors) + return $this->createQuotesAsyncWithHttpInfo($xero_tenant_id, $quotes, $summarize_errors, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -13182,12 +13599,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Quotes $quotes Quotes with an array of Quote object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createQuotesAsyncWithHttpInfo($xero_tenant_id, $quotes, $summarize_errors = false) + public function createQuotesAsyncWithHttpInfo($xero_tenant_id, $quotes, $summarize_errors = false, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Quotes'; - $request = $this->createQuotesRequest($xero_tenant_id, $quotes, $summarize_errors); + $request = $this->createQuotesRequest($xero_tenant_id, $quotes, $summarize_errors, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -13226,9 +13644,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Quotes $quotes Quotes with an array of Quote object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createQuotesRequest($xero_tenant_id, $quotes, $summarize_errors = false) + protected function createQuotesRequest($xero_tenant_id, $quotes, $summarize_errors = false, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -13256,6 +13675,10 @@ protected function createQuotesRequest($xero_tenant_id, $quotes, $summarize_erro if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($quotes)) { @@ -13325,13 +13748,14 @@ protected function createQuotesRequest($xero_tenant_id, $quotes, $summarize_erro * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Receipts $receipts Receipts with an array of Receipt object in body of request (required) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Receipts|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createReceipt($xero_tenant_id, $receipts, $unitdp = null) + public function createReceipt($xero_tenant_id, $receipts, $unitdp = null, $idempotency_key = null) { - list($response) = $this->createReceiptWithHttpInfo($xero_tenant_id, $receipts, $unitdp); + list($response) = $this->createReceiptWithHttpInfo($xero_tenant_id, $receipts, $unitdp, $idempotency_key); return $response; } /** @@ -13340,13 +13764,14 @@ public function createReceipt($xero_tenant_id, $receipts, $unitdp = null) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Receipts $receipts Receipts with an array of Receipt object in body of request (required) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Receipts|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createReceiptWithHttpInfo($xero_tenant_id, $receipts, $unitdp = null) + public function createReceiptWithHttpInfo($xero_tenant_id, $receipts, $unitdp = null, $idempotency_key = null) { - $request = $this->createReceiptRequest($xero_tenant_id, $receipts, $unitdp); + $request = $this->createReceiptRequest($xero_tenant_id, $receipts, $unitdp, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -13437,12 +13862,13 @@ public function createReceiptWithHttpInfo($xero_tenant_id, $receipts, $unitdp = * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Receipts $receipts Receipts with an array of Receipt object in body of request (required) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createReceiptAsync($xero_tenant_id, $receipts, $unitdp = null) + public function createReceiptAsync($xero_tenant_id, $receipts, $unitdp = null, $idempotency_key = null) { - return $this->createReceiptAsyncWithHttpInfo($xero_tenant_id, $receipts, $unitdp) + return $this->createReceiptAsyncWithHttpInfo($xero_tenant_id, $receipts, $unitdp, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -13455,12 +13881,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Receipts $receipts Receipts with an array of Receipt object in body of request (required) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createReceiptAsyncWithHttpInfo($xero_tenant_id, $receipts, $unitdp = null) + public function createReceiptAsyncWithHttpInfo($xero_tenant_id, $receipts, $unitdp = null, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Receipts'; - $request = $this->createReceiptRequest($xero_tenant_id, $receipts, $unitdp); + $request = $this->createReceiptRequest($xero_tenant_id, $receipts, $unitdp, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -13499,9 +13926,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Receipts $receipts Receipts with an array of Receipt object in body of request (required) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createReceiptRequest($xero_tenant_id, $receipts, $unitdp = null) + protected function createReceiptRequest($xero_tenant_id, $receipts, $unitdp = null, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -13529,6 +13957,10 @@ protected function createReceiptRequest($xero_tenant_id, $receipts, $unitdp = nu if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($receipts)) { @@ -13599,13 +14031,14 @@ protected function createReceiptRequest($xero_tenant_id, $receipts, $unitdp = nu * @param string $receipt_id Unique identifier for a Receipt (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createReceiptAttachmentByFileName($xero_tenant_id, $receipt_id, $file_name, $body) + public function createReceiptAttachmentByFileName($xero_tenant_id, $receipt_id, $file_name, $body, $idempotency_key = null) { - list($response) = $this->createReceiptAttachmentByFileNameWithHttpInfo($xero_tenant_id, $receipt_id, $file_name, $body); + list($response) = $this->createReceiptAttachmentByFileNameWithHttpInfo($xero_tenant_id, $receipt_id, $file_name, $body, $idempotency_key); return $response; } /** @@ -13615,13 +14048,14 @@ public function createReceiptAttachmentByFileName($xero_tenant_id, $receipt_id, * @param string $receipt_id Unique identifier for a Receipt (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createReceiptAttachmentByFileNameWithHttpInfo($xero_tenant_id, $receipt_id, $file_name, $body) + public function createReceiptAttachmentByFileNameWithHttpInfo($xero_tenant_id, $receipt_id, $file_name, $body, $idempotency_key = null) { - $request = $this->createReceiptAttachmentByFileNameRequest($xero_tenant_id, $receipt_id, $file_name, $body); + $request = $this->createReceiptAttachmentByFileNameRequest($xero_tenant_id, $receipt_id, $file_name, $body, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -13713,12 +14147,13 @@ public function createReceiptAttachmentByFileNameWithHttpInfo($xero_tenant_id, $ * @param string $receipt_id Unique identifier for a Receipt (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createReceiptAttachmentByFileNameAsync($xero_tenant_id, $receipt_id, $file_name, $body) + public function createReceiptAttachmentByFileNameAsync($xero_tenant_id, $receipt_id, $file_name, $body, $idempotency_key = null) { - return $this->createReceiptAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $receipt_id, $file_name, $body) + return $this->createReceiptAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $receipt_id, $file_name, $body, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -13732,12 +14167,13 @@ function ($response) { * @param string $receipt_id Unique identifier for a Receipt (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createReceiptAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $receipt_id, $file_name, $body) + public function createReceiptAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $receipt_id, $file_name, $body, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; - $request = $this->createReceiptAttachmentByFileNameRequest($xero_tenant_id, $receipt_id, $file_name, $body); + $request = $this->createReceiptAttachmentByFileNameRequest($xero_tenant_id, $receipt_id, $file_name, $body, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -13777,9 +14213,10 @@ function ($exception) { * @param string $receipt_id Unique identifier for a Receipt (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createReceiptAttachmentByFileNameRequest($xero_tenant_id, $receipt_id, $file_name, $body) + protected function createReceiptAttachmentByFileNameRequest($xero_tenant_id, $receipt_id, $file_name, $body, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -13815,6 +14252,10 @@ protected function createReceiptAttachmentByFileNameRequest($xero_tenant_id, $re if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($receipt_id !== null) { $resourcePath = str_replace( @@ -13900,13 +14341,14 @@ protected function createReceiptAttachmentByFileNameRequest($xero_tenant_id, $re * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $receipt_id Unique identifier for a Receipt (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createReceiptHistory($xero_tenant_id, $receipt_id, $history_records) + public function createReceiptHistory($xero_tenant_id, $receipt_id, $history_records, $idempotency_key = null) { - list($response) = $this->createReceiptHistoryWithHttpInfo($xero_tenant_id, $receipt_id, $history_records); + list($response) = $this->createReceiptHistoryWithHttpInfo($xero_tenant_id, $receipt_id, $history_records, $idempotency_key); return $response; } /** @@ -13915,13 +14357,14 @@ public function createReceiptHistory($xero_tenant_id, $receipt_id, $history_reco * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $receipt_id Unique identifier for a Receipt (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\HistoryRecords|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createReceiptHistoryWithHttpInfo($xero_tenant_id, $receipt_id, $history_records) + public function createReceiptHistoryWithHttpInfo($xero_tenant_id, $receipt_id, $history_records, $idempotency_key = null) { - $request = $this->createReceiptHistoryRequest($xero_tenant_id, $receipt_id, $history_records); + $request = $this->createReceiptHistoryRequest($xero_tenant_id, $receipt_id, $history_records, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -14012,12 +14455,13 @@ public function createReceiptHistoryWithHttpInfo($xero_tenant_id, $receipt_id, $ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $receipt_id Unique identifier for a Receipt (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createReceiptHistoryAsync($xero_tenant_id, $receipt_id, $history_records) + public function createReceiptHistoryAsync($xero_tenant_id, $receipt_id, $history_records, $idempotency_key = null) { - return $this->createReceiptHistoryAsyncWithHttpInfo($xero_tenant_id, $receipt_id, $history_records) + return $this->createReceiptHistoryAsyncWithHttpInfo($xero_tenant_id, $receipt_id, $history_records, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -14030,12 +14474,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $receipt_id Unique identifier for a Receipt (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createReceiptHistoryAsyncWithHttpInfo($xero_tenant_id, $receipt_id, $history_records) + public function createReceiptHistoryAsyncWithHttpInfo($xero_tenant_id, $receipt_id, $history_records, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords'; - $request = $this->createReceiptHistoryRequest($xero_tenant_id, $receipt_id, $history_records); + $request = $this->createReceiptHistoryRequest($xero_tenant_id, $receipt_id, $history_records, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -14074,9 +14519,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $receipt_id Unique identifier for a Receipt (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createReceiptHistoryRequest($xero_tenant_id, $receipt_id, $history_records) + protected function createReceiptHistoryRequest($xero_tenant_id, $receipt_id, $history_records, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -14106,6 +14552,10 @@ protected function createReceiptHistoryRequest($xero_tenant_id, $receipt_id, $hi if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($receipt_id !== null) { $resourcePath = str_replace( @@ -14184,13 +14634,14 @@ protected function createReceiptHistoryRequest($xero_tenant_id, $receipt_id, $hi * @param string $repeating_invoice_id Unique identifier for a Repeating Invoice (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createRepeatingInvoiceAttachmentByFileName($xero_tenant_id, $repeating_invoice_id, $file_name, $body) + public function createRepeatingInvoiceAttachmentByFileName($xero_tenant_id, $repeating_invoice_id, $file_name, $body, $idempotency_key = null) { - list($response) = $this->createRepeatingInvoiceAttachmentByFileNameWithHttpInfo($xero_tenant_id, $repeating_invoice_id, $file_name, $body); + list($response) = $this->createRepeatingInvoiceAttachmentByFileNameWithHttpInfo($xero_tenant_id, $repeating_invoice_id, $file_name, $body, $idempotency_key); return $response; } /** @@ -14200,13 +14651,14 @@ public function createRepeatingInvoiceAttachmentByFileName($xero_tenant_id, $rep * @param string $repeating_invoice_id Unique identifier for a Repeating Invoice (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createRepeatingInvoiceAttachmentByFileNameWithHttpInfo($xero_tenant_id, $repeating_invoice_id, $file_name, $body) + public function createRepeatingInvoiceAttachmentByFileNameWithHttpInfo($xero_tenant_id, $repeating_invoice_id, $file_name, $body, $idempotency_key = null) { - $request = $this->createRepeatingInvoiceAttachmentByFileNameRequest($xero_tenant_id, $repeating_invoice_id, $file_name, $body); + $request = $this->createRepeatingInvoiceAttachmentByFileNameRequest($xero_tenant_id, $repeating_invoice_id, $file_name, $body, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -14298,12 +14750,13 @@ public function createRepeatingInvoiceAttachmentByFileNameWithHttpInfo($xero_ten * @param string $repeating_invoice_id Unique identifier for a Repeating Invoice (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createRepeatingInvoiceAttachmentByFileNameAsync($xero_tenant_id, $repeating_invoice_id, $file_name, $body) + public function createRepeatingInvoiceAttachmentByFileNameAsync($xero_tenant_id, $repeating_invoice_id, $file_name, $body, $idempotency_key = null) { - return $this->createRepeatingInvoiceAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $repeating_invoice_id, $file_name, $body) + return $this->createRepeatingInvoiceAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $repeating_invoice_id, $file_name, $body, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -14317,12 +14770,13 @@ function ($response) { * @param string $repeating_invoice_id Unique identifier for a Repeating Invoice (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createRepeatingInvoiceAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $repeating_invoice_id, $file_name, $body) + public function createRepeatingInvoiceAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $repeating_invoice_id, $file_name, $body, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; - $request = $this->createRepeatingInvoiceAttachmentByFileNameRequest($xero_tenant_id, $repeating_invoice_id, $file_name, $body); + $request = $this->createRepeatingInvoiceAttachmentByFileNameRequest($xero_tenant_id, $repeating_invoice_id, $file_name, $body, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -14362,9 +14816,10 @@ function ($exception) { * @param string $repeating_invoice_id Unique identifier for a Repeating Invoice (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createRepeatingInvoiceAttachmentByFileNameRequest($xero_tenant_id, $repeating_invoice_id, $file_name, $body) + protected function createRepeatingInvoiceAttachmentByFileNameRequest($xero_tenant_id, $repeating_invoice_id, $file_name, $body, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -14400,6 +14855,10 @@ protected function createRepeatingInvoiceAttachmentByFileNameRequest($xero_tenan if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($repeating_invoice_id !== null) { $resourcePath = str_replace( @@ -14485,13 +14944,14 @@ protected function createRepeatingInvoiceAttachmentByFileNameRequest($xero_tenan * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $repeating_invoice_id Unique identifier for a Repeating Invoice (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createRepeatingInvoiceHistory($xero_tenant_id, $repeating_invoice_id, $history_records) + public function createRepeatingInvoiceHistory($xero_tenant_id, $repeating_invoice_id, $history_records, $idempotency_key = null) { - list($response) = $this->createRepeatingInvoiceHistoryWithHttpInfo($xero_tenant_id, $repeating_invoice_id, $history_records); + list($response) = $this->createRepeatingInvoiceHistoryWithHttpInfo($xero_tenant_id, $repeating_invoice_id, $history_records, $idempotency_key); return $response; } /** @@ -14500,13 +14960,14 @@ public function createRepeatingInvoiceHistory($xero_tenant_id, $repeating_invoic * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $repeating_invoice_id Unique identifier for a Repeating Invoice (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\HistoryRecords|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createRepeatingInvoiceHistoryWithHttpInfo($xero_tenant_id, $repeating_invoice_id, $history_records) + public function createRepeatingInvoiceHistoryWithHttpInfo($xero_tenant_id, $repeating_invoice_id, $history_records, $idempotency_key = null) { - $request = $this->createRepeatingInvoiceHistoryRequest($xero_tenant_id, $repeating_invoice_id, $history_records); + $request = $this->createRepeatingInvoiceHistoryRequest($xero_tenant_id, $repeating_invoice_id, $history_records, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -14597,12 +15058,13 @@ public function createRepeatingInvoiceHistoryWithHttpInfo($xero_tenant_id, $repe * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $repeating_invoice_id Unique identifier for a Repeating Invoice (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createRepeatingInvoiceHistoryAsync($xero_tenant_id, $repeating_invoice_id, $history_records) + public function createRepeatingInvoiceHistoryAsync($xero_tenant_id, $repeating_invoice_id, $history_records, $idempotency_key = null) { - return $this->createRepeatingInvoiceHistoryAsyncWithHttpInfo($xero_tenant_id, $repeating_invoice_id, $history_records) + return $this->createRepeatingInvoiceHistoryAsyncWithHttpInfo($xero_tenant_id, $repeating_invoice_id, $history_records, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -14615,12 +15077,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $repeating_invoice_id Unique identifier for a Repeating Invoice (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createRepeatingInvoiceHistoryAsyncWithHttpInfo($xero_tenant_id, $repeating_invoice_id, $history_records) + public function createRepeatingInvoiceHistoryAsyncWithHttpInfo($xero_tenant_id, $repeating_invoice_id, $history_records, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords'; - $request = $this->createRepeatingInvoiceHistoryRequest($xero_tenant_id, $repeating_invoice_id, $history_records); + $request = $this->createRepeatingInvoiceHistoryRequest($xero_tenant_id, $repeating_invoice_id, $history_records, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -14659,9 +15122,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $repeating_invoice_id Unique identifier for a Repeating Invoice (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords $history_records HistoryRecords containing an array of HistoryRecord objects in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createRepeatingInvoiceHistoryRequest($xero_tenant_id, $repeating_invoice_id, $history_records) + protected function createRepeatingInvoiceHistoryRequest($xero_tenant_id, $repeating_invoice_id, $history_records, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -14691,6 +15155,10 @@ protected function createRepeatingInvoiceHistoryRequest($xero_tenant_id, $repeat if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($repeating_invoice_id !== null) { $resourcePath = str_replace( @@ -14768,13 +15236,14 @@ protected function createRepeatingInvoiceHistoryRequest($xero_tenant_id, $repeat * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\RepeatingInvoices $repeating_invoices RepeatingInvoices with an array of repeating invoice objects in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\RepeatingInvoices|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createRepeatingInvoices($xero_tenant_id, $repeating_invoices, $summarize_errors = false) + public function createRepeatingInvoices($xero_tenant_id, $repeating_invoices, $summarize_errors = false, $idempotency_key = null) { - list($response) = $this->createRepeatingInvoicesWithHttpInfo($xero_tenant_id, $repeating_invoices, $summarize_errors); + list($response) = $this->createRepeatingInvoicesWithHttpInfo($xero_tenant_id, $repeating_invoices, $summarize_errors, $idempotency_key); return $response; } /** @@ -14783,13 +15252,14 @@ public function createRepeatingInvoices($xero_tenant_id, $repeating_invoices, $s * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\RepeatingInvoices $repeating_invoices RepeatingInvoices with an array of repeating invoice objects in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\RepeatingInvoices|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createRepeatingInvoicesWithHttpInfo($xero_tenant_id, $repeating_invoices, $summarize_errors = false) + public function createRepeatingInvoicesWithHttpInfo($xero_tenant_id, $repeating_invoices, $summarize_errors = false, $idempotency_key = null) { - $request = $this->createRepeatingInvoicesRequest($xero_tenant_id, $repeating_invoices, $summarize_errors); + $request = $this->createRepeatingInvoicesRequest($xero_tenant_id, $repeating_invoices, $summarize_errors, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -14880,12 +15350,13 @@ public function createRepeatingInvoicesWithHttpInfo($xero_tenant_id, $repeating_ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\RepeatingInvoices $repeating_invoices RepeatingInvoices with an array of repeating invoice objects in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createRepeatingInvoicesAsync($xero_tenant_id, $repeating_invoices, $summarize_errors = false) + public function createRepeatingInvoicesAsync($xero_tenant_id, $repeating_invoices, $summarize_errors = false, $idempotency_key = null) { - return $this->createRepeatingInvoicesAsyncWithHttpInfo($xero_tenant_id, $repeating_invoices, $summarize_errors) + return $this->createRepeatingInvoicesAsyncWithHttpInfo($xero_tenant_id, $repeating_invoices, $summarize_errors, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -14898,12 +15369,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\RepeatingInvoices $repeating_invoices RepeatingInvoices with an array of repeating invoice objects in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createRepeatingInvoicesAsyncWithHttpInfo($xero_tenant_id, $repeating_invoices, $summarize_errors = false) + public function createRepeatingInvoicesAsyncWithHttpInfo($xero_tenant_id, $repeating_invoices, $summarize_errors = false, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\RepeatingInvoices'; - $request = $this->createRepeatingInvoicesRequest($xero_tenant_id, $repeating_invoices, $summarize_errors); + $request = $this->createRepeatingInvoicesRequest($xero_tenant_id, $repeating_invoices, $summarize_errors, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -14942,9 +15414,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\RepeatingInvoices $repeating_invoices RepeatingInvoices with an array of repeating invoice objects in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createRepeatingInvoicesRequest($xero_tenant_id, $repeating_invoices, $summarize_errors = false) + protected function createRepeatingInvoicesRequest($xero_tenant_id, $repeating_invoices, $summarize_errors = false, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -14972,6 +15445,10 @@ protected function createRepeatingInvoicesRequest($xero_tenant_id, $repeating_in if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($repeating_invoices)) { @@ -15040,13 +15517,14 @@ protected function createRepeatingInvoicesRequest($xero_tenant_id, $repeating_in * Creates one or more tax rates * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TaxRates $tax_rates TaxRates array with TaxRate object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TaxRates|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createTaxRates($xero_tenant_id, $tax_rates) + public function createTaxRates($xero_tenant_id, $tax_rates, $idempotency_key = null) { - list($response) = $this->createTaxRatesWithHttpInfo($xero_tenant_id, $tax_rates); + list($response) = $this->createTaxRatesWithHttpInfo($xero_tenant_id, $tax_rates, $idempotency_key); return $response; } /** @@ -15054,13 +15532,14 @@ public function createTaxRates($xero_tenant_id, $tax_rates) * Creates one or more tax rates * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TaxRates $tax_rates TaxRates array with TaxRate object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\TaxRates|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createTaxRatesWithHttpInfo($xero_tenant_id, $tax_rates) + public function createTaxRatesWithHttpInfo($xero_tenant_id, $tax_rates, $idempotency_key = null) { - $request = $this->createTaxRatesRequest($xero_tenant_id, $tax_rates); + $request = $this->createTaxRatesRequest($xero_tenant_id, $tax_rates, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -15150,12 +15629,13 @@ public function createTaxRatesWithHttpInfo($xero_tenant_id, $tax_rates) * Creates one or more tax rates * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TaxRates $tax_rates TaxRates array with TaxRate object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createTaxRatesAsync($xero_tenant_id, $tax_rates) + public function createTaxRatesAsync($xero_tenant_id, $tax_rates, $idempotency_key = null) { - return $this->createTaxRatesAsyncWithHttpInfo($xero_tenant_id, $tax_rates) + return $this->createTaxRatesAsyncWithHttpInfo($xero_tenant_id, $tax_rates, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -15167,12 +15647,13 @@ function ($response) { * Creates one or more tax rates * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TaxRates $tax_rates TaxRates array with TaxRate object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createTaxRatesAsyncWithHttpInfo($xero_tenant_id, $tax_rates) + public function createTaxRatesAsyncWithHttpInfo($xero_tenant_id, $tax_rates, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TaxRates'; - $request = $this->createTaxRatesRequest($xero_tenant_id, $tax_rates); + $request = $this->createTaxRatesRequest($xero_tenant_id, $tax_rates, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -15210,9 +15691,10 @@ function ($exception) { * Create request for operation 'createTaxRates' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TaxRates $tax_rates TaxRates array with TaxRate object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createTaxRatesRequest($xero_tenant_id, $tax_rates) + protected function createTaxRatesRequest($xero_tenant_id, $tax_rates, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -15236,6 +15718,10 @@ protected function createTaxRatesRequest($xero_tenant_id, $tax_rates) if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($tax_rates)) { @@ -15304,13 +15790,14 @@ protected function createTaxRatesRequest($xero_tenant_id, $tax_rates) * Create tracking categories * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingCategory $tracking_category TrackingCategory object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingCategories|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createTrackingCategory($xero_tenant_id, $tracking_category) + public function createTrackingCategory($xero_tenant_id, $tracking_category, $idempotency_key = null) { - list($response) = $this->createTrackingCategoryWithHttpInfo($xero_tenant_id, $tracking_category); + list($response) = $this->createTrackingCategoryWithHttpInfo($xero_tenant_id, $tracking_category, $idempotency_key); return $response; } /** @@ -15318,13 +15805,14 @@ public function createTrackingCategory($xero_tenant_id, $tracking_category) * Create tracking categories * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingCategory $tracking_category TrackingCategory object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\TrackingCategories|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createTrackingCategoryWithHttpInfo($xero_tenant_id, $tracking_category) + public function createTrackingCategoryWithHttpInfo($xero_tenant_id, $tracking_category, $idempotency_key = null) { - $request = $this->createTrackingCategoryRequest($xero_tenant_id, $tracking_category); + $request = $this->createTrackingCategoryRequest($xero_tenant_id, $tracking_category, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -15414,12 +15902,13 @@ public function createTrackingCategoryWithHttpInfo($xero_tenant_id, $tracking_ca * Create tracking categories * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingCategory $tracking_category TrackingCategory object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createTrackingCategoryAsync($xero_tenant_id, $tracking_category) + public function createTrackingCategoryAsync($xero_tenant_id, $tracking_category, $idempotency_key = null) { - return $this->createTrackingCategoryAsyncWithHttpInfo($xero_tenant_id, $tracking_category) + return $this->createTrackingCategoryAsyncWithHttpInfo($xero_tenant_id, $tracking_category, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -15431,12 +15920,13 @@ function ($response) { * Create tracking categories * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingCategory $tracking_category TrackingCategory object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createTrackingCategoryAsyncWithHttpInfo($xero_tenant_id, $tracking_category) + public function createTrackingCategoryAsyncWithHttpInfo($xero_tenant_id, $tracking_category, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingCategories'; - $request = $this->createTrackingCategoryRequest($xero_tenant_id, $tracking_category); + $request = $this->createTrackingCategoryRequest($xero_tenant_id, $tracking_category, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -15474,9 +15964,10 @@ function ($exception) { * Create request for operation 'createTrackingCategory' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingCategory $tracking_category TrackingCategory object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createTrackingCategoryRequest($xero_tenant_id, $tracking_category) + protected function createTrackingCategoryRequest($xero_tenant_id, $tracking_category, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -15500,6 +15991,10 @@ protected function createTrackingCategoryRequest($xero_tenant_id, $tracking_cate if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($tracking_category)) { @@ -15569,13 +16064,14 @@ protected function createTrackingCategoryRequest($xero_tenant_id, $tracking_cate * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $tracking_category_id Unique identifier for a TrackingCategory (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingOption $tracking_option TrackingOption object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingOptions|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function createTrackingOptions($xero_tenant_id, $tracking_category_id, $tracking_option) + public function createTrackingOptions($xero_tenant_id, $tracking_category_id, $tracking_option, $idempotency_key = null) { - list($response) = $this->createTrackingOptionsWithHttpInfo($xero_tenant_id, $tracking_category_id, $tracking_option); + list($response) = $this->createTrackingOptionsWithHttpInfo($xero_tenant_id, $tracking_category_id, $tracking_option, $idempotency_key); return $response; } /** @@ -15584,13 +16080,14 @@ public function createTrackingOptions($xero_tenant_id, $tracking_category_id, $t * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $tracking_category_id Unique identifier for a TrackingCategory (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingOption $tracking_option TrackingOption object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\TrackingOptions|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createTrackingOptionsWithHttpInfo($xero_tenant_id, $tracking_category_id, $tracking_option) + public function createTrackingOptionsWithHttpInfo($xero_tenant_id, $tracking_category_id, $tracking_option, $idempotency_key = null) { - $request = $this->createTrackingOptionsRequest($xero_tenant_id, $tracking_category_id, $tracking_option); + $request = $this->createTrackingOptionsRequest($xero_tenant_id, $tracking_category_id, $tracking_option, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -15681,12 +16178,13 @@ public function createTrackingOptionsWithHttpInfo($xero_tenant_id, $tracking_cat * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $tracking_category_id Unique identifier for a TrackingCategory (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingOption $tracking_option TrackingOption object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createTrackingOptionsAsync($xero_tenant_id, $tracking_category_id, $tracking_option) + public function createTrackingOptionsAsync($xero_tenant_id, $tracking_category_id, $tracking_option, $idempotency_key = null) { - return $this->createTrackingOptionsAsyncWithHttpInfo($xero_tenant_id, $tracking_category_id, $tracking_option) + return $this->createTrackingOptionsAsyncWithHttpInfo($xero_tenant_id, $tracking_category_id, $tracking_option, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -15699,12 +16197,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $tracking_category_id Unique identifier for a TrackingCategory (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingOption $tracking_option TrackingOption object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createTrackingOptionsAsyncWithHttpInfo($xero_tenant_id, $tracking_category_id, $tracking_option) + public function createTrackingOptionsAsyncWithHttpInfo($xero_tenant_id, $tracking_category_id, $tracking_option, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingOptions'; - $request = $this->createTrackingOptionsRequest($xero_tenant_id, $tracking_category_id, $tracking_option); + $request = $this->createTrackingOptionsRequest($xero_tenant_id, $tracking_category_id, $tracking_option, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -15743,9 +16242,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $tracking_category_id Unique identifier for a TrackingCategory (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingOption $tracking_option TrackingOption object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createTrackingOptionsRequest($xero_tenant_id, $tracking_category_id, $tracking_option) + protected function createTrackingOptionsRequest($xero_tenant_id, $tracking_category_id, $tracking_option, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -15775,6 +16275,10 @@ protected function createTrackingOptionsRequest($xero_tenant_id, $tracking_categ if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($tracking_category_id !== null) { $resourcePath = str_replace( @@ -16120,13 +16624,14 @@ protected function deleteAccountRequest($xero_tenant_id, $account_id) * Updates a specific batch payment for invoices and credit notes * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPaymentDelete $batch_payment_delete batch_payment_delete (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function deleteBatchPayment($xero_tenant_id, $batch_payment_delete) + public function deleteBatchPayment($xero_tenant_id, $batch_payment_delete, $idempotency_key = null) { - list($response) = $this->deleteBatchPaymentWithHttpInfo($xero_tenant_id, $batch_payment_delete); + list($response) = $this->deleteBatchPaymentWithHttpInfo($xero_tenant_id, $batch_payment_delete, $idempotency_key); return $response; } /** @@ -16134,13 +16639,14 @@ public function deleteBatchPayment($xero_tenant_id, $batch_payment_delete) * Updates a specific batch payment for invoices and credit notes * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPaymentDelete $batch_payment_delete (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\BatchPayments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function deleteBatchPaymentWithHttpInfo($xero_tenant_id, $batch_payment_delete) + public function deleteBatchPaymentWithHttpInfo($xero_tenant_id, $batch_payment_delete, $idempotency_key = null) { - $request = $this->deleteBatchPaymentRequest($xero_tenant_id, $batch_payment_delete); + $request = $this->deleteBatchPaymentRequest($xero_tenant_id, $batch_payment_delete, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -16230,12 +16736,13 @@ public function deleteBatchPaymentWithHttpInfo($xero_tenant_id, $batch_payment_d * Updates a specific batch payment for invoices and credit notes * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPaymentDelete $batch_payment_delete (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function deleteBatchPaymentAsync($xero_tenant_id, $batch_payment_delete) + public function deleteBatchPaymentAsync($xero_tenant_id, $batch_payment_delete, $idempotency_key = null) { - return $this->deleteBatchPaymentAsyncWithHttpInfo($xero_tenant_id, $batch_payment_delete) + return $this->deleteBatchPaymentAsyncWithHttpInfo($xero_tenant_id, $batch_payment_delete, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -16247,12 +16754,13 @@ function ($response) { * Updates a specific batch payment for invoices and credit notes * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPaymentDelete $batch_payment_delete (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function deleteBatchPaymentAsyncWithHttpInfo($xero_tenant_id, $batch_payment_delete) + public function deleteBatchPaymentAsyncWithHttpInfo($xero_tenant_id, $batch_payment_delete, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayments'; - $request = $this->deleteBatchPaymentRequest($xero_tenant_id, $batch_payment_delete); + $request = $this->deleteBatchPaymentRequest($xero_tenant_id, $batch_payment_delete, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -16290,9 +16798,10 @@ function ($exception) { * Create request for operation 'deleteBatchPayment' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPaymentDelete $batch_payment_delete (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function deleteBatchPaymentRequest($xero_tenant_id, $batch_payment_delete) + protected function deleteBatchPaymentRequest($xero_tenant_id, $batch_payment_delete, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -16316,6 +16825,10 @@ protected function deleteBatchPaymentRequest($xero_tenant_id, $batch_payment_del if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($batch_payment_delete)) { @@ -16385,13 +16898,14 @@ protected function deleteBatchPaymentRequest($xero_tenant_id, $batch_payment_del * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $batch_payment_id Unique identifier for BatchPayment (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPaymentDeleteByUrlParam $batch_payment_delete_by_url_param batch_payment_delete_by_url_param (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function deleteBatchPaymentByUrlParam($xero_tenant_id, $batch_payment_id, $batch_payment_delete_by_url_param) + public function deleteBatchPaymentByUrlParam($xero_tenant_id, $batch_payment_id, $batch_payment_delete_by_url_param, $idempotency_key = null) { - list($response) = $this->deleteBatchPaymentByUrlParamWithHttpInfo($xero_tenant_id, $batch_payment_id, $batch_payment_delete_by_url_param); + list($response) = $this->deleteBatchPaymentByUrlParamWithHttpInfo($xero_tenant_id, $batch_payment_id, $batch_payment_delete_by_url_param, $idempotency_key); return $response; } /** @@ -16400,13 +16914,14 @@ public function deleteBatchPaymentByUrlParam($xero_tenant_id, $batch_payment_id, * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $batch_payment_id Unique identifier for BatchPayment (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPaymentDeleteByUrlParam $batch_payment_delete_by_url_param (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\BatchPayments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function deleteBatchPaymentByUrlParamWithHttpInfo($xero_tenant_id, $batch_payment_id, $batch_payment_delete_by_url_param) + public function deleteBatchPaymentByUrlParamWithHttpInfo($xero_tenant_id, $batch_payment_id, $batch_payment_delete_by_url_param, $idempotency_key = null) { - $request = $this->deleteBatchPaymentByUrlParamRequest($xero_tenant_id, $batch_payment_id, $batch_payment_delete_by_url_param); + $request = $this->deleteBatchPaymentByUrlParamRequest($xero_tenant_id, $batch_payment_id, $batch_payment_delete_by_url_param, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -16497,12 +17012,13 @@ public function deleteBatchPaymentByUrlParamWithHttpInfo($xero_tenant_id, $batch * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $batch_payment_id Unique identifier for BatchPayment (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPaymentDeleteByUrlParam $batch_payment_delete_by_url_param (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function deleteBatchPaymentByUrlParamAsync($xero_tenant_id, $batch_payment_id, $batch_payment_delete_by_url_param) + public function deleteBatchPaymentByUrlParamAsync($xero_tenant_id, $batch_payment_id, $batch_payment_delete_by_url_param, $idempotency_key = null) { - return $this->deleteBatchPaymentByUrlParamAsyncWithHttpInfo($xero_tenant_id, $batch_payment_id, $batch_payment_delete_by_url_param) + return $this->deleteBatchPaymentByUrlParamAsyncWithHttpInfo($xero_tenant_id, $batch_payment_id, $batch_payment_delete_by_url_param, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -16515,12 +17031,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $batch_payment_id Unique identifier for BatchPayment (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPaymentDeleteByUrlParam $batch_payment_delete_by_url_param (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function deleteBatchPaymentByUrlParamAsyncWithHttpInfo($xero_tenant_id, $batch_payment_id, $batch_payment_delete_by_url_param) + public function deleteBatchPaymentByUrlParamAsyncWithHttpInfo($xero_tenant_id, $batch_payment_id, $batch_payment_delete_by_url_param, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayments'; - $request = $this->deleteBatchPaymentByUrlParamRequest($xero_tenant_id, $batch_payment_id, $batch_payment_delete_by_url_param); + $request = $this->deleteBatchPaymentByUrlParamRequest($xero_tenant_id, $batch_payment_id, $batch_payment_delete_by_url_param, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -16559,9 +17076,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $batch_payment_id Unique identifier for BatchPayment (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPaymentDeleteByUrlParam $batch_payment_delete_by_url_param (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function deleteBatchPaymentByUrlParamRequest($xero_tenant_id, $batch_payment_id, $batch_payment_delete_by_url_param) + protected function deleteBatchPaymentByUrlParamRequest($xero_tenant_id, $batch_payment_id, $batch_payment_delete_by_url_param, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -16591,6 +17109,10 @@ protected function deleteBatchPaymentByUrlParamRequest($xero_tenant_id, $batch_p if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($batch_payment_id !== null) { $resourcePath = str_replace( @@ -17102,30 +17624,33 @@ protected function deleteContactGroupContactsRequest($xero_tenant_id, $contact_g } /** - * Operation deleteItem - * Deletes a specific item + * Operation deleteCreditNoteAllocations + * Deletes an Allocation from a Credit Note * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $item_id Unique identifier for an Item (required) + * @param string $credit_note_id Unique identifier for a Credit Note (required) + * @param string $allocation_id Unique identifier for Allocation object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocation */ - public function deleteItem($xero_tenant_id, $item_id) + public function deleteCreditNoteAllocations($xero_tenant_id, $credit_note_id, $allocation_id) { - $this->deleteItemWithHttpInfo($xero_tenant_id, $item_id); + list($response) = $this->deleteCreditNoteAllocationsWithHttpInfo($xero_tenant_id, $credit_note_id, $allocation_id); + return $response; } /** - * Operation deleteItemWithHttpInfo - * Deletes a specific item + * Operation deleteCreditNoteAllocationsWithHttpInfo + * Deletes an Allocation from a Credit Note * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $item_id Unique identifier for an Item (required) + * @param string $credit_note_id Unique identifier for a Credit Note (required) + * @param string $allocation_id Unique identifier for Allocation object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\Accounting\Allocation, HTTP status code, HTTP response headers (array of strings) */ - public function deleteItemWithHttpInfo($xero_tenant_id, $item_id) + public function deleteCreditNoteAllocationsWithHttpInfo($xero_tenant_id, $credit_note_id, $allocation_id) { - $request = $this->deleteItemRequest($xero_tenant_id, $item_id); + $request = $this->deleteCreditNoteAllocationsRequest($xero_tenant_id, $credit_note_id, $allocation_id); try { $options = $this->createHttpClientOption(); try { @@ -17151,13 +17676,38 @@ public function deleteItemWithHttpInfo($xero_tenant_id, $item_id) $response->getBody() ); } - return [null, $statusCode, $response->getHeaders()]; + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocation' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocation', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocation'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + AccountingObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { - case 400: + case 200: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocation', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -17167,16 +17717,17 @@ public function deleteItemWithHttpInfo($xero_tenant_id, $item_id) } } /** - * Operation deleteItemAsync - * Deletes a specific item + * Operation deleteCreditNoteAllocationsAsync + * Deletes an Allocation from a Credit Note * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $item_id Unique identifier for an Item (required) + * @param string $credit_note_id Unique identifier for a Credit Note (required) + * @param string $allocation_id Unique identifier for Allocation object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function deleteItemAsync($xero_tenant_id, $item_id) + public function deleteCreditNoteAllocationsAsync($xero_tenant_id, $credit_note_id, $allocation_id) { - return $this->deleteItemAsyncWithHttpInfo($xero_tenant_id, $item_id) + return $this->deleteCreditNoteAllocationsAsyncWithHttpInfo($xero_tenant_id, $credit_note_id, $allocation_id) ->then( function ($response) { return $response[0]; @@ -17184,21 +17735,32 @@ function ($response) { ); } /** - * Operation deleteItemAsyncWithHttpInfo - * Deletes a specific item + * Operation deleteCreditNoteAllocationsAsyncWithHttpInfo + * Deletes an Allocation from a Credit Note * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $item_id Unique identifier for an Item (required) + * @param string $credit_note_id Unique identifier for a Credit Note (required) + * @param string $allocation_id Unique identifier for Allocation object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function deleteItemAsyncWithHttpInfo($xero_tenant_id, $item_id) + public function deleteCreditNoteAllocationsAsyncWithHttpInfo($xero_tenant_id, $credit_note_id, $allocation_id) { - $returnType = ''; - $request = $this->deleteItemRequest($xero_tenant_id, $item_id); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocation'; + $request = $this->deleteCreditNoteAllocationsRequest($xero_tenant_id, $credit_note_id, $allocation_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + AccountingObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -17218,26 +17780,33 @@ function ($exception) { } /** - * Create request for operation 'deleteItem' + * Create request for operation 'deleteCreditNoteAllocations' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $item_id Unique identifier for an Item (required) + * @param string $credit_note_id Unique identifier for a Credit Note (required) + * @param string $allocation_id Unique identifier for Allocation object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function deleteItemRequest($xero_tenant_id, $item_id) + protected function deleteCreditNoteAllocationsRequest($xero_tenant_id, $credit_note_id, $allocation_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling deleteItem' + 'Missing the required parameter $xero_tenant_id when calling deleteCreditNoteAllocations' ); } - // verify the required parameter 'item_id' is set - if ($item_id === null || (is_array($item_id) && count($item_id) === 0)) { + // verify the required parameter 'credit_note_id' is set + if ($credit_note_id === null || (is_array($credit_note_id) && count($credit_note_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $item_id when calling deleteItem' + 'Missing the required parameter $credit_note_id when calling deleteCreditNoteAllocations' ); } - $resourcePath = '/Items/{ItemID}'; + // verify the required parameter 'allocation_id' is set + if ($allocation_id === null || (is_array($allocation_id) && count($allocation_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $allocation_id when calling deleteCreditNoteAllocations' + ); + } + $resourcePath = '/CreditNotes/{CreditNoteID}/Allocations/{AllocationID}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -17248,10 +17817,18 @@ protected function deleteItemRequest($xero_tenant_id, $item_id) $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } // path params - if ($item_id !== null) { + if ($credit_note_id !== null) { $resourcePath = str_replace( - '{' . 'ItemID' . '}', - AccountingObjectSerializer::toPathValue($item_id), + '{' . 'CreditNoteID' . '}', + AccountingObjectSerializer::toPathValue($credit_note_id), + $resourcePath + ); + } + // path params + if ($allocation_id !== null) { + $resourcePath = str_replace( + '{' . 'AllocationID' . '}', + AccountingObjectSerializer::toPathValue($allocation_id), $resourcePath ); } @@ -17316,30 +17893,30 @@ protected function deleteItemRequest($xero_tenant_id, $item_id) } /** - * Operation deleteLinkedTransaction - * Deletes a specific linked transactions (billable expenses) + * Operation deleteItem + * Deletes a specific item * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $linked_transaction_id Unique identifier for a LinkedTransaction (required) + * @param string $item_id Unique identifier for an Item (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function deleteLinkedTransaction($xero_tenant_id, $linked_transaction_id) + public function deleteItem($xero_tenant_id, $item_id) { - $this->deleteLinkedTransactionWithHttpInfo($xero_tenant_id, $linked_transaction_id); + $this->deleteItemWithHttpInfo($xero_tenant_id, $item_id); } /** - * Operation deleteLinkedTransactionWithHttpInfo - * Deletes a specific linked transactions (billable expenses) + * Operation deleteItemWithHttpInfo + * Deletes a specific item * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $linked_transaction_id Unique identifier for a LinkedTransaction (required) + * @param string $item_id Unique identifier for an Item (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function deleteLinkedTransactionWithHttpInfo($xero_tenant_id, $linked_transaction_id) + public function deleteItemWithHttpInfo($xero_tenant_id, $item_id) { - $request = $this->deleteLinkedTransactionRequest($xero_tenant_id, $linked_transaction_id); + $request = $this->deleteItemRequest($xero_tenant_id, $item_id); try { $options = $this->createHttpClientOption(); try { @@ -17381,16 +17958,16 @@ public function deleteLinkedTransactionWithHttpInfo($xero_tenant_id, $linked_tra } } /** - * Operation deleteLinkedTransactionAsync - * Deletes a specific linked transactions (billable expenses) + * Operation deleteItemAsync + * Deletes a specific item * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $linked_transaction_id Unique identifier for a LinkedTransaction (required) + * @param string $item_id Unique identifier for an Item (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function deleteLinkedTransactionAsync($xero_tenant_id, $linked_transaction_id) + public function deleteItemAsync($xero_tenant_id, $item_id) { - return $this->deleteLinkedTransactionAsyncWithHttpInfo($xero_tenant_id, $linked_transaction_id) + return $this->deleteItemAsyncWithHttpInfo($xero_tenant_id, $item_id) ->then( function ($response) { return $response[0]; @@ -17398,16 +17975,16 @@ function ($response) { ); } /** - * Operation deleteLinkedTransactionAsyncWithHttpInfo - * Deletes a specific linked transactions (billable expenses) + * Operation deleteItemAsyncWithHttpInfo + * Deletes a specific item * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $linked_transaction_id Unique identifier for a LinkedTransaction (required) + * @param string $item_id Unique identifier for an Item (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function deleteLinkedTransactionAsyncWithHttpInfo($xero_tenant_id, $linked_transaction_id) + public function deleteItemAsyncWithHttpInfo($xero_tenant_id, $item_id) { $returnType = ''; - $request = $this->deleteLinkedTransactionRequest($xero_tenant_id, $linked_transaction_id); + $request = $this->deleteItemRequest($xero_tenant_id, $item_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -17432,26 +18009,26 @@ function ($exception) { } /** - * Create request for operation 'deleteLinkedTransaction' + * Create request for operation 'deleteItem' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $linked_transaction_id Unique identifier for a LinkedTransaction (required) + * @param string $item_id Unique identifier for an Item (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function deleteLinkedTransactionRequest($xero_tenant_id, $linked_transaction_id) + protected function deleteItemRequest($xero_tenant_id, $item_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling deleteLinkedTransaction' + 'Missing the required parameter $xero_tenant_id when calling deleteItem' ); } - // verify the required parameter 'linked_transaction_id' is set - if ($linked_transaction_id === null || (is_array($linked_transaction_id) && count($linked_transaction_id) === 0)) { + // verify the required parameter 'item_id' is set + if ($item_id === null || (is_array($item_id) && count($item_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $linked_transaction_id when calling deleteLinkedTransaction' + 'Missing the required parameter $item_id when calling deleteItem' ); } - $resourcePath = '/LinkedTransactions/{LinkedTransactionID}'; + $resourcePath = '/Items/{ItemID}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -17462,10 +18039,10 @@ protected function deleteLinkedTransactionRequest($xero_tenant_id, $linked_trans $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } // path params - if ($linked_transaction_id !== null) { + if ($item_id !== null) { $resourcePath = str_replace( - '{' . 'LinkedTransactionID' . '}', - AccountingObjectSerializer::toPathValue($linked_transaction_id), + '{' . 'ItemID' . '}', + AccountingObjectSerializer::toPathValue($item_id), $resourcePath ); } @@ -17530,33 +18107,30 @@ protected function deleteLinkedTransactionRequest($xero_tenant_id, $linked_trans } /** - * Operation deletePayment - * Updates a specific payment for invoices and credit notes + * Operation deleteLinkedTransaction + * Deletes a specific linked transactions (billable expenses) * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $payment_id Unique identifier for a Payment (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentDelete $payment_delete payment_delete (required) + * @param string $linked_transaction_id Unique identifier for a LinkedTransaction (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Payments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error + * @return void */ - public function deletePayment($xero_tenant_id, $payment_id, $payment_delete) + public function deleteLinkedTransaction($xero_tenant_id, $linked_transaction_id) { - list($response) = $this->deletePaymentWithHttpInfo($xero_tenant_id, $payment_id, $payment_delete); - return $response; + $this->deleteLinkedTransactionWithHttpInfo($xero_tenant_id, $linked_transaction_id); } /** - * Operation deletePaymentWithHttpInfo - * Updates a specific payment for invoices and credit notes + * Operation deleteLinkedTransactionWithHttpInfo + * Deletes a specific linked transactions (billable expenses) * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $payment_id Unique identifier for a Payment (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentDelete $payment_delete (required) + * @param string $linked_transaction_id Unique identifier for a LinkedTransaction (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\Accounting\Payments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function deletePaymentWithHttpInfo($xero_tenant_id, $payment_id, $payment_delete) + public function deleteLinkedTransactionWithHttpInfo($xero_tenant_id, $linked_transaction_id) { - $request = $this->deletePaymentRequest($xero_tenant_id, $payment_id, $payment_delete); + $request = $this->deleteLinkedTransactionRequest($xero_tenant_id, $linked_transaction_id); try { $options = $this->createHttpClientOption(); try { @@ -17582,53 +18156,9 @@ public function deletePaymentWithHttpInfo($xero_tenant_id, $payment_id, $payment $response->getBody() ); } - $responseBody = $response->getBody(); - switch($statusCode) { - case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Payments' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - } - return [ - AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Payments', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - } - return [ - AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Payments'; - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - } - return [ - AccountingObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = AccountingObjectSerializer::deserialize( - $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Payments', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; case 400: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), @@ -17642,17 +18172,16 @@ public function deletePaymentWithHttpInfo($xero_tenant_id, $payment_id, $payment } } /** - * Operation deletePaymentAsync - * Updates a specific payment for invoices and credit notes + * Operation deleteLinkedTransactionAsync + * Deletes a specific linked transactions (billable expenses) * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $payment_id Unique identifier for a Payment (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentDelete $payment_delete (required) + * @param string $linked_transaction_id Unique identifier for a LinkedTransaction (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function deletePaymentAsync($xero_tenant_id, $payment_id, $payment_delete) + public function deleteLinkedTransactionAsync($xero_tenant_id, $linked_transaction_id) { - return $this->deletePaymentAsyncWithHttpInfo($xero_tenant_id, $payment_id, $payment_delete) + return $this->deleteLinkedTransactionAsyncWithHttpInfo($xero_tenant_id, $linked_transaction_id) ->then( function ($response) { return $response[0]; @@ -17660,32 +18189,21 @@ function ($response) { ); } /** - * Operation deletePaymentAsyncWithHttpInfo - * Updates a specific payment for invoices and credit notes + * Operation deleteLinkedTransactionAsyncWithHttpInfo + * Deletes a specific linked transactions (billable expenses) * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $payment_id Unique identifier for a Payment (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentDelete $payment_delete (required) + * @param string $linked_transaction_id Unique identifier for a LinkedTransaction (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function deletePaymentAsyncWithHttpInfo($xero_tenant_id, $payment_id, $payment_delete) + public function deleteLinkedTransactionAsyncWithHttpInfo($xero_tenant_id, $linked_transaction_id) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Payments'; - $request = $this->deletePaymentRequest($xero_tenant_id, $payment_id, $payment_delete); + $returnType = ''; + $request = $this->deleteLinkedTransactionRequest($xero_tenant_id, $linked_transaction_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - } - return [ - AccountingObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -17705,33 +18223,26 @@ function ($exception) { } /** - * Create request for operation 'deletePayment' + * Create request for operation 'deleteLinkedTransaction' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $payment_id Unique identifier for a Payment (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentDelete $payment_delete (required) + * @param string $linked_transaction_id Unique identifier for a LinkedTransaction (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function deletePaymentRequest($xero_tenant_id, $payment_id, $payment_delete) + protected function deleteLinkedTransactionRequest($xero_tenant_id, $linked_transaction_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling deletePayment' - ); - } - // verify the required parameter 'payment_id' is set - if ($payment_id === null || (is_array($payment_id) && count($payment_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $payment_id when calling deletePayment' + 'Missing the required parameter $xero_tenant_id when calling deleteLinkedTransaction' ); } - // verify the required parameter 'payment_delete' is set - if ($payment_delete === null || (is_array($payment_delete) && count($payment_delete) === 0)) { + // verify the required parameter 'linked_transaction_id' is set + if ($linked_transaction_id === null || (is_array($linked_transaction_id) && count($linked_transaction_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $payment_delete when calling deletePayment' + 'Missing the required parameter $linked_transaction_id when calling deleteLinkedTransaction' ); } - $resourcePath = '/Payments/{PaymentID}'; + $resourcePath = '/LinkedTransactions/{LinkedTransactionID}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -17742,18 +18253,15 @@ protected function deletePaymentRequest($xero_tenant_id, $payment_id, $payment_d $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } // path params - if ($payment_id !== null) { + if ($linked_transaction_id !== null) { $resourcePath = str_replace( - '{' . 'PaymentID' . '}', - AccountingObjectSerializer::toPathValue($payment_id), + '{' . 'LinkedTransactionID' . '}', + AccountingObjectSerializer::toPathValue($linked_transaction_id), $resourcePath ); } // body params $_tempBody = null; - if (isset($payment_delete)) { - $_tempBody = $payment_delete; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] @@ -17761,7 +18269,7 @@ protected function deletePaymentRequest($xero_tenant_id, $payment_id, $payment_d } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } // for model (json/xml) @@ -17805,7 +18313,7 @@ protected function deletePaymentRequest($xero_tenant_id, $payment_id, $payment_d ); $query = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Query::build($queryParams); return new Request( - 'POST', + 'DELETE', $this->config->getHostAccounting() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -17813,31 +18321,33 @@ protected function deletePaymentRequest($xero_tenant_id, $payment_id, $payment_d } /** - * Operation deleteTrackingCategory - * Deletes a specific tracking category + * Operation deleteOverpaymentAllocations + * Deletes an Allocation from an overpayment * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $tracking_category_id Unique identifier for a TrackingCategory (required) + * @param string $overpayment_id Unique identifier for a Overpayment (required) + * @param string $allocation_id Unique identifier for Allocation object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingCategories|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocation */ - public function deleteTrackingCategory($xero_tenant_id, $tracking_category_id) + public function deleteOverpaymentAllocations($xero_tenant_id, $overpayment_id, $allocation_id) { - list($response) = $this->deleteTrackingCategoryWithHttpInfo($xero_tenant_id, $tracking_category_id); + list($response) = $this->deleteOverpaymentAllocationsWithHttpInfo($xero_tenant_id, $overpayment_id, $allocation_id); return $response; } /** - * Operation deleteTrackingCategoryWithHttpInfo - * Deletes a specific tracking category + * Operation deleteOverpaymentAllocationsWithHttpInfo + * Deletes an Allocation from an overpayment * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $tracking_category_id Unique identifier for a TrackingCategory (required) + * @param string $overpayment_id Unique identifier for a Overpayment (required) + * @param string $allocation_id Unique identifier for Allocation object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\Accounting\TrackingCategories|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\Accounting\Allocation, HTTP status code, HTTP response headers (array of strings) */ - public function deleteTrackingCategoryWithHttpInfo($xero_tenant_id, $tracking_category_id) + public function deleteOverpaymentAllocationsWithHttpInfo($xero_tenant_id, $overpayment_id, $allocation_id) { - $request = $this->deleteTrackingCategoryRequest($xero_tenant_id, $tracking_category_id); + $request = $this->deleteOverpaymentAllocationsRequest($xero_tenant_id, $overpayment_id, $allocation_id); try { $options = $this->createHttpClientOption(); try { @@ -17866,29 +18376,18 @@ public function deleteTrackingCategoryWithHttpInfo($xero_tenant_id, $tracking_ca $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingCategories' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - } - return [ - AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingCategories', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocation' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error', []), + AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocation', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingCategories'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocation'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -17905,15 +18404,7 @@ public function deleteTrackingCategoryWithHttpInfo($xero_tenant_id, $tracking_ca case 200: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingCategories', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = AccountingObjectSerializer::deserialize( - $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocation', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -17923,16 +18414,17 @@ public function deleteTrackingCategoryWithHttpInfo($xero_tenant_id, $tracking_ca } } /** - * Operation deleteTrackingCategoryAsync - * Deletes a specific tracking category + * Operation deleteOverpaymentAllocationsAsync + * Deletes an Allocation from an overpayment * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $tracking_category_id Unique identifier for a TrackingCategory (required) + * @param string $overpayment_id Unique identifier for a Overpayment (required) + * @param string $allocation_id Unique identifier for Allocation object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function deleteTrackingCategoryAsync($xero_tenant_id, $tracking_category_id) + public function deleteOverpaymentAllocationsAsync($xero_tenant_id, $overpayment_id, $allocation_id) { - return $this->deleteTrackingCategoryAsyncWithHttpInfo($xero_tenant_id, $tracking_category_id) + return $this->deleteOverpaymentAllocationsAsyncWithHttpInfo($xero_tenant_id, $overpayment_id, $allocation_id) ->then( function ($response) { return $response[0]; @@ -17940,16 +18432,17 @@ function ($response) { ); } /** - * Operation deleteTrackingCategoryAsyncWithHttpInfo - * Deletes a specific tracking category + * Operation deleteOverpaymentAllocationsAsyncWithHttpInfo + * Deletes an Allocation from an overpayment * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $tracking_category_id Unique identifier for a TrackingCategory (required) + * @param string $overpayment_id Unique identifier for a Overpayment (required) + * @param string $allocation_id Unique identifier for Allocation object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function deleteTrackingCategoryAsyncWithHttpInfo($xero_tenant_id, $tracking_category_id) + public function deleteOverpaymentAllocationsAsyncWithHttpInfo($xero_tenant_id, $overpayment_id, $allocation_id) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingCategories'; - $request = $this->deleteTrackingCategoryRequest($xero_tenant_id, $tracking_category_id); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocation'; + $request = $this->deleteOverpaymentAllocationsRequest($xero_tenant_id, $overpayment_id, $allocation_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -17984,26 +18477,33 @@ function ($exception) { } /** - * Create request for operation 'deleteTrackingCategory' + * Create request for operation 'deleteOverpaymentAllocations' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $tracking_category_id Unique identifier for a TrackingCategory (required) + * @param string $overpayment_id Unique identifier for a Overpayment (required) + * @param string $allocation_id Unique identifier for Allocation object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function deleteTrackingCategoryRequest($xero_tenant_id, $tracking_category_id) + protected function deleteOverpaymentAllocationsRequest($xero_tenant_id, $overpayment_id, $allocation_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling deleteTrackingCategory' + 'Missing the required parameter $xero_tenant_id when calling deleteOverpaymentAllocations' ); } - // verify the required parameter 'tracking_category_id' is set - if ($tracking_category_id === null || (is_array($tracking_category_id) && count($tracking_category_id) === 0)) { + // verify the required parameter 'overpayment_id' is set + if ($overpayment_id === null || (is_array($overpayment_id) && count($overpayment_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $tracking_category_id when calling deleteTrackingCategory' + 'Missing the required parameter $overpayment_id when calling deleteOverpaymentAllocations' ); } - $resourcePath = '/TrackingCategories/{TrackingCategoryID}'; + // verify the required parameter 'allocation_id' is set + if ($allocation_id === null || (is_array($allocation_id) && count($allocation_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $allocation_id when calling deleteOverpaymentAllocations' + ); + } + $resourcePath = '/Overpayments/{OverpaymentID}/Allocations/{AllocationID}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -18014,10 +18514,18 @@ protected function deleteTrackingCategoryRequest($xero_tenant_id, $tracking_cate $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } // path params - if ($tracking_category_id !== null) { + if ($overpayment_id !== null) { $resourcePath = str_replace( - '{' . 'TrackingCategoryID' . '}', - AccountingObjectSerializer::toPathValue($tracking_category_id), + '{' . 'OverpaymentID' . '}', + AccountingObjectSerializer::toPathValue($overpayment_id), + $resourcePath + ); + } + // path params + if ($allocation_id !== null) { + $resourcePath = str_replace( + '{' . 'AllocationID' . '}', + AccountingObjectSerializer::toPathValue($allocation_id), $resourcePath ); } @@ -18082,33 +18590,35 @@ protected function deleteTrackingCategoryRequest($xero_tenant_id, $tracking_cate } /** - * Operation deleteTrackingOptions - * Deletes a specific option for a specific tracking category + * Operation deletePayment + * Updates a specific payment for invoices and credit notes * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $tracking_category_id Unique identifier for a TrackingCategory (required) - * @param string $tracking_option_id Unique identifier for a Tracking Option (required) + * @param string $payment_id Unique identifier for a Payment (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentDelete $payment_delete payment_delete (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingOptions|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Payments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function deleteTrackingOptions($xero_tenant_id, $tracking_category_id, $tracking_option_id) + public function deletePayment($xero_tenant_id, $payment_id, $payment_delete, $idempotency_key = null) { - list($response) = $this->deleteTrackingOptionsWithHttpInfo($xero_tenant_id, $tracking_category_id, $tracking_option_id); + list($response) = $this->deletePaymentWithHttpInfo($xero_tenant_id, $payment_id, $payment_delete, $idempotency_key); return $response; } /** - * Operation deleteTrackingOptionsWithHttpInfo - * Deletes a specific option for a specific tracking category + * Operation deletePaymentWithHttpInfo + * Updates a specific payment for invoices and credit notes * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $tracking_category_id Unique identifier for a TrackingCategory (required) - * @param string $tracking_option_id Unique identifier for a Tracking Option (required) + * @param string $payment_id Unique identifier for a Payment (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentDelete $payment_delete (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\Accounting\TrackingOptions|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\Accounting\Payments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function deleteTrackingOptionsWithHttpInfo($xero_tenant_id, $tracking_category_id, $tracking_option_id) + public function deletePaymentWithHttpInfo($xero_tenant_id, $payment_id, $payment_delete, $idempotency_key = null) { - $request = $this->deleteTrackingOptionsRequest($xero_tenant_id, $tracking_category_id, $tracking_option_id); + $request = $this->deletePaymentRequest($xero_tenant_id, $payment_id, $payment_delete, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -18137,13 +18647,13 @@ public function deleteTrackingOptionsWithHttpInfo($xero_tenant_id, $tracking_cat $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingOptions' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Payments' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingOptions', []), + AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Payments', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -18159,7 +18669,7 @@ public function deleteTrackingOptionsWithHttpInfo($xero_tenant_id, $tracking_cat $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingOptions'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Payments'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -18176,7 +18686,7 @@ public function deleteTrackingOptionsWithHttpInfo($xero_tenant_id, $tracking_cat case 200: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingOptions', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Payments', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -18194,17 +18704,18 @@ public function deleteTrackingOptionsWithHttpInfo($xero_tenant_id, $tracking_cat } } /** - * Operation deleteTrackingOptionsAsync - * Deletes a specific option for a specific tracking category + * Operation deletePaymentAsync + * Updates a specific payment for invoices and credit notes * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $tracking_category_id Unique identifier for a TrackingCategory (required) - * @param string $tracking_option_id Unique identifier for a Tracking Option (required) + * @param string $payment_id Unique identifier for a Payment (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentDelete $payment_delete (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function deleteTrackingOptionsAsync($xero_tenant_id, $tracking_category_id, $tracking_option_id) + public function deletePaymentAsync($xero_tenant_id, $payment_id, $payment_delete, $idempotency_key = null) { - return $this->deleteTrackingOptionsAsyncWithHttpInfo($xero_tenant_id, $tracking_category_id, $tracking_option_id) + return $this->deletePaymentAsyncWithHttpInfo($xero_tenant_id, $payment_id, $payment_delete, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -18212,17 +18723,18 @@ function ($response) { ); } /** - * Operation deleteTrackingOptionsAsyncWithHttpInfo - * Deletes a specific option for a specific tracking category + * Operation deletePaymentAsyncWithHttpInfo + * Updates a specific payment for invoices and credit notes * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $tracking_category_id Unique identifier for a TrackingCategory (required) - * @param string $tracking_option_id Unique identifier for a Tracking Option (required) + * @param string $payment_id Unique identifier for a Payment (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentDelete $payment_delete (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function deleteTrackingOptionsAsyncWithHttpInfo($xero_tenant_id, $tracking_category_id, $tracking_option_id) + public function deletePaymentAsyncWithHttpInfo($xero_tenant_id, $payment_id, $payment_delete, $idempotency_key = null) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingOptions'; - $request = $this->deleteTrackingOptionsRequest($xero_tenant_id, $tracking_category_id, $tracking_option_id); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Payments'; + $request = $this->deletePaymentRequest($xero_tenant_id, $payment_id, $payment_delete, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -18257,33 +18769,34 @@ function ($exception) { } /** - * Create request for operation 'deleteTrackingOptions' + * Create request for operation 'deletePayment' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $tracking_category_id Unique identifier for a TrackingCategory (required) - * @param string $tracking_option_id Unique identifier for a Tracking Option (required) + * @param string $payment_id Unique identifier for a Payment (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentDelete $payment_delete (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function deleteTrackingOptionsRequest($xero_tenant_id, $tracking_category_id, $tracking_option_id) + protected function deletePaymentRequest($xero_tenant_id, $payment_id, $payment_delete, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling deleteTrackingOptions' + 'Missing the required parameter $xero_tenant_id when calling deletePayment' ); } - // verify the required parameter 'tracking_category_id' is set - if ($tracking_category_id === null || (is_array($tracking_category_id) && count($tracking_category_id) === 0)) { + // verify the required parameter 'payment_id' is set + if ($payment_id === null || (is_array($payment_id) && count($payment_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $tracking_category_id when calling deleteTrackingOptions' + 'Missing the required parameter $payment_id when calling deletePayment' ); } - // verify the required parameter 'tracking_option_id' is set - if ($tracking_option_id === null || (is_array($tracking_option_id) && count($tracking_option_id) === 0)) { + // verify the required parameter 'payment_delete' is set + if ($payment_delete === null || (is_array($payment_delete) && count($payment_delete) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $tracking_option_id when calling deleteTrackingOptions' + 'Missing the required parameter $payment_delete when calling deletePayment' ); } - $resourcePath = '/TrackingCategories/{TrackingCategoryID}/Options/{TrackingOptionID}'; + $resourcePath = '/Payments/{PaymentID}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -18293,24 +18806,23 @@ protected function deleteTrackingOptionsRequest($xero_tenant_id, $tracking_categ if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } - // path params - if ($tracking_category_id !== null) { - $resourcePath = str_replace( - '{' . 'TrackingCategoryID' . '}', - AccountingObjectSerializer::toPathValue($tracking_category_id), - $resourcePath - ); + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); } // path params - if ($tracking_option_id !== null) { + if ($payment_id !== null) { $resourcePath = str_replace( - '{' . 'TrackingOptionID' . '}', - AccountingObjectSerializer::toPathValue($tracking_option_id), + '{' . 'PaymentID' . '}', + AccountingObjectSerializer::toPathValue($payment_id), $resourcePath ); } // body params $_tempBody = null; + if (isset($payment_delete)) { + $_tempBody = $payment_delete; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] @@ -18318,7 +18830,7 @@ protected function deleteTrackingOptionsRequest($xero_tenant_id, $tracking_categ } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['application/json'] ); } // for model (json/xml) @@ -18362,7 +18874,7 @@ protected function deleteTrackingOptionsRequest($xero_tenant_id, $tracking_categ ); $query = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Query::build($queryParams); return new Request( - 'DELETE', + 'POST', $this->config->getHostAccounting() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -18370,32 +18882,33 @@ protected function deleteTrackingOptionsRequest($xero_tenant_id, $tracking_categ } /** - * Operation emailInvoice - * Sends a copy of a specific invoice to related contact via email + * Operation deletePrepaymentAllocations + * Deletes an Allocation from a Prepayment * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $invoice_id Unique identifier for an Invoice (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\RequestEmpty $request_empty request_empty (required) + * @param string $prepayment_id Unique identifier for a PrePayment (required) + * @param string $allocation_id Unique identifier for Allocation object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocation */ - public function emailInvoice($xero_tenant_id, $invoice_id, $request_empty) + public function deletePrepaymentAllocations($xero_tenant_id, $prepayment_id, $allocation_id) { - $this->emailInvoiceWithHttpInfo($xero_tenant_id, $invoice_id, $request_empty); + list($response) = $this->deletePrepaymentAllocationsWithHttpInfo($xero_tenant_id, $prepayment_id, $allocation_id); + return $response; } /** - * Operation emailInvoiceWithHttpInfo - * Sends a copy of a specific invoice to related contact via email + * Operation deletePrepaymentAllocationsWithHttpInfo + * Deletes an Allocation from a Prepayment * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $invoice_id Unique identifier for an Invoice (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\RequestEmpty $request_empty (required) + * @param string $prepayment_id Unique identifier for a PrePayment (required) + * @param string $allocation_id Unique identifier for Allocation object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\Accounting\Allocation, HTTP status code, HTTP response headers (array of strings) */ - public function emailInvoiceWithHttpInfo($xero_tenant_id, $invoice_id, $request_empty) + public function deletePrepaymentAllocationsWithHttpInfo($xero_tenant_id, $prepayment_id, $allocation_id) { - $request = $this->emailInvoiceRequest($xero_tenant_id, $invoice_id, $request_empty); + $request = $this->deletePrepaymentAllocationsRequest($xero_tenant_id, $prepayment_id, $allocation_id); try { $options = $this->createHttpClientOption(); try { @@ -18421,13 +18934,38 @@ public function emailInvoiceWithHttpInfo($xero_tenant_id, $invoice_id, $request_ $response->getBody() ); } - return [null, $statusCode, $response->getHeaders()]; + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocation' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocation', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocation'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + AccountingObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { - case 400: + case 200: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocation', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -18437,17 +18975,17 @@ public function emailInvoiceWithHttpInfo($xero_tenant_id, $invoice_id, $request_ } } /** - * Operation emailInvoiceAsync - * Sends a copy of a specific invoice to related contact via email + * Operation deletePrepaymentAllocationsAsync + * Deletes an Allocation from a Prepayment * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $invoice_id Unique identifier for an Invoice (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\RequestEmpty $request_empty (required) + * @param string $prepayment_id Unique identifier for a PrePayment (required) + * @param string $allocation_id Unique identifier for Allocation object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function emailInvoiceAsync($xero_tenant_id, $invoice_id, $request_empty) + public function deletePrepaymentAllocationsAsync($xero_tenant_id, $prepayment_id, $allocation_id) { - return $this->emailInvoiceAsyncWithHttpInfo($xero_tenant_id, $invoice_id, $request_empty) + return $this->deletePrepaymentAllocationsAsyncWithHttpInfo($xero_tenant_id, $prepayment_id, $allocation_id) ->then( function ($response) { return $response[0]; @@ -18455,22 +18993,32 @@ function ($response) { ); } /** - * Operation emailInvoiceAsyncWithHttpInfo - * Sends a copy of a specific invoice to related contact via email + * Operation deletePrepaymentAllocationsAsyncWithHttpInfo + * Deletes an Allocation from a Prepayment * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $invoice_id Unique identifier for an Invoice (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\RequestEmpty $request_empty (required) + * @param string $prepayment_id Unique identifier for a PrePayment (required) + * @param string $allocation_id Unique identifier for Allocation object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function emailInvoiceAsyncWithHttpInfo($xero_tenant_id, $invoice_id, $request_empty) + public function deletePrepaymentAllocationsAsyncWithHttpInfo($xero_tenant_id, $prepayment_id, $allocation_id) { - $returnType = ''; - $request = $this->emailInvoiceRequest($xero_tenant_id, $invoice_id, $request_empty); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Allocation'; + $request = $this->deletePrepaymentAllocationsRequest($xero_tenant_id, $prepayment_id, $allocation_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + AccountingObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -18490,33 +19038,33 @@ function ($exception) { } /** - * Create request for operation 'emailInvoice' + * Create request for operation 'deletePrepaymentAllocations' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $invoice_id Unique identifier for an Invoice (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\RequestEmpty $request_empty (required) + * @param string $prepayment_id Unique identifier for a PrePayment (required) + * @param string $allocation_id Unique identifier for Allocation object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function emailInvoiceRequest($xero_tenant_id, $invoice_id, $request_empty) + protected function deletePrepaymentAllocationsRequest($xero_tenant_id, $prepayment_id, $allocation_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling emailInvoice' + 'Missing the required parameter $xero_tenant_id when calling deletePrepaymentAllocations' ); } - // verify the required parameter 'invoice_id' is set - if ($invoice_id === null || (is_array($invoice_id) && count($invoice_id) === 0)) { + // verify the required parameter 'prepayment_id' is set + if ($prepayment_id === null || (is_array($prepayment_id) && count($prepayment_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $invoice_id when calling emailInvoice' + 'Missing the required parameter $prepayment_id when calling deletePrepaymentAllocations' ); } - // verify the required parameter 'request_empty' is set - if ($request_empty === null || (is_array($request_empty) && count($request_empty) === 0)) { + // verify the required parameter 'allocation_id' is set + if ($allocation_id === null || (is_array($allocation_id) && count($allocation_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $request_empty when calling emailInvoice' + 'Missing the required parameter $allocation_id when calling deletePrepaymentAllocations' ); } - $resourcePath = '/Invoices/{InvoiceID}/Email'; + $resourcePath = '/Prepayments/{PrepaymentID}/Allocations/{AllocationID}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -18527,18 +19075,23 @@ protected function emailInvoiceRequest($xero_tenant_id, $invoice_id, $request_em $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } // path params - if ($invoice_id !== null) { + if ($prepayment_id !== null) { $resourcePath = str_replace( - '{' . 'InvoiceID' . '}', - AccountingObjectSerializer::toPathValue($invoice_id), + '{' . 'PrepaymentID' . '}', + AccountingObjectSerializer::toPathValue($prepayment_id), + $resourcePath + ); + } + // path params + if ($allocation_id !== null) { + $resourcePath = str_replace( + '{' . 'AllocationID' . '}', + AccountingObjectSerializer::toPathValue($allocation_id), $resourcePath ); } // body params $_tempBody = null; - if (isset($request_empty)) { - $_tempBody = $request_empty; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] @@ -18546,7 +19099,7 @@ protected function emailInvoiceRequest($xero_tenant_id, $invoice_id, $request_em } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } // for model (json/xml) @@ -18590,7 +19143,7 @@ protected function emailInvoiceRequest($xero_tenant_id, $invoice_id, $request_em ); $query = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Query::build($queryParams); return new Request( - 'POST', + 'DELETE', $this->config->getHostAccounting() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -18598,31 +19151,31 @@ protected function emailInvoiceRequest($xero_tenant_id, $invoice_id, $request_em } /** - * Operation getAccount - * Retrieves a single chart of accounts by using a unique account Id + * Operation deleteTrackingCategory + * Deletes a specific tracking category * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $account_id Unique identifier for Account object (required) + * @param string $tracking_category_id Unique identifier for a TrackingCategory (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Accounts + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingCategories|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function getAccount($xero_tenant_id, $account_id) + public function deleteTrackingCategory($xero_tenant_id, $tracking_category_id) { - list($response) = $this->getAccountWithHttpInfo($xero_tenant_id, $account_id); + list($response) = $this->deleteTrackingCategoryWithHttpInfo($xero_tenant_id, $tracking_category_id); return $response; } /** - * Operation getAccountWithHttpInfo - * Retrieves a single chart of accounts by using a unique account Id + * Operation deleteTrackingCategoryWithHttpInfo + * Deletes a specific tracking category * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $account_id Unique identifier for Account object (required) + * @param string $tracking_category_id Unique identifier for a TrackingCategory (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\Accounting\Accounts, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\Accounting\TrackingCategories|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function getAccountWithHttpInfo($xero_tenant_id, $account_id) + public function deleteTrackingCategoryWithHttpInfo($xero_tenant_id, $tracking_category_id) { - $request = $this->getAccountRequest($xero_tenant_id, $account_id); + $request = $this->deleteTrackingCategoryRequest($xero_tenant_id, $tracking_category_id); try { $options = $this->createHttpClientOption(); try { @@ -18651,18 +19204,29 @@ public function getAccountWithHttpInfo($xero_tenant_id, $account_id) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Accounts' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingCategories' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Accounts', []), + AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingCategories', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Accounts'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingCategories'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -18679,7 +19243,15 @@ public function getAccountWithHttpInfo($xero_tenant_id, $account_id) case 200: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Accounts', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingCategories', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = AccountingObjectSerializer::deserialize( + $e->getResponseBody(), + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -18689,16 +19261,16 @@ public function getAccountWithHttpInfo($xero_tenant_id, $account_id) } } /** - * Operation getAccountAsync - * Retrieves a single chart of accounts by using a unique account Id + * Operation deleteTrackingCategoryAsync + * Deletes a specific tracking category * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $account_id Unique identifier for Account object (required) + * @param string $tracking_category_id Unique identifier for a TrackingCategory (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getAccountAsync($xero_tenant_id, $account_id) + public function deleteTrackingCategoryAsync($xero_tenant_id, $tracking_category_id) { - return $this->getAccountAsyncWithHttpInfo($xero_tenant_id, $account_id) + return $this->deleteTrackingCategoryAsyncWithHttpInfo($xero_tenant_id, $tracking_category_id) ->then( function ($response) { return $response[0]; @@ -18706,16 +19278,16 @@ function ($response) { ); } /** - * Operation getAccountAsyncWithHttpInfo - * Retrieves a single chart of accounts by using a unique account Id + * Operation deleteTrackingCategoryAsyncWithHttpInfo + * Deletes a specific tracking category * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $account_id Unique identifier for Account object (required) + * @param string $tracking_category_id Unique identifier for a TrackingCategory (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getAccountAsyncWithHttpInfo($xero_tenant_id, $account_id) + public function deleteTrackingCategoryAsyncWithHttpInfo($xero_tenant_id, $tracking_category_id) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Accounts'; - $request = $this->getAccountRequest($xero_tenant_id, $account_id); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingCategories'; + $request = $this->deleteTrackingCategoryRequest($xero_tenant_id, $tracking_category_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -18750,26 +19322,26 @@ function ($exception) { } /** - * Create request for operation 'getAccount' + * Create request for operation 'deleteTrackingCategory' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $account_id Unique identifier for Account object (required) + * @param string $tracking_category_id Unique identifier for a TrackingCategory (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getAccountRequest($xero_tenant_id, $account_id) + protected function deleteTrackingCategoryRequest($xero_tenant_id, $tracking_category_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getAccount' + 'Missing the required parameter $xero_tenant_id when calling deleteTrackingCategory' ); } - // verify the required parameter 'account_id' is set - if ($account_id === null || (is_array($account_id) && count($account_id) === 0)) { + // verify the required parameter 'tracking_category_id' is set + if ($tracking_category_id === null || (is_array($tracking_category_id) && count($tracking_category_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $account_id when calling getAccount' + 'Missing the required parameter $tracking_category_id when calling deleteTrackingCategory' ); } - $resourcePath = '/Accounts/{AccountID}'; + $resourcePath = '/TrackingCategories/{TrackingCategoryID}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -18780,10 +19352,10 @@ protected function getAccountRequest($xero_tenant_id, $account_id) $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } // path params - if ($account_id !== null) { + if ($tracking_category_id !== null) { $resourcePath = str_replace( - '{' . 'AccountID' . '}', - AccountingObjectSerializer::toPathValue($account_id), + '{' . 'TrackingCategoryID' . '}', + AccountingObjectSerializer::toPathValue($tracking_category_id), $resourcePath ); } @@ -18840,7 +19412,7 @@ protected function getAccountRequest($xero_tenant_id, $account_id) ); $query = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Query::build($queryParams); return new Request( - 'GET', + 'DELETE', $this->config->getHostAccounting() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -18848,35 +19420,33 @@ protected function getAccountRequest($xero_tenant_id, $account_id) } /** - * Operation getAccountAttachmentByFileName - * Retrieves an attachment for a specific account by filename + * Operation deleteTrackingOptions + * Deletes a specific option for a specific tracking category * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $account_id Unique identifier for Account object (required) - * @param string $file_name Name of the attachment (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param string $tracking_category_id Unique identifier for a TrackingCategory (required) + * @param string $tracking_option_id Unique identifier for a Tracking Option (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \SplFileObject + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingOptions|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function getAccountAttachmentByFileName($xero_tenant_id, $account_id, $file_name, $content_type) + public function deleteTrackingOptions($xero_tenant_id, $tracking_category_id, $tracking_option_id) { - list($response) = $this->getAccountAttachmentByFileNameWithHttpInfo($xero_tenant_id, $account_id, $file_name, $content_type); + list($response) = $this->deleteTrackingOptionsWithHttpInfo($xero_tenant_id, $tracking_category_id, $tracking_option_id); return $response; } /** - * Operation getAccountAttachmentByFileNameWithHttpInfo - * Retrieves an attachment for a specific account by filename + * Operation deleteTrackingOptionsWithHttpInfo + * Deletes a specific option for a specific tracking category * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $account_id Unique identifier for Account object (required) - * @param string $file_name Name of the attachment (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param string $tracking_category_id Unique identifier for a TrackingCategory (required) + * @param string $tracking_option_id Unique identifier for a Tracking Option (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\Accounting\TrackingOptions|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function getAccountAttachmentByFileNameWithHttpInfo($xero_tenant_id, $account_id, $file_name, $content_type) + public function deleteTrackingOptionsWithHttpInfo($xero_tenant_id, $tracking_category_id, $tracking_option_id) { - $request = $this->getAccountAttachmentByFileNameRequest($xero_tenant_id, $account_id, $file_name, $content_type); + $request = $this->deleteTrackingOptionsRequest($xero_tenant_id, $tracking_category_id, $tracking_option_id); try { $options = $this->createHttpClientOption(); try { @@ -18905,18 +19475,29 @@ public function getAccountAttachmentByFileNameWithHttpInfo($xero_tenant_id, $acc $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingOptions' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - AccountingObjectSerializer::deserialize($content, '\SplFileObject', []), + AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingOptions', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\SplFileObject'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingOptions'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -18933,7 +19514,15 @@ public function getAccountAttachmentByFileNameWithHttpInfo($xero_tenant_id, $acc case 200: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\SplFileObject', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingOptions', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = AccountingObjectSerializer::deserialize( + $e->getResponseBody(), + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -18943,18 +19532,17 @@ public function getAccountAttachmentByFileNameWithHttpInfo($xero_tenant_id, $acc } } /** - * Operation getAccountAttachmentByFileNameAsync - * Retrieves an attachment for a specific account by filename + * Operation deleteTrackingOptionsAsync + * Deletes a specific option for a specific tracking category * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $account_id Unique identifier for Account object (required) - * @param string $file_name Name of the attachment (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param string $tracking_category_id Unique identifier for a TrackingCategory (required) + * @param string $tracking_option_id Unique identifier for a Tracking Option (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getAccountAttachmentByFileNameAsync($xero_tenant_id, $account_id, $file_name, $content_type) + public function deleteTrackingOptionsAsync($xero_tenant_id, $tracking_category_id, $tracking_option_id) { - return $this->getAccountAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $account_id, $file_name, $content_type) + return $this->deleteTrackingOptionsAsyncWithHttpInfo($xero_tenant_id, $tracking_category_id, $tracking_option_id) ->then( function ($response) { return $response[0]; @@ -18962,18 +19550,17 @@ function ($response) { ); } /** - * Operation getAccountAttachmentByFileNameAsyncWithHttpInfo - * Retrieves an attachment for a specific account by filename + * Operation deleteTrackingOptionsAsyncWithHttpInfo + * Deletes a specific option for a specific tracking category * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $account_id Unique identifier for Account object (required) - * @param string $file_name Name of the attachment (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param string $tracking_category_id Unique identifier for a TrackingCategory (required) + * @param string $tracking_option_id Unique identifier for a Tracking Option (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getAccountAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $account_id, $file_name, $content_type) + public function deleteTrackingOptionsAsyncWithHttpInfo($xero_tenant_id, $tracking_category_id, $tracking_option_id) { - $returnType = '\SplFileObject'; - $request = $this->getAccountAttachmentByFileNameRequest($xero_tenant_id, $account_id, $file_name, $content_type); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingOptions'; + $request = $this->deleteTrackingOptionsRequest($xero_tenant_id, $tracking_category_id, $tracking_option_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -19008,40 +19595,33 @@ function ($exception) { } /** - * Create request for operation 'getAccountAttachmentByFileName' + * Create request for operation 'deleteTrackingOptions' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $account_id Unique identifier for Account object (required) - * @param string $file_name Name of the attachment (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param string $tracking_category_id Unique identifier for a TrackingCategory (required) + * @param string $tracking_option_id Unique identifier for a Tracking Option (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getAccountAttachmentByFileNameRequest($xero_tenant_id, $account_id, $file_name, $content_type) + protected function deleteTrackingOptionsRequest($xero_tenant_id, $tracking_category_id, $tracking_option_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getAccountAttachmentByFileName' - ); - } - // verify the required parameter 'account_id' is set - if ($account_id === null || (is_array($account_id) && count($account_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $account_id when calling getAccountAttachmentByFileName' + 'Missing the required parameter $xero_tenant_id when calling deleteTrackingOptions' ); } - // verify the required parameter 'file_name' is set - if ($file_name === null || (is_array($file_name) && count($file_name) === 0)) { + // verify the required parameter 'tracking_category_id' is set + if ($tracking_category_id === null || (is_array($tracking_category_id) && count($tracking_category_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $file_name when calling getAccountAttachmentByFileName' + 'Missing the required parameter $tracking_category_id when calling deleteTrackingOptions' ); } - // verify the required parameter 'content_type' is set - if ($content_type === null || (is_array($content_type) && count($content_type) === 0)) { + // verify the required parameter 'tracking_option_id' is set + if ($tracking_option_id === null || (is_array($tracking_option_id) && count($tracking_option_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $content_type when calling getAccountAttachmentByFileName' + 'Missing the required parameter $tracking_option_id when calling deleteTrackingOptions' ); } - $resourcePath = '/Accounts/{AccountID}/Attachments/{FileName}'; + $resourcePath = '/TrackingCategories/{TrackingCategoryID}/Options/{TrackingOptionID}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -19051,23 +19631,19 @@ protected function getAccountAttachmentByFileNameRequest($xero_tenant_id, $accou if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } - // header params - if ($content_type !== null) { - $headerParams['contentType'] = AccountingObjectSerializer::toHeaderValue($content_type); - } // path params - if ($account_id !== null) { + if ($tracking_category_id !== null) { $resourcePath = str_replace( - '{' . 'AccountID' . '}', - AccountingObjectSerializer::toPathValue($account_id), + '{' . 'TrackingCategoryID' . '}', + AccountingObjectSerializer::toPathValue($tracking_category_id), $resourcePath ); } // path params - if ($file_name !== null) { + if ($tracking_option_id !== null) { $resourcePath = str_replace( - '{' . 'FileName' . '}', - AccountingObjectSerializer::toPathValue($file_name), + '{' . 'TrackingOptionID' . '}', + AccountingObjectSerializer::toPathValue($tracking_option_id), $resourcePath ); } @@ -19075,11 +19651,11 @@ protected function getAccountAttachmentByFileNameRequest($xero_tenant_id, $accou $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/octet-stream'] + ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/octet-stream'], + ['application/json'], [] ); } @@ -19124,7 +19700,7 @@ protected function getAccountAttachmentByFileNameRequest($xero_tenant_id, $accou ); $query = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Query::build($queryParams); return new Request( - 'GET', + 'DELETE', $this->config->getHostAccounting() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -19132,35 +19708,34 @@ protected function getAccountAttachmentByFileNameRequest($xero_tenant_id, $accou } /** - * Operation getAccountAttachmentById - * Retrieves a specific attachment from a specific account using a unique attachment Id + * Operation emailInvoice + * Sends a copy of a specific invoice to related contact via email * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $account_id Unique identifier for Account object (required) - * @param string $attachment_id Unique identifier for Attachment object (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param string $invoice_id Unique identifier for an Invoice (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\RequestEmpty $request_empty request_empty (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \SplFileObject + * @return void */ - public function getAccountAttachmentById($xero_tenant_id, $account_id, $attachment_id, $content_type) + public function emailInvoice($xero_tenant_id, $invoice_id, $request_empty, $idempotency_key = null) { - list($response) = $this->getAccountAttachmentByIdWithHttpInfo($xero_tenant_id, $account_id, $attachment_id, $content_type); - return $response; + $this->emailInvoiceWithHttpInfo($xero_tenant_id, $invoice_id, $request_empty, $idempotency_key); } /** - * Operation getAccountAttachmentByIdWithHttpInfo - * Retrieves a specific attachment from a specific account using a unique attachment Id + * Operation emailInvoiceWithHttpInfo + * Sends a copy of a specific invoice to related contact via email * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $account_id Unique identifier for Account object (required) - * @param string $attachment_id Unique identifier for Attachment object (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param string $invoice_id Unique identifier for an Invoice (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\RequestEmpty $request_empty (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function getAccountAttachmentByIdWithHttpInfo($xero_tenant_id, $account_id, $attachment_id, $content_type) + public function emailInvoiceWithHttpInfo($xero_tenant_id, $invoice_id, $request_empty, $idempotency_key = null) { - $request = $this->getAccountAttachmentByIdRequest($xero_tenant_id, $account_id, $attachment_id, $content_type); + $request = $this->emailInvoiceRequest($xero_tenant_id, $invoice_id, $request_empty, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -19186,38 +19761,13 @@ public function getAccountAttachmentByIdWithHttpInfo($xero_tenant_id, $account_i $response->getBody() ); } - $responseBody = $response->getBody(); - switch($statusCode) { - case 200: - if ('\SplFileObject' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - } - return [ - AccountingObjectSerializer::deserialize($content, '\SplFileObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - $returnType = '\SplFileObject'; - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - } - return [ - AccountingObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: + case 400: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\SplFileObject', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -19227,18 +19777,18 @@ public function getAccountAttachmentByIdWithHttpInfo($xero_tenant_id, $account_i } } /** - * Operation getAccountAttachmentByIdAsync - * Retrieves a specific attachment from a specific account using a unique attachment Id + * Operation emailInvoiceAsync + * Sends a copy of a specific invoice to related contact via email * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $account_id Unique identifier for Account object (required) - * @param string $attachment_id Unique identifier for Attachment object (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param string $invoice_id Unique identifier for an Invoice (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\RequestEmpty $request_empty (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getAccountAttachmentByIdAsync($xero_tenant_id, $account_id, $attachment_id, $content_type) + public function emailInvoiceAsync($xero_tenant_id, $invoice_id, $request_empty, $idempotency_key = null) { - return $this->getAccountAttachmentByIdAsyncWithHttpInfo($xero_tenant_id, $account_id, $attachment_id, $content_type) + return $this->emailInvoiceAsyncWithHttpInfo($xero_tenant_id, $invoice_id, $request_empty, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -19246,33 +19796,23 @@ function ($response) { ); } /** - * Operation getAccountAttachmentByIdAsyncWithHttpInfo - * Retrieves a specific attachment from a specific account using a unique attachment Id + * Operation emailInvoiceAsyncWithHttpInfo + * Sends a copy of a specific invoice to related contact via email * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $account_id Unique identifier for Account object (required) - * @param string $attachment_id Unique identifier for Attachment object (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param string $invoice_id Unique identifier for an Invoice (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\RequestEmpty $request_empty (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getAccountAttachmentByIdAsyncWithHttpInfo($xero_tenant_id, $account_id, $attachment_id, $content_type) + public function emailInvoiceAsyncWithHttpInfo($xero_tenant_id, $invoice_id, $request_empty, $idempotency_key = null) { - $returnType = '\SplFileObject'; - $request = $this->getAccountAttachmentByIdRequest($xero_tenant_id, $account_id, $attachment_id, $content_type); + $returnType = ''; + $request = $this->emailInvoiceRequest($xero_tenant_id, $invoice_id, $request_empty, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - } - return [ - AccountingObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -19292,40 +19832,34 @@ function ($exception) { } /** - * Create request for operation 'getAccountAttachmentById' + * Create request for operation 'emailInvoice' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $account_id Unique identifier for Account object (required) - * @param string $attachment_id Unique identifier for Attachment object (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param string $invoice_id Unique identifier for an Invoice (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\RequestEmpty $request_empty (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getAccountAttachmentByIdRequest($xero_tenant_id, $account_id, $attachment_id, $content_type) + protected function emailInvoiceRequest($xero_tenant_id, $invoice_id, $request_empty, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getAccountAttachmentById' - ); - } - // verify the required parameter 'account_id' is set - if ($account_id === null || (is_array($account_id) && count($account_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $account_id when calling getAccountAttachmentById' + 'Missing the required parameter $xero_tenant_id when calling emailInvoice' ); } - // verify the required parameter 'attachment_id' is set - if ($attachment_id === null || (is_array($attachment_id) && count($attachment_id) === 0)) { + // verify the required parameter 'invoice_id' is set + if ($invoice_id === null || (is_array($invoice_id) && count($invoice_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $attachment_id when calling getAccountAttachmentById' + 'Missing the required parameter $invoice_id when calling emailInvoice' ); } - // verify the required parameter 'content_type' is set - if ($content_type === null || (is_array($content_type) && count($content_type) === 0)) { + // verify the required parameter 'request_empty' is set + if ($request_empty === null || (is_array($request_empty) && count($request_empty) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $content_type when calling getAccountAttachmentById' + 'Missing the required parameter $request_empty when calling emailInvoice' ); } - $resourcePath = '/Accounts/{AccountID}/Attachments/{AttachmentID}'; + $resourcePath = '/Invoices/{InvoiceID}/Email'; $formParams = []; $queryParams = []; $headerParams = []; @@ -19336,35 +19870,30 @@ protected function getAccountAttachmentByIdRequest($xero_tenant_id, $account_id, $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } // header params - if ($content_type !== null) { - $headerParams['contentType'] = AccountingObjectSerializer::toHeaderValue($content_type); + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); } // path params - if ($account_id !== null) { - $resourcePath = str_replace( - '{' . 'AccountID' . '}', - AccountingObjectSerializer::toPathValue($account_id), - $resourcePath - ); - } - // path params - if ($attachment_id !== null) { + if ($invoice_id !== null) { $resourcePath = str_replace( - '{' . 'AttachmentID' . '}', - AccountingObjectSerializer::toPathValue($attachment_id), + '{' . 'InvoiceID' . '}', + AccountingObjectSerializer::toPathValue($invoice_id), $resourcePath ); } // body params $_tempBody = null; + if (isset($request_empty)) { + $_tempBody = $request_empty; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/octet-stream'] + ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/octet-stream'], - [] + ['application/json'], + ['application/json'] ); } // for model (json/xml) @@ -19408,7 +19937,7 @@ protected function getAccountAttachmentByIdRequest($xero_tenant_id, $account_id, ); $query = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Query::build($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHostAccounting() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -19416,31 +19945,31 @@ protected function getAccountAttachmentByIdRequest($xero_tenant_id, $account_id, } /** - * Operation getAccountAttachments - * Retrieves attachments for a specific accounts by using a unique account Id + * Operation getAccount + * Retrieves a single chart of accounts by using a unique account Id * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $account_id Unique identifier for Account object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Accounts */ - public function getAccountAttachments($xero_tenant_id, $account_id) + public function getAccount($xero_tenant_id, $account_id) { - list($response) = $this->getAccountAttachmentsWithHttpInfo($xero_tenant_id, $account_id); + list($response) = $this->getAccountWithHttpInfo($xero_tenant_id, $account_id); return $response; } /** - * Operation getAccountAttachmentsWithHttpInfo - * Retrieves attachments for a specific accounts by using a unique account Id + * Operation getAccountWithHttpInfo + * Retrieves a single chart of accounts by using a unique account Id * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $account_id Unique identifier for Account object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\Accounting\Attachments, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\Accounting\Accounts, HTTP status code, HTTP response headers (array of strings) */ - public function getAccountAttachmentsWithHttpInfo($xero_tenant_id, $account_id) + public function getAccountWithHttpInfo($xero_tenant_id, $account_id) { - $request = $this->getAccountAttachmentsRequest($xero_tenant_id, $account_id); + $request = $this->getAccountRequest($xero_tenant_id, $account_id); try { $options = $this->createHttpClientOption(); try { @@ -19469,18 +19998,18 @@ public function getAccountAttachmentsWithHttpInfo($xero_tenant_id, $account_id) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Accounts' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments', []), + AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Accounts', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Accounts'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -19497,7 +20026,7 @@ public function getAccountAttachmentsWithHttpInfo($xero_tenant_id, $account_id) case 200: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Accounts', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -19507,16 +20036,16 @@ public function getAccountAttachmentsWithHttpInfo($xero_tenant_id, $account_id) } } /** - * Operation getAccountAttachmentsAsync - * Retrieves attachments for a specific accounts by using a unique account Id + * Operation getAccountAsync + * Retrieves a single chart of accounts by using a unique account Id * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $account_id Unique identifier for Account object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getAccountAttachmentsAsync($xero_tenant_id, $account_id) + public function getAccountAsync($xero_tenant_id, $account_id) { - return $this->getAccountAttachmentsAsyncWithHttpInfo($xero_tenant_id, $account_id) + return $this->getAccountAsyncWithHttpInfo($xero_tenant_id, $account_id) ->then( function ($response) { return $response[0]; @@ -19524,16 +20053,16 @@ function ($response) { ); } /** - * Operation getAccountAttachmentsAsyncWithHttpInfo - * Retrieves attachments for a specific accounts by using a unique account Id + * Operation getAccountAsyncWithHttpInfo + * Retrieves a single chart of accounts by using a unique account Id * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $account_id Unique identifier for Account object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getAccountAttachmentsAsyncWithHttpInfo($xero_tenant_id, $account_id) + public function getAccountAsyncWithHttpInfo($xero_tenant_id, $account_id) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; - $request = $this->getAccountAttachmentsRequest($xero_tenant_id, $account_id); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Accounts'; + $request = $this->getAccountRequest($xero_tenant_id, $account_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -19568,26 +20097,26 @@ function ($exception) { } /** - * Create request for operation 'getAccountAttachments' + * Create request for operation 'getAccount' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $account_id Unique identifier for Account object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getAccountAttachmentsRequest($xero_tenant_id, $account_id) + protected function getAccountRequest($xero_tenant_id, $account_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getAccountAttachments' + 'Missing the required parameter $xero_tenant_id when calling getAccount' ); } // verify the required parameter 'account_id' is set if ($account_id === null || (is_array($account_id) && count($account_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $account_id when calling getAccountAttachments' + 'Missing the required parameter $account_id when calling getAccount' ); } - $resourcePath = '/Accounts/{AccountID}/Attachments'; + $resourcePath = '/Accounts/{AccountID}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -19666,35 +20195,35 @@ protected function getAccountAttachmentsRequest($xero_tenant_id, $account_id) } /** - * Operation getAccounts - * Retrieves the full chart of accounts + * Operation getAccountAttachmentByFileName + * Retrieves an attachment for a specific account by filename * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) - * @param string $where Filter by an any element (optional) - * @param string $order Order by an any element (optional) + * @param string $account_id Unique identifier for Account object (required) + * @param string $file_name Name of the attachment (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Accounts + * @return \SplFileObject */ - public function getAccounts($xero_tenant_id, $if_modified_since = null, $where = null, $order = null) + public function getAccountAttachmentByFileName($xero_tenant_id, $account_id, $file_name, $content_type) { - list($response) = $this->getAccountsWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order); + list($response) = $this->getAccountAttachmentByFileNameWithHttpInfo($xero_tenant_id, $account_id, $file_name, $content_type); return $response; } /** - * Operation getAccountsWithHttpInfo - * Retrieves the full chart of accounts + * Operation getAccountAttachmentByFileNameWithHttpInfo + * Retrieves an attachment for a specific account by filename * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) - * @param string $where Filter by an any element (optional) - * @param string $order Order by an any element (optional) + * @param string $account_id Unique identifier for Account object (required) + * @param string $file_name Name of the attachment (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\Accounting\Accounts, HTTP status code, HTTP response headers (array of strings) + * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) */ - public function getAccountsWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null) + public function getAccountAttachmentByFileNameWithHttpInfo($xero_tenant_id, $account_id, $file_name, $content_type) { - $request = $this->getAccountsRequest($xero_tenant_id, $if_modified_since, $where, $order); + $request = $this->getAccountAttachmentByFileNameRequest($xero_tenant_id, $account_id, $file_name, $content_type); try { $options = $this->createHttpClientOption(); try { @@ -19723,18 +20252,18 @@ public function getAccountsWithHttpInfo($xero_tenant_id, $if_modified_since = nu $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Accounts' === '\SplFileObject') { + if ('\SplFileObject' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Accounts', []), + AccountingObjectSerializer::deserialize($content, '\SplFileObject', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Accounts'; + $returnType = '\SplFileObject'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -19751,7 +20280,7 @@ public function getAccountsWithHttpInfo($xero_tenant_id, $if_modified_since = nu case 200: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Accounts', + '\SplFileObject', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -19761,18 +20290,18 @@ public function getAccountsWithHttpInfo($xero_tenant_id, $if_modified_since = nu } } /** - * Operation getAccountsAsync - * Retrieves the full chart of accounts + * Operation getAccountAttachmentByFileNameAsync + * Retrieves an attachment for a specific account by filename * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) - * @param string $where Filter by an any element (optional) - * @param string $order Order by an any element (optional) + * @param string $account_id Unique identifier for Account object (required) + * @param string $file_name Name of the attachment (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getAccountsAsync($xero_tenant_id, $if_modified_since = null, $where = null, $order = null) + public function getAccountAttachmentByFileNameAsync($xero_tenant_id, $account_id, $file_name, $content_type) { - return $this->getAccountsAsyncWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order) + return $this->getAccountAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $account_id, $file_name, $content_type) ->then( function ($response) { return $response[0]; @@ -19780,18 +20309,18 @@ function ($response) { ); } /** - * Operation getAccountsAsyncWithHttpInfo - * Retrieves the full chart of accounts + * Operation getAccountAttachmentByFileNameAsyncWithHttpInfo + * Retrieves an attachment for a specific account by filename * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) - * @param string $where Filter by an any element (optional) - * @param string $order Order by an any element (optional) + * @param string $account_id Unique identifier for Account object (required) + * @param string $file_name Name of the attachment (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getAccountsAsyncWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null) + public function getAccountAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $account_id, $file_name, $content_type) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Accounts'; - $request = $this->getAccountsRequest($xero_tenant_id, $if_modified_since, $where, $order); + $returnType = '\SplFileObject'; + $request = $this->getAccountAttachmentByFileNameRequest($xero_tenant_id, $account_id, $file_name, $content_type); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -19826,52 +20355,78 @@ function ($exception) { } /** - * Create request for operation 'getAccounts' + * Create request for operation 'getAccountAttachmentByFileName' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) - * @param string $where Filter by an any element (optional) - * @param string $order Order by an any element (optional) + * @param string $account_id Unique identifier for Account object (required) + * @param string $file_name Name of the attachment (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getAccountsRequest($xero_tenant_id, $if_modified_since = null, $where = null, $order = null) + protected function getAccountAttachmentByFileNameRequest($xero_tenant_id, $account_id, $file_name, $content_type) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getAccounts' + 'Missing the required parameter $xero_tenant_id when calling getAccountAttachmentByFileName' ); } - $resourcePath = '/Accounts'; + // verify the required parameter 'account_id' is set + if ($account_id === null || (is_array($account_id) && count($account_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $account_id when calling getAccountAttachmentByFileName' + ); + } + // verify the required parameter 'file_name' is set + if ($file_name === null || (is_array($file_name) && count($file_name) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $file_name when calling getAccountAttachmentByFileName' + ); + } + // verify the required parameter 'content_type' is set + if ($content_type === null || (is_array($content_type) && count($content_type) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $content_type when calling getAccountAttachmentByFileName' + ); + } + $resourcePath = '/Accounts/{AccountID}/Attachments/{FileName}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if ($where !== null) { - $queryParams['where'] = AccountingObjectSerializer::toQueryValue($where); - } - // query params - if ($order !== null) { - $queryParams['order'] = AccountingObjectSerializer::toQueryValue($order); - } // header params if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } // header params - if ($if_modified_since !== null) { - $headerParams['If-Modified-Since'] = AccountingObjectSerializer::toHeaderValue($if_modified_since); + if ($content_type !== null) { + $headerParams['contentType'] = AccountingObjectSerializer::toHeaderValue($content_type); + } + // path params + if ($account_id !== null) { + $resourcePath = str_replace( + '{' . 'AccountID' . '}', + AccountingObjectSerializer::toPathValue($account_id), + $resourcePath + ); + } + // path params + if ($file_name !== null) { + $resourcePath = str_replace( + '{' . 'FileName' . '}', + AccountingObjectSerializer::toPathValue($file_name), + $resourcePath + ); } // body params $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/octet-stream'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/octet-stream'], [] ); } @@ -19924,33 +20479,35 @@ protected function getAccountsRequest($xero_tenant_id, $if_modified_since = null } /** - * Operation getBankTransaction - * Retrieves a single spent or received money transaction by using a unique bank transaction Id + * Operation getAccountAttachmentById + * Retrieves a specific attachment from a specific account using a unique attachment Id * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) - * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $account_id Unique identifier for Account object (required) + * @param string $attachment_id Unique identifier for Attachment object (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions + * @return \SplFileObject */ - public function getBankTransaction($xero_tenant_id, $bank_transaction_id, $unitdp = null) + public function getAccountAttachmentById($xero_tenant_id, $account_id, $attachment_id, $content_type) { - list($response) = $this->getBankTransactionWithHttpInfo($xero_tenant_id, $bank_transaction_id, $unitdp); + list($response) = $this->getAccountAttachmentByIdWithHttpInfo($xero_tenant_id, $account_id, $attachment_id, $content_type); return $response; } /** - * Operation getBankTransactionWithHttpInfo - * Retrieves a single spent or received money transaction by using a unique bank transaction Id + * Operation getAccountAttachmentByIdWithHttpInfo + * Retrieves a specific attachment from a specific account using a unique attachment Id * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) - * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $account_id Unique identifier for Account object (required) + * @param string $attachment_id Unique identifier for Attachment object (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\Accounting\BankTransactions, HTTP status code, HTTP response headers (array of strings) + * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) */ - public function getBankTransactionWithHttpInfo($xero_tenant_id, $bank_transaction_id, $unitdp = null) + public function getAccountAttachmentByIdWithHttpInfo($xero_tenant_id, $account_id, $attachment_id, $content_type) { - $request = $this->getBankTransactionRequest($xero_tenant_id, $bank_transaction_id, $unitdp); + $request = $this->getAccountAttachmentByIdRequest($xero_tenant_id, $account_id, $attachment_id, $content_type); try { $options = $this->createHttpClientOption(); try { @@ -19979,18 +20536,18 @@ public function getBankTransactionWithHttpInfo($xero_tenant_id, $bank_transactio $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions' === '\SplFileObject') { + if ('\SplFileObject' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions', []), + AccountingObjectSerializer::deserialize($content, '\SplFileObject', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions'; + $returnType = '\SplFileObject'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -20007,7 +20564,7 @@ public function getBankTransactionWithHttpInfo($xero_tenant_id, $bank_transactio case 200: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions', + '\SplFileObject', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -20017,17 +20574,18 @@ public function getBankTransactionWithHttpInfo($xero_tenant_id, $bank_transactio } } /** - * Operation getBankTransactionAsync - * Retrieves a single spent or received money transaction by using a unique bank transaction Id + * Operation getAccountAttachmentByIdAsync + * Retrieves a specific attachment from a specific account using a unique attachment Id * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) - * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $account_id Unique identifier for Account object (required) + * @param string $attachment_id Unique identifier for Attachment object (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBankTransactionAsync($xero_tenant_id, $bank_transaction_id, $unitdp = null) + public function getAccountAttachmentByIdAsync($xero_tenant_id, $account_id, $attachment_id, $content_type) { - return $this->getBankTransactionAsyncWithHttpInfo($xero_tenant_id, $bank_transaction_id, $unitdp) + return $this->getAccountAttachmentByIdAsyncWithHttpInfo($xero_tenant_id, $account_id, $attachment_id, $content_type) ->then( function ($response) { return $response[0]; @@ -20035,17 +20593,18 @@ function ($response) { ); } /** - * Operation getBankTransactionAsyncWithHttpInfo - * Retrieves a single spent or received money transaction by using a unique bank transaction Id + * Operation getAccountAttachmentByIdAsyncWithHttpInfo + * Retrieves a specific attachment from a specific account using a unique attachment Id * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) - * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $account_id Unique identifier for Account object (required) + * @param string $attachment_id Unique identifier for Attachment object (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBankTransactionAsyncWithHttpInfo($xero_tenant_id, $bank_transaction_id, $unitdp = null) + public function getAccountAttachmentByIdAsyncWithHttpInfo($xero_tenant_id, $account_id, $attachment_id, $content_type) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions'; - $request = $this->getBankTransactionRequest($xero_tenant_id, $bank_transaction_id, $unitdp); + $returnType = '\SplFileObject'; + $request = $this->getAccountAttachmentByIdRequest($xero_tenant_id, $account_id, $attachment_id, $content_type); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -20080,45 +20639,66 @@ function ($exception) { } /** - * Create request for operation 'getBankTransaction' + * Create request for operation 'getAccountAttachmentById' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) - * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $account_id Unique identifier for Account object (required) + * @param string $attachment_id Unique identifier for Attachment object (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getBankTransactionRequest($xero_tenant_id, $bank_transaction_id, $unitdp = null) + protected function getAccountAttachmentByIdRequest($xero_tenant_id, $account_id, $attachment_id, $content_type) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getBankTransaction' + 'Missing the required parameter $xero_tenant_id when calling getAccountAttachmentById' ); } - // verify the required parameter 'bank_transaction_id' is set - if ($bank_transaction_id === null || (is_array($bank_transaction_id) && count($bank_transaction_id) === 0)) { + // verify the required parameter 'account_id' is set + if ($account_id === null || (is_array($account_id) && count($account_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $bank_transaction_id when calling getBankTransaction' + 'Missing the required parameter $account_id when calling getAccountAttachmentById' ); } - $resourcePath = '/BankTransactions/{BankTransactionID}'; + // verify the required parameter 'attachment_id' is set + if ($attachment_id === null || (is_array($attachment_id) && count($attachment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $attachment_id when calling getAccountAttachmentById' + ); + } + // verify the required parameter 'content_type' is set + if ($content_type === null || (is_array($content_type) && count($content_type) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $content_type when calling getAccountAttachmentById' + ); + } + $resourcePath = '/Accounts/{AccountID}/Attachments/{AttachmentID}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if ($unitdp !== null) { - $queryParams['unitdp'] = AccountingObjectSerializer::toQueryValue($unitdp); - } // header params if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($content_type !== null) { + $headerParams['contentType'] = AccountingObjectSerializer::toHeaderValue($content_type); + } // path params - if ($bank_transaction_id !== null) { + if ($account_id !== null) { $resourcePath = str_replace( - '{' . 'BankTransactionID' . '}', - AccountingObjectSerializer::toPathValue($bank_transaction_id), + '{' . 'AccountID' . '}', + AccountingObjectSerializer::toPathValue($account_id), + $resourcePath + ); + } + // path params + if ($attachment_id !== null) { + $resourcePath = str_replace( + '{' . 'AttachmentID' . '}', + AccountingObjectSerializer::toPathValue($attachment_id), $resourcePath ); } @@ -20126,11 +20706,11 @@ protected function getBankTransactionRequest($xero_tenant_id, $bank_transaction_ $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/octet-stream'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/octet-stream'], [] ); } @@ -20183,35 +20763,31 @@ protected function getBankTransactionRequest($xero_tenant_id, $bank_transaction_ } /** - * Operation getBankTransactionAttachmentByFileName - * Retrieves a specific attachment from a specific bank transaction by filename + * Operation getAccountAttachments + * Retrieves attachments for a specific accounts by using a unique account Id * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) - * @param string $file_name Name of the attachment (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param string $account_id Unique identifier for Account object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \SplFileObject + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments */ - public function getBankTransactionAttachmentByFileName($xero_tenant_id, $bank_transaction_id, $file_name, $content_type) + public function getAccountAttachments($xero_tenant_id, $account_id) { - list($response) = $this->getBankTransactionAttachmentByFileNameWithHttpInfo($xero_tenant_id, $bank_transaction_id, $file_name, $content_type); + list($response) = $this->getAccountAttachmentsWithHttpInfo($xero_tenant_id, $account_id); return $response; } /** - * Operation getBankTransactionAttachmentByFileNameWithHttpInfo - * Retrieves a specific attachment from a specific bank transaction by filename + * Operation getAccountAttachmentsWithHttpInfo + * Retrieves attachments for a specific accounts by using a unique account Id * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) - * @param string $file_name Name of the attachment (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param string $account_id Unique identifier for Account object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\Accounting\Attachments, HTTP status code, HTTP response headers (array of strings) */ - public function getBankTransactionAttachmentByFileNameWithHttpInfo($xero_tenant_id, $bank_transaction_id, $file_name, $content_type) + public function getAccountAttachmentsWithHttpInfo($xero_tenant_id, $account_id) { - $request = $this->getBankTransactionAttachmentByFileNameRequest($xero_tenant_id, $bank_transaction_id, $file_name, $content_type); + $request = $this->getAccountAttachmentsRequest($xero_tenant_id, $account_id); try { $options = $this->createHttpClientOption(); try { @@ -20240,18 +20816,18 @@ public function getBankTransactionAttachmentByFileNameWithHttpInfo($xero_tenant_ $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - AccountingObjectSerializer::deserialize($content, '\SplFileObject', []), + AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\SplFileObject'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -20268,7 +20844,7 @@ public function getBankTransactionAttachmentByFileNameWithHttpInfo($xero_tenant_ case 200: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\SplFileObject', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -20278,18 +20854,16 @@ public function getBankTransactionAttachmentByFileNameWithHttpInfo($xero_tenant_ } } /** - * Operation getBankTransactionAttachmentByFileNameAsync - * Retrieves a specific attachment from a specific bank transaction by filename + * Operation getAccountAttachmentsAsync + * Retrieves attachments for a specific accounts by using a unique account Id * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) - * @param string $file_name Name of the attachment (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param string $account_id Unique identifier for Account object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBankTransactionAttachmentByFileNameAsync($xero_tenant_id, $bank_transaction_id, $file_name, $content_type) + public function getAccountAttachmentsAsync($xero_tenant_id, $account_id) { - return $this->getBankTransactionAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $bank_transaction_id, $file_name, $content_type) + return $this->getAccountAttachmentsAsyncWithHttpInfo($xero_tenant_id, $account_id) ->then( function ($response) { return $response[0]; @@ -20297,18 +20871,16 @@ function ($response) { ); } /** - * Operation getBankTransactionAttachmentByFileNameAsyncWithHttpInfo - * Retrieves a specific attachment from a specific bank transaction by filename + * Operation getAccountAttachmentsAsyncWithHttpInfo + * Retrieves attachments for a specific accounts by using a unique account Id * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) - * @param string $file_name Name of the attachment (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param string $account_id Unique identifier for Account object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBankTransactionAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $bank_transaction_id, $file_name, $content_type) + public function getAccountAttachmentsAsyncWithHttpInfo($xero_tenant_id, $account_id) { - $returnType = '\SplFileObject'; - $request = $this->getBankTransactionAttachmentByFileNameRequest($xero_tenant_id, $bank_transaction_id, $file_name, $content_type); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; + $request = $this->getAccountAttachmentsRequest($xero_tenant_id, $account_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -20343,40 +20915,26 @@ function ($exception) { } /** - * Create request for operation 'getBankTransactionAttachmentByFileName' + * Create request for operation 'getAccountAttachments' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) - * @param string $file_name Name of the attachment (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param string $account_id Unique identifier for Account object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getBankTransactionAttachmentByFileNameRequest($xero_tenant_id, $bank_transaction_id, $file_name, $content_type) + protected function getAccountAttachmentsRequest($xero_tenant_id, $account_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getBankTransactionAttachmentByFileName' - ); - } - // verify the required parameter 'bank_transaction_id' is set - if ($bank_transaction_id === null || (is_array($bank_transaction_id) && count($bank_transaction_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $bank_transaction_id when calling getBankTransactionAttachmentByFileName' - ); - } - // verify the required parameter 'file_name' is set - if ($file_name === null || (is_array($file_name) && count($file_name) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $file_name when calling getBankTransactionAttachmentByFileName' + 'Missing the required parameter $xero_tenant_id when calling getAccountAttachments' ); } - // verify the required parameter 'content_type' is set - if ($content_type === null || (is_array($content_type) && count($content_type) === 0)) { + // verify the required parameter 'account_id' is set + if ($account_id === null || (is_array($account_id) && count($account_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $content_type when calling getBankTransactionAttachmentByFileName' + 'Missing the required parameter $account_id when calling getAccountAttachments' ); } - $resourcePath = '/BankTransactions/{BankTransactionID}/Attachments/{FileName}'; + $resourcePath = '/Accounts/{AccountID}/Attachments'; $formParams = []; $queryParams = []; $headerParams = []; @@ -20386,23 +20944,11 @@ protected function getBankTransactionAttachmentByFileNameRequest($xero_tenant_id if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } - // header params - if ($content_type !== null) { - $headerParams['contentType'] = AccountingObjectSerializer::toHeaderValue($content_type); - } // path params - if ($bank_transaction_id !== null) { - $resourcePath = str_replace( - '{' . 'BankTransactionID' . '}', - AccountingObjectSerializer::toPathValue($bank_transaction_id), - $resourcePath - ); - } - // path params - if ($file_name !== null) { + if ($account_id !== null) { $resourcePath = str_replace( - '{' . 'FileName' . '}', - AccountingObjectSerializer::toPathValue($file_name), + '{' . 'AccountID' . '}', + AccountingObjectSerializer::toPathValue($account_id), $resourcePath ); } @@ -20410,11 +20956,11 @@ protected function getBankTransactionAttachmentByFileNameRequest($xero_tenant_id $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/octet-stream'] + ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/octet-stream'], + ['application/json'], [] ); } @@ -20467,35 +21013,35 @@ protected function getBankTransactionAttachmentByFileNameRequest($xero_tenant_id } /** - * Operation getBankTransactionAttachmentById - * Retrieves specific attachments from a specific BankTransaction using a unique attachment Id + * Operation getAccounts + * Retrieves the full chart of accounts * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) - * @param string $attachment_id Unique identifier for Attachment object (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) + * @param string $where Filter by an any element (optional) + * @param string $order Order by an any element (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \SplFileObject + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Accounts */ - public function getBankTransactionAttachmentById($xero_tenant_id, $bank_transaction_id, $attachment_id, $content_type) + public function getAccounts($xero_tenant_id, $if_modified_since = null, $where = null, $order = null) { - list($response) = $this->getBankTransactionAttachmentByIdWithHttpInfo($xero_tenant_id, $bank_transaction_id, $attachment_id, $content_type); + list($response) = $this->getAccountsWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order); return $response; } /** - * Operation getBankTransactionAttachmentByIdWithHttpInfo - * Retrieves specific attachments from a specific BankTransaction using a unique attachment Id + * Operation getAccountsWithHttpInfo + * Retrieves the full chart of accounts * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) - * @param string $attachment_id Unique identifier for Attachment object (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) + * @param string $where Filter by an any element (optional) + * @param string $order Order by an any element (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\Accounting\Accounts, HTTP status code, HTTP response headers (array of strings) */ - public function getBankTransactionAttachmentByIdWithHttpInfo($xero_tenant_id, $bank_transaction_id, $attachment_id, $content_type) + public function getAccountsWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null) { - $request = $this->getBankTransactionAttachmentByIdRequest($xero_tenant_id, $bank_transaction_id, $attachment_id, $content_type); + $request = $this->getAccountsRequest($xero_tenant_id, $if_modified_since, $where, $order); try { $options = $this->createHttpClientOption(); try { @@ -20524,18 +21070,18 @@ public function getBankTransactionAttachmentByIdWithHttpInfo($xero_tenant_id, $b $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Accounts' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - AccountingObjectSerializer::deserialize($content, '\SplFileObject', []), + AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Accounts', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\SplFileObject'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Accounts'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -20552,7 +21098,7 @@ public function getBankTransactionAttachmentByIdWithHttpInfo($xero_tenant_id, $b case 200: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\SplFileObject', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Accounts', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -20562,18 +21108,18 @@ public function getBankTransactionAttachmentByIdWithHttpInfo($xero_tenant_id, $b } } /** - * Operation getBankTransactionAttachmentByIdAsync - * Retrieves specific attachments from a specific BankTransaction using a unique attachment Id + * Operation getAccountsAsync + * Retrieves the full chart of accounts * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) - * @param string $attachment_id Unique identifier for Attachment object (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) + * @param string $where Filter by an any element (optional) + * @param string $order Order by an any element (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBankTransactionAttachmentByIdAsync($xero_tenant_id, $bank_transaction_id, $attachment_id, $content_type) + public function getAccountsAsync($xero_tenant_id, $if_modified_since = null, $where = null, $order = null) { - return $this->getBankTransactionAttachmentByIdAsyncWithHttpInfo($xero_tenant_id, $bank_transaction_id, $attachment_id, $content_type) + return $this->getAccountsAsyncWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order) ->then( function ($response) { return $response[0]; @@ -20581,18 +21127,18 @@ function ($response) { ); } /** - * Operation getBankTransactionAttachmentByIdAsyncWithHttpInfo - * Retrieves specific attachments from a specific BankTransaction using a unique attachment Id + * Operation getAccountsAsyncWithHttpInfo + * Retrieves the full chart of accounts * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) - * @param string $attachment_id Unique identifier for Attachment object (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) + * @param string $where Filter by an any element (optional) + * @param string $order Order by an any element (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBankTransactionAttachmentByIdAsyncWithHttpInfo($xero_tenant_id, $bank_transaction_id, $attachment_id, $content_type) + public function getAccountsAsyncWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null) { - $returnType = '\SplFileObject'; - $request = $this->getBankTransactionAttachmentByIdRequest($xero_tenant_id, $bank_transaction_id, $attachment_id, $content_type); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Accounts'; + $request = $this->getAccountsRequest($xero_tenant_id, $if_modified_since, $where, $order); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -20627,78 +21173,52 @@ function ($exception) { } /** - * Create request for operation 'getBankTransactionAttachmentById' + * Create request for operation 'getAccounts' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) - * @param string $attachment_id Unique identifier for Attachment object (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) + * @param string $where Filter by an any element (optional) + * @param string $order Order by an any element (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getBankTransactionAttachmentByIdRequest($xero_tenant_id, $bank_transaction_id, $attachment_id, $content_type) + protected function getAccountsRequest($xero_tenant_id, $if_modified_since = null, $where = null, $order = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getBankTransactionAttachmentById' - ); - } - // verify the required parameter 'bank_transaction_id' is set - if ($bank_transaction_id === null || (is_array($bank_transaction_id) && count($bank_transaction_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $bank_transaction_id when calling getBankTransactionAttachmentById' - ); - } - // verify the required parameter 'attachment_id' is set - if ($attachment_id === null || (is_array($attachment_id) && count($attachment_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $attachment_id when calling getBankTransactionAttachmentById' - ); - } - // verify the required parameter 'content_type' is set - if ($content_type === null || (is_array($content_type) && count($content_type) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $content_type when calling getBankTransactionAttachmentById' + 'Missing the required parameter $xero_tenant_id when calling getAccounts' ); } - $resourcePath = '/BankTransactions/{BankTransactionID}/Attachments/{AttachmentID}'; + $resourcePath = '/Accounts'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if ($where !== null) { + $queryParams['where'] = AccountingObjectSerializer::toQueryValue($where); + } + // query params + if ($order !== null) { + $queryParams['order'] = AccountingObjectSerializer::toQueryValue($order); + } // header params if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } // header params - if ($content_type !== null) { - $headerParams['contentType'] = AccountingObjectSerializer::toHeaderValue($content_type); - } - // path params - if ($bank_transaction_id !== null) { - $resourcePath = str_replace( - '{' . 'BankTransactionID' . '}', - AccountingObjectSerializer::toPathValue($bank_transaction_id), - $resourcePath - ); - } - // path params - if ($attachment_id !== null) { - $resourcePath = str_replace( - '{' . 'AttachmentID' . '}', - AccountingObjectSerializer::toPathValue($attachment_id), - $resourcePath - ); + if ($if_modified_since !== null) { + $headerParams['If-Modified-Since'] = AccountingObjectSerializer::toHeaderValue($if_modified_since); } // body params $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/octet-stream'] + ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/octet-stream'], + ['application/json'], [] ); } @@ -20751,31 +21271,33 @@ protected function getBankTransactionAttachmentByIdRequest($xero_tenant_id, $ban } /** - * Operation getBankTransactionAttachments - * Retrieves any attachments from a specific bank transactions + * Operation getBankTransaction + * Retrieves a single spent or received money transaction by using a unique bank transaction Id * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) + * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions */ - public function getBankTransactionAttachments($xero_tenant_id, $bank_transaction_id) + public function getBankTransaction($xero_tenant_id, $bank_transaction_id, $unitdp = null) { - list($response) = $this->getBankTransactionAttachmentsWithHttpInfo($xero_tenant_id, $bank_transaction_id); + list($response) = $this->getBankTransactionWithHttpInfo($xero_tenant_id, $bank_transaction_id, $unitdp); return $response; } /** - * Operation getBankTransactionAttachmentsWithHttpInfo - * Retrieves any attachments from a specific bank transactions + * Operation getBankTransactionWithHttpInfo + * Retrieves a single spent or received money transaction by using a unique bank transaction Id * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) + * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\Accounting\Attachments, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\Accounting\BankTransactions, HTTP status code, HTTP response headers (array of strings) */ - public function getBankTransactionAttachmentsWithHttpInfo($xero_tenant_id, $bank_transaction_id) + public function getBankTransactionWithHttpInfo($xero_tenant_id, $bank_transaction_id, $unitdp = null) { - $request = $this->getBankTransactionAttachmentsRequest($xero_tenant_id, $bank_transaction_id); + $request = $this->getBankTransactionRequest($xero_tenant_id, $bank_transaction_id, $unitdp); try { $options = $this->createHttpClientOption(); try { @@ -20804,18 +21326,18 @@ public function getBankTransactionAttachmentsWithHttpInfo($xero_tenant_id, $bank $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments', []), + AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -20832,7 +21354,7 @@ public function getBankTransactionAttachmentsWithHttpInfo($xero_tenant_id, $bank case 200: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -20842,16 +21364,17 @@ public function getBankTransactionAttachmentsWithHttpInfo($xero_tenant_id, $bank } } /** - * Operation getBankTransactionAttachmentsAsync - * Retrieves any attachments from a specific bank transactions + * Operation getBankTransactionAsync + * Retrieves a single spent or received money transaction by using a unique bank transaction Id * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) + * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBankTransactionAttachmentsAsync($xero_tenant_id, $bank_transaction_id) + public function getBankTransactionAsync($xero_tenant_id, $bank_transaction_id, $unitdp = null) { - return $this->getBankTransactionAttachmentsAsyncWithHttpInfo($xero_tenant_id, $bank_transaction_id) + return $this->getBankTransactionAsyncWithHttpInfo($xero_tenant_id, $bank_transaction_id, $unitdp) ->then( function ($response) { return $response[0]; @@ -20859,16 +21382,17 @@ function ($response) { ); } /** - * Operation getBankTransactionAttachmentsAsyncWithHttpInfo - * Retrieves any attachments from a specific bank transactions + * Operation getBankTransactionAsyncWithHttpInfo + * Retrieves a single spent or received money transaction by using a unique bank transaction Id * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) + * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBankTransactionAttachmentsAsyncWithHttpInfo($xero_tenant_id, $bank_transaction_id) + public function getBankTransactionAsyncWithHttpInfo($xero_tenant_id, $bank_transaction_id, $unitdp = null) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; - $request = $this->getBankTransactionAttachmentsRequest($xero_tenant_id, $bank_transaction_id); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions'; + $request = $this->getBankTransactionRequest($xero_tenant_id, $bank_transaction_id, $unitdp); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -20903,31 +21427,36 @@ function ($exception) { } /** - * Create request for operation 'getBankTransactionAttachments' + * Create request for operation 'getBankTransaction' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) + * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getBankTransactionAttachmentsRequest($xero_tenant_id, $bank_transaction_id) + protected function getBankTransactionRequest($xero_tenant_id, $bank_transaction_id, $unitdp = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getBankTransactionAttachments' + 'Missing the required parameter $xero_tenant_id when calling getBankTransaction' ); } // verify the required parameter 'bank_transaction_id' is set if ($bank_transaction_id === null || (is_array($bank_transaction_id) && count($bank_transaction_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $bank_transaction_id when calling getBankTransactionAttachments' + 'Missing the required parameter $bank_transaction_id when calling getBankTransaction' ); } - $resourcePath = '/BankTransactions/{BankTransactionID}/Attachments'; + $resourcePath = '/BankTransactions/{BankTransactionID}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if ($unitdp !== null) { + $queryParams['unitdp'] = AccountingObjectSerializer::toQueryValue($unitdp); + } // header params if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); @@ -21001,39 +21530,35 @@ protected function getBankTransactionAttachmentsRequest($xero_tenant_id, $bank_t } /** - * Operation getBankTransactions - * Retrieves any spent or received money transactions + * Operation getBankTransactionAttachmentByFileName + * Retrieves a specific attachment from a specific bank transaction by filename * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) - * @param string $where Filter by an any element (optional) - * @param string $order Order by an any element (optional) - * @param int $page Up to 100 bank transactions will be returned in a single API call with line items details (optional) - * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) + * @param string $file_name Name of the attachment (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions + * @return \SplFileObject */ - public function getBankTransactions($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null) + public function getBankTransactionAttachmentByFileName($xero_tenant_id, $bank_transaction_id, $file_name, $content_type) { - list($response) = $this->getBankTransactionsWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $page, $unitdp); + list($response) = $this->getBankTransactionAttachmentByFileNameWithHttpInfo($xero_tenant_id, $bank_transaction_id, $file_name, $content_type); return $response; } /** - * Operation getBankTransactionsWithHttpInfo - * Retrieves any spent or received money transactions + * Operation getBankTransactionAttachmentByFileNameWithHttpInfo + * Retrieves a specific attachment from a specific bank transaction by filename * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) - * @param string $where Filter by an any element (optional) - * @param string $order Order by an any element (optional) - * @param int $page Up to 100 bank transactions will be returned in a single API call with line items details (optional) - * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) + * @param string $file_name Name of the attachment (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\Accounting\BankTransactions, HTTP status code, HTTP response headers (array of strings) + * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) */ - public function getBankTransactionsWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null) + public function getBankTransactionAttachmentByFileNameWithHttpInfo($xero_tenant_id, $bank_transaction_id, $file_name, $content_type) { - $request = $this->getBankTransactionsRequest($xero_tenant_id, $if_modified_since, $where, $order, $page, $unitdp); + $request = $this->getBankTransactionAttachmentByFileNameRequest($xero_tenant_id, $bank_transaction_id, $file_name, $content_type); try { $options = $this->createHttpClientOption(); try { @@ -21062,18 +21587,18 @@ public function getBankTransactionsWithHttpInfo($xero_tenant_id, $if_modified_si $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions' === '\SplFileObject') { + if ('\SplFileObject' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions', []), + AccountingObjectSerializer::deserialize($content, '\SplFileObject', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions'; + $returnType = '\SplFileObject'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -21090,7 +21615,7 @@ public function getBankTransactionsWithHttpInfo($xero_tenant_id, $if_modified_si case 200: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions', + '\SplFileObject', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -21100,20 +21625,18 @@ public function getBankTransactionsWithHttpInfo($xero_tenant_id, $if_modified_si } } /** - * Operation getBankTransactionsAsync - * Retrieves any spent or received money transactions + * Operation getBankTransactionAttachmentByFileNameAsync + * Retrieves a specific attachment from a specific bank transaction by filename * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) - * @param string $where Filter by an any element (optional) - * @param string $order Order by an any element (optional) - * @param int $page Up to 100 bank transactions will be returned in a single API call with line items details (optional) - * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) + * @param string $file_name Name of the attachment (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBankTransactionsAsync($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null) + public function getBankTransactionAttachmentByFileNameAsync($xero_tenant_id, $bank_transaction_id, $file_name, $content_type) { - return $this->getBankTransactionsAsyncWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $page, $unitdp) + return $this->getBankTransactionAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $bank_transaction_id, $file_name, $content_type) ->then( function ($response) { return $response[0]; @@ -21121,20 +21644,18 @@ function ($response) { ); } /** - * Operation getBankTransactionsAsyncWithHttpInfo - * Retrieves any spent or received money transactions + * Operation getBankTransactionAttachmentByFileNameAsyncWithHttpInfo + * Retrieves a specific attachment from a specific bank transaction by filename * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) - * @param string $where Filter by an any element (optional) - * @param string $order Order by an any element (optional) - * @param int $page Up to 100 bank transactions will be returned in a single API call with line items details (optional) - * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) + * @param string $file_name Name of the attachment (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBankTransactionsAsyncWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null) + public function getBankTransactionAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $bank_transaction_id, $file_name, $content_type) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions'; - $request = $this->getBankTransactionsRequest($xero_tenant_id, $if_modified_since, $where, $order, $page, $unitdp); + $returnType = '\SplFileObject'; + $request = $this->getBankTransactionAttachmentByFileNameRequest($xero_tenant_id, $bank_transaction_id, $file_name, $content_type); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -21169,62 +21690,78 @@ function ($exception) { } /** - * Create request for operation 'getBankTransactions' + * Create request for operation 'getBankTransactionAttachmentByFileName' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) - * @param string $where Filter by an any element (optional) - * @param string $order Order by an any element (optional) - * @param int $page Up to 100 bank transactions will be returned in a single API call with line items details (optional) - * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) + * @param string $file_name Name of the attachment (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getBankTransactionsRequest($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null) + protected function getBankTransactionAttachmentByFileNameRequest($xero_tenant_id, $bank_transaction_id, $file_name, $content_type) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getBankTransactions' + 'Missing the required parameter $xero_tenant_id when calling getBankTransactionAttachmentByFileName' ); } - $resourcePath = '/BankTransactions'; + // verify the required parameter 'bank_transaction_id' is set + if ($bank_transaction_id === null || (is_array($bank_transaction_id) && count($bank_transaction_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $bank_transaction_id when calling getBankTransactionAttachmentByFileName' + ); + } + // verify the required parameter 'file_name' is set + if ($file_name === null || (is_array($file_name) && count($file_name) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $file_name when calling getBankTransactionAttachmentByFileName' + ); + } + // verify the required parameter 'content_type' is set + if ($content_type === null || (is_array($content_type) && count($content_type) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $content_type when calling getBankTransactionAttachmentByFileName' + ); + } + $resourcePath = '/BankTransactions/{BankTransactionID}/Attachments/{FileName}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if ($where !== null) { - $queryParams['where'] = AccountingObjectSerializer::toQueryValue($where); - } - // query params - if ($order !== null) { - $queryParams['order'] = AccountingObjectSerializer::toQueryValue($order); - } - // query params - if ($page !== null) { - $queryParams['page'] = AccountingObjectSerializer::toQueryValue($page); - } - // query params - if ($unitdp !== null) { - $queryParams['unitdp'] = AccountingObjectSerializer::toQueryValue($unitdp); - } // header params if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } // header params - if ($if_modified_since !== null) { - $headerParams['If-Modified-Since'] = AccountingObjectSerializer::toHeaderValue($if_modified_since); + if ($content_type !== null) { + $headerParams['contentType'] = AccountingObjectSerializer::toHeaderValue($content_type); + } + // path params + if ($bank_transaction_id !== null) { + $resourcePath = str_replace( + '{' . 'BankTransactionID' . '}', + AccountingObjectSerializer::toPathValue($bank_transaction_id), + $resourcePath + ); + } + // path params + if ($file_name !== null) { + $resourcePath = str_replace( + '{' . 'FileName' . '}', + AccountingObjectSerializer::toPathValue($file_name), + $resourcePath + ); } // body params $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/octet-stream'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/octet-stream'], [] ); } @@ -21277,31 +21814,35 @@ protected function getBankTransactionsRequest($xero_tenant_id, $if_modified_sinc } /** - * Operation getBankTransactionsHistory - * Retrieves history from a specific bank transaction using a unique bank transaction Id + * Operation getBankTransactionAttachmentById + * Retrieves specific attachments from a specific BankTransaction using a unique attachment Id * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) + * @param string $attachment_id Unique identifier for Attachment object (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords + * @return \SplFileObject */ - public function getBankTransactionsHistory($xero_tenant_id, $bank_transaction_id) + public function getBankTransactionAttachmentById($xero_tenant_id, $bank_transaction_id, $attachment_id, $content_type) { - list($response) = $this->getBankTransactionsHistoryWithHttpInfo($xero_tenant_id, $bank_transaction_id); + list($response) = $this->getBankTransactionAttachmentByIdWithHttpInfo($xero_tenant_id, $bank_transaction_id, $attachment_id, $content_type); return $response; } /** - * Operation getBankTransactionsHistoryWithHttpInfo - * Retrieves history from a specific bank transaction using a unique bank transaction Id + * Operation getBankTransactionAttachmentByIdWithHttpInfo + * Retrieves specific attachments from a specific BankTransaction using a unique attachment Id * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) + * @param string $attachment_id Unique identifier for Attachment object (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\Accounting\HistoryRecords, HTTP status code, HTTP response headers (array of strings) + * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) */ - public function getBankTransactionsHistoryWithHttpInfo($xero_tenant_id, $bank_transaction_id) + public function getBankTransactionAttachmentByIdWithHttpInfo($xero_tenant_id, $bank_transaction_id, $attachment_id, $content_type) { - $request = $this->getBankTransactionsHistoryRequest($xero_tenant_id, $bank_transaction_id); + $request = $this->getBankTransactionAttachmentByIdRequest($xero_tenant_id, $bank_transaction_id, $attachment_id, $content_type); try { $options = $this->createHttpClientOption(); try { @@ -21330,18 +21871,18 @@ public function getBankTransactionsHistoryWithHttpInfo($xero_tenant_id, $bank_tr $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords' === '\SplFileObject') { + if ('\SplFileObject' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords', []), + AccountingObjectSerializer::deserialize($content, '\SplFileObject', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords'; + $returnType = '\SplFileObject'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -21358,7 +21899,7 @@ public function getBankTransactionsHistoryWithHttpInfo($xero_tenant_id, $bank_tr case 200: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords', + '\SplFileObject', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -21368,16 +21909,18 @@ public function getBankTransactionsHistoryWithHttpInfo($xero_tenant_id, $bank_tr } } /** - * Operation getBankTransactionsHistoryAsync - * Retrieves history from a specific bank transaction using a unique bank transaction Id + * Operation getBankTransactionAttachmentByIdAsync + * Retrieves specific attachments from a specific BankTransaction using a unique attachment Id * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) + * @param string $attachment_id Unique identifier for Attachment object (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBankTransactionsHistoryAsync($xero_tenant_id, $bank_transaction_id) + public function getBankTransactionAttachmentByIdAsync($xero_tenant_id, $bank_transaction_id, $attachment_id, $content_type) { - return $this->getBankTransactionsHistoryAsyncWithHttpInfo($xero_tenant_id, $bank_transaction_id) + return $this->getBankTransactionAttachmentByIdAsyncWithHttpInfo($xero_tenant_id, $bank_transaction_id, $attachment_id, $content_type) ->then( function ($response) { return $response[0]; @@ -21385,16 +21928,18 @@ function ($response) { ); } /** - * Operation getBankTransactionsHistoryAsyncWithHttpInfo - * Retrieves history from a specific bank transaction using a unique bank transaction Id + * Operation getBankTransactionAttachmentByIdAsyncWithHttpInfo + * Retrieves specific attachments from a specific BankTransaction using a unique attachment Id * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) + * @param string $attachment_id Unique identifier for Attachment object (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBankTransactionsHistoryAsyncWithHttpInfo($xero_tenant_id, $bank_transaction_id) + public function getBankTransactionAttachmentByIdAsyncWithHttpInfo($xero_tenant_id, $bank_transaction_id, $attachment_id, $content_type) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords'; - $request = $this->getBankTransactionsHistoryRequest($xero_tenant_id, $bank_transaction_id); + $returnType = '\SplFileObject'; + $request = $this->getBankTransactionAttachmentByIdRequest($xero_tenant_id, $bank_transaction_id, $attachment_id, $content_type); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -21429,26 +21974,40 @@ function ($exception) { } /** - * Create request for operation 'getBankTransactionsHistory' + * Create request for operation 'getBankTransactionAttachmentById' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) + * @param string $attachment_id Unique identifier for Attachment object (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getBankTransactionsHistoryRequest($xero_tenant_id, $bank_transaction_id) + protected function getBankTransactionAttachmentByIdRequest($xero_tenant_id, $bank_transaction_id, $attachment_id, $content_type) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getBankTransactionsHistory' + 'Missing the required parameter $xero_tenant_id when calling getBankTransactionAttachmentById' ); } // verify the required parameter 'bank_transaction_id' is set if ($bank_transaction_id === null || (is_array($bank_transaction_id) && count($bank_transaction_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $bank_transaction_id when calling getBankTransactionsHistory' + 'Missing the required parameter $bank_transaction_id when calling getBankTransactionAttachmentById' ); } - $resourcePath = '/BankTransactions/{BankTransactionID}/History'; + // verify the required parameter 'attachment_id' is set + if ($attachment_id === null || (is_array($attachment_id) && count($attachment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $attachment_id when calling getBankTransactionAttachmentById' + ); + } + // verify the required parameter 'content_type' is set + if ($content_type === null || (is_array($content_type) && count($content_type) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $content_type when calling getBankTransactionAttachmentById' + ); + } + $resourcePath = '/BankTransactions/{BankTransactionID}/Attachments/{AttachmentID}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -21458,6 +22017,10 @@ protected function getBankTransactionsHistoryRequest($xero_tenant_id, $bank_tran if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($content_type !== null) { + $headerParams['contentType'] = AccountingObjectSerializer::toHeaderValue($content_type); + } // path params if ($bank_transaction_id !== null) { $resourcePath = str_replace( @@ -21466,15 +22029,23 @@ protected function getBankTransactionsHistoryRequest($xero_tenant_id, $bank_tran $resourcePath ); } + // path params + if ($attachment_id !== null) { + $resourcePath = str_replace( + '{' . 'AttachmentID' . '}', + AccountingObjectSerializer::toPathValue($attachment_id), + $resourcePath + ); + } // body params $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/octet-stream'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/octet-stream'], [] ); } @@ -21527,31 +22098,31 @@ protected function getBankTransactionsHistoryRequest($xero_tenant_id, $bank_tran } /** - * Operation getBankTransfer - * Retrieves specific bank transfers by using a unique bank transfer Id + * Operation getBankTransactionAttachments + * Retrieves any attachments from a specific bank transactions * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) + * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransfers + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments */ - public function getBankTransfer($xero_tenant_id, $bank_transfer_id) + public function getBankTransactionAttachments($xero_tenant_id, $bank_transaction_id) { - list($response) = $this->getBankTransferWithHttpInfo($xero_tenant_id, $bank_transfer_id); + list($response) = $this->getBankTransactionAttachmentsWithHttpInfo($xero_tenant_id, $bank_transaction_id); return $response; } /** - * Operation getBankTransferWithHttpInfo - * Retrieves specific bank transfers by using a unique bank transfer Id + * Operation getBankTransactionAttachmentsWithHttpInfo + * Retrieves any attachments from a specific bank transactions * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) + * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\Accounting\BankTransfers, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\Accounting\Attachments, HTTP status code, HTTP response headers (array of strings) */ - public function getBankTransferWithHttpInfo($xero_tenant_id, $bank_transfer_id) + public function getBankTransactionAttachmentsWithHttpInfo($xero_tenant_id, $bank_transaction_id) { - $request = $this->getBankTransferRequest($xero_tenant_id, $bank_transfer_id); + $request = $this->getBankTransactionAttachmentsRequest($xero_tenant_id, $bank_transaction_id); try { $options = $this->createHttpClientOption(); try { @@ -21580,18 +22151,18 @@ public function getBankTransferWithHttpInfo($xero_tenant_id, $bank_transfer_id) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransfers' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransfers', []), + AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransfers'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -21608,7 +22179,7 @@ public function getBankTransferWithHttpInfo($xero_tenant_id, $bank_transfer_id) case 200: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransfers', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -21618,16 +22189,16 @@ public function getBankTransferWithHttpInfo($xero_tenant_id, $bank_transfer_id) } } /** - * Operation getBankTransferAsync - * Retrieves specific bank transfers by using a unique bank transfer Id + * Operation getBankTransactionAttachmentsAsync + * Retrieves any attachments from a specific bank transactions * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) + * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBankTransferAsync($xero_tenant_id, $bank_transfer_id) + public function getBankTransactionAttachmentsAsync($xero_tenant_id, $bank_transaction_id) { - return $this->getBankTransferAsyncWithHttpInfo($xero_tenant_id, $bank_transfer_id) + return $this->getBankTransactionAttachmentsAsyncWithHttpInfo($xero_tenant_id, $bank_transaction_id) ->then( function ($response) { return $response[0]; @@ -21635,16 +22206,16 @@ function ($response) { ); } /** - * Operation getBankTransferAsyncWithHttpInfo - * Retrieves specific bank transfers by using a unique bank transfer Id + * Operation getBankTransactionAttachmentsAsyncWithHttpInfo + * Retrieves any attachments from a specific bank transactions * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) + * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBankTransferAsyncWithHttpInfo($xero_tenant_id, $bank_transfer_id) + public function getBankTransactionAttachmentsAsyncWithHttpInfo($xero_tenant_id, $bank_transaction_id) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransfers'; - $request = $this->getBankTransferRequest($xero_tenant_id, $bank_transfer_id); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; + $request = $this->getBankTransactionAttachmentsRequest($xero_tenant_id, $bank_transaction_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -21679,26 +22250,26 @@ function ($exception) { } /** - * Create request for operation 'getBankTransfer' + * Create request for operation 'getBankTransactionAttachments' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) + * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getBankTransferRequest($xero_tenant_id, $bank_transfer_id) + protected function getBankTransactionAttachmentsRequest($xero_tenant_id, $bank_transaction_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getBankTransfer' + 'Missing the required parameter $xero_tenant_id when calling getBankTransactionAttachments' ); } - // verify the required parameter 'bank_transfer_id' is set - if ($bank_transfer_id === null || (is_array($bank_transfer_id) && count($bank_transfer_id) === 0)) { + // verify the required parameter 'bank_transaction_id' is set + if ($bank_transaction_id === null || (is_array($bank_transaction_id) && count($bank_transaction_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $bank_transfer_id when calling getBankTransfer' + 'Missing the required parameter $bank_transaction_id when calling getBankTransactionAttachments' ); } - $resourcePath = '/BankTransfers/{BankTransferID}'; + $resourcePath = '/BankTransactions/{BankTransactionID}/Attachments'; $formParams = []; $queryParams = []; $headerParams = []; @@ -21709,10 +22280,10 @@ protected function getBankTransferRequest($xero_tenant_id, $bank_transfer_id) $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } // path params - if ($bank_transfer_id !== null) { + if ($bank_transaction_id !== null) { $resourcePath = str_replace( - '{' . 'BankTransferID' . '}', - AccountingObjectSerializer::toPathValue($bank_transfer_id), + '{' . 'BankTransactionID' . '}', + AccountingObjectSerializer::toPathValue($bank_transaction_id), $resourcePath ); } @@ -21777,35 +22348,41 @@ protected function getBankTransferRequest($xero_tenant_id, $bank_transfer_id) } /** - * Operation getBankTransferAttachmentByFileName - * Retrieves a specific attachment on a specific bank transfer by file name + * Operation getBankTransactions + * Retrieves any spent or received money transactions * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) - * @param string $file_name Name of the attachment (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) + * @param string $where Filter by an any element (optional) + * @param string $order Order by an any element (optional) + * @param int $page Up to 100 bank transactions will be returned in a single API call with line items details (optional) + * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \SplFileObject + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions */ - public function getBankTransferAttachmentByFileName($xero_tenant_id, $bank_transfer_id, $file_name, $content_type) + public function getBankTransactions($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null, $page_size = null) { - list($response) = $this->getBankTransferAttachmentByFileNameWithHttpInfo($xero_tenant_id, $bank_transfer_id, $file_name, $content_type); + list($response) = $this->getBankTransactionsWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $page, $unitdp, $page_size); return $response; } /** - * Operation getBankTransferAttachmentByFileNameWithHttpInfo - * Retrieves a specific attachment on a specific bank transfer by file name + * Operation getBankTransactionsWithHttpInfo + * Retrieves any spent or received money transactions * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) - * @param string $file_name Name of the attachment (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) + * @param string $where Filter by an any element (optional) + * @param string $order Order by an any element (optional) + * @param int $page Up to 100 bank transactions will be returned in a single API call with line items details (optional) + * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\Accounting\BankTransactions, HTTP status code, HTTP response headers (array of strings) */ - public function getBankTransferAttachmentByFileNameWithHttpInfo($xero_tenant_id, $bank_transfer_id, $file_name, $content_type) + public function getBankTransactionsWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null, $page_size = null) { - $request = $this->getBankTransferAttachmentByFileNameRequest($xero_tenant_id, $bank_transfer_id, $file_name, $content_type); + $request = $this->getBankTransactionsRequest($xero_tenant_id, $if_modified_since, $where, $order, $page, $unitdp, $page_size); try { $options = $this->createHttpClientOption(); try { @@ -21834,18 +22411,18 @@ public function getBankTransferAttachmentByFileNameWithHttpInfo($xero_tenant_id, $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - AccountingObjectSerializer::deserialize($content, '\SplFileObject', []), + AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\SplFileObject'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -21862,7 +22439,7 @@ public function getBankTransferAttachmentByFileNameWithHttpInfo($xero_tenant_id, case 200: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\SplFileObject', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -21872,18 +22449,21 @@ public function getBankTransferAttachmentByFileNameWithHttpInfo($xero_tenant_id, } } /** - * Operation getBankTransferAttachmentByFileNameAsync - * Retrieves a specific attachment on a specific bank transfer by file name + * Operation getBankTransactionsAsync + * Retrieves any spent or received money transactions * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) - * @param string $file_name Name of the attachment (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) + * @param string $where Filter by an any element (optional) + * @param string $order Order by an any element (optional) + * @param int $page Up to 100 bank transactions will be returned in a single API call with line items details (optional) + * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBankTransferAttachmentByFileNameAsync($xero_tenant_id, $bank_transfer_id, $file_name, $content_type) + public function getBankTransactionsAsync($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null, $page_size = null) { - return $this->getBankTransferAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $bank_transfer_id, $file_name, $content_type) + return $this->getBankTransactionsAsyncWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $page, $unitdp, $page_size) ->then( function ($response) { return $response[0]; @@ -21891,18 +22471,21 @@ function ($response) { ); } /** - * Operation getBankTransferAttachmentByFileNameAsyncWithHttpInfo - * Retrieves a specific attachment on a specific bank transfer by file name + * Operation getBankTransactionsAsyncWithHttpInfo + * Retrieves any spent or received money transactions * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) - * @param string $file_name Name of the attachment (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) + * @param string $where Filter by an any element (optional) + * @param string $order Order by an any element (optional) + * @param int $page Up to 100 bank transactions will be returned in a single API call with line items details (optional) + * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBankTransferAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $bank_transfer_id, $file_name, $content_type) + public function getBankTransactionsAsyncWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null, $page_size = null) { - $returnType = '\SplFileObject'; - $request = $this->getBankTransferAttachmentByFileNameRequest($xero_tenant_id, $bank_transfer_id, $file_name, $content_type); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions'; + $request = $this->getBankTransactionsRequest($xero_tenant_id, $if_modified_since, $where, $order, $page, $unitdp, $page_size); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -21937,78 +22520,67 @@ function ($exception) { } /** - * Create request for operation 'getBankTransferAttachmentByFileName' + * Create request for operation 'getBankTransactions' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) - * @param string $file_name Name of the attachment (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) + * @param string $where Filter by an any element (optional) + * @param string $order Order by an any element (optional) + * @param int $page Up to 100 bank transactions will be returned in a single API call with line items details (optional) + * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getBankTransferAttachmentByFileNameRequest($xero_tenant_id, $bank_transfer_id, $file_name, $content_type) + protected function getBankTransactionsRequest($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null, $page_size = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getBankTransferAttachmentByFileName' - ); - } - // verify the required parameter 'bank_transfer_id' is set - if ($bank_transfer_id === null || (is_array($bank_transfer_id) && count($bank_transfer_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $bank_transfer_id when calling getBankTransferAttachmentByFileName' - ); - } - // verify the required parameter 'file_name' is set - if ($file_name === null || (is_array($file_name) && count($file_name) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $file_name when calling getBankTransferAttachmentByFileName' - ); - } - // verify the required parameter 'content_type' is set - if ($content_type === null || (is_array($content_type) && count($content_type) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $content_type when calling getBankTransferAttachmentByFileName' + 'Missing the required parameter $xero_tenant_id when calling getBankTransactions' ); } - $resourcePath = '/BankTransfers/{BankTransferID}/Attachments/{FileName}'; + $resourcePath = '/BankTransactions'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if ($where !== null) { + $queryParams['where'] = AccountingObjectSerializer::toQueryValue($where); + } + // query params + if ($order !== null) { + $queryParams['order'] = AccountingObjectSerializer::toQueryValue($order); + } + // query params + if ($page !== null) { + $queryParams['page'] = AccountingObjectSerializer::toQueryValue($page); + } + // query params + if ($unitdp !== null) { + $queryParams['unitdp'] = AccountingObjectSerializer::toQueryValue($unitdp); + } + // query params + if ($page_size !== null) { + $queryParams['pageSize'] = AccountingObjectSerializer::toQueryValue($page_size); + } // header params if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } // header params - if ($content_type !== null) { - $headerParams['contentType'] = AccountingObjectSerializer::toHeaderValue($content_type); - } - // path params - if ($bank_transfer_id !== null) { - $resourcePath = str_replace( - '{' . 'BankTransferID' . '}', - AccountingObjectSerializer::toPathValue($bank_transfer_id), - $resourcePath - ); - } - // path params - if ($file_name !== null) { - $resourcePath = str_replace( - '{' . 'FileName' . '}', - AccountingObjectSerializer::toPathValue($file_name), - $resourcePath - ); + if ($if_modified_since !== null) { + $headerParams['If-Modified-Since'] = AccountingObjectSerializer::toHeaderValue($if_modified_since); } // body params $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/octet-stream'] + ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/octet-stream'], + ['application/json'], [] ); } @@ -22061,35 +22633,31 @@ protected function getBankTransferAttachmentByFileNameRequest($xero_tenant_id, $ } /** - * Operation getBankTransferAttachmentById - * Retrieves a specific attachment from a specific bank transfer using a unique attachment ID + * Operation getBankTransactionsHistory + * Retrieves history from a specific bank transaction using a unique bank transaction Id * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) - * @param string $attachment_id Unique identifier for Attachment object (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \SplFileObject + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords */ - public function getBankTransferAttachmentById($xero_tenant_id, $bank_transfer_id, $attachment_id, $content_type) + public function getBankTransactionsHistory($xero_tenant_id, $bank_transaction_id) { - list($response) = $this->getBankTransferAttachmentByIdWithHttpInfo($xero_tenant_id, $bank_transfer_id, $attachment_id, $content_type); + list($response) = $this->getBankTransactionsHistoryWithHttpInfo($xero_tenant_id, $bank_transaction_id); return $response; } /** - * Operation getBankTransferAttachmentByIdWithHttpInfo - * Retrieves a specific attachment from a specific bank transfer using a unique attachment ID + * Operation getBankTransactionsHistoryWithHttpInfo + * Retrieves history from a specific bank transaction using a unique bank transaction Id * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) - * @param string $attachment_id Unique identifier for Attachment object (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\Accounting\HistoryRecords, HTTP status code, HTTP response headers (array of strings) */ - public function getBankTransferAttachmentByIdWithHttpInfo($xero_tenant_id, $bank_transfer_id, $attachment_id, $content_type) + public function getBankTransactionsHistoryWithHttpInfo($xero_tenant_id, $bank_transaction_id) { - $request = $this->getBankTransferAttachmentByIdRequest($xero_tenant_id, $bank_transfer_id, $attachment_id, $content_type); + $request = $this->getBankTransactionsHistoryRequest($xero_tenant_id, $bank_transaction_id); try { $options = $this->createHttpClientOption(); try { @@ -22118,18 +22686,18 @@ public function getBankTransferAttachmentByIdWithHttpInfo($xero_tenant_id, $bank $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - AccountingObjectSerializer::deserialize($content, '\SplFileObject', []), + AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\SplFileObject'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -22146,7 +22714,7 @@ public function getBankTransferAttachmentByIdWithHttpInfo($xero_tenant_id, $bank case 200: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\SplFileObject', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -22156,18 +22724,16 @@ public function getBankTransferAttachmentByIdWithHttpInfo($xero_tenant_id, $bank } } /** - * Operation getBankTransferAttachmentByIdAsync - * Retrieves a specific attachment from a specific bank transfer using a unique attachment ID + * Operation getBankTransactionsHistoryAsync + * Retrieves history from a specific bank transaction using a unique bank transaction Id * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) - * @param string $attachment_id Unique identifier for Attachment object (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBankTransferAttachmentByIdAsync($xero_tenant_id, $bank_transfer_id, $attachment_id, $content_type) + public function getBankTransactionsHistoryAsync($xero_tenant_id, $bank_transaction_id) { - return $this->getBankTransferAttachmentByIdAsyncWithHttpInfo($xero_tenant_id, $bank_transfer_id, $attachment_id, $content_type) + return $this->getBankTransactionsHistoryAsyncWithHttpInfo($xero_tenant_id, $bank_transaction_id) ->then( function ($response) { return $response[0]; @@ -22175,18 +22741,16 @@ function ($response) { ); } /** - * Operation getBankTransferAttachmentByIdAsyncWithHttpInfo - * Retrieves a specific attachment from a specific bank transfer using a unique attachment ID + * Operation getBankTransactionsHistoryAsyncWithHttpInfo + * Retrieves history from a specific bank transaction using a unique bank transaction Id * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) - * @param string $attachment_id Unique identifier for Attachment object (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBankTransferAttachmentByIdAsyncWithHttpInfo($xero_tenant_id, $bank_transfer_id, $attachment_id, $content_type) + public function getBankTransactionsHistoryAsyncWithHttpInfo($xero_tenant_id, $bank_transaction_id) { - $returnType = '\SplFileObject'; - $request = $this->getBankTransferAttachmentByIdRequest($xero_tenant_id, $bank_transfer_id, $attachment_id, $content_type); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords'; + $request = $this->getBankTransactionsHistoryRequest($xero_tenant_id, $bank_transaction_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -22221,40 +22785,26 @@ function ($exception) { } /** - * Create request for operation 'getBankTransferAttachmentById' + * Create request for operation 'getBankTransactionsHistory' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) - * @param string $attachment_id Unique identifier for Attachment object (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getBankTransferAttachmentByIdRequest($xero_tenant_id, $bank_transfer_id, $attachment_id, $content_type) + protected function getBankTransactionsHistoryRequest($xero_tenant_id, $bank_transaction_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getBankTransferAttachmentById' - ); - } - // verify the required parameter 'bank_transfer_id' is set - if ($bank_transfer_id === null || (is_array($bank_transfer_id) && count($bank_transfer_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $bank_transfer_id when calling getBankTransferAttachmentById' - ); - } - // verify the required parameter 'attachment_id' is set - if ($attachment_id === null || (is_array($attachment_id) && count($attachment_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $attachment_id when calling getBankTransferAttachmentById' + 'Missing the required parameter $xero_tenant_id when calling getBankTransactionsHistory' ); } - // verify the required parameter 'content_type' is set - if ($content_type === null || (is_array($content_type) && count($content_type) === 0)) { + // verify the required parameter 'bank_transaction_id' is set + if ($bank_transaction_id === null || (is_array($bank_transaction_id) && count($bank_transaction_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $content_type when calling getBankTransferAttachmentById' + 'Missing the required parameter $bank_transaction_id when calling getBankTransactionsHistory' ); } - $resourcePath = '/BankTransfers/{BankTransferID}/Attachments/{AttachmentID}'; + $resourcePath = '/BankTransactions/{BankTransactionID}/History'; $formParams = []; $queryParams = []; $headerParams = []; @@ -22264,23 +22814,11 @@ protected function getBankTransferAttachmentByIdRequest($xero_tenant_id, $bank_t if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } - // header params - if ($content_type !== null) { - $headerParams['contentType'] = AccountingObjectSerializer::toHeaderValue($content_type); - } // path params - if ($bank_transfer_id !== null) { - $resourcePath = str_replace( - '{' . 'BankTransferID' . '}', - AccountingObjectSerializer::toPathValue($bank_transfer_id), - $resourcePath - ); - } - // path params - if ($attachment_id !== null) { + if ($bank_transaction_id !== null) { $resourcePath = str_replace( - '{' . 'AttachmentID' . '}', - AccountingObjectSerializer::toPathValue($attachment_id), + '{' . 'BankTransactionID' . '}', + AccountingObjectSerializer::toPathValue($bank_transaction_id), $resourcePath ); } @@ -22288,11 +22826,11 @@ protected function getBankTransferAttachmentByIdRequest($xero_tenant_id, $bank_t $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/octet-stream'] + ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/octet-stream'], + ['application/json'], [] ); } @@ -22345,31 +22883,31 @@ protected function getBankTransferAttachmentByIdRequest($xero_tenant_id, $bank_t } /** - * Operation getBankTransferAttachments - * Retrieves attachments from a specific bank transfer + * Operation getBankTransfer + * Retrieves specific bank transfers by using a unique bank transfer Id * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransfers */ - public function getBankTransferAttachments($xero_tenant_id, $bank_transfer_id) + public function getBankTransfer($xero_tenant_id, $bank_transfer_id) { - list($response) = $this->getBankTransferAttachmentsWithHttpInfo($xero_tenant_id, $bank_transfer_id); + list($response) = $this->getBankTransferWithHttpInfo($xero_tenant_id, $bank_transfer_id); return $response; } /** - * Operation getBankTransferAttachmentsWithHttpInfo - * Retrieves attachments from a specific bank transfer + * Operation getBankTransferWithHttpInfo + * Retrieves specific bank transfers by using a unique bank transfer Id * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\Accounting\Attachments, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\Accounting\BankTransfers, HTTP status code, HTTP response headers (array of strings) */ - public function getBankTransferAttachmentsWithHttpInfo($xero_tenant_id, $bank_transfer_id) + public function getBankTransferWithHttpInfo($xero_tenant_id, $bank_transfer_id) { - $request = $this->getBankTransferAttachmentsRequest($xero_tenant_id, $bank_transfer_id); + $request = $this->getBankTransferRequest($xero_tenant_id, $bank_transfer_id); try { $options = $this->createHttpClientOption(); try { @@ -22398,18 +22936,18 @@ public function getBankTransferAttachmentsWithHttpInfo($xero_tenant_id, $bank_tr $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransfers' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments', []), + AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransfers', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransfers'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -22426,7 +22964,7 @@ public function getBankTransferAttachmentsWithHttpInfo($xero_tenant_id, $bank_tr case 200: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransfers', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -22436,16 +22974,16 @@ public function getBankTransferAttachmentsWithHttpInfo($xero_tenant_id, $bank_tr } } /** - * Operation getBankTransferAttachmentsAsync - * Retrieves attachments from a specific bank transfer + * Operation getBankTransferAsync + * Retrieves specific bank transfers by using a unique bank transfer Id * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBankTransferAttachmentsAsync($xero_tenant_id, $bank_transfer_id) + public function getBankTransferAsync($xero_tenant_id, $bank_transfer_id) { - return $this->getBankTransferAttachmentsAsyncWithHttpInfo($xero_tenant_id, $bank_transfer_id) + return $this->getBankTransferAsyncWithHttpInfo($xero_tenant_id, $bank_transfer_id) ->then( function ($response) { return $response[0]; @@ -22453,16 +22991,16 @@ function ($response) { ); } /** - * Operation getBankTransferAttachmentsAsyncWithHttpInfo - * Retrieves attachments from a specific bank transfer + * Operation getBankTransferAsyncWithHttpInfo + * Retrieves specific bank transfers by using a unique bank transfer Id * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBankTransferAttachmentsAsyncWithHttpInfo($xero_tenant_id, $bank_transfer_id) + public function getBankTransferAsyncWithHttpInfo($xero_tenant_id, $bank_transfer_id) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; - $request = $this->getBankTransferAttachmentsRequest($xero_tenant_id, $bank_transfer_id); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransfers'; + $request = $this->getBankTransferRequest($xero_tenant_id, $bank_transfer_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -22497,26 +23035,26 @@ function ($exception) { } /** - * Create request for operation 'getBankTransferAttachments' + * Create request for operation 'getBankTransfer' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getBankTransferAttachmentsRequest($xero_tenant_id, $bank_transfer_id) + protected function getBankTransferRequest($xero_tenant_id, $bank_transfer_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getBankTransferAttachments' + 'Missing the required parameter $xero_tenant_id when calling getBankTransfer' ); } // verify the required parameter 'bank_transfer_id' is set if ($bank_transfer_id === null || (is_array($bank_transfer_id) && count($bank_transfer_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $bank_transfer_id when calling getBankTransferAttachments' + 'Missing the required parameter $bank_transfer_id when calling getBankTransfer' ); } - $resourcePath = '/BankTransfers/{BankTransferID}/Attachments'; + $resourcePath = '/BankTransfers/{BankTransferID}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -22595,31 +23133,35 @@ protected function getBankTransferAttachmentsRequest($xero_tenant_id, $bank_tran } /** - * Operation getBankTransferHistory - * Retrieves history from a specific bank transfer using a unique bank transfer Id + * Operation getBankTransferAttachmentByFileName + * Retrieves a specific attachment on a specific bank transfer by file name * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) + * @param string $file_name Name of the attachment (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords + * @return \SplFileObject */ - public function getBankTransferHistory($xero_tenant_id, $bank_transfer_id) + public function getBankTransferAttachmentByFileName($xero_tenant_id, $bank_transfer_id, $file_name, $content_type) { - list($response) = $this->getBankTransferHistoryWithHttpInfo($xero_tenant_id, $bank_transfer_id); + list($response) = $this->getBankTransferAttachmentByFileNameWithHttpInfo($xero_tenant_id, $bank_transfer_id, $file_name, $content_type); return $response; } /** - * Operation getBankTransferHistoryWithHttpInfo - * Retrieves history from a specific bank transfer using a unique bank transfer Id + * Operation getBankTransferAttachmentByFileNameWithHttpInfo + * Retrieves a specific attachment on a specific bank transfer by file name * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) + * @param string $file_name Name of the attachment (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\Accounting\HistoryRecords, HTTP status code, HTTP response headers (array of strings) + * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) */ - public function getBankTransferHistoryWithHttpInfo($xero_tenant_id, $bank_transfer_id) + public function getBankTransferAttachmentByFileNameWithHttpInfo($xero_tenant_id, $bank_transfer_id, $file_name, $content_type) { - $request = $this->getBankTransferHistoryRequest($xero_tenant_id, $bank_transfer_id); + $request = $this->getBankTransferAttachmentByFileNameRequest($xero_tenant_id, $bank_transfer_id, $file_name, $content_type); try { $options = $this->createHttpClientOption(); try { @@ -22648,18 +23190,18 @@ public function getBankTransferHistoryWithHttpInfo($xero_tenant_id, $bank_transf $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords' === '\SplFileObject') { + if ('\SplFileObject' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords', []), + AccountingObjectSerializer::deserialize($content, '\SplFileObject', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords'; + $returnType = '\SplFileObject'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -22676,7 +23218,7 @@ public function getBankTransferHistoryWithHttpInfo($xero_tenant_id, $bank_transf case 200: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords', + '\SplFileObject', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -22686,16 +23228,18 @@ public function getBankTransferHistoryWithHttpInfo($xero_tenant_id, $bank_transf } } /** - * Operation getBankTransferHistoryAsync - * Retrieves history from a specific bank transfer using a unique bank transfer Id + * Operation getBankTransferAttachmentByFileNameAsync + * Retrieves a specific attachment on a specific bank transfer by file name * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) + * @param string $file_name Name of the attachment (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBankTransferHistoryAsync($xero_tenant_id, $bank_transfer_id) + public function getBankTransferAttachmentByFileNameAsync($xero_tenant_id, $bank_transfer_id, $file_name, $content_type) { - return $this->getBankTransferHistoryAsyncWithHttpInfo($xero_tenant_id, $bank_transfer_id) + return $this->getBankTransferAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $bank_transfer_id, $file_name, $content_type) ->then( function ($response) { return $response[0]; @@ -22703,16 +23247,18 @@ function ($response) { ); } /** - * Operation getBankTransferHistoryAsyncWithHttpInfo - * Retrieves history from a specific bank transfer using a unique bank transfer Id + * Operation getBankTransferAttachmentByFileNameAsyncWithHttpInfo + * Retrieves a specific attachment on a specific bank transfer by file name * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) + * @param string $file_name Name of the attachment (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBankTransferHistoryAsyncWithHttpInfo($xero_tenant_id, $bank_transfer_id) + public function getBankTransferAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $bank_transfer_id, $file_name, $content_type) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords'; - $request = $this->getBankTransferHistoryRequest($xero_tenant_id, $bank_transfer_id); + $returnType = '\SplFileObject'; + $request = $this->getBankTransferAttachmentByFileNameRequest($xero_tenant_id, $bank_transfer_id, $file_name, $content_type); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -22747,26 +23293,40 @@ function ($exception) { } /** - * Create request for operation 'getBankTransferHistory' + * Create request for operation 'getBankTransferAttachmentByFileName' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) + * @param string $file_name Name of the attachment (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getBankTransferHistoryRequest($xero_tenant_id, $bank_transfer_id) + protected function getBankTransferAttachmentByFileNameRequest($xero_tenant_id, $bank_transfer_id, $file_name, $content_type) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getBankTransferHistory' + 'Missing the required parameter $xero_tenant_id when calling getBankTransferAttachmentByFileName' ); } // verify the required parameter 'bank_transfer_id' is set if ($bank_transfer_id === null || (is_array($bank_transfer_id) && count($bank_transfer_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $bank_transfer_id when calling getBankTransferHistory' + 'Missing the required parameter $bank_transfer_id when calling getBankTransferAttachmentByFileName' ); } - $resourcePath = '/BankTransfers/{BankTransferID}/History'; + // verify the required parameter 'file_name' is set + if ($file_name === null || (is_array($file_name) && count($file_name) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $file_name when calling getBankTransferAttachmentByFileName' + ); + } + // verify the required parameter 'content_type' is set + if ($content_type === null || (is_array($content_type) && count($content_type) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $content_type when calling getBankTransferAttachmentByFileName' + ); + } + $resourcePath = '/BankTransfers/{BankTransferID}/Attachments/{FileName}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -22776,6 +23336,10 @@ protected function getBankTransferHistoryRequest($xero_tenant_id, $bank_transfer if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($content_type !== null) { + $headerParams['contentType'] = AccountingObjectSerializer::toHeaderValue($content_type); + } // path params if ($bank_transfer_id !== null) { $resourcePath = str_replace( @@ -22784,15 +23348,23 @@ protected function getBankTransferHistoryRequest($xero_tenant_id, $bank_transfer $resourcePath ); } + // path params + if ($file_name !== null) { + $resourcePath = str_replace( + '{' . 'FileName' . '}', + AccountingObjectSerializer::toPathValue($file_name), + $resourcePath + ); + } // body params $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/octet-stream'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/octet-stream'], [] ); } @@ -22845,35 +23417,35 @@ protected function getBankTransferHistoryRequest($xero_tenant_id, $bank_transfer } /** - * Operation getBankTransfers - * Retrieves all bank transfers + * Operation getBankTransferAttachmentById + * Retrieves a specific attachment from a specific bank transfer using a unique attachment ID * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) - * @param string $where Filter by an any element (optional) - * @param string $order Order by an any element (optional) + * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) + * @param string $attachment_id Unique identifier for Attachment object (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransfers + * @return \SplFileObject */ - public function getBankTransfers($xero_tenant_id, $if_modified_since = null, $where = null, $order = null) + public function getBankTransferAttachmentById($xero_tenant_id, $bank_transfer_id, $attachment_id, $content_type) { - list($response) = $this->getBankTransfersWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order); + list($response) = $this->getBankTransferAttachmentByIdWithHttpInfo($xero_tenant_id, $bank_transfer_id, $attachment_id, $content_type); return $response; } /** - * Operation getBankTransfersWithHttpInfo - * Retrieves all bank transfers + * Operation getBankTransferAttachmentByIdWithHttpInfo + * Retrieves a specific attachment from a specific bank transfer using a unique attachment ID * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) - * @param string $where Filter by an any element (optional) - * @param string $order Order by an any element (optional) + * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) + * @param string $attachment_id Unique identifier for Attachment object (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\Accounting\BankTransfers, HTTP status code, HTTP response headers (array of strings) + * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) */ - public function getBankTransfersWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null) + public function getBankTransferAttachmentByIdWithHttpInfo($xero_tenant_id, $bank_transfer_id, $attachment_id, $content_type) { - $request = $this->getBankTransfersRequest($xero_tenant_id, $if_modified_since, $where, $order); + $request = $this->getBankTransferAttachmentByIdRequest($xero_tenant_id, $bank_transfer_id, $attachment_id, $content_type); try { $options = $this->createHttpClientOption(); try { @@ -22902,18 +23474,18 @@ public function getBankTransfersWithHttpInfo($xero_tenant_id, $if_modified_since $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransfers' === '\SplFileObject') { + if ('\SplFileObject' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransfers', []), + AccountingObjectSerializer::deserialize($content, '\SplFileObject', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransfers'; + $returnType = '\SplFileObject'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -22930,7 +23502,7 @@ public function getBankTransfersWithHttpInfo($xero_tenant_id, $if_modified_since case 200: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransfers', + '\SplFileObject', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -22940,18 +23512,18 @@ public function getBankTransfersWithHttpInfo($xero_tenant_id, $if_modified_since } } /** - * Operation getBankTransfersAsync - * Retrieves all bank transfers + * Operation getBankTransferAttachmentByIdAsync + * Retrieves a specific attachment from a specific bank transfer using a unique attachment ID * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) - * @param string $where Filter by an any element (optional) - * @param string $order Order by an any element (optional) + * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) + * @param string $attachment_id Unique identifier for Attachment object (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBankTransfersAsync($xero_tenant_id, $if_modified_since = null, $where = null, $order = null) + public function getBankTransferAttachmentByIdAsync($xero_tenant_id, $bank_transfer_id, $attachment_id, $content_type) { - return $this->getBankTransfersAsyncWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order) + return $this->getBankTransferAttachmentByIdAsyncWithHttpInfo($xero_tenant_id, $bank_transfer_id, $attachment_id, $content_type) ->then( function ($response) { return $response[0]; @@ -22959,18 +23531,18 @@ function ($response) { ); } /** - * Operation getBankTransfersAsyncWithHttpInfo - * Retrieves all bank transfers + * Operation getBankTransferAttachmentByIdAsyncWithHttpInfo + * Retrieves a specific attachment from a specific bank transfer using a unique attachment ID * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) - * @param string $where Filter by an any element (optional) - * @param string $order Order by an any element (optional) + * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) + * @param string $attachment_id Unique identifier for Attachment object (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBankTransfersAsyncWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null) + public function getBankTransferAttachmentByIdAsyncWithHttpInfo($xero_tenant_id, $bank_transfer_id, $attachment_id, $content_type) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransfers'; - $request = $this->getBankTransfersRequest($xero_tenant_id, $if_modified_since, $where, $order); + $returnType = '\SplFileObject'; + $request = $this->getBankTransferAttachmentByIdRequest($xero_tenant_id, $bank_transfer_id, $attachment_id, $content_type); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -23005,52 +23577,78 @@ function ($exception) { } /** - * Create request for operation 'getBankTransfers' + * Create request for operation 'getBankTransferAttachmentById' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) - * @param string $where Filter by an any element (optional) - * @param string $order Order by an any element (optional) + * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) + * @param string $attachment_id Unique identifier for Attachment object (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getBankTransfersRequest($xero_tenant_id, $if_modified_since = null, $where = null, $order = null) + protected function getBankTransferAttachmentByIdRequest($xero_tenant_id, $bank_transfer_id, $attachment_id, $content_type) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getBankTransfers' + 'Missing the required parameter $xero_tenant_id when calling getBankTransferAttachmentById' ); } - $resourcePath = '/BankTransfers'; + // verify the required parameter 'bank_transfer_id' is set + if ($bank_transfer_id === null || (is_array($bank_transfer_id) && count($bank_transfer_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $bank_transfer_id when calling getBankTransferAttachmentById' + ); + } + // verify the required parameter 'attachment_id' is set + if ($attachment_id === null || (is_array($attachment_id) && count($attachment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $attachment_id when calling getBankTransferAttachmentById' + ); + } + // verify the required parameter 'content_type' is set + if ($content_type === null || (is_array($content_type) && count($content_type) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $content_type when calling getBankTransferAttachmentById' + ); + } + $resourcePath = '/BankTransfers/{BankTransferID}/Attachments/{AttachmentID}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if ($where !== null) { - $queryParams['where'] = AccountingObjectSerializer::toQueryValue($where); - } - // query params - if ($order !== null) { - $queryParams['order'] = AccountingObjectSerializer::toQueryValue($order); - } // header params if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } // header params - if ($if_modified_since !== null) { - $headerParams['If-Modified-Since'] = AccountingObjectSerializer::toHeaderValue($if_modified_since); + if ($content_type !== null) { + $headerParams['contentType'] = AccountingObjectSerializer::toHeaderValue($content_type); + } + // path params + if ($bank_transfer_id !== null) { + $resourcePath = str_replace( + '{' . 'BankTransferID' . '}', + AccountingObjectSerializer::toPathValue($bank_transfer_id), + $resourcePath + ); + } + // path params + if ($attachment_id !== null) { + $resourcePath = str_replace( + '{' . 'AttachmentID' . '}', + AccountingObjectSerializer::toPathValue($attachment_id), + $resourcePath + ); } // body params $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/octet-stream'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/octet-stream'], [] ); } @@ -23103,31 +23701,31 @@ protected function getBankTransfersRequest($xero_tenant_id, $if_modified_since = } /** - * Operation getBatchPayment - * Retrieves a specific batch payment using a unique batch payment Id + * Operation getBankTransferAttachments + * Retrieves attachments from a specific bank transfer * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $batch_payment_id Unique identifier for BatchPayment (required) + * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayments + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments */ - public function getBatchPayment($xero_tenant_id, $batch_payment_id) + public function getBankTransferAttachments($xero_tenant_id, $bank_transfer_id) { - list($response) = $this->getBatchPaymentWithHttpInfo($xero_tenant_id, $batch_payment_id); + list($response) = $this->getBankTransferAttachmentsWithHttpInfo($xero_tenant_id, $bank_transfer_id); return $response; } /** - * Operation getBatchPaymentWithHttpInfo - * Retrieves a specific batch payment using a unique batch payment Id + * Operation getBankTransferAttachmentsWithHttpInfo + * Retrieves attachments from a specific bank transfer * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $batch_payment_id Unique identifier for BatchPayment (required) + * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\Accounting\BatchPayments, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\Accounting\Attachments, HTTP status code, HTTP response headers (array of strings) */ - public function getBatchPaymentWithHttpInfo($xero_tenant_id, $batch_payment_id) + public function getBankTransferAttachmentsWithHttpInfo($xero_tenant_id, $bank_transfer_id) { - $request = $this->getBatchPaymentRequest($xero_tenant_id, $batch_payment_id); + $request = $this->getBankTransferAttachmentsRequest($xero_tenant_id, $bank_transfer_id); try { $options = $this->createHttpClientOption(); try { @@ -23156,18 +23754,18 @@ public function getBatchPaymentWithHttpInfo($xero_tenant_id, $batch_payment_id) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayments' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayments', []), + AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayments'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -23184,7 +23782,7 @@ public function getBatchPaymentWithHttpInfo($xero_tenant_id, $batch_payment_id) case 200: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayments', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -23194,16 +23792,16 @@ public function getBatchPaymentWithHttpInfo($xero_tenant_id, $batch_payment_id) } } /** - * Operation getBatchPaymentAsync - * Retrieves a specific batch payment using a unique batch payment Id + * Operation getBankTransferAttachmentsAsync + * Retrieves attachments from a specific bank transfer * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $batch_payment_id Unique identifier for BatchPayment (required) + * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBatchPaymentAsync($xero_tenant_id, $batch_payment_id) + public function getBankTransferAttachmentsAsync($xero_tenant_id, $bank_transfer_id) { - return $this->getBatchPaymentAsyncWithHttpInfo($xero_tenant_id, $batch_payment_id) + return $this->getBankTransferAttachmentsAsyncWithHttpInfo($xero_tenant_id, $bank_transfer_id) ->then( function ($response) { return $response[0]; @@ -23211,16 +23809,16 @@ function ($response) { ); } /** - * Operation getBatchPaymentAsyncWithHttpInfo - * Retrieves a specific batch payment using a unique batch payment Id + * Operation getBankTransferAttachmentsAsyncWithHttpInfo + * Retrieves attachments from a specific bank transfer * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $batch_payment_id Unique identifier for BatchPayment (required) + * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBatchPaymentAsyncWithHttpInfo($xero_tenant_id, $batch_payment_id) + public function getBankTransferAttachmentsAsyncWithHttpInfo($xero_tenant_id, $bank_transfer_id) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayments'; - $request = $this->getBatchPaymentRequest($xero_tenant_id, $batch_payment_id); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; + $request = $this->getBankTransferAttachmentsRequest($xero_tenant_id, $bank_transfer_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -23255,26 +23853,26 @@ function ($exception) { } /** - * Create request for operation 'getBatchPayment' + * Create request for operation 'getBankTransferAttachments' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $batch_payment_id Unique identifier for BatchPayment (required) + * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getBatchPaymentRequest($xero_tenant_id, $batch_payment_id) + protected function getBankTransferAttachmentsRequest($xero_tenant_id, $bank_transfer_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getBatchPayment' + 'Missing the required parameter $xero_tenant_id when calling getBankTransferAttachments' ); } - // verify the required parameter 'batch_payment_id' is set - if ($batch_payment_id === null || (is_array($batch_payment_id) && count($batch_payment_id) === 0)) { + // verify the required parameter 'bank_transfer_id' is set + if ($bank_transfer_id === null || (is_array($bank_transfer_id) && count($bank_transfer_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $batch_payment_id when calling getBatchPayment' + 'Missing the required parameter $bank_transfer_id when calling getBankTransferAttachments' ); } - $resourcePath = '/BatchPayments/{BatchPaymentID}'; + $resourcePath = '/BankTransfers/{BankTransferID}/Attachments'; $formParams = []; $queryParams = []; $headerParams = []; @@ -23285,10 +23883,10 @@ protected function getBatchPaymentRequest($xero_tenant_id, $batch_payment_id) $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } // path params - if ($batch_payment_id !== null) { + if ($bank_transfer_id !== null) { $resourcePath = str_replace( - '{' . 'BatchPaymentID' . '}', - AccountingObjectSerializer::toPathValue($batch_payment_id), + '{' . 'BankTransferID' . '}', + AccountingObjectSerializer::toPathValue($bank_transfer_id), $resourcePath ); } @@ -23353,31 +23951,31 @@ protected function getBatchPaymentRequest($xero_tenant_id, $batch_payment_id) } /** - * Operation getBatchPaymentHistory - * Retrieves history from a specific batch payment + * Operation getBankTransferHistory + * Retrieves history from a specific bank transfer using a unique bank transfer Id * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $batch_payment_id Unique identifier for BatchPayment (required) + * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords */ - public function getBatchPaymentHistory($xero_tenant_id, $batch_payment_id) + public function getBankTransferHistory($xero_tenant_id, $bank_transfer_id) { - list($response) = $this->getBatchPaymentHistoryWithHttpInfo($xero_tenant_id, $batch_payment_id); + list($response) = $this->getBankTransferHistoryWithHttpInfo($xero_tenant_id, $bank_transfer_id); return $response; } /** - * Operation getBatchPaymentHistoryWithHttpInfo - * Retrieves history from a specific batch payment + * Operation getBankTransferHistoryWithHttpInfo + * Retrieves history from a specific bank transfer using a unique bank transfer Id * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $batch_payment_id Unique identifier for BatchPayment (required) + * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\HistoryRecords, HTTP status code, HTTP response headers (array of strings) */ - public function getBatchPaymentHistoryWithHttpInfo($xero_tenant_id, $batch_payment_id) + public function getBankTransferHistoryWithHttpInfo($xero_tenant_id, $bank_transfer_id) { - $request = $this->getBatchPaymentHistoryRequest($xero_tenant_id, $batch_payment_id); + $request = $this->getBankTransferHistoryRequest($xero_tenant_id, $bank_transfer_id); try { $options = $this->createHttpClientOption(); try { @@ -23444,16 +24042,16 @@ public function getBatchPaymentHistoryWithHttpInfo($xero_tenant_id, $batch_payme } } /** - * Operation getBatchPaymentHistoryAsync - * Retrieves history from a specific batch payment + * Operation getBankTransferHistoryAsync + * Retrieves history from a specific bank transfer using a unique bank transfer Id * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $batch_payment_id Unique identifier for BatchPayment (required) + * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBatchPaymentHistoryAsync($xero_tenant_id, $batch_payment_id) + public function getBankTransferHistoryAsync($xero_tenant_id, $bank_transfer_id) { - return $this->getBatchPaymentHistoryAsyncWithHttpInfo($xero_tenant_id, $batch_payment_id) + return $this->getBankTransferHistoryAsyncWithHttpInfo($xero_tenant_id, $bank_transfer_id) ->then( function ($response) { return $response[0]; @@ -23461,16 +24059,16 @@ function ($response) { ); } /** - * Operation getBatchPaymentHistoryAsyncWithHttpInfo - * Retrieves history from a specific batch payment + * Operation getBankTransferHistoryAsyncWithHttpInfo + * Retrieves history from a specific bank transfer using a unique bank transfer Id * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $batch_payment_id Unique identifier for BatchPayment (required) + * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBatchPaymentHistoryAsyncWithHttpInfo($xero_tenant_id, $batch_payment_id) + public function getBankTransferHistoryAsyncWithHttpInfo($xero_tenant_id, $bank_transfer_id) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords'; - $request = $this->getBatchPaymentHistoryRequest($xero_tenant_id, $batch_payment_id); + $request = $this->getBankTransferHistoryRequest($xero_tenant_id, $bank_transfer_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -23505,26 +24103,26 @@ function ($exception) { } /** - * Create request for operation 'getBatchPaymentHistory' + * Create request for operation 'getBankTransferHistory' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $batch_payment_id Unique identifier for BatchPayment (required) + * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getBatchPaymentHistoryRequest($xero_tenant_id, $batch_payment_id) + protected function getBankTransferHistoryRequest($xero_tenant_id, $bank_transfer_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getBatchPaymentHistory' + 'Missing the required parameter $xero_tenant_id when calling getBankTransferHistory' ); } - // verify the required parameter 'batch_payment_id' is set - if ($batch_payment_id === null || (is_array($batch_payment_id) && count($batch_payment_id) === 0)) { + // verify the required parameter 'bank_transfer_id' is set + if ($bank_transfer_id === null || (is_array($bank_transfer_id) && count($bank_transfer_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $batch_payment_id when calling getBatchPaymentHistory' + 'Missing the required parameter $bank_transfer_id when calling getBankTransferHistory' ); } - $resourcePath = '/BatchPayments/{BatchPaymentID}/History'; + $resourcePath = '/BankTransfers/{BankTransferID}/History'; $formParams = []; $queryParams = []; $headerParams = []; @@ -23535,10 +24133,10 @@ protected function getBatchPaymentHistoryRequest($xero_tenant_id, $batch_payment $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } // path params - if ($batch_payment_id !== null) { + if ($bank_transfer_id !== null) { $resourcePath = str_replace( - '{' . 'BatchPaymentID' . '}', - AccountingObjectSerializer::toPathValue($batch_payment_id), + '{' . 'BankTransferID' . '}', + AccountingObjectSerializer::toPathValue($bank_transfer_id), $resourcePath ); } @@ -23603,35 +24201,35 @@ protected function getBatchPaymentHistoryRequest($xero_tenant_id, $batch_payment } /** - * Operation getBatchPayments - * Retrieves either one or many batch payments for invoices + * Operation getBankTransfers + * Retrieves all bank transfers * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) * @param string $where Filter by an any element (optional) * @param string $order Order by an any element (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayments + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransfers */ - public function getBatchPayments($xero_tenant_id, $if_modified_since = null, $where = null, $order = null) + public function getBankTransfers($xero_tenant_id, $if_modified_since = null, $where = null, $order = null) { - list($response) = $this->getBatchPaymentsWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order); + list($response) = $this->getBankTransfersWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order); return $response; } /** - * Operation getBatchPaymentsWithHttpInfo - * Retrieves either one or many batch payments for invoices + * Operation getBankTransfersWithHttpInfo + * Retrieves all bank transfers * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) * @param string $where Filter by an any element (optional) * @param string $order Order by an any element (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\Accounting\BatchPayments, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\Accounting\BankTransfers, HTTP status code, HTTP response headers (array of strings) */ - public function getBatchPaymentsWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null) + public function getBankTransfersWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null) { - $request = $this->getBatchPaymentsRequest($xero_tenant_id, $if_modified_since, $where, $order); + $request = $this->getBankTransfersRequest($xero_tenant_id, $if_modified_since, $where, $order); try { $options = $this->createHttpClientOption(); try { @@ -23660,18 +24258,18 @@ public function getBatchPaymentsWithHttpInfo($xero_tenant_id, $if_modified_since $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayments' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransfers' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayments', []), + AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransfers', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayments'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransfers'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -23688,7 +24286,7 @@ public function getBatchPaymentsWithHttpInfo($xero_tenant_id, $if_modified_since case 200: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayments', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransfers', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -23698,8 +24296,8 @@ public function getBatchPaymentsWithHttpInfo($xero_tenant_id, $if_modified_since } } /** - * Operation getBatchPaymentsAsync - * Retrieves either one or many batch payments for invoices + * Operation getBankTransfersAsync + * Retrieves all bank transfers * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) * @param string $where Filter by an any element (optional) @@ -23707,9 +24305,9 @@ public function getBatchPaymentsWithHttpInfo($xero_tenant_id, $if_modified_since * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBatchPaymentsAsync($xero_tenant_id, $if_modified_since = null, $where = null, $order = null) + public function getBankTransfersAsync($xero_tenant_id, $if_modified_since = null, $where = null, $order = null) { - return $this->getBatchPaymentsAsyncWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order) + return $this->getBankTransfersAsyncWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order) ->then( function ($response) { return $response[0]; @@ -23717,18 +24315,18 @@ function ($response) { ); } /** - * Operation getBatchPaymentsAsyncWithHttpInfo - * Retrieves either one or many batch payments for invoices + * Operation getBankTransfersAsyncWithHttpInfo + * Retrieves all bank transfers * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) * @param string $where Filter by an any element (optional) * @param string $order Order by an any element (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBatchPaymentsAsyncWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null) + public function getBankTransfersAsyncWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayments'; - $request = $this->getBatchPaymentsRequest($xero_tenant_id, $if_modified_since, $where, $order); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransfers'; + $request = $this->getBankTransfersRequest($xero_tenant_id, $if_modified_since, $where, $order); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -23763,22 +24361,22 @@ function ($exception) { } /** - * Create request for operation 'getBatchPayments' + * Create request for operation 'getBankTransfers' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) * @param string $where Filter by an any element (optional) * @param string $order Order by an any element (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getBatchPaymentsRequest($xero_tenant_id, $if_modified_since = null, $where = null, $order = null) + protected function getBankTransfersRequest($xero_tenant_id, $if_modified_since = null, $where = null, $order = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getBatchPayments' + 'Missing the required parameter $xero_tenant_id when calling getBankTransfers' ); } - $resourcePath = '/BatchPayments'; + $resourcePath = '/BankTransfers'; $formParams = []; $queryParams = []; $headerParams = []; @@ -23861,31 +24459,31 @@ protected function getBatchPaymentsRequest($xero_tenant_id, $if_modified_since = } /** - * Operation getBrandingTheme - * Retrieves a specific branding theme using a unique branding theme Id + * Operation getBatchPayment + * Retrieves a specific batch payment using a unique batch payment Id * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $branding_theme_id Unique identifier for a Branding Theme (required) + * @param string $batch_payment_id Unique identifier for BatchPayment (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BrandingThemes + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayments */ - public function getBrandingTheme($xero_tenant_id, $branding_theme_id) + public function getBatchPayment($xero_tenant_id, $batch_payment_id) { - list($response) = $this->getBrandingThemeWithHttpInfo($xero_tenant_id, $branding_theme_id); + list($response) = $this->getBatchPaymentWithHttpInfo($xero_tenant_id, $batch_payment_id); return $response; } /** - * Operation getBrandingThemeWithHttpInfo - * Retrieves a specific branding theme using a unique branding theme Id + * Operation getBatchPaymentWithHttpInfo + * Retrieves a specific batch payment using a unique batch payment Id * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $branding_theme_id Unique identifier for a Branding Theme (required) + * @param string $batch_payment_id Unique identifier for BatchPayment (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\Accounting\BrandingThemes, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\Accounting\BatchPayments, HTTP status code, HTTP response headers (array of strings) */ - public function getBrandingThemeWithHttpInfo($xero_tenant_id, $branding_theme_id) + public function getBatchPaymentWithHttpInfo($xero_tenant_id, $batch_payment_id) { - $request = $this->getBrandingThemeRequest($xero_tenant_id, $branding_theme_id); + $request = $this->getBatchPaymentRequest($xero_tenant_id, $batch_payment_id); try { $options = $this->createHttpClientOption(); try { @@ -23914,18 +24512,18 @@ public function getBrandingThemeWithHttpInfo($xero_tenant_id, $branding_theme_id $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BrandingThemes' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayments' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BrandingThemes', []), + AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayments', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BrandingThemes'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayments'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -23942,7 +24540,7 @@ public function getBrandingThemeWithHttpInfo($xero_tenant_id, $branding_theme_id case 200: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BrandingThemes', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayments', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -23952,16 +24550,16 @@ public function getBrandingThemeWithHttpInfo($xero_tenant_id, $branding_theme_id } } /** - * Operation getBrandingThemeAsync - * Retrieves a specific branding theme using a unique branding theme Id + * Operation getBatchPaymentAsync + * Retrieves a specific batch payment using a unique batch payment Id * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $branding_theme_id Unique identifier for a Branding Theme (required) + * @param string $batch_payment_id Unique identifier for BatchPayment (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBrandingThemeAsync($xero_tenant_id, $branding_theme_id) + public function getBatchPaymentAsync($xero_tenant_id, $batch_payment_id) { - return $this->getBrandingThemeAsyncWithHttpInfo($xero_tenant_id, $branding_theme_id) + return $this->getBatchPaymentAsyncWithHttpInfo($xero_tenant_id, $batch_payment_id) ->then( function ($response) { return $response[0]; @@ -23969,16 +24567,16 @@ function ($response) { ); } /** - * Operation getBrandingThemeAsyncWithHttpInfo - * Retrieves a specific branding theme using a unique branding theme Id + * Operation getBatchPaymentAsyncWithHttpInfo + * Retrieves a specific batch payment using a unique batch payment Id * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $branding_theme_id Unique identifier for a Branding Theme (required) + * @param string $batch_payment_id Unique identifier for BatchPayment (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBrandingThemeAsyncWithHttpInfo($xero_tenant_id, $branding_theme_id) + public function getBatchPaymentAsyncWithHttpInfo($xero_tenant_id, $batch_payment_id) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BrandingThemes'; - $request = $this->getBrandingThemeRequest($xero_tenant_id, $branding_theme_id); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayments'; + $request = $this->getBatchPaymentRequest($xero_tenant_id, $batch_payment_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -24013,26 +24611,26 @@ function ($exception) { } /** - * Create request for operation 'getBrandingTheme' + * Create request for operation 'getBatchPayment' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $branding_theme_id Unique identifier for a Branding Theme (required) + * @param string $batch_payment_id Unique identifier for BatchPayment (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getBrandingThemeRequest($xero_tenant_id, $branding_theme_id) + protected function getBatchPaymentRequest($xero_tenant_id, $batch_payment_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getBrandingTheme' + 'Missing the required parameter $xero_tenant_id when calling getBatchPayment' ); } - // verify the required parameter 'branding_theme_id' is set - if ($branding_theme_id === null || (is_array($branding_theme_id) && count($branding_theme_id) === 0)) { + // verify the required parameter 'batch_payment_id' is set + if ($batch_payment_id === null || (is_array($batch_payment_id) && count($batch_payment_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $branding_theme_id when calling getBrandingTheme' + 'Missing the required parameter $batch_payment_id when calling getBatchPayment' ); } - $resourcePath = '/BrandingThemes/{BrandingThemeID}'; + $resourcePath = '/BatchPayments/{BatchPaymentID}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -24043,10 +24641,10 @@ protected function getBrandingThemeRequest($xero_tenant_id, $branding_theme_id) $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } // path params - if ($branding_theme_id !== null) { + if ($batch_payment_id !== null) { $resourcePath = str_replace( - '{' . 'BrandingThemeID' . '}', - AccountingObjectSerializer::toPathValue($branding_theme_id), + '{' . 'BatchPaymentID' . '}', + AccountingObjectSerializer::toPathValue($batch_payment_id), $resourcePath ); } @@ -24111,31 +24709,31 @@ protected function getBrandingThemeRequest($xero_tenant_id, $branding_theme_id) } /** - * Operation getBrandingThemePaymentServices - * Retrieves the payment services for a specific branding theme + * Operation getBatchPaymentHistory + * Retrieves history from a specific batch payment * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $branding_theme_id Unique identifier for a Branding Theme (required) + * @param string $batch_payment_id Unique identifier for BatchPayment (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentServices + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords */ - public function getBrandingThemePaymentServices($xero_tenant_id, $branding_theme_id) + public function getBatchPaymentHistory($xero_tenant_id, $batch_payment_id) { - list($response) = $this->getBrandingThemePaymentServicesWithHttpInfo($xero_tenant_id, $branding_theme_id); + list($response) = $this->getBatchPaymentHistoryWithHttpInfo($xero_tenant_id, $batch_payment_id); return $response; } /** - * Operation getBrandingThemePaymentServicesWithHttpInfo - * Retrieves the payment services for a specific branding theme + * Operation getBatchPaymentHistoryWithHttpInfo + * Retrieves history from a specific batch payment * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $branding_theme_id Unique identifier for a Branding Theme (required) + * @param string $batch_payment_id Unique identifier for BatchPayment (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\Accounting\PaymentServices, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\Accounting\HistoryRecords, HTTP status code, HTTP response headers (array of strings) */ - public function getBrandingThemePaymentServicesWithHttpInfo($xero_tenant_id, $branding_theme_id) + public function getBatchPaymentHistoryWithHttpInfo($xero_tenant_id, $batch_payment_id) { - $request = $this->getBrandingThemePaymentServicesRequest($xero_tenant_id, $branding_theme_id); + $request = $this->getBatchPaymentHistoryRequest($xero_tenant_id, $batch_payment_id); try { $options = $this->createHttpClientOption(); try { @@ -24164,18 +24762,18 @@ public function getBrandingThemePaymentServicesWithHttpInfo($xero_tenant_id, $br $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentServices' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentServices', []), + AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentServices'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -24192,7 +24790,7 @@ public function getBrandingThemePaymentServicesWithHttpInfo($xero_tenant_id, $br case 200: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentServices', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -24202,16 +24800,16 @@ public function getBrandingThemePaymentServicesWithHttpInfo($xero_tenant_id, $br } } /** - * Operation getBrandingThemePaymentServicesAsync - * Retrieves the payment services for a specific branding theme + * Operation getBatchPaymentHistoryAsync + * Retrieves history from a specific batch payment * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $branding_theme_id Unique identifier for a Branding Theme (required) + * @param string $batch_payment_id Unique identifier for BatchPayment (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBrandingThemePaymentServicesAsync($xero_tenant_id, $branding_theme_id) + public function getBatchPaymentHistoryAsync($xero_tenant_id, $batch_payment_id) { - return $this->getBrandingThemePaymentServicesAsyncWithHttpInfo($xero_tenant_id, $branding_theme_id) + return $this->getBatchPaymentHistoryAsyncWithHttpInfo($xero_tenant_id, $batch_payment_id) ->then( function ($response) { return $response[0]; @@ -24219,16 +24817,16 @@ function ($response) { ); } /** - * Operation getBrandingThemePaymentServicesAsyncWithHttpInfo - * Retrieves the payment services for a specific branding theme + * Operation getBatchPaymentHistoryAsyncWithHttpInfo + * Retrieves history from a specific batch payment * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $branding_theme_id Unique identifier for a Branding Theme (required) + * @param string $batch_payment_id Unique identifier for BatchPayment (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBrandingThemePaymentServicesAsyncWithHttpInfo($xero_tenant_id, $branding_theme_id) + public function getBatchPaymentHistoryAsyncWithHttpInfo($xero_tenant_id, $batch_payment_id) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentServices'; - $request = $this->getBrandingThemePaymentServicesRequest($xero_tenant_id, $branding_theme_id); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\HistoryRecords'; + $request = $this->getBatchPaymentHistoryRequest($xero_tenant_id, $batch_payment_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -24263,26 +24861,26 @@ function ($exception) { } /** - * Create request for operation 'getBrandingThemePaymentServices' + * Create request for operation 'getBatchPaymentHistory' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $branding_theme_id Unique identifier for a Branding Theme (required) + * @param string $batch_payment_id Unique identifier for BatchPayment (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getBrandingThemePaymentServicesRequest($xero_tenant_id, $branding_theme_id) + protected function getBatchPaymentHistoryRequest($xero_tenant_id, $batch_payment_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getBrandingThemePaymentServices' + 'Missing the required parameter $xero_tenant_id when calling getBatchPaymentHistory' ); } - // verify the required parameter 'branding_theme_id' is set - if ($branding_theme_id === null || (is_array($branding_theme_id) && count($branding_theme_id) === 0)) { + // verify the required parameter 'batch_payment_id' is set + if ($batch_payment_id === null || (is_array($batch_payment_id) && count($batch_payment_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $branding_theme_id when calling getBrandingThemePaymentServices' + 'Missing the required parameter $batch_payment_id when calling getBatchPaymentHistory' ); } - $resourcePath = '/BrandingThemes/{BrandingThemeID}/PaymentServices'; + $resourcePath = '/BatchPayments/{BatchPaymentID}/History'; $formParams = []; $queryParams = []; $headerParams = []; @@ -24293,10 +24891,10 @@ protected function getBrandingThemePaymentServicesRequest($xero_tenant_id, $bran $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } // path params - if ($branding_theme_id !== null) { + if ($batch_payment_id !== null) { $resourcePath = str_replace( - '{' . 'BrandingThemeID' . '}', - AccountingObjectSerializer::toPathValue($branding_theme_id), + '{' . 'BatchPaymentID' . '}', + AccountingObjectSerializer::toPathValue($batch_payment_id), $resourcePath ); } @@ -24361,29 +24959,35 @@ protected function getBrandingThemePaymentServicesRequest($xero_tenant_id, $bran } /** - * Operation getBrandingThemes - * Retrieves all the branding themes + * Operation getBatchPayments + * Retrieves either one or many batch payments for invoices * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) + * @param string $where Filter by an any element (optional) + * @param string $order Order by an any element (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BrandingThemes + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayments */ - public function getBrandingThemes($xero_tenant_id) + public function getBatchPayments($xero_tenant_id, $if_modified_since = null, $where = null, $order = null) { - list($response) = $this->getBrandingThemesWithHttpInfo($xero_tenant_id); + list($response) = $this->getBatchPaymentsWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order); return $response; } /** - * Operation getBrandingThemesWithHttpInfo - * Retrieves all the branding themes + * Operation getBatchPaymentsWithHttpInfo + * Retrieves either one or many batch payments for invoices * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) + * @param string $where Filter by an any element (optional) + * @param string $order Order by an any element (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\Accounting\BrandingThemes, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\Accounting\BatchPayments, HTTP status code, HTTP response headers (array of strings) */ - public function getBrandingThemesWithHttpInfo($xero_tenant_id) + public function getBatchPaymentsWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null) { - $request = $this->getBrandingThemesRequest($xero_tenant_id); + $request = $this->getBatchPaymentsRequest($xero_tenant_id, $if_modified_since, $where, $order); try { $options = $this->createHttpClientOption(); try { @@ -24412,18 +25016,18 @@ public function getBrandingThemesWithHttpInfo($xero_tenant_id) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BrandingThemes' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayments' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BrandingThemes', []), + AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayments', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BrandingThemes'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayments'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -24440,7 +25044,7 @@ public function getBrandingThemesWithHttpInfo($xero_tenant_id) case 200: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BrandingThemes', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayments', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -24450,15 +25054,18 @@ public function getBrandingThemesWithHttpInfo($xero_tenant_id) } } /** - * Operation getBrandingThemesAsync - * Retrieves all the branding themes + * Operation getBatchPaymentsAsync + * Retrieves either one or many batch payments for invoices * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) + * @param string $where Filter by an any element (optional) + * @param string $order Order by an any element (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBrandingThemesAsync($xero_tenant_id) + public function getBatchPaymentsAsync($xero_tenant_id, $if_modified_since = null, $where = null, $order = null) { - return $this->getBrandingThemesAsyncWithHttpInfo($xero_tenant_id) + return $this->getBatchPaymentsAsyncWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order) ->then( function ($response) { return $response[0]; @@ -24466,15 +25073,18 @@ function ($response) { ); } /** - * Operation getBrandingThemesAsyncWithHttpInfo - * Retrieves all the branding themes + * Operation getBatchPaymentsAsyncWithHttpInfo + * Retrieves either one or many batch payments for invoices * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) + * @param string $where Filter by an any element (optional) + * @param string $order Order by an any element (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBrandingThemesAsyncWithHttpInfo($xero_tenant_id) + public function getBatchPaymentsAsyncWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BrandingThemes'; - $request = $this->getBrandingThemesRequest($xero_tenant_id); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BatchPayments'; + $request = $this->getBatchPaymentsRequest($xero_tenant_id, $if_modified_since, $where, $order); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -24509,28 +25119,43 @@ function ($exception) { } /** - * Create request for operation 'getBrandingThemes' + * Create request for operation 'getBatchPayments' * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) + * @param string $where Filter by an any element (optional) + * @param string $order Order by an any element (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getBrandingThemesRequest($xero_tenant_id) + protected function getBatchPaymentsRequest($xero_tenant_id, $if_modified_since = null, $where = null, $order = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getBrandingThemes' + 'Missing the required parameter $xero_tenant_id when calling getBatchPayments' ); } - $resourcePath = '/BrandingThemes'; + $resourcePath = '/BatchPayments'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if ($where !== null) { + $queryParams['where'] = AccountingObjectSerializer::toQueryValue($where); + } + // query params + if ($order !== null) { + $queryParams['order'] = AccountingObjectSerializer::toQueryValue($order); + } // header params if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($if_modified_since !== null) { + $headerParams['If-Modified-Since'] = AccountingObjectSerializer::toHeaderValue($if_modified_since); + } // body params $_tempBody = null; if ($multipart) { @@ -24592,35 +25217,31 @@ protected function getBrandingThemesRequest($xero_tenant_id) } /** - * Operation getBudget - * Retrieves a specific budget, which includes budget lines + * Operation getBrandingTheme + * Retrieves a specific branding theme using a unique branding theme Id * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $budget_id Unique identifier for Budgets (required) - * @param \DateTime $date_to Filter by start date (optional) - * @param \DateTime $date_from Filter by end date (optional) + * @param string $branding_theme_id Unique identifier for a Branding Theme (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Budgets + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BrandingThemes */ - public function getBudget($xero_tenant_id, $budget_id, $date_to = null, $date_from = null) + public function getBrandingTheme($xero_tenant_id, $branding_theme_id) { - list($response) = $this->getBudgetWithHttpInfo($xero_tenant_id, $budget_id, $date_to, $date_from); + list($response) = $this->getBrandingThemeWithHttpInfo($xero_tenant_id, $branding_theme_id); return $response; } /** - * Operation getBudgetWithHttpInfo - * Retrieves a specific budget, which includes budget lines + * Operation getBrandingThemeWithHttpInfo + * Retrieves a specific branding theme using a unique branding theme Id * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $budget_id Unique identifier for Budgets (required) - * @param \DateTime $date_to Filter by start date (optional) - * @param \DateTime $date_from Filter by end date (optional) + * @param string $branding_theme_id Unique identifier for a Branding Theme (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\Accounting\Budgets, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\Accounting\BrandingThemes, HTTP status code, HTTP response headers (array of strings) */ - public function getBudgetWithHttpInfo($xero_tenant_id, $budget_id, $date_to = null, $date_from = null) + public function getBrandingThemeWithHttpInfo($xero_tenant_id, $branding_theme_id) { - $request = $this->getBudgetRequest($xero_tenant_id, $budget_id, $date_to, $date_from); + $request = $this->getBrandingThemeRequest($xero_tenant_id, $branding_theme_id); try { $options = $this->createHttpClientOption(); try { @@ -24649,18 +25270,18 @@ public function getBudgetWithHttpInfo($xero_tenant_id, $budget_id, $date_to = nu $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Budgets' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BrandingThemes' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Budgets', []), + AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BrandingThemes', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Budgets'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BrandingThemes'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -24677,7 +25298,7 @@ public function getBudgetWithHttpInfo($xero_tenant_id, $budget_id, $date_to = nu case 200: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Budgets', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BrandingThemes', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -24687,18 +25308,16 @@ public function getBudgetWithHttpInfo($xero_tenant_id, $budget_id, $date_to = nu } } /** - * Operation getBudgetAsync - * Retrieves a specific budget, which includes budget lines + * Operation getBrandingThemeAsync + * Retrieves a specific branding theme using a unique branding theme Id * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $budget_id Unique identifier for Budgets (required) - * @param \DateTime $date_to Filter by start date (optional) - * @param \DateTime $date_from Filter by end date (optional) + * @param string $branding_theme_id Unique identifier for a Branding Theme (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBudgetAsync($xero_tenant_id, $budget_id, $date_to = null, $date_from = null) + public function getBrandingThemeAsync($xero_tenant_id, $branding_theme_id) { - return $this->getBudgetAsyncWithHttpInfo($xero_tenant_id, $budget_id, $date_to, $date_from) + return $this->getBrandingThemeAsyncWithHttpInfo($xero_tenant_id, $branding_theme_id) ->then( function ($response) { return $response[0]; @@ -24706,18 +25325,16 @@ function ($response) { ); } /** - * Operation getBudgetAsyncWithHttpInfo - * Retrieves a specific budget, which includes budget lines + * Operation getBrandingThemeAsyncWithHttpInfo + * Retrieves a specific branding theme using a unique branding theme Id * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $budget_id Unique identifier for Budgets (required) - * @param \DateTime $date_to Filter by start date (optional) - * @param \DateTime $date_from Filter by end date (optional) + * @param string $branding_theme_id Unique identifier for a Branding Theme (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBudgetAsyncWithHttpInfo($xero_tenant_id, $budget_id, $date_to = null, $date_from = null) + public function getBrandingThemeAsyncWithHttpInfo($xero_tenant_id, $branding_theme_id) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Budgets'; - $request = $this->getBudgetRequest($xero_tenant_id, $budget_id, $date_to, $date_from); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BrandingThemes'; + $request = $this->getBrandingThemeRequest($xero_tenant_id, $branding_theme_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -24752,50 +25369,40 @@ function ($exception) { } /** - * Create request for operation 'getBudget' + * Create request for operation 'getBrandingTheme' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $budget_id Unique identifier for Budgets (required) - * @param \DateTime $date_to Filter by start date (optional) - * @param \DateTime $date_from Filter by end date (optional) + * @param string $branding_theme_id Unique identifier for a Branding Theme (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getBudgetRequest($xero_tenant_id, $budget_id, $date_to = null, $date_from = null) + protected function getBrandingThemeRequest($xero_tenant_id, $branding_theme_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getBudget' + 'Missing the required parameter $xero_tenant_id when calling getBrandingTheme' ); } - // verify the required parameter 'budget_id' is set - if ($budget_id === null || (is_array($budget_id) && count($budget_id) === 0)) { + // verify the required parameter 'branding_theme_id' is set + if ($branding_theme_id === null || (is_array($branding_theme_id) && count($branding_theme_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $budget_id when calling getBudget' + 'Missing the required parameter $branding_theme_id when calling getBrandingTheme' ); } - $resourcePath = '/Budgets/{BudgetID}'; + $resourcePath = '/BrandingThemes/{BrandingThemeID}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if ($date_to !== null) { - $queryParams['DateTo'] = AccountingObjectSerializer::toQueryValue($date_to); - } - // query params - if ($date_from !== null) { - $queryParams['DateFrom'] = AccountingObjectSerializer::toQueryValue($date_from); - } // header params if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } // path params - if ($budget_id !== null) { + if ($branding_theme_id !== null) { $resourcePath = str_replace( - '{' . 'BudgetID' . '}', - AccountingObjectSerializer::toPathValue($budget_id), + '{' . 'BrandingThemeID' . '}', + AccountingObjectSerializer::toPathValue($branding_theme_id), $resourcePath ); } @@ -24860,35 +25467,31 @@ protected function getBudgetRequest($xero_tenant_id, $budget_id, $date_to = null } /** - * Operation getBudgets - * Retrieve a list of budgets + * Operation getBrandingThemePaymentServices + * Retrieves the payment services for a specific branding theme * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string[] $ids Filter by BudgetID. Allows you to retrieve a specific individual budget. (optional) - * @param \DateTime $date_to Filter by start date (optional) - * @param \DateTime $date_from Filter by end date (optional) + * @param string $branding_theme_id Unique identifier for a Branding Theme (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Budgets + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentServices */ - public function getBudgets($xero_tenant_id, $ids = null, $date_to = null, $date_from = null) + public function getBrandingThemePaymentServices($xero_tenant_id, $branding_theme_id) { - list($response) = $this->getBudgetsWithHttpInfo($xero_tenant_id, $ids, $date_to, $date_from); + list($response) = $this->getBrandingThemePaymentServicesWithHttpInfo($xero_tenant_id, $branding_theme_id); return $response; } /** - * Operation getBudgetsWithHttpInfo - * Retrieve a list of budgets + * Operation getBrandingThemePaymentServicesWithHttpInfo + * Retrieves the payment services for a specific branding theme * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string[] $ids Filter by BudgetID. Allows you to retrieve a specific individual budget. (optional) - * @param \DateTime $date_to Filter by start date (optional) - * @param \DateTime $date_from Filter by end date (optional) + * @param string $branding_theme_id Unique identifier for a Branding Theme (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\Accounting\Budgets, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\Accounting\PaymentServices, HTTP status code, HTTP response headers (array of strings) */ - public function getBudgetsWithHttpInfo($xero_tenant_id, $ids = null, $date_to = null, $date_from = null) + public function getBrandingThemePaymentServicesWithHttpInfo($xero_tenant_id, $branding_theme_id) { - $request = $this->getBudgetsRequest($xero_tenant_id, $ids, $date_to, $date_from); + $request = $this->getBrandingThemePaymentServicesRequest($xero_tenant_id, $branding_theme_id); try { $options = $this->createHttpClientOption(); try { @@ -24917,18 +25520,18 @@ public function getBudgetsWithHttpInfo($xero_tenant_id, $ids = null, $date_to = $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Budgets' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentServices' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Budgets', []), + AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentServices', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Budgets'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentServices'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -24945,7 +25548,7 @@ public function getBudgetsWithHttpInfo($xero_tenant_id, $ids = null, $date_to = case 200: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Budgets', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentServices', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -24955,18 +25558,16 @@ public function getBudgetsWithHttpInfo($xero_tenant_id, $ids = null, $date_to = } } /** - * Operation getBudgetsAsync - * Retrieve a list of budgets + * Operation getBrandingThemePaymentServicesAsync + * Retrieves the payment services for a specific branding theme * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string[] $ids Filter by BudgetID. Allows you to retrieve a specific individual budget. (optional) - * @param \DateTime $date_to Filter by start date (optional) - * @param \DateTime $date_from Filter by end date (optional) + * @param string $branding_theme_id Unique identifier for a Branding Theme (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBudgetsAsync($xero_tenant_id, $ids = null, $date_to = null, $date_from = null) + public function getBrandingThemePaymentServicesAsync($xero_tenant_id, $branding_theme_id) { - return $this->getBudgetsAsyncWithHttpInfo($xero_tenant_id, $ids, $date_to, $date_from) + return $this->getBrandingThemePaymentServicesAsyncWithHttpInfo($xero_tenant_id, $branding_theme_id) ->then( function ($response) { return $response[0]; @@ -24974,18 +25575,16 @@ function ($response) { ); } /** - * Operation getBudgetsAsyncWithHttpInfo - * Retrieve a list of budgets + * Operation getBrandingThemePaymentServicesAsyncWithHttpInfo + * Retrieves the payment services for a specific branding theme * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string[] $ids Filter by BudgetID. Allows you to retrieve a specific individual budget. (optional) - * @param \DateTime $date_to Filter by start date (optional) - * @param \DateTime $date_from Filter by end date (optional) + * @param string $branding_theme_id Unique identifier for a Branding Theme (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getBudgetsAsyncWithHttpInfo($xero_tenant_id, $ids = null, $date_to = null, $date_from = null) + public function getBrandingThemePaymentServicesAsyncWithHttpInfo($xero_tenant_id, $branding_theme_id) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Budgets'; - $request = $this->getBudgetsRequest($xero_tenant_id, $ids, $date_to, $date_from); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PaymentServices'; + $request = $this->getBrandingThemePaymentServicesRequest($xero_tenant_id, $branding_theme_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -25020,46 +25619,43 @@ function ($exception) { } /** - * Create request for operation 'getBudgets' + * Create request for operation 'getBrandingThemePaymentServices' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string[] $ids Filter by BudgetID. Allows you to retrieve a specific individual budget. (optional) - * @param \DateTime $date_to Filter by start date (optional) - * @param \DateTime $date_from Filter by end date (optional) + * @param string $branding_theme_id Unique identifier for a Branding Theme (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getBudgetsRequest($xero_tenant_id, $ids = null, $date_to = null, $date_from = null) + protected function getBrandingThemePaymentServicesRequest($xero_tenant_id, $branding_theme_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getBudgets' + 'Missing the required parameter $xero_tenant_id when calling getBrandingThemePaymentServices' ); } - $resourcePath = '/Budgets'; + // verify the required parameter 'branding_theme_id' is set + if ($branding_theme_id === null || (is_array($branding_theme_id) && count($branding_theme_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $branding_theme_id when calling getBrandingThemePaymentServices' + ); + } + $resourcePath = '/BrandingThemes/{BrandingThemeID}/PaymentServices'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if (is_array($ids)) { - $ids = AccountingObjectSerializer::serializeCollection($ids, 'csv', true); - } - if ($ids !== null) { - $queryParams['IDs'] = AccountingObjectSerializer::toQueryValue($ids); - } - // query params - if ($date_to !== null) { - $queryParams['DateTo'] = AccountingObjectSerializer::toQueryValue($date_to); - } - // query params - if ($date_from !== null) { - $queryParams['DateFrom'] = AccountingObjectSerializer::toQueryValue($date_from); - } // header params if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // path params + if ($branding_theme_id !== null) { + $resourcePath = str_replace( + '{' . 'BrandingThemeID' . '}', + AccountingObjectSerializer::toPathValue($branding_theme_id), + $resourcePath + ); + } // body params $_tempBody = null; if ($multipart) { @@ -25121,31 +25717,29 @@ protected function getBudgetsRequest($xero_tenant_id, $ids = null, $date_to = nu } /** - * Operation getContact - * Retrieves a specific contacts in a Xero organisation using a unique contact Id + * Operation getBrandingThemes + * Retrieves all the branding themes * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $contact_id Unique identifier for a Contact (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BrandingThemes */ - public function getContact($xero_tenant_id, $contact_id) + public function getBrandingThemes($xero_tenant_id) { - list($response) = $this->getContactWithHttpInfo($xero_tenant_id, $contact_id); + list($response) = $this->getBrandingThemesWithHttpInfo($xero_tenant_id); return $response; } /** - * Operation getContactWithHttpInfo - * Retrieves a specific contacts in a Xero organisation using a unique contact Id + * Operation getBrandingThemesWithHttpInfo + * Retrieves all the branding themes * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $contact_id Unique identifier for a Contact (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\Accounting\Contacts, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\Accounting\BrandingThemes, HTTP status code, HTTP response headers (array of strings) */ - public function getContactWithHttpInfo($xero_tenant_id, $contact_id) + public function getBrandingThemesWithHttpInfo($xero_tenant_id) { - $request = $this->getContactRequest($xero_tenant_id, $contact_id); + $request = $this->getBrandingThemesRequest($xero_tenant_id); try { $options = $this->createHttpClientOption(); try { @@ -25174,18 +25768,18 @@ public function getContactWithHttpInfo($xero_tenant_id, $contact_id) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BrandingThemes' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts', []), + AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BrandingThemes', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BrandingThemes'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -25202,7 +25796,7 @@ public function getContactWithHttpInfo($xero_tenant_id, $contact_id) case 200: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BrandingThemes', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -25212,16 +25806,15 @@ public function getContactWithHttpInfo($xero_tenant_id, $contact_id) } } /** - * Operation getContactAsync - * Retrieves a specific contacts in a Xero organisation using a unique contact Id + * Operation getBrandingThemesAsync + * Retrieves all the branding themes * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $contact_id Unique identifier for a Contact (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getContactAsync($xero_tenant_id, $contact_id) + public function getBrandingThemesAsync($xero_tenant_id) { - return $this->getContactAsyncWithHttpInfo($xero_tenant_id, $contact_id) + return $this->getBrandingThemesAsyncWithHttpInfo($xero_tenant_id) ->then( function ($response) { return $response[0]; @@ -25229,16 +25822,15 @@ function ($response) { ); } /** - * Operation getContactAsyncWithHttpInfo - * Retrieves a specific contacts in a Xero organisation using a unique contact Id + * Operation getBrandingThemesAsyncWithHttpInfo + * Retrieves all the branding themes * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $contact_id Unique identifier for a Contact (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getContactAsyncWithHttpInfo($xero_tenant_id, $contact_id) + public function getBrandingThemesAsyncWithHttpInfo($xero_tenant_id) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts'; - $request = $this->getContactRequest($xero_tenant_id, $contact_id); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BrandingThemes'; + $request = $this->getBrandingThemesRequest($xero_tenant_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -25273,26 +25865,19 @@ function ($exception) { } /** - * Create request for operation 'getContact' + * Create request for operation 'getBrandingThemes' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $contact_id Unique identifier for a Contact (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getContactRequest($xero_tenant_id, $contact_id) + protected function getBrandingThemesRequest($xero_tenant_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getContact' - ); - } - // verify the required parameter 'contact_id' is set - if ($contact_id === null || (is_array($contact_id) && count($contact_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $contact_id when calling getContact' + 'Missing the required parameter $xero_tenant_id when calling getBrandingThemes' ); } - $resourcePath = '/Contacts/{ContactID}'; + $resourcePath = '/BrandingThemes'; $formParams = []; $queryParams = []; $headerParams = []; @@ -25302,14 +25887,6 @@ protected function getContactRequest($xero_tenant_id, $contact_id) if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } - // path params - if ($contact_id !== null) { - $resourcePath = str_replace( - '{' . 'ContactID' . '}', - AccountingObjectSerializer::toPathValue($contact_id), - $resourcePath - ); - } // body params $_tempBody = null; if ($multipart) { @@ -25371,35 +25948,35 @@ protected function getContactRequest($xero_tenant_id, $contact_id) } /** - * Operation getContactAttachmentByFileName - * Retrieves a specific attachment from a specific contact by file name + * Operation getBudget + * Retrieves a specific budget, which includes budget lines * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $contact_id Unique identifier for a Contact (required) - * @param string $file_name Name of the attachment (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param string $budget_id Unique identifier for Budgets (required) + * @param \DateTime $date_to Filter by start date (optional) + * @param \DateTime $date_from Filter by end date (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \SplFileObject + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Budgets */ - public function getContactAttachmentByFileName($xero_tenant_id, $contact_id, $file_name, $content_type) + public function getBudget($xero_tenant_id, $budget_id, $date_to = null, $date_from = null) { - list($response) = $this->getContactAttachmentByFileNameWithHttpInfo($xero_tenant_id, $contact_id, $file_name, $content_type); + list($response) = $this->getBudgetWithHttpInfo($xero_tenant_id, $budget_id, $date_to, $date_from); return $response; } /** - * Operation getContactAttachmentByFileNameWithHttpInfo - * Retrieves a specific attachment from a specific contact by file name + * Operation getBudgetWithHttpInfo + * Retrieves a specific budget, which includes budget lines * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $contact_id Unique identifier for a Contact (required) - * @param string $file_name Name of the attachment (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param string $budget_id Unique identifier for Budgets (required) + * @param \DateTime $date_to Filter by start date (optional) + * @param \DateTime $date_from Filter by end date (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\Accounting\Budgets, HTTP status code, HTTP response headers (array of strings) */ - public function getContactAttachmentByFileNameWithHttpInfo($xero_tenant_id, $contact_id, $file_name, $content_type) + public function getBudgetWithHttpInfo($xero_tenant_id, $budget_id, $date_to = null, $date_from = null) { - $request = $this->getContactAttachmentByFileNameRequest($xero_tenant_id, $contact_id, $file_name, $content_type); + $request = $this->getBudgetRequest($xero_tenant_id, $budget_id, $date_to, $date_from); try { $options = $this->createHttpClientOption(); try { @@ -25428,18 +26005,18 @@ public function getContactAttachmentByFileNameWithHttpInfo($xero_tenant_id, $con $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Budgets' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - AccountingObjectSerializer::deserialize($content, '\SplFileObject', []), + AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Budgets', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\SplFileObject'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Budgets'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -25456,7 +26033,7 @@ public function getContactAttachmentByFileNameWithHttpInfo($xero_tenant_id, $con case 200: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\SplFileObject', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Budgets', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -25466,18 +26043,18 @@ public function getContactAttachmentByFileNameWithHttpInfo($xero_tenant_id, $con } } /** - * Operation getContactAttachmentByFileNameAsync - * Retrieves a specific attachment from a specific contact by file name + * Operation getBudgetAsync + * Retrieves a specific budget, which includes budget lines * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $contact_id Unique identifier for a Contact (required) - * @param string $file_name Name of the attachment (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param string $budget_id Unique identifier for Budgets (required) + * @param \DateTime $date_to Filter by start date (optional) + * @param \DateTime $date_from Filter by end date (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getContactAttachmentByFileNameAsync($xero_tenant_id, $contact_id, $file_name, $content_type) + public function getBudgetAsync($xero_tenant_id, $budget_id, $date_to = null, $date_from = null) { - return $this->getContactAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $contact_id, $file_name, $content_type) + return $this->getBudgetAsyncWithHttpInfo($xero_tenant_id, $budget_id, $date_to, $date_from) ->then( function ($response) { return $response[0]; @@ -25485,18 +26062,18 @@ function ($response) { ); } /** - * Operation getContactAttachmentByFileNameAsyncWithHttpInfo - * Retrieves a specific attachment from a specific contact by file name + * Operation getBudgetAsyncWithHttpInfo + * Retrieves a specific budget, which includes budget lines * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $contact_id Unique identifier for a Contact (required) - * @param string $file_name Name of the attachment (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param string $budget_id Unique identifier for Budgets (required) + * @param \DateTime $date_to Filter by start date (optional) + * @param \DateTime $date_from Filter by end date (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getContactAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $contact_id, $file_name, $content_type) + public function getBudgetAsyncWithHttpInfo($xero_tenant_id, $budget_id, $date_to = null, $date_from = null) { - $returnType = '\SplFileObject'; - $request = $this->getContactAttachmentByFileNameRequest($xero_tenant_id, $contact_id, $file_name, $content_type); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Budgets'; + $request = $this->getBudgetRequest($xero_tenant_id, $budget_id, $date_to, $date_from); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -25531,66 +26108,50 @@ function ($exception) { } /** - * Create request for operation 'getContactAttachmentByFileName' + * Create request for operation 'getBudget' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $contact_id Unique identifier for a Contact (required) - * @param string $file_name Name of the attachment (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param string $budget_id Unique identifier for Budgets (required) + * @param \DateTime $date_to Filter by start date (optional) + * @param \DateTime $date_from Filter by end date (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getContactAttachmentByFileNameRequest($xero_tenant_id, $contact_id, $file_name, $content_type) + protected function getBudgetRequest($xero_tenant_id, $budget_id, $date_to = null, $date_from = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getContactAttachmentByFileName' - ); - } - // verify the required parameter 'contact_id' is set - if ($contact_id === null || (is_array($contact_id) && count($contact_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $contact_id when calling getContactAttachmentByFileName' - ); - } - // verify the required parameter 'file_name' is set - if ($file_name === null || (is_array($file_name) && count($file_name) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $file_name when calling getContactAttachmentByFileName' + 'Missing the required parameter $xero_tenant_id when calling getBudget' ); } - // verify the required parameter 'content_type' is set - if ($content_type === null || (is_array($content_type) && count($content_type) === 0)) { + // verify the required parameter 'budget_id' is set + if ($budget_id === null || (is_array($budget_id) && count($budget_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $content_type when calling getContactAttachmentByFileName' + 'Missing the required parameter $budget_id when calling getBudget' ); } - $resourcePath = '/Contacts/{ContactID}/Attachments/{FileName}'; + $resourcePath = '/Budgets/{BudgetID}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if ($date_to !== null) { + $queryParams['DateTo'] = AccountingObjectSerializer::toQueryValue($date_to); + } + // query params + if ($date_from !== null) { + $queryParams['DateFrom'] = AccountingObjectSerializer::toQueryValue($date_from); + } // header params if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } - // header params - if ($content_type !== null) { - $headerParams['contentType'] = AccountingObjectSerializer::toHeaderValue($content_type); - } - // path params - if ($contact_id !== null) { - $resourcePath = str_replace( - '{' . 'ContactID' . '}', - AccountingObjectSerializer::toPathValue($contact_id), - $resourcePath - ); - } // path params - if ($file_name !== null) { + if ($budget_id !== null) { $resourcePath = str_replace( - '{' . 'FileName' . '}', - AccountingObjectSerializer::toPathValue($file_name), + '{' . 'BudgetID' . '}', + AccountingObjectSerializer::toPathValue($budget_id), $resourcePath ); } @@ -25598,11 +26159,11 @@ protected function getContactAttachmentByFileNameRequest($xero_tenant_id, $conta $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/octet-stream'] + ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/octet-stream'], + ['application/json'], [] ); } @@ -25655,35 +26216,35 @@ protected function getContactAttachmentByFileNameRequest($xero_tenant_id, $conta } /** - * Operation getContactAttachmentById - * Retrieves a specific attachment from a specific contact using a unique attachment Id + * Operation getBudgets + * Retrieve a list of budgets * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $contact_id Unique identifier for a Contact (required) - * @param string $attachment_id Unique identifier for Attachment object (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param string[] $ids Filter by BudgetID. Allows you to retrieve a specific individual budget. (optional) + * @param \DateTime $date_to Filter by start date (optional) + * @param \DateTime $date_from Filter by end date (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \SplFileObject + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Budgets */ - public function getContactAttachmentById($xero_tenant_id, $contact_id, $attachment_id, $content_type) + public function getBudgets($xero_tenant_id, $ids = null, $date_to = null, $date_from = null) { - list($response) = $this->getContactAttachmentByIdWithHttpInfo($xero_tenant_id, $contact_id, $attachment_id, $content_type); + list($response) = $this->getBudgetsWithHttpInfo($xero_tenant_id, $ids, $date_to, $date_from); return $response; } /** - * Operation getContactAttachmentByIdWithHttpInfo - * Retrieves a specific attachment from a specific contact using a unique attachment Id + * Operation getBudgetsWithHttpInfo + * Retrieve a list of budgets * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $contact_id Unique identifier for a Contact (required) - * @param string $attachment_id Unique identifier for Attachment object (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param string[] $ids Filter by BudgetID. Allows you to retrieve a specific individual budget. (optional) + * @param \DateTime $date_to Filter by start date (optional) + * @param \DateTime $date_from Filter by end date (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\Accounting\Budgets, HTTP status code, HTTP response headers (array of strings) */ - public function getContactAttachmentByIdWithHttpInfo($xero_tenant_id, $contact_id, $attachment_id, $content_type) + public function getBudgetsWithHttpInfo($xero_tenant_id, $ids = null, $date_to = null, $date_from = null) { - $request = $this->getContactAttachmentByIdRequest($xero_tenant_id, $contact_id, $attachment_id, $content_type); + $request = $this->getBudgetsRequest($xero_tenant_id, $ids, $date_to, $date_from); try { $options = $this->createHttpClientOption(); try { @@ -25712,18 +26273,18 @@ public function getContactAttachmentByIdWithHttpInfo($xero_tenant_id, $contact_i $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Budgets' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - AccountingObjectSerializer::deserialize($content, '\SplFileObject', []), + AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Budgets', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\SplFileObject'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Budgets'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -25740,7 +26301,7 @@ public function getContactAttachmentByIdWithHttpInfo($xero_tenant_id, $contact_i case 200: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\SplFileObject', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Budgets', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -25750,18 +26311,18 @@ public function getContactAttachmentByIdWithHttpInfo($xero_tenant_id, $contact_i } } /** - * Operation getContactAttachmentByIdAsync - * Retrieves a specific attachment from a specific contact using a unique attachment Id + * Operation getBudgetsAsync + * Retrieve a list of budgets * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $contact_id Unique identifier for a Contact (required) - * @param string $attachment_id Unique identifier for Attachment object (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param string[] $ids Filter by BudgetID. Allows you to retrieve a specific individual budget. (optional) + * @param \DateTime $date_to Filter by start date (optional) + * @param \DateTime $date_from Filter by end date (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getContactAttachmentByIdAsync($xero_tenant_id, $contact_id, $attachment_id, $content_type) + public function getBudgetsAsync($xero_tenant_id, $ids = null, $date_to = null, $date_from = null) { - return $this->getContactAttachmentByIdAsyncWithHttpInfo($xero_tenant_id, $contact_id, $attachment_id, $content_type) + return $this->getBudgetsAsyncWithHttpInfo($xero_tenant_id, $ids, $date_to, $date_from) ->then( function ($response) { return $response[0]; @@ -25769,18 +26330,18 @@ function ($response) { ); } /** - * Operation getContactAttachmentByIdAsyncWithHttpInfo - * Retrieves a specific attachment from a specific contact using a unique attachment Id + * Operation getBudgetsAsyncWithHttpInfo + * Retrieve a list of budgets * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $contact_id Unique identifier for a Contact (required) - * @param string $attachment_id Unique identifier for Attachment object (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param string[] $ids Filter by BudgetID. Allows you to retrieve a specific individual budget. (optional) + * @param \DateTime $date_to Filter by start date (optional) + * @param \DateTime $date_from Filter by end date (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getContactAttachmentByIdAsyncWithHttpInfo($xero_tenant_id, $contact_id, $attachment_id, $content_type) + public function getBudgetsAsyncWithHttpInfo($xero_tenant_id, $ids = null, $date_to = null, $date_from = null) { - $returnType = '\SplFileObject'; - $request = $this->getContactAttachmentByIdRequest($xero_tenant_id, $contact_id, $attachment_id, $content_type); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Budgets'; + $request = $this->getBudgetsRequest($xero_tenant_id, $ids, $date_to, $date_from); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -25815,78 +26376,55 @@ function ($exception) { } /** - * Create request for operation 'getContactAttachmentById' + * Create request for operation 'getBudgets' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $contact_id Unique identifier for a Contact (required) - * @param string $attachment_id Unique identifier for Attachment object (required) - * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) + * @param string[] $ids Filter by BudgetID. Allows you to retrieve a specific individual budget. (optional) + * @param \DateTime $date_to Filter by start date (optional) + * @param \DateTime $date_from Filter by end date (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getContactAttachmentByIdRequest($xero_tenant_id, $contact_id, $attachment_id, $content_type) + protected function getBudgetsRequest($xero_tenant_id, $ids = null, $date_to = null, $date_from = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getContactAttachmentById' - ); - } - // verify the required parameter 'contact_id' is set - if ($contact_id === null || (is_array($contact_id) && count($contact_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $contact_id when calling getContactAttachmentById' - ); - } - // verify the required parameter 'attachment_id' is set - if ($attachment_id === null || (is_array($attachment_id) && count($attachment_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $attachment_id when calling getContactAttachmentById' - ); - } - // verify the required parameter 'content_type' is set - if ($content_type === null || (is_array($content_type) && count($content_type) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $content_type when calling getContactAttachmentById' + 'Missing the required parameter $xero_tenant_id when calling getBudgets' ); } - $resourcePath = '/Contacts/{ContactID}/Attachments/{AttachmentID}'; + $resourcePath = '/Budgets'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // header params - if ($xero_tenant_id !== null) { - $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); + // query params + if (is_array($ids)) { + $ids = AccountingObjectSerializer::serializeCollection($ids, 'csv', true); } - // header params - if ($content_type !== null) { - $headerParams['contentType'] = AccountingObjectSerializer::toHeaderValue($content_type); + if ($ids !== null) { + $queryParams['IDs'] = AccountingObjectSerializer::toQueryValue($ids); } - // path params - if ($contact_id !== null) { - $resourcePath = str_replace( - '{' . 'ContactID' . '}', - AccountingObjectSerializer::toPathValue($contact_id), - $resourcePath - ); + // query params + if ($date_to !== null) { + $queryParams['DateTo'] = AccountingObjectSerializer::toQueryValue($date_to); } - // path params - if ($attachment_id !== null) { - $resourcePath = str_replace( - '{' . 'AttachmentID' . '}', - AccountingObjectSerializer::toPathValue($attachment_id), - $resourcePath - ); + // query params + if ($date_from !== null) { + $queryParams['DateFrom'] = AccountingObjectSerializer::toQueryValue($date_from); + } + // header params + if ($xero_tenant_id !== null) { + $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } // body params $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/octet-stream'] + ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/octet-stream'], + ['application/json'], [] ); } @@ -25939,31 +26477,31 @@ protected function getContactAttachmentByIdRequest($xero_tenant_id, $contact_id, } /** - * Operation getContactAttachments - * Retrieves attachments for a specific contact in a Xero organisation + * Operation getContact + * Retrieves a specific contacts in a Xero organisation using a unique contact Id * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $contact_id Unique identifier for a Contact (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts */ - public function getContactAttachments($xero_tenant_id, $contact_id) + public function getContact($xero_tenant_id, $contact_id) { - list($response) = $this->getContactAttachmentsWithHttpInfo($xero_tenant_id, $contact_id); + list($response) = $this->getContactWithHttpInfo($xero_tenant_id, $contact_id); return $response; } /** - * Operation getContactAttachmentsWithHttpInfo - * Retrieves attachments for a specific contact in a Xero organisation + * Operation getContactWithHttpInfo + * Retrieves a specific contacts in a Xero organisation using a unique contact Id * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $contact_id Unique identifier for a Contact (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\Accounting\Attachments, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\Accounting\Contacts, HTTP status code, HTTP response headers (array of strings) */ - public function getContactAttachmentsWithHttpInfo($xero_tenant_id, $contact_id) + public function getContactWithHttpInfo($xero_tenant_id, $contact_id) { - $request = $this->getContactAttachmentsRequest($xero_tenant_id, $contact_id); + $request = $this->getContactRequest($xero_tenant_id, $contact_id); try { $options = $this->createHttpClientOption(); try { @@ -25992,18 +26530,18 @@ public function getContactAttachmentsWithHttpInfo($xero_tenant_id, $contact_id) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments', []), + AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -26020,7 +26558,7 @@ public function getContactAttachmentsWithHttpInfo($xero_tenant_id, $contact_id) case 200: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -26030,16 +26568,16 @@ public function getContactAttachmentsWithHttpInfo($xero_tenant_id, $contact_id) } } /** - * Operation getContactAttachmentsAsync - * Retrieves attachments for a specific contact in a Xero organisation + * Operation getContactAsync + * Retrieves a specific contacts in a Xero organisation using a unique contact Id * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $contact_id Unique identifier for a Contact (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getContactAttachmentsAsync($xero_tenant_id, $contact_id) + public function getContactAsync($xero_tenant_id, $contact_id) { - return $this->getContactAttachmentsAsyncWithHttpInfo($xero_tenant_id, $contact_id) + return $this->getContactAsyncWithHttpInfo($xero_tenant_id, $contact_id) ->then( function ($response) { return $response[0]; @@ -26047,16 +26585,16 @@ function ($response) { ); } /** - * Operation getContactAttachmentsAsyncWithHttpInfo - * Retrieves attachments for a specific contact in a Xero organisation + * Operation getContactAsyncWithHttpInfo + * Retrieves a specific contacts in a Xero organisation using a unique contact Id * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $contact_id Unique identifier for a Contact (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getContactAttachmentsAsyncWithHttpInfo($xero_tenant_id, $contact_id) + public function getContactAsyncWithHttpInfo($xero_tenant_id, $contact_id) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; - $request = $this->getContactAttachmentsRequest($xero_tenant_id, $contact_id); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts'; + $request = $this->getContactRequest($xero_tenant_id, $contact_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -26091,26 +26629,26 @@ function ($exception) { } /** - * Create request for operation 'getContactAttachments' + * Create request for operation 'getContact' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $contact_id Unique identifier for a Contact (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getContactAttachmentsRequest($xero_tenant_id, $contact_id) + protected function getContactRequest($xero_tenant_id, $contact_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getContactAttachments' + 'Missing the required parameter $xero_tenant_id when calling getContact' ); } // verify the required parameter 'contact_id' is set if ($contact_id === null || (is_array($contact_id) && count($contact_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $contact_id when calling getContactAttachments' + 'Missing the required parameter $contact_id when calling getContact' ); } - $resourcePath = '/Contacts/{ContactID}/Attachments'; + $resourcePath = '/Contacts/{ContactID}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -26189,31 +26727,35 @@ protected function getContactAttachmentsRequest($xero_tenant_id, $contact_id) } /** - * Operation getContactByContactNumber - * Retrieves a specific contact by contact number in a Xero organisation + * Operation getContactAttachmentByFileName + * Retrieves a specific attachment from a specific contact by file name * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $contact_number This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). (required) + * @param string $contact_id Unique identifier for a Contact (required) + * @param string $file_name Name of the attachment (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts + * @return \SplFileObject */ - public function getContactByContactNumber($xero_tenant_id, $contact_number) + public function getContactAttachmentByFileName($xero_tenant_id, $contact_id, $file_name, $content_type) { - list($response) = $this->getContactByContactNumberWithHttpInfo($xero_tenant_id, $contact_number); + list($response) = $this->getContactAttachmentByFileNameWithHttpInfo($xero_tenant_id, $contact_id, $file_name, $content_type); return $response; } /** - * Operation getContactByContactNumberWithHttpInfo - * Retrieves a specific contact by contact number in a Xero organisation + * Operation getContactAttachmentByFileNameWithHttpInfo + * Retrieves a specific attachment from a specific contact by file name * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $contact_number This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). (required) + * @param string $contact_id Unique identifier for a Contact (required) + * @param string $file_name Name of the attachment (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\Accounting\Contacts, HTTP status code, HTTP response headers (array of strings) + * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) */ - public function getContactByContactNumberWithHttpInfo($xero_tenant_id, $contact_number) + public function getContactAttachmentByFileNameWithHttpInfo($xero_tenant_id, $contact_id, $file_name, $content_type) { - $request = $this->getContactByContactNumberRequest($xero_tenant_id, $contact_number); + $request = $this->getContactAttachmentByFileNameRequest($xero_tenant_id, $contact_id, $file_name, $content_type); try { $options = $this->createHttpClientOption(); try { @@ -26242,18 +26784,18 @@ public function getContactByContactNumberWithHttpInfo($xero_tenant_id, $contact_ $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts' === '\SplFileObject') { + if ('\SplFileObject' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts', []), + AccountingObjectSerializer::deserialize($content, '\SplFileObject', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts'; + $returnType = '\SplFileObject'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -26270,7 +26812,7 @@ public function getContactByContactNumberWithHttpInfo($xero_tenant_id, $contact_ case 200: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts', + '\SplFileObject', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -26280,16 +26822,18 @@ public function getContactByContactNumberWithHttpInfo($xero_tenant_id, $contact_ } } /** - * Operation getContactByContactNumberAsync - * Retrieves a specific contact by contact number in a Xero organisation + * Operation getContactAttachmentByFileNameAsync + * Retrieves a specific attachment from a specific contact by file name * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $contact_number This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). (required) + * @param string $contact_id Unique identifier for a Contact (required) + * @param string $file_name Name of the attachment (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getContactByContactNumberAsync($xero_tenant_id, $contact_number) + public function getContactAttachmentByFileNameAsync($xero_tenant_id, $contact_id, $file_name, $content_type) { - return $this->getContactByContactNumberAsyncWithHttpInfo($xero_tenant_id, $contact_number) + return $this->getContactAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $contact_id, $file_name, $content_type) ->then( function ($response) { return $response[0]; @@ -26297,16 +26841,18 @@ function ($response) { ); } /** - * Operation getContactByContactNumberAsyncWithHttpInfo - * Retrieves a specific contact by contact number in a Xero organisation + * Operation getContactAttachmentByFileNameAsyncWithHttpInfo + * Retrieves a specific attachment from a specific contact by file name * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $contact_number This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). (required) + * @param string $contact_id Unique identifier for a Contact (required) + * @param string $file_name Name of the attachment (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getContactByContactNumberAsyncWithHttpInfo($xero_tenant_id, $contact_number) + public function getContactAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $contact_id, $file_name, $content_type) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts'; - $request = $this->getContactByContactNumberRequest($xero_tenant_id, $contact_number); + $returnType = '\SplFileObject'; + $request = $this->getContactAttachmentByFileNameRequest($xero_tenant_id, $contact_id, $file_name, $content_type); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -26341,26 +26887,40 @@ function ($exception) { } /** - * Create request for operation 'getContactByContactNumber' + * Create request for operation 'getContactAttachmentByFileName' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $contact_number This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). (required) + * @param string $contact_id Unique identifier for a Contact (required) + * @param string $file_name Name of the attachment (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getContactByContactNumberRequest($xero_tenant_id, $contact_number) + protected function getContactAttachmentByFileNameRequest($xero_tenant_id, $contact_id, $file_name, $content_type) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getContactByContactNumber' + 'Missing the required parameter $xero_tenant_id when calling getContactAttachmentByFileName' ); } - // verify the required parameter 'contact_number' is set - if ($contact_number === null || (is_array($contact_number) && count($contact_number) === 0)) { + // verify the required parameter 'contact_id' is set + if ($contact_id === null || (is_array($contact_id) && count($contact_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $contact_number when calling getContactByContactNumber' + 'Missing the required parameter $contact_id when calling getContactAttachmentByFileName' ); } - $resourcePath = '/Contacts/{ContactNumber}'; + // verify the required parameter 'file_name' is set + if ($file_name === null || (is_array($file_name) && count($file_name) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $file_name when calling getContactAttachmentByFileName' + ); + } + // verify the required parameter 'content_type' is set + if ($content_type === null || (is_array($content_type) && count($content_type) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $content_type when calling getContactAttachmentByFileName' + ); + } + $resourcePath = '/Contacts/{ContactID}/Attachments/{FileName}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -26370,11 +26930,23 @@ protected function getContactByContactNumberRequest($xero_tenant_id, $contact_nu if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($content_type !== null) { + $headerParams['contentType'] = AccountingObjectSerializer::toHeaderValue($content_type); + } // path params - if ($contact_number !== null) { + if ($contact_id !== null) { $resourcePath = str_replace( - '{' . 'ContactNumber' . '}', - AccountingObjectSerializer::toPathValue($contact_number), + '{' . 'ContactID' . '}', + AccountingObjectSerializer::toPathValue($contact_id), + $resourcePath + ); + } + // path params + if ($file_name !== null) { + $resourcePath = str_replace( + '{' . 'FileName' . '}', + AccountingObjectSerializer::toPathValue($file_name), $resourcePath ); } @@ -26382,11 +26954,11 @@ protected function getContactByContactNumberRequest($xero_tenant_id, $contact_nu $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/octet-stream'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/octet-stream'], [] ); } @@ -26439,31 +27011,35 @@ protected function getContactByContactNumberRequest($xero_tenant_id, $contact_nu } /** - * Operation getContactCISSettings - * Retrieves CIS settings for a specific contact in a Xero organisation + * Operation getContactAttachmentById + * Retrieves a specific attachment from a specific contact using a unique attachment Id * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $contact_id Unique identifier for a Contact (required) + * @param string $attachment_id Unique identifier for Attachment object (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CISSettings + * @return \SplFileObject */ - public function getContactCISSettings($xero_tenant_id, $contact_id) + public function getContactAttachmentById($xero_tenant_id, $contact_id, $attachment_id, $content_type) { - list($response) = $this->getContactCISSettingsWithHttpInfo($xero_tenant_id, $contact_id); + list($response) = $this->getContactAttachmentByIdWithHttpInfo($xero_tenant_id, $contact_id, $attachment_id, $content_type); return $response; } /** - * Operation getContactCISSettingsWithHttpInfo - * Retrieves CIS settings for a specific contact in a Xero organisation + * Operation getContactAttachmentByIdWithHttpInfo + * Retrieves a specific attachment from a specific contact using a unique attachment Id * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $contact_id Unique identifier for a Contact (required) + * @param string $attachment_id Unique identifier for Attachment object (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\Accounting\CISSettings, HTTP status code, HTTP response headers (array of strings) + * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) */ - public function getContactCISSettingsWithHttpInfo($xero_tenant_id, $contact_id) + public function getContactAttachmentByIdWithHttpInfo($xero_tenant_id, $contact_id, $attachment_id, $content_type) { - $request = $this->getContactCISSettingsRequest($xero_tenant_id, $contact_id); + $request = $this->getContactAttachmentByIdRequest($xero_tenant_id, $contact_id, $attachment_id, $content_type); try { $options = $this->createHttpClientOption(); try { @@ -26492,18 +27068,18 @@ public function getContactCISSettingsWithHttpInfo($xero_tenant_id, $contact_id) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CISSettings' === '\SplFileObject') { + if ('\SplFileObject' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CISSettings', []), + AccountingObjectSerializer::deserialize($content, '\SplFileObject', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CISSettings'; + $returnType = '\SplFileObject'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -26520,7 +27096,7 @@ public function getContactCISSettingsWithHttpInfo($xero_tenant_id, $contact_id) case 200: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CISSettings', + '\SplFileObject', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -26530,16 +27106,18 @@ public function getContactCISSettingsWithHttpInfo($xero_tenant_id, $contact_id) } } /** - * Operation getContactCISSettingsAsync - * Retrieves CIS settings for a specific contact in a Xero organisation + * Operation getContactAttachmentByIdAsync + * Retrieves a specific attachment from a specific contact using a unique attachment Id * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $contact_id Unique identifier for a Contact (required) + * @param string $attachment_id Unique identifier for Attachment object (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getContactCISSettingsAsync($xero_tenant_id, $contact_id) + public function getContactAttachmentByIdAsync($xero_tenant_id, $contact_id, $attachment_id, $content_type) { - return $this->getContactCISSettingsAsyncWithHttpInfo($xero_tenant_id, $contact_id) + return $this->getContactAttachmentByIdAsyncWithHttpInfo($xero_tenant_id, $contact_id, $attachment_id, $content_type) ->then( function ($response) { return $response[0]; @@ -26547,16 +27125,18 @@ function ($response) { ); } /** - * Operation getContactCISSettingsAsyncWithHttpInfo - * Retrieves CIS settings for a specific contact in a Xero organisation + * Operation getContactAttachmentByIdAsyncWithHttpInfo + * Retrieves a specific attachment from a specific contact using a unique attachment Id * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $contact_id Unique identifier for a Contact (required) + * @param string $attachment_id Unique identifier for Attachment object (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getContactCISSettingsAsyncWithHttpInfo($xero_tenant_id, $contact_id) + public function getContactAttachmentByIdAsyncWithHttpInfo($xero_tenant_id, $contact_id, $attachment_id, $content_type) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CISSettings'; - $request = $this->getContactCISSettingsRequest($xero_tenant_id, $contact_id); + $returnType = '\SplFileObject'; + $request = $this->getContactAttachmentByIdRequest($xero_tenant_id, $contact_id, $attachment_id, $content_type); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -26591,26 +27171,40 @@ function ($exception) { } /** - * Create request for operation 'getContactCISSettings' + * Create request for operation 'getContactAttachmentById' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $contact_id Unique identifier for a Contact (required) + * @param string $attachment_id Unique identifier for Attachment object (required) + * @param string $content_type The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getContactCISSettingsRequest($xero_tenant_id, $contact_id) + protected function getContactAttachmentByIdRequest($xero_tenant_id, $contact_id, $attachment_id, $content_type) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getContactCISSettings' + 'Missing the required parameter $xero_tenant_id when calling getContactAttachmentById' ); } // verify the required parameter 'contact_id' is set if ($contact_id === null || (is_array($contact_id) && count($contact_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $contact_id when calling getContactCISSettings' + 'Missing the required parameter $contact_id when calling getContactAttachmentById' ); } - $resourcePath = '/Contacts/{ContactID}/CISSettings'; + // verify the required parameter 'attachment_id' is set + if ($attachment_id === null || (is_array($attachment_id) && count($attachment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $attachment_id when calling getContactAttachmentById' + ); + } + // verify the required parameter 'content_type' is set + if ($content_type === null || (is_array($content_type) && count($content_type) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $content_type when calling getContactAttachmentById' + ); + } + $resourcePath = '/Contacts/{ContactID}/Attachments/{AttachmentID}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -26620,6 +27214,10 @@ protected function getContactCISSettingsRequest($xero_tenant_id, $contact_id) if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($content_type !== null) { + $headerParams['contentType'] = AccountingObjectSerializer::toHeaderValue($content_type); + } // path params if ($contact_id !== null) { $resourcePath = str_replace( @@ -26628,15 +27226,23 @@ protected function getContactCISSettingsRequest($xero_tenant_id, $contact_id) $resourcePath ); } + // path params + if ($attachment_id !== null) { + $resourcePath = str_replace( + '{' . 'AttachmentID' . '}', + AccountingObjectSerializer::toPathValue($attachment_id), + $resourcePath + ); + } // body params $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + ['application/octet-stream'] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + ['application/octet-stream'], [] ); } @@ -26689,31 +27295,31 @@ protected function getContactCISSettingsRequest($xero_tenant_id, $contact_id) } /** - * Operation getContactGroup - * Retrieves a specific contact group by using a unique contact group Id + * Operation getContactAttachments + * Retrieves attachments for a specific contact in a Xero organisation * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $contact_group_id Unique identifier for a Contact Group (required) + * @param string $contact_id Unique identifier for a Contact (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ContactGroups + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments */ - public function getContactGroup($xero_tenant_id, $contact_group_id) + public function getContactAttachments($xero_tenant_id, $contact_id) { - list($response) = $this->getContactGroupWithHttpInfo($xero_tenant_id, $contact_group_id); + list($response) = $this->getContactAttachmentsWithHttpInfo($xero_tenant_id, $contact_id); return $response; } /** - * Operation getContactGroupWithHttpInfo - * Retrieves a specific contact group by using a unique contact group Id + * Operation getContactAttachmentsWithHttpInfo + * Retrieves attachments for a specific contact in a Xero organisation * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $contact_group_id Unique identifier for a Contact Group (required) + * @param string $contact_id Unique identifier for a Contact (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\Accounting\ContactGroups, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\Accounting\Attachments, HTTP status code, HTTP response headers (array of strings) */ - public function getContactGroupWithHttpInfo($xero_tenant_id, $contact_group_id) + public function getContactAttachmentsWithHttpInfo($xero_tenant_id, $contact_id) { - $request = $this->getContactGroupRequest($xero_tenant_id, $contact_group_id); + $request = $this->getContactAttachmentsRequest($xero_tenant_id, $contact_id); try { $options = $this->createHttpClientOption(); try { @@ -26742,18 +27348,18 @@ public function getContactGroupWithHttpInfo($xero_tenant_id, $contact_group_id) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ContactGroups' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ContactGroups', []), + AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ContactGroups'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -26770,7 +27376,7 @@ public function getContactGroupWithHttpInfo($xero_tenant_id, $contact_group_id) case 200: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ContactGroups', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -26780,16 +27386,16 @@ public function getContactGroupWithHttpInfo($xero_tenant_id, $contact_group_id) } } /** - * Operation getContactGroupAsync - * Retrieves a specific contact group by using a unique contact group Id + * Operation getContactAttachmentsAsync + * Retrieves attachments for a specific contact in a Xero organisation * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $contact_group_id Unique identifier for a Contact Group (required) + * @param string $contact_id Unique identifier for a Contact (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getContactGroupAsync($xero_tenant_id, $contact_group_id) + public function getContactAttachmentsAsync($xero_tenant_id, $contact_id) { - return $this->getContactGroupAsyncWithHttpInfo($xero_tenant_id, $contact_group_id) + return $this->getContactAttachmentsAsyncWithHttpInfo($xero_tenant_id, $contact_id) ->then( function ($response) { return $response[0]; @@ -26797,16 +27403,766 @@ function ($response) { ); } /** - * Operation getContactGroupAsyncWithHttpInfo - * Retrieves a specific contact group by using a unique contact group Id + * Operation getContactAttachmentsAsyncWithHttpInfo + * Retrieves attachments for a specific contact in a Xero organisation * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $contact_group_id Unique identifier for a Contact Group (required) + * @param string $contact_id Unique identifier for a Contact (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getContactGroupAsyncWithHttpInfo($xero_tenant_id, $contact_group_id) + public function getContactAttachmentsAsyncWithHttpInfo($xero_tenant_id, $contact_id) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ContactGroups'; - $request = $this->getContactGroupRequest($xero_tenant_id, $contact_group_id); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; + $request = $this->getContactAttachmentsRequest($xero_tenant_id, $contact_id); + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + AccountingObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getContactAttachments' + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $contact_id Unique identifier for a Contact (required) + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ + protected function getContactAttachmentsRequest($xero_tenant_id, $contact_id) + { + // verify the required parameter 'xero_tenant_id' is set + if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $xero_tenant_id when calling getContactAttachments' + ); + } + // verify the required parameter 'contact_id' is set + if ($contact_id === null || (is_array($contact_id) && count($contact_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $contact_id when calling getContactAttachments' + ); + } + $resourcePath = '/Contacts/{ContactID}/Attachments'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + // header params + if ($xero_tenant_id !== null) { + $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); + } + // path params + if ($contact_id !== null) { + $resourcePath = str_replace( + '{' . 'ContactID' . '}', + AccountingObjectSerializer::toPathValue($contact_id), + $resourcePath + ); + } + // body params + $_tempBody = null; + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\json_encode(AccountingObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = [ + [ + 'Content-type' => 'multipart/form-data', + ] + ]; + + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\json_encode($formParams); + } else { + // for HTTP post (form) + $httpBody = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Query::build($formParams); + } + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + $query = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHostAccounting() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getContactByContactNumber + * Retrieves a specific contact by contact number in a Xero organisation + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $contact_number This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). (required) + * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts + */ + public function getContactByContactNumber($xero_tenant_id, $contact_number) + { + list($response) = $this->getContactByContactNumberWithHttpInfo($xero_tenant_id, $contact_number); + return $response; + } + /** + * Operation getContactByContactNumberWithHttpInfo + * Retrieves a specific contact by contact number in a Xero organisation + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $contact_number This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). (required) + * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \XeroAPI\XeroPHP\Models\Accounting\Contacts, HTTP status code, HTTP response headers (array of strings) + */ + public function getContactByContactNumberWithHttpInfo($xero_tenant_id, $contact_number) + { + $request = $this->getContactByContactNumberRequest($xero_tenant_id, $contact_number); + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + $statusCode = $response->getStatusCode(); + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + AccountingObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = AccountingObjectSerializer::deserialize( + $e->getResponseBody(), + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + /** + * Operation getContactByContactNumberAsync + * Retrieves a specific contact by contact number in a Xero organisation + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $contact_number This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). (required) + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface + */ + public function getContactByContactNumberAsync($xero_tenant_id, $contact_number) + { + return $this->getContactByContactNumberAsyncWithHttpInfo($xero_tenant_id, $contact_number) + ->then( + function ($response) { + return $response[0]; + } + ); + } + /** + * Operation getContactByContactNumberAsyncWithHttpInfo + * Retrieves a specific contact by contact number in a Xero organisation + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $contact_number This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). (required) + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ + public function getContactByContactNumberAsyncWithHttpInfo($xero_tenant_id, $contact_number) + { + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts'; + $request = $this->getContactByContactNumberRequest($xero_tenant_id, $contact_number); + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + AccountingObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getContactByContactNumber' + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $contact_number This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). (required) + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ + protected function getContactByContactNumberRequest($xero_tenant_id, $contact_number) + { + // verify the required parameter 'xero_tenant_id' is set + if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $xero_tenant_id when calling getContactByContactNumber' + ); + } + // verify the required parameter 'contact_number' is set + if ($contact_number === null || (is_array($contact_number) && count($contact_number) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $contact_number when calling getContactByContactNumber' + ); + } + $resourcePath = '/Contacts/{ContactNumber}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + // header params + if ($xero_tenant_id !== null) { + $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); + } + // path params + if ($contact_number !== null) { + $resourcePath = str_replace( + '{' . 'ContactNumber' . '}', + AccountingObjectSerializer::toPathValue($contact_number), + $resourcePath + ); + } + // body params + $_tempBody = null; + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\json_encode(AccountingObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = [ + [ + 'Content-type' => 'multipart/form-data', + ] + ]; + + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\json_encode($formParams); + } else { + // for HTTP post (form) + $httpBody = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Query::build($formParams); + } + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + $query = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHostAccounting() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getContactCISSettings + * Retrieves CIS settings for a specific contact in a Xero organisation + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $contact_id Unique identifier for a Contact (required) + * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CISSettings + */ + public function getContactCISSettings($xero_tenant_id, $contact_id) + { + list($response) = $this->getContactCISSettingsWithHttpInfo($xero_tenant_id, $contact_id); + return $response; + } + /** + * Operation getContactCISSettingsWithHttpInfo + * Retrieves CIS settings for a specific contact in a Xero organisation + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $contact_id Unique identifier for a Contact (required) + * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \XeroAPI\XeroPHP\Models\Accounting\CISSettings, HTTP status code, HTTP response headers (array of strings) + */ + public function getContactCISSettingsWithHttpInfo($xero_tenant_id, $contact_id) + { + $request = $this->getContactCISSettingsRequest($xero_tenant_id, $contact_id); + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + $statusCode = $response->getStatusCode(); + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CISSettings' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CISSettings', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CISSettings'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + AccountingObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = AccountingObjectSerializer::deserialize( + $e->getResponseBody(), + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CISSettings', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + /** + * Operation getContactCISSettingsAsync + * Retrieves CIS settings for a specific contact in a Xero organisation + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $contact_id Unique identifier for a Contact (required) + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface + */ + public function getContactCISSettingsAsync($xero_tenant_id, $contact_id) + { + return $this->getContactCISSettingsAsyncWithHttpInfo($xero_tenant_id, $contact_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + /** + * Operation getContactCISSettingsAsyncWithHttpInfo + * Retrieves CIS settings for a specific contact in a Xero organisation + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $contact_id Unique identifier for a Contact (required) + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ + public function getContactCISSettingsAsyncWithHttpInfo($xero_tenant_id, $contact_id) + { + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CISSettings'; + $request = $this->getContactCISSettingsRequest($xero_tenant_id, $contact_id); + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + AccountingObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getContactCISSettings' + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $contact_id Unique identifier for a Contact (required) + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ + protected function getContactCISSettingsRequest($xero_tenant_id, $contact_id) + { + // verify the required parameter 'xero_tenant_id' is set + if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $xero_tenant_id when calling getContactCISSettings' + ); + } + // verify the required parameter 'contact_id' is set + if ($contact_id === null || (is_array($contact_id) && count($contact_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $contact_id when calling getContactCISSettings' + ); + } + $resourcePath = '/Contacts/{ContactID}/CISSettings'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + // header params + if ($xero_tenant_id !== null) { + $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); + } + // path params + if ($contact_id !== null) { + $resourcePath = str_replace( + '{' . 'ContactID' . '}', + AccountingObjectSerializer::toPathValue($contact_id), + $resourcePath + ); + } + // body params + $_tempBody = null; + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\json_encode(AccountingObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = [ + [ + 'Content-type' => 'multipart/form-data', + ] + ]; + + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\json_encode($formParams); + } else { + // for HTTP post (form) + $httpBody = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Query::build($formParams); + } + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + $query = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHostAccounting() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getContactGroup + * Retrieves a specific contact group by using a unique contact group Id + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $contact_group_id Unique identifier for a Contact Group (required) + * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ContactGroups + */ + public function getContactGroup($xero_tenant_id, $contact_group_id) + { + list($response) = $this->getContactGroupWithHttpInfo($xero_tenant_id, $contact_group_id); + return $response; + } + /** + * Operation getContactGroupWithHttpInfo + * Retrieves a specific contact group by using a unique contact group Id + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $contact_group_id Unique identifier for a Contact Group (required) + * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \XeroAPI\XeroPHP\Models\Accounting\ContactGroups, HTTP status code, HTTP response headers (array of strings) + */ + public function getContactGroupWithHttpInfo($xero_tenant_id, $contact_group_id) + { + $request = $this->getContactGroupRequest($xero_tenant_id, $contact_group_id); + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + $statusCode = $response->getStatusCode(); + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ContactGroups' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ContactGroups', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ContactGroups'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + AccountingObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = AccountingObjectSerializer::deserialize( + $e->getResponseBody(), + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ContactGroups', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + /** + * Operation getContactGroupAsync + * Retrieves a specific contact group by using a unique contact group Id + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $contact_group_id Unique identifier for a Contact Group (required) + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface + */ + public function getContactGroupAsync($xero_tenant_id, $contact_group_id) + { + return $this->getContactGroupAsyncWithHttpInfo($xero_tenant_id, $contact_group_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + /** + * Operation getContactGroupAsyncWithHttpInfo + * Retrieves a specific contact group by using a unique contact group Id + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $contact_group_id Unique identifier for a Contact Group (required) + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ + public function getContactGroupAsyncWithHttpInfo($xero_tenant_id, $contact_group_id) + { + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ContactGroups'; + $request = $this->getContactGroupRequest($xero_tenant_id, $contact_group_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -27449,13 +28805,14 @@ protected function getContactHistoryRequest($xero_tenant_id, $contact_id) * @param bool $include_archived e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response (optional) * @param bool $summary_only Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient. (optional, default to false) * @param string $search_term Search parameter that performs a case-insensitive text search across the Name, FirstName, LastName, ContactNumber and EmailAddress fields. (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts */ - public function getContacts($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $ids = null, $page = null, $include_archived = null, $summary_only = false, $search_term = null) + public function getContacts($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $ids = null, $page = null, $include_archived = null, $summary_only = false, $search_term = null, $page_size = null) { - list($response) = $this->getContactsWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $ids, $page, $include_archived, $summary_only, $search_term); + list($response) = $this->getContactsWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $ids, $page, $include_archived, $summary_only, $search_term, $page_size); return $response; } /** @@ -27470,13 +28827,14 @@ public function getContacts($xero_tenant_id, $if_modified_since = null, $where = * @param bool $include_archived e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response (optional) * @param bool $summary_only Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient. (optional, default to false) * @param string $search_term Search parameter that performs a case-insensitive text search across the Name, FirstName, LastName, ContactNumber and EmailAddress fields. (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Contacts, HTTP status code, HTTP response headers (array of strings) */ - public function getContactsWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $ids = null, $page = null, $include_archived = null, $summary_only = false, $search_term = null) + public function getContactsWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $ids = null, $page = null, $include_archived = null, $summary_only = false, $search_term = null, $page_size = null) { - $request = $this->getContactsRequest($xero_tenant_id, $if_modified_since, $where, $order, $ids, $page, $include_archived, $summary_only, $search_term); + $request = $this->getContactsRequest($xero_tenant_id, $if_modified_since, $where, $order, $ids, $page, $include_archived, $summary_only, $search_term, $page_size); try { $options = $this->createHttpClientOption(); try { @@ -27554,12 +28912,13 @@ public function getContactsWithHttpInfo($xero_tenant_id, $if_modified_since = nu * @param bool $include_archived e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response (optional) * @param bool $summary_only Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient. (optional, default to false) * @param string $search_term Search parameter that performs a case-insensitive text search across the Name, FirstName, LastName, ContactNumber and EmailAddress fields. (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getContactsAsync($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $ids = null, $page = null, $include_archived = null, $summary_only = false, $search_term = null) + public function getContactsAsync($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $ids = null, $page = null, $include_archived = null, $summary_only = false, $search_term = null, $page_size = null) { - return $this->getContactsAsyncWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $ids, $page, $include_archived, $summary_only, $search_term) + return $this->getContactsAsyncWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $ids, $page, $include_archived, $summary_only, $search_term, $page_size) ->then( function ($response) { return $response[0]; @@ -27578,12 +28937,13 @@ function ($response) { * @param bool $include_archived e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response (optional) * @param bool $summary_only Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient. (optional, default to false) * @param string $search_term Search parameter that performs a case-insensitive text search across the Name, FirstName, LastName, ContactNumber and EmailAddress fields. (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getContactsAsyncWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $ids = null, $page = null, $include_archived = null, $summary_only = false, $search_term = null) + public function getContactsAsyncWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $ids = null, $page = null, $include_archived = null, $summary_only = false, $search_term = null, $page_size = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts'; - $request = $this->getContactsRequest($xero_tenant_id, $if_modified_since, $where, $order, $ids, $page, $include_archived, $summary_only, $search_term); + $request = $this->getContactsRequest($xero_tenant_id, $if_modified_since, $where, $order, $ids, $page, $include_archived, $summary_only, $search_term, $page_size); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -27628,9 +28988,10 @@ function ($exception) { * @param bool $include_archived e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response (optional) * @param bool $summary_only Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient. (optional, default to false) * @param string $search_term Search parameter that performs a case-insensitive text search across the Name, FirstName, LastName, ContactNumber and EmailAddress fields. (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getContactsRequest($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $ids = null, $page = null, $include_archived = null, $summary_only = false, $search_term = null) + protected function getContactsRequest($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $ids = null, $page = null, $include_archived = null, $summary_only = false, $search_term = null, $page_size = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -27675,6 +29036,10 @@ protected function getContactsRequest($xero_tenant_id, $if_modified_since = null if ($search_term !== null) { $queryParams['searchTerm'] = AccountingObjectSerializer::toQueryValue($search_term); } + // query params + if ($page_size !== null) { + $queryParams['pageSize'] = AccountingObjectSerializer::toQueryValue($page_size); + } // header params if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); @@ -29329,13 +30694,14 @@ protected function getCreditNoteHistoryRequest($xero_tenant_id, $credit_note_id) * @param string $order Order by an any element (optional) * @param int $page e.g. page=1 – Up to 100 credit notes will be returned in a single API call with line items shown for each credit note (optional) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CreditNotes */ - public function getCreditNotes($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null) + public function getCreditNotes($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null, $page_size = null) { - list($response) = $this->getCreditNotesWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $page, $unitdp); + list($response) = $this->getCreditNotesWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $page, $unitdp, $page_size); return $response; } /** @@ -29347,13 +30713,14 @@ public function getCreditNotes($xero_tenant_id, $if_modified_since = null, $wher * @param string $order Order by an any element (optional) * @param int $page e.g. page=1 – Up to 100 credit notes will be returned in a single API call with line items shown for each credit note (optional) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\CreditNotes, HTTP status code, HTTP response headers (array of strings) */ - public function getCreditNotesWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null) + public function getCreditNotesWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null, $page_size = null) { - $request = $this->getCreditNotesRequest($xero_tenant_id, $if_modified_since, $where, $order, $page, $unitdp); + $request = $this->getCreditNotesRequest($xero_tenant_id, $if_modified_since, $where, $order, $page, $unitdp, $page_size); try { $options = $this->createHttpClientOption(); try { @@ -29428,12 +30795,13 @@ public function getCreditNotesWithHttpInfo($xero_tenant_id, $if_modified_since = * @param string $order Order by an any element (optional) * @param int $page e.g. page=1 – Up to 100 credit notes will be returned in a single API call with line items shown for each credit note (optional) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getCreditNotesAsync($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null) + public function getCreditNotesAsync($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null, $page_size = null) { - return $this->getCreditNotesAsyncWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $page, $unitdp) + return $this->getCreditNotesAsyncWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $page, $unitdp, $page_size) ->then( function ($response) { return $response[0]; @@ -29449,12 +30817,13 @@ function ($response) { * @param string $order Order by an any element (optional) * @param int $page e.g. page=1 – Up to 100 credit notes will be returned in a single API call with line items shown for each credit note (optional) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getCreditNotesAsyncWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null) + public function getCreditNotesAsyncWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null, $page_size = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CreditNotes'; - $request = $this->getCreditNotesRequest($xero_tenant_id, $if_modified_since, $where, $order, $page, $unitdp); + $request = $this->getCreditNotesRequest($xero_tenant_id, $if_modified_since, $where, $order, $page, $unitdp, $page_size); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -29496,9 +30865,10 @@ function ($exception) { * @param string $order Order by an any element (optional) * @param int $page e.g. page=1 – Up to 100 credit notes will be returned in a single API call with line items shown for each credit note (optional) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getCreditNotesRequest($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null) + protected function getCreditNotesRequest($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null, $page_size = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -29528,6 +30898,10 @@ protected function getCreditNotesRequest($xero_tenant_id, $if_modified_since = n if ($unitdp !== null) { $queryParams['unitdp'] = AccountingObjectSerializer::toQueryValue($unitdp); } + // query params + if ($page_size !== null) { + $queryParams['pageSize'] = AccountingObjectSerializer::toQueryValue($page_size); + } // header params if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); @@ -32935,13 +34309,15 @@ protected function getInvoiceRemindersRequest($xero_tenant_id) * @param bool $created_by_my_app When set to true you'll only retrieve Invoices created by your app (optional) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) * @param bool $summary_only Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient. (optional, default to false) + * @param int $page_size Number of records to retrieve per page (optional) + * @param string $search_term Search parameter that performs a case-insensitive text search across the fields e.g. InvoiceNumber, Reference. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Invoices */ - public function getInvoices($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $ids = null, $invoice_numbers = null, $contact_ids = null, $statuses = null, $page = null, $include_archived = null, $created_by_my_app = null, $unitdp = null, $summary_only = false) + public function getInvoices($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $ids = null, $invoice_numbers = null, $contact_ids = null, $statuses = null, $page = null, $include_archived = null, $created_by_my_app = null, $unitdp = null, $summary_only = false, $page_size = null, $search_term = null) { - list($response) = $this->getInvoicesWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $ids, $invoice_numbers, $contact_ids, $statuses, $page, $include_archived, $created_by_my_app, $unitdp, $summary_only); + list($response) = $this->getInvoicesWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $ids, $invoice_numbers, $contact_ids, $statuses, $page, $include_archived, $created_by_my_app, $unitdp, $summary_only, $page_size, $search_term); return $response; } /** @@ -32960,13 +34336,15 @@ public function getInvoices($xero_tenant_id, $if_modified_since = null, $where = * @param bool $created_by_my_app When set to true you'll only retrieve Invoices created by your app (optional) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) * @param bool $summary_only Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient. (optional, default to false) + * @param int $page_size Number of records to retrieve per page (optional) + * @param string $search_term Search parameter that performs a case-insensitive text search across the fields e.g. InvoiceNumber, Reference. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Invoices, HTTP status code, HTTP response headers (array of strings) */ - public function getInvoicesWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $ids = null, $invoice_numbers = null, $contact_ids = null, $statuses = null, $page = null, $include_archived = null, $created_by_my_app = null, $unitdp = null, $summary_only = false) + public function getInvoicesWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $ids = null, $invoice_numbers = null, $contact_ids = null, $statuses = null, $page = null, $include_archived = null, $created_by_my_app = null, $unitdp = null, $summary_only = false, $page_size = null, $search_term = null) { - $request = $this->getInvoicesRequest($xero_tenant_id, $if_modified_since, $where, $order, $ids, $invoice_numbers, $contact_ids, $statuses, $page, $include_archived, $created_by_my_app, $unitdp, $summary_only); + $request = $this->getInvoicesRequest($xero_tenant_id, $if_modified_since, $where, $order, $ids, $invoice_numbers, $contact_ids, $statuses, $page, $include_archived, $created_by_my_app, $unitdp, $summary_only, $page_size, $search_term); try { $options = $this->createHttpClientOption(); try { @@ -33048,12 +34426,14 @@ public function getInvoicesWithHttpInfo($xero_tenant_id, $if_modified_since = nu * @param bool $created_by_my_app When set to true you'll only retrieve Invoices created by your app (optional) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) * @param bool $summary_only Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient. (optional, default to false) + * @param int $page_size Number of records to retrieve per page (optional) + * @param string $search_term Search parameter that performs a case-insensitive text search across the fields e.g. InvoiceNumber, Reference. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getInvoicesAsync($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $ids = null, $invoice_numbers = null, $contact_ids = null, $statuses = null, $page = null, $include_archived = null, $created_by_my_app = null, $unitdp = null, $summary_only = false) + public function getInvoicesAsync($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $ids = null, $invoice_numbers = null, $contact_ids = null, $statuses = null, $page = null, $include_archived = null, $created_by_my_app = null, $unitdp = null, $summary_only = false, $page_size = null, $search_term = null) { - return $this->getInvoicesAsyncWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $ids, $invoice_numbers, $contact_ids, $statuses, $page, $include_archived, $created_by_my_app, $unitdp, $summary_only) + return $this->getInvoicesAsyncWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $ids, $invoice_numbers, $contact_ids, $statuses, $page, $include_archived, $created_by_my_app, $unitdp, $summary_only, $page_size, $search_term) ->then( function ($response) { return $response[0]; @@ -33076,12 +34456,14 @@ function ($response) { * @param bool $created_by_my_app When set to true you'll only retrieve Invoices created by your app (optional) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) * @param bool $summary_only Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient. (optional, default to false) + * @param int $page_size Number of records to retrieve per page (optional) + * @param string $search_term Search parameter that performs a case-insensitive text search across the fields e.g. InvoiceNumber, Reference. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getInvoicesAsyncWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $ids = null, $invoice_numbers = null, $contact_ids = null, $statuses = null, $page = null, $include_archived = null, $created_by_my_app = null, $unitdp = null, $summary_only = false) + public function getInvoicesAsyncWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $ids = null, $invoice_numbers = null, $contact_ids = null, $statuses = null, $page = null, $include_archived = null, $created_by_my_app = null, $unitdp = null, $summary_only = false, $page_size = null, $search_term = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Invoices'; - $request = $this->getInvoicesRequest($xero_tenant_id, $if_modified_since, $where, $order, $ids, $invoice_numbers, $contact_ids, $statuses, $page, $include_archived, $created_by_my_app, $unitdp, $summary_only); + $request = $this->getInvoicesRequest($xero_tenant_id, $if_modified_since, $where, $order, $ids, $invoice_numbers, $contact_ids, $statuses, $page, $include_archived, $created_by_my_app, $unitdp, $summary_only, $page_size, $search_term); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -33130,9 +34512,11 @@ function ($exception) { * @param bool $created_by_my_app When set to true you'll only retrieve Invoices created by your app (optional) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) * @param bool $summary_only Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient. (optional, default to false) + * @param int $page_size Number of records to retrieve per page (optional) + * @param string $search_term Search parameter that performs a case-insensitive text search across the fields e.g. InvoiceNumber, Reference. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getInvoicesRequest($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $ids = null, $invoice_numbers = null, $contact_ids = null, $statuses = null, $page = null, $include_archived = null, $created_by_my_app = null, $unitdp = null, $summary_only = false) + protected function getInvoicesRequest($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $ids = null, $invoice_numbers = null, $contact_ids = null, $statuses = null, $page = null, $include_archived = null, $created_by_my_app = null, $unitdp = null, $summary_only = false, $page_size = null, $search_term = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -33202,6 +34586,14 @@ protected function getInvoicesRequest($xero_tenant_id, $if_modified_since = null if ($summary_only !== null) { $queryParams['summaryOnly'] = $summary_only ? 'true' : 'false'; } + // query params + if ($page_size !== null) { + $queryParams['pageSize'] = AccountingObjectSerializer::toQueryValue($page_size); + } + // query params + if ($search_term !== null) { + $queryParams['searchTerm'] = AccountingObjectSerializer::toQueryValue($search_term); + } // header params if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); @@ -36415,13 +37807,14 @@ protected function getManualJournalAttachmentsRequest($xero_tenant_id, $manual_j * @param string $where Filter by an any element (optional) * @param string $order Order by an any element (optional) * @param int $page e.g. page=1 – Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ManualJournals */ - public function getManualJournals($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null) + public function getManualJournals($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $page_size = null) { - list($response) = $this->getManualJournalsWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $page); + list($response) = $this->getManualJournalsWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $page, $page_size); return $response; } /** @@ -36432,13 +37825,14 @@ public function getManualJournals($xero_tenant_id, $if_modified_since = null, $w * @param string $where Filter by an any element (optional) * @param string $order Order by an any element (optional) * @param int $page e.g. page=1 – Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\ManualJournals, HTTP status code, HTTP response headers (array of strings) */ - public function getManualJournalsWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null) + public function getManualJournalsWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $page_size = null) { - $request = $this->getManualJournalsRequest($xero_tenant_id, $if_modified_since, $where, $order, $page); + $request = $this->getManualJournalsRequest($xero_tenant_id, $if_modified_since, $where, $order, $page, $page_size); try { $options = $this->createHttpClientOption(); try { @@ -36512,12 +37906,13 @@ public function getManualJournalsWithHttpInfo($xero_tenant_id, $if_modified_sinc * @param string $where Filter by an any element (optional) * @param string $order Order by an any element (optional) * @param int $page e.g. page=1 – Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getManualJournalsAsync($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null) + public function getManualJournalsAsync($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $page_size = null) { - return $this->getManualJournalsAsyncWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $page) + return $this->getManualJournalsAsyncWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $page, $page_size) ->then( function ($response) { return $response[0]; @@ -36532,12 +37927,13 @@ function ($response) { * @param string $where Filter by an any element (optional) * @param string $order Order by an any element (optional) * @param int $page e.g. page=1 – Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getManualJournalsAsyncWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null) + public function getManualJournalsAsyncWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $page_size = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ManualJournals'; - $request = $this->getManualJournalsRequest($xero_tenant_id, $if_modified_since, $where, $order, $page); + $request = $this->getManualJournalsRequest($xero_tenant_id, $if_modified_since, $where, $order, $page, $page_size); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -36578,9 +37974,10 @@ function ($exception) { * @param string $where Filter by an any element (optional) * @param string $order Order by an any element (optional) * @param int $page e.g. page=1 – Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getManualJournalsRequest($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null) + protected function getManualJournalsRequest($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $page_size = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -36606,6 +38003,10 @@ protected function getManualJournalsRequest($xero_tenant_id, $if_modified_since if ($page !== null) { $queryParams['page'] = AccountingObjectSerializer::toQueryValue($page); } + // query params + if ($page_size !== null) { + $queryParams['pageSize'] = AccountingObjectSerializer::toQueryValue($page_size); + } // header params if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); @@ -38395,13 +39796,14 @@ protected function getOverpaymentHistoryRequest($xero_tenant_id, $overpayment_id * @param string $order Order by an any element (optional) * @param int $page e.g. page=1 – Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment (optional) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Overpayments */ - public function getOverpayments($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null) + public function getOverpayments($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null, $page_size = null) { - list($response) = $this->getOverpaymentsWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $page, $unitdp); + list($response) = $this->getOverpaymentsWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $page, $unitdp, $page_size); return $response; } /** @@ -38413,13 +39815,14 @@ public function getOverpayments($xero_tenant_id, $if_modified_since = null, $whe * @param string $order Order by an any element (optional) * @param int $page e.g. page=1 – Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment (optional) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Overpayments, HTTP status code, HTTP response headers (array of strings) */ - public function getOverpaymentsWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null) + public function getOverpaymentsWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null, $page_size = null) { - $request = $this->getOverpaymentsRequest($xero_tenant_id, $if_modified_since, $where, $order, $page, $unitdp); + $request = $this->getOverpaymentsRequest($xero_tenant_id, $if_modified_since, $where, $order, $page, $unitdp, $page_size); try { $options = $this->createHttpClientOption(); try { @@ -38494,12 +39897,13 @@ public function getOverpaymentsWithHttpInfo($xero_tenant_id, $if_modified_since * @param string $order Order by an any element (optional) * @param int $page e.g. page=1 – Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment (optional) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getOverpaymentsAsync($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null) + public function getOverpaymentsAsync($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null, $page_size = null) { - return $this->getOverpaymentsAsyncWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $page, $unitdp) + return $this->getOverpaymentsAsyncWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $page, $unitdp, $page_size) ->then( function ($response) { return $response[0]; @@ -38515,12 +39919,13 @@ function ($response) { * @param string $order Order by an any element (optional) * @param int $page e.g. page=1 – Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment (optional) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getOverpaymentsAsyncWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null) + public function getOverpaymentsAsyncWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null, $page_size = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Overpayments'; - $request = $this->getOverpaymentsRequest($xero_tenant_id, $if_modified_since, $where, $order, $page, $unitdp); + $request = $this->getOverpaymentsRequest($xero_tenant_id, $if_modified_since, $where, $order, $page, $unitdp, $page_size); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -38562,9 +39967,10 @@ function ($exception) { * @param string $order Order by an any element (optional) * @param int $page e.g. page=1 – Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment (optional) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getOverpaymentsRequest($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null) + protected function getOverpaymentsRequest($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null, $page_size = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -38594,6 +40000,10 @@ protected function getOverpaymentsRequest($xero_tenant_id, $if_modified_since = if ($unitdp !== null) { $queryParams['unitdp'] = AccountingObjectSerializer::toQueryValue($unitdp); } + // query params + if ($page_size !== null) { + $queryParams['pageSize'] = AccountingObjectSerializer::toQueryValue($page_size); + } // header params if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); @@ -39401,13 +40811,14 @@ protected function getPaymentServicesRequest($xero_tenant_id) * @param string $where Filter by an any element (optional) * @param string $order Order by an any element (optional) * @param int $page Up to 100 payments will be returned in a single API call (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Payments */ - public function getPayments($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null) + public function getPayments($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $page_size = null) { - list($response) = $this->getPaymentsWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $page); + list($response) = $this->getPaymentsWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $page, $page_size); return $response; } /** @@ -39418,13 +40829,14 @@ public function getPayments($xero_tenant_id, $if_modified_since = null, $where = * @param string $where Filter by an any element (optional) * @param string $order Order by an any element (optional) * @param int $page Up to 100 payments will be returned in a single API call (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Payments, HTTP status code, HTTP response headers (array of strings) */ - public function getPaymentsWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null) + public function getPaymentsWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $page_size = null) { - $request = $this->getPaymentsRequest($xero_tenant_id, $if_modified_since, $where, $order, $page); + $request = $this->getPaymentsRequest($xero_tenant_id, $if_modified_since, $where, $order, $page, $page_size); try { $options = $this->createHttpClientOption(); try { @@ -39498,12 +40910,13 @@ public function getPaymentsWithHttpInfo($xero_tenant_id, $if_modified_since = nu * @param string $where Filter by an any element (optional) * @param string $order Order by an any element (optional) * @param int $page Up to 100 payments will be returned in a single API call (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getPaymentsAsync($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null) + public function getPaymentsAsync($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $page_size = null) { - return $this->getPaymentsAsyncWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $page) + return $this->getPaymentsAsyncWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $page, $page_size) ->then( function ($response) { return $response[0]; @@ -39518,12 +40931,13 @@ function ($response) { * @param string $where Filter by an any element (optional) * @param string $order Order by an any element (optional) * @param int $page Up to 100 payments will be returned in a single API call (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getPaymentsAsyncWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null) + public function getPaymentsAsyncWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $page_size = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Payments'; - $request = $this->getPaymentsRequest($xero_tenant_id, $if_modified_since, $where, $order, $page); + $request = $this->getPaymentsRequest($xero_tenant_id, $if_modified_since, $where, $order, $page, $page_size); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -39564,9 +40978,10 @@ function ($exception) { * @param string $where Filter by an any element (optional) * @param string $order Order by an any element (optional) * @param int $page Up to 100 payments will be returned in a single API call (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getPaymentsRequest($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null) + protected function getPaymentsRequest($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $page_size = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -39592,6 +41007,10 @@ protected function getPaymentsRequest($xero_tenant_id, $if_modified_since = null if ($page !== null) { $queryParams['page'] = AccountingObjectSerializer::toQueryValue($page); } + // query params + if ($page_size !== null) { + $queryParams['pageSize'] = AccountingObjectSerializer::toQueryValue($page_size); + } // header params if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); @@ -40169,13 +41588,14 @@ protected function getPrepaymentHistoryRequest($xero_tenant_id, $prepayment_id) * @param string $order Order by an any element (optional) * @param int $page e.g. page=1 – Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment (optional) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Prepayments */ - public function getPrepayments($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null) + public function getPrepayments($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null, $page_size = null) { - list($response) = $this->getPrepaymentsWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $page, $unitdp); + list($response) = $this->getPrepaymentsWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $page, $unitdp, $page_size); return $response; } /** @@ -40187,13 +41607,14 @@ public function getPrepayments($xero_tenant_id, $if_modified_since = null, $wher * @param string $order Order by an any element (optional) * @param int $page e.g. page=1 – Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment (optional) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Prepayments, HTTP status code, HTTP response headers (array of strings) */ - public function getPrepaymentsWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null) + public function getPrepaymentsWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null, $page_size = null) { - $request = $this->getPrepaymentsRequest($xero_tenant_id, $if_modified_since, $where, $order, $page, $unitdp); + $request = $this->getPrepaymentsRequest($xero_tenant_id, $if_modified_since, $where, $order, $page, $unitdp, $page_size); try { $options = $this->createHttpClientOption(); try { @@ -40268,12 +41689,13 @@ public function getPrepaymentsWithHttpInfo($xero_tenant_id, $if_modified_since = * @param string $order Order by an any element (optional) * @param int $page e.g. page=1 – Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment (optional) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getPrepaymentsAsync($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null) + public function getPrepaymentsAsync($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null, $page_size = null) { - return $this->getPrepaymentsAsyncWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $page, $unitdp) + return $this->getPrepaymentsAsyncWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $page, $unitdp, $page_size) ->then( function ($response) { return $response[0]; @@ -40289,12 +41711,13 @@ function ($response) { * @param string $order Order by an any element (optional) * @param int $page e.g. page=1 – Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment (optional) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getPrepaymentsAsyncWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null) + public function getPrepaymentsAsyncWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null, $page_size = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Prepayments'; - $request = $this->getPrepaymentsRequest($xero_tenant_id, $if_modified_since, $where, $order, $page, $unitdp); + $request = $this->getPrepaymentsRequest($xero_tenant_id, $if_modified_since, $where, $order, $page, $unitdp, $page_size); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -40336,9 +41759,10 @@ function ($exception) { * @param string $order Order by an any element (optional) * @param int $page e.g. page=1 – Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment (optional) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getPrepaymentsRequest($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null) + protected function getPrepaymentsRequest($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null, $unitdp = null, $page_size = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -40368,6 +41792,10 @@ protected function getPrepaymentsRequest($xero_tenant_id, $if_modified_since = n if ($unitdp !== null) { $queryParams['unitdp'] = AccountingObjectSerializer::toQueryValue($unitdp); } + // query params + if ($page_size !== null) { + $queryParams['pageSize'] = AccountingObjectSerializer::toQueryValue($page_size); + } // header params if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); @@ -42264,13 +43692,14 @@ protected function getPurchaseOrderHistoryRequest($xero_tenant_id, $purchase_ord * @param string $date_to Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 (optional) * @param string $order Order by an any element (optional) * @param int $page To specify a page, append the page parameter to the URL e.g. ?page=1. If there are 100 records in the response you will need to check if there is any more data by fetching the next page e.g ?page=2 and continuing this process until no more results are returned. (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PurchaseOrders */ - public function getPurchaseOrders($xero_tenant_id, $if_modified_since = null, $status = null, $date_from = null, $date_to = null, $order = null, $page = null) + public function getPurchaseOrders($xero_tenant_id, $if_modified_since = null, $status = null, $date_from = null, $date_to = null, $order = null, $page = null, $page_size = null) { - list($response) = $this->getPurchaseOrdersWithHttpInfo($xero_tenant_id, $if_modified_since, $status, $date_from, $date_to, $order, $page); + list($response) = $this->getPurchaseOrdersWithHttpInfo($xero_tenant_id, $if_modified_since, $status, $date_from, $date_to, $order, $page, $page_size); return $response; } /** @@ -42283,13 +43712,14 @@ public function getPurchaseOrders($xero_tenant_id, $if_modified_since = null, $s * @param string $date_to Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 (optional) * @param string $order Order by an any element (optional) * @param int $page To specify a page, append the page parameter to the URL e.g. ?page=1. If there are 100 records in the response you will need to check if there is any more data by fetching the next page e.g ?page=2 and continuing this process until no more results are returned. (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\PurchaseOrders, HTTP status code, HTTP response headers (array of strings) */ - public function getPurchaseOrdersWithHttpInfo($xero_tenant_id, $if_modified_since = null, $status = null, $date_from = null, $date_to = null, $order = null, $page = null) + public function getPurchaseOrdersWithHttpInfo($xero_tenant_id, $if_modified_since = null, $status = null, $date_from = null, $date_to = null, $order = null, $page = null, $page_size = null) { - $request = $this->getPurchaseOrdersRequest($xero_tenant_id, $if_modified_since, $status, $date_from, $date_to, $order, $page); + $request = $this->getPurchaseOrdersRequest($xero_tenant_id, $if_modified_since, $status, $date_from, $date_to, $order, $page, $page_size); try { $options = $this->createHttpClientOption(); try { @@ -42365,12 +43795,13 @@ public function getPurchaseOrdersWithHttpInfo($xero_tenant_id, $if_modified_sinc * @param string $date_to Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 (optional) * @param string $order Order by an any element (optional) * @param int $page To specify a page, append the page parameter to the URL e.g. ?page=1. If there are 100 records in the response you will need to check if there is any more data by fetching the next page e.g ?page=2 and continuing this process until no more results are returned. (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getPurchaseOrdersAsync($xero_tenant_id, $if_modified_since = null, $status = null, $date_from = null, $date_to = null, $order = null, $page = null) + public function getPurchaseOrdersAsync($xero_tenant_id, $if_modified_since = null, $status = null, $date_from = null, $date_to = null, $order = null, $page = null, $page_size = null) { - return $this->getPurchaseOrdersAsyncWithHttpInfo($xero_tenant_id, $if_modified_since, $status, $date_from, $date_to, $order, $page) + return $this->getPurchaseOrdersAsyncWithHttpInfo($xero_tenant_id, $if_modified_since, $status, $date_from, $date_to, $order, $page, $page_size) ->then( function ($response) { return $response[0]; @@ -42387,12 +43818,13 @@ function ($response) { * @param string $date_to Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 (optional) * @param string $order Order by an any element (optional) * @param int $page To specify a page, append the page parameter to the URL e.g. ?page=1. If there are 100 records in the response you will need to check if there is any more data by fetching the next page e.g ?page=2 and continuing this process until no more results are returned. (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getPurchaseOrdersAsyncWithHttpInfo($xero_tenant_id, $if_modified_since = null, $status = null, $date_from = null, $date_to = null, $order = null, $page = null) + public function getPurchaseOrdersAsyncWithHttpInfo($xero_tenant_id, $if_modified_since = null, $status = null, $date_from = null, $date_to = null, $order = null, $page = null, $page_size = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PurchaseOrders'; - $request = $this->getPurchaseOrdersRequest($xero_tenant_id, $if_modified_since, $status, $date_from, $date_to, $order, $page); + $request = $this->getPurchaseOrdersRequest($xero_tenant_id, $if_modified_since, $status, $date_from, $date_to, $order, $page, $page_size); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -42435,9 +43867,10 @@ function ($exception) { * @param string $date_to Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 (optional) * @param string $order Order by an any element (optional) * @param int $page To specify a page, append the page parameter to the URL e.g. ?page=1. If there are 100 records in the response you will need to check if there is any more data by fetching the next page e.g ?page=2 and continuing this process until no more results are returned. (optional) + * @param int $page_size Number of records to retrieve per page (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getPurchaseOrdersRequest($xero_tenant_id, $if_modified_since = null, $status = null, $date_from = null, $date_to = null, $order = null, $page = null) + protected function getPurchaseOrdersRequest($xero_tenant_id, $if_modified_since = null, $status = null, $date_from = null, $date_to = null, $order = null, $page = null, $page_size = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -42471,6 +43904,10 @@ protected function getPurchaseOrdersRequest($xero_tenant_id, $if_modified_since if ($page !== null) { $queryParams['page'] = AccountingObjectSerializer::toQueryValue($page); } + // query params + if ($page_size !== null) { + $queryParams['pageSize'] = AccountingObjectSerializer::toQueryValue($page_size); + } // header params if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); @@ -49748,31 +51185,273 @@ protected function getReportProfitAndLossRequest($xero_tenant_id, $from_date = n } /** - * Operation getReportTenNinetyNine - * Retrieve reports for 1099 + * Operation getReportTenNinetyNine + * Retrieve reports for 1099 + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $report_year The year of the 1099 report (optional) + * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Reports + */ + public function getReportTenNinetyNine($xero_tenant_id, $report_year = null) + { + list($response) = $this->getReportTenNinetyNineWithHttpInfo($xero_tenant_id, $report_year); + return $response; + } + /** + * Operation getReportTenNinetyNineWithHttpInfo + * Retrieve reports for 1099 + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $report_year The year of the 1099 report (optional) + * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \XeroAPI\XeroPHP\Models\Accounting\Reports, HTTP status code, HTTP response headers (array of strings) + */ + public function getReportTenNinetyNineWithHttpInfo($xero_tenant_id, $report_year = null) + { + $request = $this->getReportTenNinetyNineRequest($xero_tenant_id, $report_year); + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + $statusCode = $response->getStatusCode(); + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Reports' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Reports', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Reports'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + AccountingObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = AccountingObjectSerializer::deserialize( + $e->getResponseBody(), + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Reports', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + /** + * Operation getReportTenNinetyNineAsync + * Retrieve reports for 1099 + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $report_year The year of the 1099 report (optional) + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface + */ + public function getReportTenNinetyNineAsync($xero_tenant_id, $report_year = null) + { + return $this->getReportTenNinetyNineAsyncWithHttpInfo($xero_tenant_id, $report_year) + ->then( + function ($response) { + return $response[0]; + } + ); + } + /** + * Operation getReportTenNinetyNineAsyncWithHttpInfo + * Retrieve reports for 1099 + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $report_year The year of the 1099 report (optional) + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ + public function getReportTenNinetyNineAsyncWithHttpInfo($xero_tenant_id, $report_year = null) + { + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Reports'; + $request = $this->getReportTenNinetyNineRequest($xero_tenant_id, $report_year); + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + AccountingObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getReportTenNinetyNine' + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $report_year The year of the 1099 report (optional) + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ + protected function getReportTenNinetyNineRequest($xero_tenant_id, $report_year = null) + { + // verify the required parameter 'xero_tenant_id' is set + if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $xero_tenant_id when calling getReportTenNinetyNine' + ); + } + $resourcePath = '/Reports/TenNinetyNine'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + // query params + if ($report_year !== null) { + $queryParams['reportYear'] = AccountingObjectSerializer::toQueryValue($report_year); + } + // header params + if ($xero_tenant_id !== null) { + $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); + } + // body params + $_tempBody = null; + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\json_encode(AccountingObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = [ + [ + 'Content-type' => 'multipart/form-data', + ] + ]; + + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\json_encode($formParams); + } else { + // for HTTP post (form) + $httpBody = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Query::build($formParams); + } + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + $query = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHostAccounting() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getReportTrialBalance + * Retrieves report for trial balance * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $report_year The year of the 1099 report (optional) + * @param \DateTime $date The date for the Trial Balance report e.g. 2018-03-31 (optional) + * @param bool $payments_only Return cash only basis for the Trial Balance report (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Reports + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ReportWithRows */ - public function getReportTenNinetyNine($xero_tenant_id, $report_year = null) + public function getReportTrialBalance($xero_tenant_id, $date = null, $payments_only = null) { - list($response) = $this->getReportTenNinetyNineWithHttpInfo($xero_tenant_id, $report_year); + list($response) = $this->getReportTrialBalanceWithHttpInfo($xero_tenant_id, $date, $payments_only); return $response; } /** - * Operation getReportTenNinetyNineWithHttpInfo - * Retrieve reports for 1099 + * Operation getReportTrialBalanceWithHttpInfo + * Retrieves report for trial balance * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $report_year The year of the 1099 report (optional) + * @param \DateTime $date The date for the Trial Balance report e.g. 2018-03-31 (optional) + * @param bool $payments_only Return cash only basis for the Trial Balance report (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\Accounting\Reports, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\Accounting\ReportWithRows, HTTP status code, HTTP response headers (array of strings) */ - public function getReportTenNinetyNineWithHttpInfo($xero_tenant_id, $report_year = null) + public function getReportTrialBalanceWithHttpInfo($xero_tenant_id, $date = null, $payments_only = null) { - $request = $this->getReportTenNinetyNineRequest($xero_tenant_id, $report_year); + $request = $this->getReportTrialBalanceRequest($xero_tenant_id, $date, $payments_only); try { $options = $this->createHttpClientOption(); try { @@ -49801,18 +51480,18 @@ public function getReportTenNinetyNineWithHttpInfo($xero_tenant_id, $report_year $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Reports' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ReportWithRows' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Reports', []), + AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ReportWithRows', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Reports'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ReportWithRows'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -49829,7 +51508,7 @@ public function getReportTenNinetyNineWithHttpInfo($xero_tenant_id, $report_year case 200: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Reports', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ReportWithRows', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -49839,16 +51518,17 @@ public function getReportTenNinetyNineWithHttpInfo($xero_tenant_id, $report_year } } /** - * Operation getReportTenNinetyNineAsync - * Retrieve reports for 1099 + * Operation getReportTrialBalanceAsync + * Retrieves report for trial balance * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $report_year The year of the 1099 report (optional) + * @param \DateTime $date The date for the Trial Balance report e.g. 2018-03-31 (optional) + * @param bool $payments_only Return cash only basis for the Trial Balance report (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getReportTenNinetyNineAsync($xero_tenant_id, $report_year = null) + public function getReportTrialBalanceAsync($xero_tenant_id, $date = null, $payments_only = null) { - return $this->getReportTenNinetyNineAsyncWithHttpInfo($xero_tenant_id, $report_year) + return $this->getReportTrialBalanceAsyncWithHttpInfo($xero_tenant_id, $date, $payments_only) ->then( function ($response) { return $response[0]; @@ -49856,16 +51536,17 @@ function ($response) { ); } /** - * Operation getReportTenNinetyNineAsyncWithHttpInfo - * Retrieve reports for 1099 + * Operation getReportTrialBalanceAsyncWithHttpInfo + * Retrieves report for trial balance * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $report_year The year of the 1099 report (optional) + * @param \DateTime $date The date for the Trial Balance report e.g. 2018-03-31 (optional) + * @param bool $payments_only Return cash only basis for the Trial Balance report (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getReportTenNinetyNineAsyncWithHttpInfo($xero_tenant_id, $report_year = null) + public function getReportTrialBalanceAsyncWithHttpInfo($xero_tenant_id, $date = null, $payments_only = null) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Reports'; - $request = $this->getReportTenNinetyNineRequest($xero_tenant_id, $report_year); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ReportWithRows'; + $request = $this->getReportTrialBalanceRequest($xero_tenant_id, $date, $payments_only); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -49900,28 +51581,33 @@ function ($exception) { } /** - * Create request for operation 'getReportTenNinetyNine' + * Create request for operation 'getReportTrialBalance' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $report_year The year of the 1099 report (optional) + * @param \DateTime $date The date for the Trial Balance report e.g. 2018-03-31 (optional) + * @param bool $payments_only Return cash only basis for the Trial Balance report (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getReportTenNinetyNineRequest($xero_tenant_id, $report_year = null) + protected function getReportTrialBalanceRequest($xero_tenant_id, $date = null, $payments_only = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getReportTenNinetyNine' + 'Missing the required parameter $xero_tenant_id when calling getReportTrialBalance' ); } - $resourcePath = '/Reports/TenNinetyNine'; + $resourcePath = '/Reports/TrialBalance'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; // query params - if ($report_year !== null) { - $queryParams['reportYear'] = AccountingObjectSerializer::toQueryValue($report_year); + if ($date !== null) { + $queryParams['date'] = AccountingObjectSerializer::toQueryValue($date); + } + // query params + if ($payments_only !== null) { + $queryParams['paymentsOnly'] = $payments_only ? 'true' : 'false'; } // header params if ($xero_tenant_id !== null) { @@ -49988,33 +51674,29 @@ protected function getReportTenNinetyNineRequest($xero_tenant_id, $report_year = } /** - * Operation getReportTrialBalance - * Retrieves report for trial balance + * Operation getReportsList + * Retrieves a list of the organistaions unique reports that require a uuid to fetch * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \DateTime $date The date for the Trial Balance report e.g. 2018-03-31 (optional) - * @param bool $payments_only Return cash only basis for the Trial Balance report (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ReportWithRows */ - public function getReportTrialBalance($xero_tenant_id, $date = null, $payments_only = null) + public function getReportsList($xero_tenant_id) { - list($response) = $this->getReportTrialBalanceWithHttpInfo($xero_tenant_id, $date, $payments_only); + list($response) = $this->getReportsListWithHttpInfo($xero_tenant_id); return $response; } /** - * Operation getReportTrialBalanceWithHttpInfo - * Retrieves report for trial balance + * Operation getReportsListWithHttpInfo + * Retrieves a list of the organistaions unique reports that require a uuid to fetch * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \DateTime $date The date for the Trial Balance report e.g. 2018-03-31 (optional) - * @param bool $payments_only Return cash only basis for the Trial Balance report (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\ReportWithRows, HTTP status code, HTTP response headers (array of strings) */ - public function getReportTrialBalanceWithHttpInfo($xero_tenant_id, $date = null, $payments_only = null) + public function getReportsListWithHttpInfo($xero_tenant_id) { - $request = $this->getReportTrialBalanceRequest($xero_tenant_id, $date, $payments_only); + $request = $this->getReportsListRequest($xero_tenant_id); try { $options = $this->createHttpClientOption(); try { @@ -50081,17 +51763,15 @@ public function getReportTrialBalanceWithHttpInfo($xero_tenant_id, $date = null, } } /** - * Operation getReportTrialBalanceAsync - * Retrieves report for trial balance + * Operation getReportsListAsync + * Retrieves a list of the organistaions unique reports that require a uuid to fetch * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \DateTime $date The date for the Trial Balance report e.g. 2018-03-31 (optional) - * @param bool $payments_only Return cash only basis for the Trial Balance report (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getReportTrialBalanceAsync($xero_tenant_id, $date = null, $payments_only = null) + public function getReportsListAsync($xero_tenant_id) { - return $this->getReportTrialBalanceAsyncWithHttpInfo($xero_tenant_id, $date, $payments_only) + return $this->getReportsListAsyncWithHttpInfo($xero_tenant_id) ->then( function ($response) { return $response[0]; @@ -50099,17 +51779,15 @@ function ($response) { ); } /** - * Operation getReportTrialBalanceAsyncWithHttpInfo - * Retrieves report for trial balance + * Operation getReportsListAsyncWithHttpInfo + * Retrieves a list of the organistaions unique reports that require a uuid to fetch * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \DateTime $date The date for the Trial Balance report e.g. 2018-03-31 (optional) - * @param bool $payments_only Return cash only basis for the Trial Balance report (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getReportTrialBalanceAsyncWithHttpInfo($xero_tenant_id, $date = null, $payments_only = null) + public function getReportsListAsyncWithHttpInfo($xero_tenant_id) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ReportWithRows'; - $request = $this->getReportTrialBalanceRequest($xero_tenant_id, $date, $payments_only); + $request = $this->getReportsListRequest($xero_tenant_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -50144,34 +51822,24 @@ function ($exception) { } /** - * Create request for operation 'getReportTrialBalance' + * Create request for operation 'getReportsList' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \DateTime $date The date for the Trial Balance report e.g. 2018-03-31 (optional) - * @param bool $payments_only Return cash only basis for the Trial Balance report (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getReportTrialBalanceRequest($xero_tenant_id, $date = null, $payments_only = null) + protected function getReportsListRequest($xero_tenant_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getReportTrialBalance' + 'Missing the required parameter $xero_tenant_id when calling getReportsList' ); } - $resourcePath = '/Reports/TrialBalance'; + $resourcePath = '/Reports'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if ($date !== null) { - $queryParams['date'] = AccountingObjectSerializer::toQueryValue($date); - } - // query params - if ($payments_only !== null) { - $queryParams['paymentsOnly'] = $payments_only ? 'true' : 'false'; - } // header params if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); @@ -50237,29 +51905,31 @@ protected function getReportTrialBalanceRequest($xero_tenant_id, $date = null, $ } /** - * Operation getReportsList - * Retrieves a list of the organistaions unique reports that require a uuid to fetch + * Operation getTaxRateByTaxType + * Retrieves a specific tax rate according to given TaxType code * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $tax_type A valid TaxType code (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ReportWithRows + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TaxRates */ - public function getReportsList($xero_tenant_id) + public function getTaxRateByTaxType($xero_tenant_id, $tax_type) { - list($response) = $this->getReportsListWithHttpInfo($xero_tenant_id); + list($response) = $this->getTaxRateByTaxTypeWithHttpInfo($xero_tenant_id, $tax_type); return $response; } /** - * Operation getReportsListWithHttpInfo - * Retrieves a list of the organistaions unique reports that require a uuid to fetch + * Operation getTaxRateByTaxTypeWithHttpInfo + * Retrieves a specific tax rate according to given TaxType code * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $tax_type A valid TaxType code (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\Accounting\ReportWithRows, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\Accounting\TaxRates, HTTP status code, HTTP response headers (array of strings) */ - public function getReportsListWithHttpInfo($xero_tenant_id) + public function getTaxRateByTaxTypeWithHttpInfo($xero_tenant_id, $tax_type) { - $request = $this->getReportsListRequest($xero_tenant_id); + $request = $this->getTaxRateByTaxTypeRequest($xero_tenant_id, $tax_type); try { $options = $this->createHttpClientOption(); try { @@ -50288,18 +51958,18 @@ public function getReportsListWithHttpInfo($xero_tenant_id) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ReportWithRows' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TaxRates' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ReportWithRows', []), + AccountingObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TaxRates', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ReportWithRows'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TaxRates'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -50316,7 +51986,7 @@ public function getReportsListWithHttpInfo($xero_tenant_id) case 200: $data = AccountingObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ReportWithRows', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TaxRates', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -50326,15 +51996,16 @@ public function getReportsListWithHttpInfo($xero_tenant_id) } } /** - * Operation getReportsListAsync - * Retrieves a list of the organistaions unique reports that require a uuid to fetch + * Operation getTaxRateByTaxTypeAsync + * Retrieves a specific tax rate according to given TaxType code * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $tax_type A valid TaxType code (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getReportsListAsync($xero_tenant_id) + public function getTaxRateByTaxTypeAsync($xero_tenant_id, $tax_type) { - return $this->getReportsListAsyncWithHttpInfo($xero_tenant_id) + return $this->getTaxRateByTaxTypeAsyncWithHttpInfo($xero_tenant_id, $tax_type) ->then( function ($response) { return $response[0]; @@ -50342,15 +52013,16 @@ function ($response) { ); } /** - * Operation getReportsListAsyncWithHttpInfo - * Retrieves a list of the organistaions unique reports that require a uuid to fetch + * Operation getTaxRateByTaxTypeAsyncWithHttpInfo + * Retrieves a specific tax rate according to given TaxType code * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $tax_type A valid TaxType code (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getReportsListAsyncWithHttpInfo($xero_tenant_id) + public function getTaxRateByTaxTypeAsyncWithHttpInfo($xero_tenant_id, $tax_type) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ReportWithRows'; - $request = $this->getReportsListRequest($xero_tenant_id); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TaxRates'; + $request = $this->getTaxRateByTaxTypeRequest($xero_tenant_id, $tax_type); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -50385,19 +52057,26 @@ function ($exception) { } /** - * Create request for operation 'getReportsList' + * Create request for operation 'getTaxRateByTaxType' * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $tax_type A valid TaxType code (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getReportsListRequest($xero_tenant_id) + protected function getTaxRateByTaxTypeRequest($xero_tenant_id, $tax_type) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getReportsList' + 'Missing the required parameter $xero_tenant_id when calling getTaxRateByTaxType' ); } - $resourcePath = '/Reports'; + // verify the required parameter 'tax_type' is set + if ($tax_type === null || (is_array($tax_type) && count($tax_type) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $tax_type when calling getTaxRateByTaxType' + ); + } + $resourcePath = '/TaxRates/{TaxType}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -50407,6 +52086,14 @@ protected function getReportsListRequest($xero_tenant_id) if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // path params + if ($tax_type !== null) { + $resourcePath = str_replace( + '{' . 'TaxType' . '}', + AccountingObjectSerializer::toPathValue($tax_type), + $resourcePath + ); + } // body params $_tempBody = null; if ($multipart) { @@ -50473,14 +52160,13 @@ protected function getReportsListRequest($xero_tenant_id) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $where Filter by an any element (optional) * @param string $order Order by an any element (optional) - * @param string $tax_type Filter by tax type (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TaxRates */ - public function getTaxRates($xero_tenant_id, $where = null, $order = null, $tax_type = null) + public function getTaxRates($xero_tenant_id, $where = null, $order = null) { - list($response) = $this->getTaxRatesWithHttpInfo($xero_tenant_id, $where, $order, $tax_type); + list($response) = $this->getTaxRatesWithHttpInfo($xero_tenant_id, $where, $order); return $response; } /** @@ -50489,14 +52175,13 @@ public function getTaxRates($xero_tenant_id, $where = null, $order = null, $tax_ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $where Filter by an any element (optional) * @param string $order Order by an any element (optional) - * @param string $tax_type Filter by tax type (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\TaxRates, HTTP status code, HTTP response headers (array of strings) */ - public function getTaxRatesWithHttpInfo($xero_tenant_id, $where = null, $order = null, $tax_type = null) + public function getTaxRatesWithHttpInfo($xero_tenant_id, $where = null, $order = null) { - $request = $this->getTaxRatesRequest($xero_tenant_id, $where, $order, $tax_type); + $request = $this->getTaxRatesRequest($xero_tenant_id, $where, $order); try { $options = $this->createHttpClientOption(); try { @@ -50568,13 +52253,12 @@ public function getTaxRatesWithHttpInfo($xero_tenant_id, $where = null, $order = * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $where Filter by an any element (optional) * @param string $order Order by an any element (optional) - * @param string $tax_type Filter by tax type (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getTaxRatesAsync($xero_tenant_id, $where = null, $order = null, $tax_type = null) + public function getTaxRatesAsync($xero_tenant_id, $where = null, $order = null) { - return $this->getTaxRatesAsyncWithHttpInfo($xero_tenant_id, $where, $order, $tax_type) + return $this->getTaxRatesAsyncWithHttpInfo($xero_tenant_id, $where, $order) ->then( function ($response) { return $response[0]; @@ -50587,13 +52271,12 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $where Filter by an any element (optional) * @param string $order Order by an any element (optional) - * @param string $tax_type Filter by tax type (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getTaxRatesAsyncWithHttpInfo($xero_tenant_id, $where = null, $order = null, $tax_type = null) + public function getTaxRatesAsyncWithHttpInfo($xero_tenant_id, $where = null, $order = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TaxRates'; - $request = $this->getTaxRatesRequest($xero_tenant_id, $where, $order, $tax_type); + $request = $this->getTaxRatesRequest($xero_tenant_id, $where, $order); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -50632,10 +52315,9 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $where Filter by an any element (optional) * @param string $order Order by an any element (optional) - * @param string $tax_type Filter by tax type (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getTaxRatesRequest($xero_tenant_id, $where = null, $order = null, $tax_type = null) + protected function getTaxRatesRequest($xero_tenant_id, $where = null, $order = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -50657,10 +52339,6 @@ protected function getTaxRatesRequest($xero_tenant_id, $where = null, $order = n if ($order !== null) { $queryParams['order'] = AccountingObjectSerializer::toQueryValue($order); } - // query params - if ($tax_type !== null) { - $queryParams['TaxType'] = AccountingObjectSerializer::toQueryValue($tax_type); - } // header params if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); @@ -51746,13 +53424,14 @@ protected function getUsersRequest($xero_tenant_id, $if_modified_since = null, $ * Sets the chart of accounts, the conversion date and conversion balances * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Setup $setup Object including an accounts array, a conversion balances array and a conversion date object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ImportSummaryObject */ - public function postSetup($xero_tenant_id, $setup) + public function postSetup($xero_tenant_id, $setup, $idempotency_key = null) { - list($response) = $this->postSetupWithHttpInfo($xero_tenant_id, $setup); + list($response) = $this->postSetupWithHttpInfo($xero_tenant_id, $setup, $idempotency_key); return $response; } /** @@ -51760,13 +53439,14 @@ public function postSetup($xero_tenant_id, $setup) * Sets the chart of accounts, the conversion date and conversion balances * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Setup $setup Object including an accounts array, a conversion balances array and a conversion date object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\ImportSummaryObject, HTTP status code, HTTP response headers (array of strings) */ - public function postSetupWithHttpInfo($xero_tenant_id, $setup) + public function postSetupWithHttpInfo($xero_tenant_id, $setup, $idempotency_key = null) { - $request = $this->postSetupRequest($xero_tenant_id, $setup); + $request = $this->postSetupRequest($xero_tenant_id, $setup, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -51837,12 +53517,13 @@ public function postSetupWithHttpInfo($xero_tenant_id, $setup) * Sets the chart of accounts, the conversion date and conversion balances * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Setup $setup Object including an accounts array, a conversion balances array and a conversion date object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function postSetupAsync($xero_tenant_id, $setup) + public function postSetupAsync($xero_tenant_id, $setup, $idempotency_key = null) { - return $this->postSetupAsyncWithHttpInfo($xero_tenant_id, $setup) + return $this->postSetupAsyncWithHttpInfo($xero_tenant_id, $setup, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -51854,12 +53535,13 @@ function ($response) { * Sets the chart of accounts, the conversion date and conversion balances * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Setup $setup Object including an accounts array, a conversion balances array and a conversion date object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function postSetupAsyncWithHttpInfo($xero_tenant_id, $setup) + public function postSetupAsyncWithHttpInfo($xero_tenant_id, $setup, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ImportSummaryObject'; - $request = $this->postSetupRequest($xero_tenant_id, $setup); + $request = $this->postSetupRequest($xero_tenant_id, $setup, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -51897,9 +53579,10 @@ function ($exception) { * Create request for operation 'postSetup' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Setup $setup Object including an accounts array, a conversion balances array and a conversion date object in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function postSetupRequest($xero_tenant_id, $setup) + protected function postSetupRequest($xero_tenant_id, $setup, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -51923,6 +53606,10 @@ protected function postSetupRequest($xero_tenant_id, $setup) if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($setup)) { @@ -51992,13 +53679,14 @@ protected function postSetupRequest($xero_tenant_id, $setup) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $account_id Unique identifier for Account object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Accounts $accounts Request of type Accounts array with one Account (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Accounts|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updateAccount($xero_tenant_id, $account_id, $accounts) + public function updateAccount($xero_tenant_id, $account_id, $accounts, $idempotency_key = null) { - list($response) = $this->updateAccountWithHttpInfo($xero_tenant_id, $account_id, $accounts); + list($response) = $this->updateAccountWithHttpInfo($xero_tenant_id, $account_id, $accounts, $idempotency_key); return $response; } /** @@ -52007,13 +53695,14 @@ public function updateAccount($xero_tenant_id, $account_id, $accounts) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $account_id Unique identifier for Account object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Accounts $accounts Request of type Accounts array with one Account (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Accounts|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateAccountWithHttpInfo($xero_tenant_id, $account_id, $accounts) + public function updateAccountWithHttpInfo($xero_tenant_id, $account_id, $accounts, $idempotency_key = null) { - $request = $this->updateAccountRequest($xero_tenant_id, $account_id, $accounts); + $request = $this->updateAccountRequest($xero_tenant_id, $account_id, $accounts, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -52104,12 +53793,13 @@ public function updateAccountWithHttpInfo($xero_tenant_id, $account_id, $account * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $account_id Unique identifier for Account object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Accounts $accounts Request of type Accounts array with one Account (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateAccountAsync($xero_tenant_id, $account_id, $accounts) + public function updateAccountAsync($xero_tenant_id, $account_id, $accounts, $idempotency_key = null) { - return $this->updateAccountAsyncWithHttpInfo($xero_tenant_id, $account_id, $accounts) + return $this->updateAccountAsyncWithHttpInfo($xero_tenant_id, $account_id, $accounts, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -52122,12 +53812,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $account_id Unique identifier for Account object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Accounts $accounts Request of type Accounts array with one Account (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateAccountAsyncWithHttpInfo($xero_tenant_id, $account_id, $accounts) + public function updateAccountAsyncWithHttpInfo($xero_tenant_id, $account_id, $accounts, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Accounts'; - $request = $this->updateAccountRequest($xero_tenant_id, $account_id, $accounts); + $request = $this->updateAccountRequest($xero_tenant_id, $account_id, $accounts, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -52166,9 +53857,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $account_id Unique identifier for Account object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Accounts $accounts Request of type Accounts array with one Account (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateAccountRequest($xero_tenant_id, $account_id, $accounts) + protected function updateAccountRequest($xero_tenant_id, $account_id, $accounts, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -52198,6 +53890,10 @@ protected function updateAccountRequest($xero_tenant_id, $account_id, $accounts) if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($account_id !== null) { $resourcePath = str_replace( @@ -52276,13 +53972,14 @@ protected function updateAccountRequest($xero_tenant_id, $account_id, $accounts) * @param string $account_id Unique identifier for Account object (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updateAccountAttachmentByFileName($xero_tenant_id, $account_id, $file_name, $body) + public function updateAccountAttachmentByFileName($xero_tenant_id, $account_id, $file_name, $body, $idempotency_key = null) { - list($response) = $this->updateAccountAttachmentByFileNameWithHttpInfo($xero_tenant_id, $account_id, $file_name, $body); + list($response) = $this->updateAccountAttachmentByFileNameWithHttpInfo($xero_tenant_id, $account_id, $file_name, $body, $idempotency_key); return $response; } /** @@ -52292,13 +53989,14 @@ public function updateAccountAttachmentByFileName($xero_tenant_id, $account_id, * @param string $account_id Unique identifier for Account object (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateAccountAttachmentByFileNameWithHttpInfo($xero_tenant_id, $account_id, $file_name, $body) + public function updateAccountAttachmentByFileNameWithHttpInfo($xero_tenant_id, $account_id, $file_name, $body, $idempotency_key = null) { - $request = $this->updateAccountAttachmentByFileNameRequest($xero_tenant_id, $account_id, $file_name, $body); + $request = $this->updateAccountAttachmentByFileNameRequest($xero_tenant_id, $account_id, $file_name, $body, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -52390,12 +54088,13 @@ public function updateAccountAttachmentByFileNameWithHttpInfo($xero_tenant_id, $ * @param string $account_id Unique identifier for Account object (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateAccountAttachmentByFileNameAsync($xero_tenant_id, $account_id, $file_name, $body) + public function updateAccountAttachmentByFileNameAsync($xero_tenant_id, $account_id, $file_name, $body, $idempotency_key = null) { - return $this->updateAccountAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $account_id, $file_name, $body) + return $this->updateAccountAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $account_id, $file_name, $body, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -52409,12 +54108,13 @@ function ($response) { * @param string $account_id Unique identifier for Account object (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateAccountAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $account_id, $file_name, $body) + public function updateAccountAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $account_id, $file_name, $body, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; - $request = $this->updateAccountAttachmentByFileNameRequest($xero_tenant_id, $account_id, $file_name, $body); + $request = $this->updateAccountAttachmentByFileNameRequest($xero_tenant_id, $account_id, $file_name, $body, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -52454,9 +54154,10 @@ function ($exception) { * @param string $account_id Unique identifier for Account object (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateAccountAttachmentByFileNameRequest($xero_tenant_id, $account_id, $file_name, $body) + protected function updateAccountAttachmentByFileNameRequest($xero_tenant_id, $account_id, $file_name, $body, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -52492,6 +54193,10 @@ protected function updateAccountAttachmentByFileNameRequest($xero_tenant_id, $ac if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($account_id !== null) { $resourcePath = str_replace( @@ -52578,13 +54283,14 @@ protected function updateAccountAttachmentByFileNameRequest($xero_tenant_id, $ac * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions $bank_transactions bank_transactions (required) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updateBankTransaction($xero_tenant_id, $bank_transaction_id, $bank_transactions, $unitdp = null) + public function updateBankTransaction($xero_tenant_id, $bank_transaction_id, $bank_transactions, $unitdp = null, $idempotency_key = null) { - list($response) = $this->updateBankTransactionWithHttpInfo($xero_tenant_id, $bank_transaction_id, $bank_transactions, $unitdp); + list($response) = $this->updateBankTransactionWithHttpInfo($xero_tenant_id, $bank_transaction_id, $bank_transactions, $unitdp, $idempotency_key); return $response; } /** @@ -52594,13 +54300,14 @@ public function updateBankTransaction($xero_tenant_id, $bank_transaction_id, $ba * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions $bank_transactions (required) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\BankTransactions|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateBankTransactionWithHttpInfo($xero_tenant_id, $bank_transaction_id, $bank_transactions, $unitdp = null) + public function updateBankTransactionWithHttpInfo($xero_tenant_id, $bank_transaction_id, $bank_transactions, $unitdp = null, $idempotency_key = null) { - $request = $this->updateBankTransactionRequest($xero_tenant_id, $bank_transaction_id, $bank_transactions, $unitdp); + $request = $this->updateBankTransactionRequest($xero_tenant_id, $bank_transaction_id, $bank_transactions, $unitdp, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -52692,12 +54399,13 @@ public function updateBankTransactionWithHttpInfo($xero_tenant_id, $bank_transac * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions $bank_transactions (required) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateBankTransactionAsync($xero_tenant_id, $bank_transaction_id, $bank_transactions, $unitdp = null) + public function updateBankTransactionAsync($xero_tenant_id, $bank_transaction_id, $bank_transactions, $unitdp = null, $idempotency_key = null) { - return $this->updateBankTransactionAsyncWithHttpInfo($xero_tenant_id, $bank_transaction_id, $bank_transactions, $unitdp) + return $this->updateBankTransactionAsyncWithHttpInfo($xero_tenant_id, $bank_transaction_id, $bank_transactions, $unitdp, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -52711,12 +54419,13 @@ function ($response) { * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions $bank_transactions (required) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateBankTransactionAsyncWithHttpInfo($xero_tenant_id, $bank_transaction_id, $bank_transactions, $unitdp = null) + public function updateBankTransactionAsyncWithHttpInfo($xero_tenant_id, $bank_transaction_id, $bank_transactions, $unitdp = null, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions'; - $request = $this->updateBankTransactionRequest($xero_tenant_id, $bank_transaction_id, $bank_transactions, $unitdp); + $request = $this->updateBankTransactionRequest($xero_tenant_id, $bank_transaction_id, $bank_transactions, $unitdp, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -52756,9 +54465,10 @@ function ($exception) { * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions $bank_transactions (required) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateBankTransactionRequest($xero_tenant_id, $bank_transaction_id, $bank_transactions, $unitdp = null) + protected function updateBankTransactionRequest($xero_tenant_id, $bank_transaction_id, $bank_transactions, $unitdp = null, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -52792,6 +54502,10 @@ protected function updateBankTransactionRequest($xero_tenant_id, $bank_transacti if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($bank_transaction_id !== null) { $resourcePath = str_replace( @@ -52870,13 +54584,14 @@ protected function updateBankTransactionRequest($xero_tenant_id, $bank_transacti * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updateBankTransactionAttachmentByFileName($xero_tenant_id, $bank_transaction_id, $file_name, $body) + public function updateBankTransactionAttachmentByFileName($xero_tenant_id, $bank_transaction_id, $file_name, $body, $idempotency_key = null) { - list($response) = $this->updateBankTransactionAttachmentByFileNameWithHttpInfo($xero_tenant_id, $bank_transaction_id, $file_name, $body); + list($response) = $this->updateBankTransactionAttachmentByFileNameWithHttpInfo($xero_tenant_id, $bank_transaction_id, $file_name, $body, $idempotency_key); return $response; } /** @@ -52886,13 +54601,14 @@ public function updateBankTransactionAttachmentByFileName($xero_tenant_id, $bank * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateBankTransactionAttachmentByFileNameWithHttpInfo($xero_tenant_id, $bank_transaction_id, $file_name, $body) + public function updateBankTransactionAttachmentByFileNameWithHttpInfo($xero_tenant_id, $bank_transaction_id, $file_name, $body, $idempotency_key = null) { - $request = $this->updateBankTransactionAttachmentByFileNameRequest($xero_tenant_id, $bank_transaction_id, $file_name, $body); + $request = $this->updateBankTransactionAttachmentByFileNameRequest($xero_tenant_id, $bank_transaction_id, $file_name, $body, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -52984,12 +54700,13 @@ public function updateBankTransactionAttachmentByFileNameWithHttpInfo($xero_tena * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateBankTransactionAttachmentByFileNameAsync($xero_tenant_id, $bank_transaction_id, $file_name, $body) + public function updateBankTransactionAttachmentByFileNameAsync($xero_tenant_id, $bank_transaction_id, $file_name, $body, $idempotency_key = null) { - return $this->updateBankTransactionAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $bank_transaction_id, $file_name, $body) + return $this->updateBankTransactionAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $bank_transaction_id, $file_name, $body, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -53003,12 +54720,13 @@ function ($response) { * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateBankTransactionAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $bank_transaction_id, $file_name, $body) + public function updateBankTransactionAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $bank_transaction_id, $file_name, $body, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; - $request = $this->updateBankTransactionAttachmentByFileNameRequest($xero_tenant_id, $bank_transaction_id, $file_name, $body); + $request = $this->updateBankTransactionAttachmentByFileNameRequest($xero_tenant_id, $bank_transaction_id, $file_name, $body, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -53048,9 +54766,10 @@ function ($exception) { * @param string $bank_transaction_id Xero generated unique identifier for a bank transaction (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateBankTransactionAttachmentByFileNameRequest($xero_tenant_id, $bank_transaction_id, $file_name, $body) + protected function updateBankTransactionAttachmentByFileNameRequest($xero_tenant_id, $bank_transaction_id, $file_name, $body, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -53086,6 +54805,10 @@ protected function updateBankTransactionAttachmentByFileNameRequest($xero_tenant if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($bank_transaction_id !== null) { $resourcePath = str_replace( @@ -53171,13 +54894,14 @@ protected function updateBankTransactionAttachmentByFileNameRequest($xero_tenant * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updateBankTransferAttachmentByFileName($xero_tenant_id, $bank_transfer_id, $file_name, $body) + public function updateBankTransferAttachmentByFileName($xero_tenant_id, $bank_transfer_id, $file_name, $body, $idempotency_key = null) { - list($response) = $this->updateBankTransferAttachmentByFileNameWithHttpInfo($xero_tenant_id, $bank_transfer_id, $file_name, $body); + list($response) = $this->updateBankTransferAttachmentByFileNameWithHttpInfo($xero_tenant_id, $bank_transfer_id, $file_name, $body, $idempotency_key); return $response; } /** @@ -53186,13 +54910,14 @@ public function updateBankTransferAttachmentByFileName($xero_tenant_id, $bank_tr * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateBankTransferAttachmentByFileNameWithHttpInfo($xero_tenant_id, $bank_transfer_id, $file_name, $body) + public function updateBankTransferAttachmentByFileNameWithHttpInfo($xero_tenant_id, $bank_transfer_id, $file_name, $body, $idempotency_key = null) { - $request = $this->updateBankTransferAttachmentByFileNameRequest($xero_tenant_id, $bank_transfer_id, $file_name, $body); + $request = $this->updateBankTransferAttachmentByFileNameRequest($xero_tenant_id, $bank_transfer_id, $file_name, $body, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -53284,12 +55009,13 @@ public function updateBankTransferAttachmentByFileNameWithHttpInfo($xero_tenant_ * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateBankTransferAttachmentByFileNameAsync($xero_tenant_id, $bank_transfer_id, $file_name, $body) + public function updateBankTransferAttachmentByFileNameAsync($xero_tenant_id, $bank_transfer_id, $file_name, $body, $idempotency_key = null) { - return $this->updateBankTransferAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $bank_transfer_id, $file_name, $body) + return $this->updateBankTransferAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $bank_transfer_id, $file_name, $body, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -53303,12 +55029,13 @@ function ($response) { * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateBankTransferAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $bank_transfer_id, $file_name, $body) + public function updateBankTransferAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $bank_transfer_id, $file_name, $body, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; - $request = $this->updateBankTransferAttachmentByFileNameRequest($xero_tenant_id, $bank_transfer_id, $file_name, $body); + $request = $this->updateBankTransferAttachmentByFileNameRequest($xero_tenant_id, $bank_transfer_id, $file_name, $body, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -53348,9 +55075,10 @@ function ($exception) { * @param string $bank_transfer_id Xero generated unique identifier for a bank transfer (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateBankTransferAttachmentByFileNameRequest($xero_tenant_id, $bank_transfer_id, $file_name, $body) + protected function updateBankTransferAttachmentByFileNameRequest($xero_tenant_id, $bank_transfer_id, $file_name, $body, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -53386,6 +55114,10 @@ protected function updateBankTransferAttachmentByFileNameRequest($xero_tenant_id if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($bank_transfer_id !== null) { $resourcePath = str_replace( @@ -53471,13 +55203,14 @@ protected function updateBankTransferAttachmentByFileNameRequest($xero_tenant_id * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $contact_id Unique identifier for a Contact (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts $contacts an array of Contacts containing single Contact object with properties to update (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updateContact($xero_tenant_id, $contact_id, $contacts) + public function updateContact($xero_tenant_id, $contact_id, $contacts, $idempotency_key = null) { - list($response) = $this->updateContactWithHttpInfo($xero_tenant_id, $contact_id, $contacts); + list($response) = $this->updateContactWithHttpInfo($xero_tenant_id, $contact_id, $contacts, $idempotency_key); return $response; } /** @@ -53486,13 +55219,14 @@ public function updateContact($xero_tenant_id, $contact_id, $contacts) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $contact_id Unique identifier for a Contact (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts $contacts an array of Contacts containing single Contact object with properties to update (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Contacts|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateContactWithHttpInfo($xero_tenant_id, $contact_id, $contacts) + public function updateContactWithHttpInfo($xero_tenant_id, $contact_id, $contacts, $idempotency_key = null) { - $request = $this->updateContactRequest($xero_tenant_id, $contact_id, $contacts); + $request = $this->updateContactRequest($xero_tenant_id, $contact_id, $contacts, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -53583,12 +55317,13 @@ public function updateContactWithHttpInfo($xero_tenant_id, $contact_id, $contact * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $contact_id Unique identifier for a Contact (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts $contacts an array of Contacts containing single Contact object with properties to update (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateContactAsync($xero_tenant_id, $contact_id, $contacts) + public function updateContactAsync($xero_tenant_id, $contact_id, $contacts, $idempotency_key = null) { - return $this->updateContactAsyncWithHttpInfo($xero_tenant_id, $contact_id, $contacts) + return $this->updateContactAsyncWithHttpInfo($xero_tenant_id, $contact_id, $contacts, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -53601,12 +55336,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $contact_id Unique identifier for a Contact (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts $contacts an array of Contacts containing single Contact object with properties to update (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateContactAsyncWithHttpInfo($xero_tenant_id, $contact_id, $contacts) + public function updateContactAsyncWithHttpInfo($xero_tenant_id, $contact_id, $contacts, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts'; - $request = $this->updateContactRequest($xero_tenant_id, $contact_id, $contacts); + $request = $this->updateContactRequest($xero_tenant_id, $contact_id, $contacts, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -53645,9 +55381,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $contact_id Unique identifier for a Contact (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts $contacts an array of Contacts containing single Contact object with properties to update (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateContactRequest($xero_tenant_id, $contact_id, $contacts) + protected function updateContactRequest($xero_tenant_id, $contact_id, $contacts, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -53677,6 +55414,10 @@ protected function updateContactRequest($xero_tenant_id, $contact_id, $contacts) if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($contact_id !== null) { $resourcePath = str_replace( @@ -53754,13 +55495,14 @@ protected function updateContactRequest($xero_tenant_id, $contact_id, $contacts) * @param string $contact_id Unique identifier for a Contact (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updateContactAttachmentByFileName($xero_tenant_id, $contact_id, $file_name, $body) + public function updateContactAttachmentByFileName($xero_tenant_id, $contact_id, $file_name, $body, $idempotency_key = null) { - list($response) = $this->updateContactAttachmentByFileNameWithHttpInfo($xero_tenant_id, $contact_id, $file_name, $body); + list($response) = $this->updateContactAttachmentByFileNameWithHttpInfo($xero_tenant_id, $contact_id, $file_name, $body, $idempotency_key); return $response; } /** @@ -53769,13 +55511,14 @@ public function updateContactAttachmentByFileName($xero_tenant_id, $contact_id, * @param string $contact_id Unique identifier for a Contact (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateContactAttachmentByFileNameWithHttpInfo($xero_tenant_id, $contact_id, $file_name, $body) + public function updateContactAttachmentByFileNameWithHttpInfo($xero_tenant_id, $contact_id, $file_name, $body, $idempotency_key = null) { - $request = $this->updateContactAttachmentByFileNameRequest($xero_tenant_id, $contact_id, $file_name, $body); + $request = $this->updateContactAttachmentByFileNameRequest($xero_tenant_id, $contact_id, $file_name, $body, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -53867,12 +55610,13 @@ public function updateContactAttachmentByFileNameWithHttpInfo($xero_tenant_id, $ * @param string $contact_id Unique identifier for a Contact (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateContactAttachmentByFileNameAsync($xero_tenant_id, $contact_id, $file_name, $body) + public function updateContactAttachmentByFileNameAsync($xero_tenant_id, $contact_id, $file_name, $body, $idempotency_key = null) { - return $this->updateContactAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $contact_id, $file_name, $body) + return $this->updateContactAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $contact_id, $file_name, $body, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -53886,12 +55630,13 @@ function ($response) { * @param string $contact_id Unique identifier for a Contact (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateContactAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $contact_id, $file_name, $body) + public function updateContactAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $contact_id, $file_name, $body, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; - $request = $this->updateContactAttachmentByFileNameRequest($xero_tenant_id, $contact_id, $file_name, $body); + $request = $this->updateContactAttachmentByFileNameRequest($xero_tenant_id, $contact_id, $file_name, $body, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -53931,9 +55676,10 @@ function ($exception) { * @param string $contact_id Unique identifier for a Contact (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateContactAttachmentByFileNameRequest($xero_tenant_id, $contact_id, $file_name, $body) + protected function updateContactAttachmentByFileNameRequest($xero_tenant_id, $contact_id, $file_name, $body, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -53969,6 +55715,10 @@ protected function updateContactAttachmentByFileNameRequest($xero_tenant_id, $co if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($contact_id !== null) { $resourcePath = str_replace( @@ -54054,13 +55804,14 @@ protected function updateContactAttachmentByFileNameRequest($xero_tenant_id, $co * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $contact_group_id Unique identifier for a Contact Group (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ContactGroups $contact_groups an array of Contact groups with Name of specific group to update (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ContactGroups|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updateContactGroup($xero_tenant_id, $contact_group_id, $contact_groups) + public function updateContactGroup($xero_tenant_id, $contact_group_id, $contact_groups, $idempotency_key = null) { - list($response) = $this->updateContactGroupWithHttpInfo($xero_tenant_id, $contact_group_id, $contact_groups); + list($response) = $this->updateContactGroupWithHttpInfo($xero_tenant_id, $contact_group_id, $contact_groups, $idempotency_key); return $response; } /** @@ -54069,13 +55820,14 @@ public function updateContactGroup($xero_tenant_id, $contact_group_id, $contact_ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $contact_group_id Unique identifier for a Contact Group (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ContactGroups $contact_groups an array of Contact groups with Name of specific group to update (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\ContactGroups|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateContactGroupWithHttpInfo($xero_tenant_id, $contact_group_id, $contact_groups) + public function updateContactGroupWithHttpInfo($xero_tenant_id, $contact_group_id, $contact_groups, $idempotency_key = null) { - $request = $this->updateContactGroupRequest($xero_tenant_id, $contact_group_id, $contact_groups); + $request = $this->updateContactGroupRequest($xero_tenant_id, $contact_group_id, $contact_groups, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -54166,12 +55918,13 @@ public function updateContactGroupWithHttpInfo($xero_tenant_id, $contact_group_i * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $contact_group_id Unique identifier for a Contact Group (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ContactGroups $contact_groups an array of Contact groups with Name of specific group to update (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateContactGroupAsync($xero_tenant_id, $contact_group_id, $contact_groups) + public function updateContactGroupAsync($xero_tenant_id, $contact_group_id, $contact_groups, $idempotency_key = null) { - return $this->updateContactGroupAsyncWithHttpInfo($xero_tenant_id, $contact_group_id, $contact_groups) + return $this->updateContactGroupAsyncWithHttpInfo($xero_tenant_id, $contact_group_id, $contact_groups, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -54184,12 +55937,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $contact_group_id Unique identifier for a Contact Group (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ContactGroups $contact_groups an array of Contact groups with Name of specific group to update (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateContactGroupAsyncWithHttpInfo($xero_tenant_id, $contact_group_id, $contact_groups) + public function updateContactGroupAsyncWithHttpInfo($xero_tenant_id, $contact_group_id, $contact_groups, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ContactGroups'; - $request = $this->updateContactGroupRequest($xero_tenant_id, $contact_group_id, $contact_groups); + $request = $this->updateContactGroupRequest($xero_tenant_id, $contact_group_id, $contact_groups, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -54228,9 +55982,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $contact_group_id Unique identifier for a Contact Group (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ContactGroups $contact_groups an array of Contact groups with Name of specific group to update (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateContactGroupRequest($xero_tenant_id, $contact_group_id, $contact_groups) + protected function updateContactGroupRequest($xero_tenant_id, $contact_group_id, $contact_groups, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -54260,6 +56015,10 @@ protected function updateContactGroupRequest($xero_tenant_id, $contact_group_id, if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($contact_group_id !== null) { $resourcePath = str_replace( @@ -54338,13 +56097,14 @@ protected function updateContactGroupRequest($xero_tenant_id, $contact_group_id, * @param string $credit_note_id Unique identifier for a Credit Note (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CreditNotes $credit_notes an array of Credit Notes containing credit note details to update (required) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CreditNotes|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updateCreditNote($xero_tenant_id, $credit_note_id, $credit_notes, $unitdp = null) + public function updateCreditNote($xero_tenant_id, $credit_note_id, $credit_notes, $unitdp = null, $idempotency_key = null) { - list($response) = $this->updateCreditNoteWithHttpInfo($xero_tenant_id, $credit_note_id, $credit_notes, $unitdp); + list($response) = $this->updateCreditNoteWithHttpInfo($xero_tenant_id, $credit_note_id, $credit_notes, $unitdp, $idempotency_key); return $response; } /** @@ -54354,13 +56114,14 @@ public function updateCreditNote($xero_tenant_id, $credit_note_id, $credit_notes * @param string $credit_note_id Unique identifier for a Credit Note (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CreditNotes $credit_notes an array of Credit Notes containing credit note details to update (required) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\CreditNotes|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateCreditNoteWithHttpInfo($xero_tenant_id, $credit_note_id, $credit_notes, $unitdp = null) + public function updateCreditNoteWithHttpInfo($xero_tenant_id, $credit_note_id, $credit_notes, $unitdp = null, $idempotency_key = null) { - $request = $this->updateCreditNoteRequest($xero_tenant_id, $credit_note_id, $credit_notes, $unitdp); + $request = $this->updateCreditNoteRequest($xero_tenant_id, $credit_note_id, $credit_notes, $unitdp, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -54452,12 +56213,13 @@ public function updateCreditNoteWithHttpInfo($xero_tenant_id, $credit_note_id, $ * @param string $credit_note_id Unique identifier for a Credit Note (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CreditNotes $credit_notes an array of Credit Notes containing credit note details to update (required) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateCreditNoteAsync($xero_tenant_id, $credit_note_id, $credit_notes, $unitdp = null) + public function updateCreditNoteAsync($xero_tenant_id, $credit_note_id, $credit_notes, $unitdp = null, $idempotency_key = null) { - return $this->updateCreditNoteAsyncWithHttpInfo($xero_tenant_id, $credit_note_id, $credit_notes, $unitdp) + return $this->updateCreditNoteAsyncWithHttpInfo($xero_tenant_id, $credit_note_id, $credit_notes, $unitdp, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -54471,12 +56233,13 @@ function ($response) { * @param string $credit_note_id Unique identifier for a Credit Note (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CreditNotes $credit_notes an array of Credit Notes containing credit note details to update (required) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateCreditNoteAsyncWithHttpInfo($xero_tenant_id, $credit_note_id, $credit_notes, $unitdp = null) + public function updateCreditNoteAsyncWithHttpInfo($xero_tenant_id, $credit_note_id, $credit_notes, $unitdp = null, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CreditNotes'; - $request = $this->updateCreditNoteRequest($xero_tenant_id, $credit_note_id, $credit_notes, $unitdp); + $request = $this->updateCreditNoteRequest($xero_tenant_id, $credit_note_id, $credit_notes, $unitdp, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -54516,9 +56279,10 @@ function ($exception) { * @param string $credit_note_id Unique identifier for a Credit Note (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CreditNotes $credit_notes an array of Credit Notes containing credit note details to update (required) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateCreditNoteRequest($xero_tenant_id, $credit_note_id, $credit_notes, $unitdp = null) + protected function updateCreditNoteRequest($xero_tenant_id, $credit_note_id, $credit_notes, $unitdp = null, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -54552,6 +56316,10 @@ protected function updateCreditNoteRequest($xero_tenant_id, $credit_note_id, $cr if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($credit_note_id !== null) { $resourcePath = str_replace( @@ -54630,13 +56398,14 @@ protected function updateCreditNoteRequest($xero_tenant_id, $credit_note_id, $cr * @param string $credit_note_id Unique identifier for a Credit Note (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updateCreditNoteAttachmentByFileName($xero_tenant_id, $credit_note_id, $file_name, $body) + public function updateCreditNoteAttachmentByFileName($xero_tenant_id, $credit_note_id, $file_name, $body, $idempotency_key = null) { - list($response) = $this->updateCreditNoteAttachmentByFileNameWithHttpInfo($xero_tenant_id, $credit_note_id, $file_name, $body); + list($response) = $this->updateCreditNoteAttachmentByFileNameWithHttpInfo($xero_tenant_id, $credit_note_id, $file_name, $body, $idempotency_key); return $response; } /** @@ -54646,13 +56415,14 @@ public function updateCreditNoteAttachmentByFileName($xero_tenant_id, $credit_no * @param string $credit_note_id Unique identifier for a Credit Note (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateCreditNoteAttachmentByFileNameWithHttpInfo($xero_tenant_id, $credit_note_id, $file_name, $body) + public function updateCreditNoteAttachmentByFileNameWithHttpInfo($xero_tenant_id, $credit_note_id, $file_name, $body, $idempotency_key = null) { - $request = $this->updateCreditNoteAttachmentByFileNameRequest($xero_tenant_id, $credit_note_id, $file_name, $body); + $request = $this->updateCreditNoteAttachmentByFileNameRequest($xero_tenant_id, $credit_note_id, $file_name, $body, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -54744,12 +56514,13 @@ public function updateCreditNoteAttachmentByFileNameWithHttpInfo($xero_tenant_id * @param string $credit_note_id Unique identifier for a Credit Note (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateCreditNoteAttachmentByFileNameAsync($xero_tenant_id, $credit_note_id, $file_name, $body) + public function updateCreditNoteAttachmentByFileNameAsync($xero_tenant_id, $credit_note_id, $file_name, $body, $idempotency_key = null) { - return $this->updateCreditNoteAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $credit_note_id, $file_name, $body) + return $this->updateCreditNoteAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $credit_note_id, $file_name, $body, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -54763,12 +56534,13 @@ function ($response) { * @param string $credit_note_id Unique identifier for a Credit Note (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateCreditNoteAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $credit_note_id, $file_name, $body) + public function updateCreditNoteAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $credit_note_id, $file_name, $body, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; - $request = $this->updateCreditNoteAttachmentByFileNameRequest($xero_tenant_id, $credit_note_id, $file_name, $body); + $request = $this->updateCreditNoteAttachmentByFileNameRequest($xero_tenant_id, $credit_note_id, $file_name, $body, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -54808,9 +56580,10 @@ function ($exception) { * @param string $credit_note_id Unique identifier for a Credit Note (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateCreditNoteAttachmentByFileNameRequest($xero_tenant_id, $credit_note_id, $file_name, $body) + protected function updateCreditNoteAttachmentByFileNameRequest($xero_tenant_id, $credit_note_id, $file_name, $body, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -54846,6 +56619,10 @@ protected function updateCreditNoteAttachmentByFileNameRequest($xero_tenant_id, if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($credit_note_id !== null) { $resourcePath = str_replace( @@ -54931,13 +56708,14 @@ protected function updateCreditNoteAttachmentByFileNameRequest($xero_tenant_id, * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $expense_claim_id Unique identifier for a ExpenseClaim (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ExpenseClaims $expense_claims expense_claims (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ExpenseClaims|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updateExpenseClaim($xero_tenant_id, $expense_claim_id, $expense_claims) + public function updateExpenseClaim($xero_tenant_id, $expense_claim_id, $expense_claims, $idempotency_key = null) { - list($response) = $this->updateExpenseClaimWithHttpInfo($xero_tenant_id, $expense_claim_id, $expense_claims); + list($response) = $this->updateExpenseClaimWithHttpInfo($xero_tenant_id, $expense_claim_id, $expense_claims, $idempotency_key); return $response; } /** @@ -54946,13 +56724,14 @@ public function updateExpenseClaim($xero_tenant_id, $expense_claim_id, $expense_ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $expense_claim_id Unique identifier for a ExpenseClaim (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ExpenseClaims $expense_claims (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\ExpenseClaims|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateExpenseClaimWithHttpInfo($xero_tenant_id, $expense_claim_id, $expense_claims) + public function updateExpenseClaimWithHttpInfo($xero_tenant_id, $expense_claim_id, $expense_claims, $idempotency_key = null) { - $request = $this->updateExpenseClaimRequest($xero_tenant_id, $expense_claim_id, $expense_claims); + $request = $this->updateExpenseClaimRequest($xero_tenant_id, $expense_claim_id, $expense_claims, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -55043,12 +56822,13 @@ public function updateExpenseClaimWithHttpInfo($xero_tenant_id, $expense_claim_i * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $expense_claim_id Unique identifier for a ExpenseClaim (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ExpenseClaims $expense_claims (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateExpenseClaimAsync($xero_tenant_id, $expense_claim_id, $expense_claims) + public function updateExpenseClaimAsync($xero_tenant_id, $expense_claim_id, $expense_claims, $idempotency_key = null) { - return $this->updateExpenseClaimAsyncWithHttpInfo($xero_tenant_id, $expense_claim_id, $expense_claims) + return $this->updateExpenseClaimAsyncWithHttpInfo($xero_tenant_id, $expense_claim_id, $expense_claims, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -55061,12 +56841,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $expense_claim_id Unique identifier for a ExpenseClaim (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ExpenseClaims $expense_claims (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateExpenseClaimAsyncWithHttpInfo($xero_tenant_id, $expense_claim_id, $expense_claims) + public function updateExpenseClaimAsyncWithHttpInfo($xero_tenant_id, $expense_claim_id, $expense_claims, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ExpenseClaims'; - $request = $this->updateExpenseClaimRequest($xero_tenant_id, $expense_claim_id, $expense_claims); + $request = $this->updateExpenseClaimRequest($xero_tenant_id, $expense_claim_id, $expense_claims, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -55105,9 +56886,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $expense_claim_id Unique identifier for a ExpenseClaim (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ExpenseClaims $expense_claims (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateExpenseClaimRequest($xero_tenant_id, $expense_claim_id, $expense_claims) + protected function updateExpenseClaimRequest($xero_tenant_id, $expense_claim_id, $expense_claims, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -55137,6 +56919,10 @@ protected function updateExpenseClaimRequest($xero_tenant_id, $expense_claim_id, if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($expense_claim_id !== null) { $resourcePath = str_replace( @@ -55215,13 +57001,14 @@ protected function updateExpenseClaimRequest($xero_tenant_id, $expense_claim_id, * @param string $invoice_id Unique identifier for an Invoice (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Invoices $invoices invoices (required) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Invoices|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updateInvoice($xero_tenant_id, $invoice_id, $invoices, $unitdp = null) + public function updateInvoice($xero_tenant_id, $invoice_id, $invoices, $unitdp = null, $idempotency_key = null) { - list($response) = $this->updateInvoiceWithHttpInfo($xero_tenant_id, $invoice_id, $invoices, $unitdp); + list($response) = $this->updateInvoiceWithHttpInfo($xero_tenant_id, $invoice_id, $invoices, $unitdp, $idempotency_key); return $response; } /** @@ -55231,13 +57018,14 @@ public function updateInvoice($xero_tenant_id, $invoice_id, $invoices, $unitdp = * @param string $invoice_id Unique identifier for an Invoice (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Invoices $invoices (required) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Invoices|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateInvoiceWithHttpInfo($xero_tenant_id, $invoice_id, $invoices, $unitdp = null) + public function updateInvoiceWithHttpInfo($xero_tenant_id, $invoice_id, $invoices, $unitdp = null, $idempotency_key = null) { - $request = $this->updateInvoiceRequest($xero_tenant_id, $invoice_id, $invoices, $unitdp); + $request = $this->updateInvoiceRequest($xero_tenant_id, $invoice_id, $invoices, $unitdp, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -55329,12 +57117,13 @@ public function updateInvoiceWithHttpInfo($xero_tenant_id, $invoice_id, $invoice * @param string $invoice_id Unique identifier for an Invoice (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Invoices $invoices (required) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateInvoiceAsync($xero_tenant_id, $invoice_id, $invoices, $unitdp = null) + public function updateInvoiceAsync($xero_tenant_id, $invoice_id, $invoices, $unitdp = null, $idempotency_key = null) { - return $this->updateInvoiceAsyncWithHttpInfo($xero_tenant_id, $invoice_id, $invoices, $unitdp) + return $this->updateInvoiceAsyncWithHttpInfo($xero_tenant_id, $invoice_id, $invoices, $unitdp, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -55348,12 +57137,13 @@ function ($response) { * @param string $invoice_id Unique identifier for an Invoice (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Invoices $invoices (required) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateInvoiceAsyncWithHttpInfo($xero_tenant_id, $invoice_id, $invoices, $unitdp = null) + public function updateInvoiceAsyncWithHttpInfo($xero_tenant_id, $invoice_id, $invoices, $unitdp = null, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Invoices'; - $request = $this->updateInvoiceRequest($xero_tenant_id, $invoice_id, $invoices, $unitdp); + $request = $this->updateInvoiceRequest($xero_tenant_id, $invoice_id, $invoices, $unitdp, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -55393,9 +57183,10 @@ function ($exception) { * @param string $invoice_id Unique identifier for an Invoice (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Invoices $invoices (required) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateInvoiceRequest($xero_tenant_id, $invoice_id, $invoices, $unitdp = null) + protected function updateInvoiceRequest($xero_tenant_id, $invoice_id, $invoices, $unitdp = null, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -55429,6 +57220,10 @@ protected function updateInvoiceRequest($xero_tenant_id, $invoice_id, $invoices, if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($invoice_id !== null) { $resourcePath = str_replace( @@ -55507,13 +57302,14 @@ protected function updateInvoiceRequest($xero_tenant_id, $invoice_id, $invoices, * @param string $invoice_id Unique identifier for an Invoice (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updateInvoiceAttachmentByFileName($xero_tenant_id, $invoice_id, $file_name, $body) + public function updateInvoiceAttachmentByFileName($xero_tenant_id, $invoice_id, $file_name, $body, $idempotency_key = null) { - list($response) = $this->updateInvoiceAttachmentByFileNameWithHttpInfo($xero_tenant_id, $invoice_id, $file_name, $body); + list($response) = $this->updateInvoiceAttachmentByFileNameWithHttpInfo($xero_tenant_id, $invoice_id, $file_name, $body, $idempotency_key); return $response; } /** @@ -55523,13 +57319,14 @@ public function updateInvoiceAttachmentByFileName($xero_tenant_id, $invoice_id, * @param string $invoice_id Unique identifier for an Invoice (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateInvoiceAttachmentByFileNameWithHttpInfo($xero_tenant_id, $invoice_id, $file_name, $body) + public function updateInvoiceAttachmentByFileNameWithHttpInfo($xero_tenant_id, $invoice_id, $file_name, $body, $idempotency_key = null) { - $request = $this->updateInvoiceAttachmentByFileNameRequest($xero_tenant_id, $invoice_id, $file_name, $body); + $request = $this->updateInvoiceAttachmentByFileNameRequest($xero_tenant_id, $invoice_id, $file_name, $body, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -55621,12 +57418,13 @@ public function updateInvoiceAttachmentByFileNameWithHttpInfo($xero_tenant_id, $ * @param string $invoice_id Unique identifier for an Invoice (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateInvoiceAttachmentByFileNameAsync($xero_tenant_id, $invoice_id, $file_name, $body) + public function updateInvoiceAttachmentByFileNameAsync($xero_tenant_id, $invoice_id, $file_name, $body, $idempotency_key = null) { - return $this->updateInvoiceAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $invoice_id, $file_name, $body) + return $this->updateInvoiceAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $invoice_id, $file_name, $body, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -55640,12 +57438,13 @@ function ($response) { * @param string $invoice_id Unique identifier for an Invoice (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateInvoiceAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $invoice_id, $file_name, $body) + public function updateInvoiceAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $invoice_id, $file_name, $body, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; - $request = $this->updateInvoiceAttachmentByFileNameRequest($xero_tenant_id, $invoice_id, $file_name, $body); + $request = $this->updateInvoiceAttachmentByFileNameRequest($xero_tenant_id, $invoice_id, $file_name, $body, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -55685,9 +57484,10 @@ function ($exception) { * @param string $invoice_id Unique identifier for an Invoice (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateInvoiceAttachmentByFileNameRequest($xero_tenant_id, $invoice_id, $file_name, $body) + protected function updateInvoiceAttachmentByFileNameRequest($xero_tenant_id, $invoice_id, $file_name, $body, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -55723,6 +57523,10 @@ protected function updateInvoiceAttachmentByFileNameRequest($xero_tenant_id, $in if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($invoice_id !== null) { $resourcePath = str_replace( @@ -55809,13 +57613,14 @@ protected function updateInvoiceAttachmentByFileNameRequest($xero_tenant_id, $in * @param string $item_id Unique identifier for an Item (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Items $items items (required) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Items|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updateItem($xero_tenant_id, $item_id, $items, $unitdp = null) + public function updateItem($xero_tenant_id, $item_id, $items, $unitdp = null, $idempotency_key = null) { - list($response) = $this->updateItemWithHttpInfo($xero_tenant_id, $item_id, $items, $unitdp); + list($response) = $this->updateItemWithHttpInfo($xero_tenant_id, $item_id, $items, $unitdp, $idempotency_key); return $response; } /** @@ -55825,13 +57630,14 @@ public function updateItem($xero_tenant_id, $item_id, $items, $unitdp = null) * @param string $item_id Unique identifier for an Item (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Items $items (required) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Items|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateItemWithHttpInfo($xero_tenant_id, $item_id, $items, $unitdp = null) + public function updateItemWithHttpInfo($xero_tenant_id, $item_id, $items, $unitdp = null, $idempotency_key = null) { - $request = $this->updateItemRequest($xero_tenant_id, $item_id, $items, $unitdp); + $request = $this->updateItemRequest($xero_tenant_id, $item_id, $items, $unitdp, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -55923,12 +57729,13 @@ public function updateItemWithHttpInfo($xero_tenant_id, $item_id, $items, $unitd * @param string $item_id Unique identifier for an Item (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Items $items (required) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateItemAsync($xero_tenant_id, $item_id, $items, $unitdp = null) + public function updateItemAsync($xero_tenant_id, $item_id, $items, $unitdp = null, $idempotency_key = null) { - return $this->updateItemAsyncWithHttpInfo($xero_tenant_id, $item_id, $items, $unitdp) + return $this->updateItemAsyncWithHttpInfo($xero_tenant_id, $item_id, $items, $unitdp, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -55942,12 +57749,13 @@ function ($response) { * @param string $item_id Unique identifier for an Item (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Items $items (required) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateItemAsyncWithHttpInfo($xero_tenant_id, $item_id, $items, $unitdp = null) + public function updateItemAsyncWithHttpInfo($xero_tenant_id, $item_id, $items, $unitdp = null, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Items'; - $request = $this->updateItemRequest($xero_tenant_id, $item_id, $items, $unitdp); + $request = $this->updateItemRequest($xero_tenant_id, $item_id, $items, $unitdp, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -55987,9 +57795,10 @@ function ($exception) { * @param string $item_id Unique identifier for an Item (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Items $items (required) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateItemRequest($xero_tenant_id, $item_id, $items, $unitdp = null) + protected function updateItemRequest($xero_tenant_id, $item_id, $items, $unitdp = null, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -56023,6 +57832,10 @@ protected function updateItemRequest($xero_tenant_id, $item_id, $items, $unitdp if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($item_id !== null) { $resourcePath = str_replace( @@ -56100,13 +57913,14 @@ protected function updateItemRequest($xero_tenant_id, $item_id, $items, $unitdp * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $linked_transaction_id Unique identifier for a LinkedTransaction (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\LinkedTransactions $linked_transactions linked_transactions (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\LinkedTransactions|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updateLinkedTransaction($xero_tenant_id, $linked_transaction_id, $linked_transactions) + public function updateLinkedTransaction($xero_tenant_id, $linked_transaction_id, $linked_transactions, $idempotency_key = null) { - list($response) = $this->updateLinkedTransactionWithHttpInfo($xero_tenant_id, $linked_transaction_id, $linked_transactions); + list($response) = $this->updateLinkedTransactionWithHttpInfo($xero_tenant_id, $linked_transaction_id, $linked_transactions, $idempotency_key); return $response; } /** @@ -56115,13 +57929,14 @@ public function updateLinkedTransaction($xero_tenant_id, $linked_transaction_id, * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $linked_transaction_id Unique identifier for a LinkedTransaction (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\LinkedTransactions $linked_transactions (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\LinkedTransactions|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateLinkedTransactionWithHttpInfo($xero_tenant_id, $linked_transaction_id, $linked_transactions) + public function updateLinkedTransactionWithHttpInfo($xero_tenant_id, $linked_transaction_id, $linked_transactions, $idempotency_key = null) { - $request = $this->updateLinkedTransactionRequest($xero_tenant_id, $linked_transaction_id, $linked_transactions); + $request = $this->updateLinkedTransactionRequest($xero_tenant_id, $linked_transaction_id, $linked_transactions, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -56212,12 +58027,13 @@ public function updateLinkedTransactionWithHttpInfo($xero_tenant_id, $linked_tra * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $linked_transaction_id Unique identifier for a LinkedTransaction (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\LinkedTransactions $linked_transactions (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateLinkedTransactionAsync($xero_tenant_id, $linked_transaction_id, $linked_transactions) + public function updateLinkedTransactionAsync($xero_tenant_id, $linked_transaction_id, $linked_transactions, $idempotency_key = null) { - return $this->updateLinkedTransactionAsyncWithHttpInfo($xero_tenant_id, $linked_transaction_id, $linked_transactions) + return $this->updateLinkedTransactionAsyncWithHttpInfo($xero_tenant_id, $linked_transaction_id, $linked_transactions, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -56230,12 +58046,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $linked_transaction_id Unique identifier for a LinkedTransaction (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\LinkedTransactions $linked_transactions (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateLinkedTransactionAsyncWithHttpInfo($xero_tenant_id, $linked_transaction_id, $linked_transactions) + public function updateLinkedTransactionAsyncWithHttpInfo($xero_tenant_id, $linked_transaction_id, $linked_transactions, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\LinkedTransactions'; - $request = $this->updateLinkedTransactionRequest($xero_tenant_id, $linked_transaction_id, $linked_transactions); + $request = $this->updateLinkedTransactionRequest($xero_tenant_id, $linked_transaction_id, $linked_transactions, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -56274,9 +58091,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $linked_transaction_id Unique identifier for a LinkedTransaction (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\LinkedTransactions $linked_transactions (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateLinkedTransactionRequest($xero_tenant_id, $linked_transaction_id, $linked_transactions) + protected function updateLinkedTransactionRequest($xero_tenant_id, $linked_transaction_id, $linked_transactions, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -56306,6 +58124,10 @@ protected function updateLinkedTransactionRequest($xero_tenant_id, $linked_trans if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($linked_transaction_id !== null) { $resourcePath = str_replace( @@ -56383,13 +58205,14 @@ protected function updateLinkedTransactionRequest($xero_tenant_id, $linked_trans * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $manual_journal_id Unique identifier for a ManualJournal (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ManualJournals $manual_journals manual_journals (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ManualJournals|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updateManualJournal($xero_tenant_id, $manual_journal_id, $manual_journals) + public function updateManualJournal($xero_tenant_id, $manual_journal_id, $manual_journals, $idempotency_key = null) { - list($response) = $this->updateManualJournalWithHttpInfo($xero_tenant_id, $manual_journal_id, $manual_journals); + list($response) = $this->updateManualJournalWithHttpInfo($xero_tenant_id, $manual_journal_id, $manual_journals, $idempotency_key); return $response; } /** @@ -56398,13 +58221,14 @@ public function updateManualJournal($xero_tenant_id, $manual_journal_id, $manual * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $manual_journal_id Unique identifier for a ManualJournal (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ManualJournals $manual_journals (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\ManualJournals|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateManualJournalWithHttpInfo($xero_tenant_id, $manual_journal_id, $manual_journals) + public function updateManualJournalWithHttpInfo($xero_tenant_id, $manual_journal_id, $manual_journals, $idempotency_key = null) { - $request = $this->updateManualJournalRequest($xero_tenant_id, $manual_journal_id, $manual_journals); + $request = $this->updateManualJournalRequest($xero_tenant_id, $manual_journal_id, $manual_journals, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -56495,12 +58319,13 @@ public function updateManualJournalWithHttpInfo($xero_tenant_id, $manual_journal * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $manual_journal_id Unique identifier for a ManualJournal (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ManualJournals $manual_journals (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateManualJournalAsync($xero_tenant_id, $manual_journal_id, $manual_journals) + public function updateManualJournalAsync($xero_tenant_id, $manual_journal_id, $manual_journals, $idempotency_key = null) { - return $this->updateManualJournalAsyncWithHttpInfo($xero_tenant_id, $manual_journal_id, $manual_journals) + return $this->updateManualJournalAsyncWithHttpInfo($xero_tenant_id, $manual_journal_id, $manual_journals, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -56513,12 +58338,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $manual_journal_id Unique identifier for a ManualJournal (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ManualJournals $manual_journals (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateManualJournalAsyncWithHttpInfo($xero_tenant_id, $manual_journal_id, $manual_journals) + public function updateManualJournalAsyncWithHttpInfo($xero_tenant_id, $manual_journal_id, $manual_journals, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ManualJournals'; - $request = $this->updateManualJournalRequest($xero_tenant_id, $manual_journal_id, $manual_journals); + $request = $this->updateManualJournalRequest($xero_tenant_id, $manual_journal_id, $manual_journals, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -56557,9 +58383,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $manual_journal_id Unique identifier for a ManualJournal (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ManualJournals $manual_journals (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateManualJournalRequest($xero_tenant_id, $manual_journal_id, $manual_journals) + protected function updateManualJournalRequest($xero_tenant_id, $manual_journal_id, $manual_journals, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -56589,6 +58416,10 @@ protected function updateManualJournalRequest($xero_tenant_id, $manual_journal_i if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($manual_journal_id !== null) { $resourcePath = str_replace( @@ -56667,13 +58498,14 @@ protected function updateManualJournalRequest($xero_tenant_id, $manual_journal_i * @param string $manual_journal_id Unique identifier for a ManualJournal (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updateManualJournalAttachmentByFileName($xero_tenant_id, $manual_journal_id, $file_name, $body) + public function updateManualJournalAttachmentByFileName($xero_tenant_id, $manual_journal_id, $file_name, $body, $idempotency_key = null) { - list($response) = $this->updateManualJournalAttachmentByFileNameWithHttpInfo($xero_tenant_id, $manual_journal_id, $file_name, $body); + list($response) = $this->updateManualJournalAttachmentByFileNameWithHttpInfo($xero_tenant_id, $manual_journal_id, $file_name, $body, $idempotency_key); return $response; } /** @@ -56683,13 +58515,14 @@ public function updateManualJournalAttachmentByFileName($xero_tenant_id, $manual * @param string $manual_journal_id Unique identifier for a ManualJournal (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateManualJournalAttachmentByFileNameWithHttpInfo($xero_tenant_id, $manual_journal_id, $file_name, $body) + public function updateManualJournalAttachmentByFileNameWithHttpInfo($xero_tenant_id, $manual_journal_id, $file_name, $body, $idempotency_key = null) { - $request = $this->updateManualJournalAttachmentByFileNameRequest($xero_tenant_id, $manual_journal_id, $file_name, $body); + $request = $this->updateManualJournalAttachmentByFileNameRequest($xero_tenant_id, $manual_journal_id, $file_name, $body, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -56781,12 +58614,13 @@ public function updateManualJournalAttachmentByFileNameWithHttpInfo($xero_tenant * @param string $manual_journal_id Unique identifier for a ManualJournal (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateManualJournalAttachmentByFileNameAsync($xero_tenant_id, $manual_journal_id, $file_name, $body) + public function updateManualJournalAttachmentByFileNameAsync($xero_tenant_id, $manual_journal_id, $file_name, $body, $idempotency_key = null) { - return $this->updateManualJournalAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $manual_journal_id, $file_name, $body) + return $this->updateManualJournalAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $manual_journal_id, $file_name, $body, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -56800,12 +58634,13 @@ function ($response) { * @param string $manual_journal_id Unique identifier for a ManualJournal (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateManualJournalAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $manual_journal_id, $file_name, $body) + public function updateManualJournalAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $manual_journal_id, $file_name, $body, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; - $request = $this->updateManualJournalAttachmentByFileNameRequest($xero_tenant_id, $manual_journal_id, $file_name, $body); + $request = $this->updateManualJournalAttachmentByFileNameRequest($xero_tenant_id, $manual_journal_id, $file_name, $body, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -56845,9 +58680,10 @@ function ($exception) { * @param string $manual_journal_id Unique identifier for a ManualJournal (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateManualJournalAttachmentByFileNameRequest($xero_tenant_id, $manual_journal_id, $file_name, $body) + protected function updateManualJournalAttachmentByFileNameRequest($xero_tenant_id, $manual_journal_id, $file_name, $body, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -56883,6 +58719,10 @@ protected function updateManualJournalAttachmentByFileNameRequest($xero_tenant_i if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($manual_journal_id !== null) { $resourcePath = str_replace( @@ -56969,13 +58809,14 @@ protected function updateManualJournalAttachmentByFileNameRequest($xero_tenant_i * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions $bank_transactions bank_transactions (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updateOrCreateBankTransactions($xero_tenant_id, $bank_transactions, $summarize_errors = false, $unitdp = null) + public function updateOrCreateBankTransactions($xero_tenant_id, $bank_transactions, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { - list($response) = $this->updateOrCreateBankTransactionsWithHttpInfo($xero_tenant_id, $bank_transactions, $summarize_errors, $unitdp); + list($response) = $this->updateOrCreateBankTransactionsWithHttpInfo($xero_tenant_id, $bank_transactions, $summarize_errors, $unitdp, $idempotency_key); return $response; } /** @@ -56985,13 +58826,14 @@ public function updateOrCreateBankTransactions($xero_tenant_id, $bank_transactio * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions $bank_transactions (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\BankTransactions|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateOrCreateBankTransactionsWithHttpInfo($xero_tenant_id, $bank_transactions, $summarize_errors = false, $unitdp = null) + public function updateOrCreateBankTransactionsWithHttpInfo($xero_tenant_id, $bank_transactions, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { - $request = $this->updateOrCreateBankTransactionsRequest($xero_tenant_id, $bank_transactions, $summarize_errors, $unitdp); + $request = $this->updateOrCreateBankTransactionsRequest($xero_tenant_id, $bank_transactions, $summarize_errors, $unitdp, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -57083,12 +58925,13 @@ public function updateOrCreateBankTransactionsWithHttpInfo($xero_tenant_id, $ban * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions $bank_transactions (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateOrCreateBankTransactionsAsync($xero_tenant_id, $bank_transactions, $summarize_errors = false, $unitdp = null) + public function updateOrCreateBankTransactionsAsync($xero_tenant_id, $bank_transactions, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { - return $this->updateOrCreateBankTransactionsAsyncWithHttpInfo($xero_tenant_id, $bank_transactions, $summarize_errors, $unitdp) + return $this->updateOrCreateBankTransactionsAsyncWithHttpInfo($xero_tenant_id, $bank_transactions, $summarize_errors, $unitdp, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -57102,12 +58945,13 @@ function ($response) { * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions $bank_transactions (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateOrCreateBankTransactionsAsyncWithHttpInfo($xero_tenant_id, $bank_transactions, $summarize_errors = false, $unitdp = null) + public function updateOrCreateBankTransactionsAsyncWithHttpInfo($xero_tenant_id, $bank_transactions, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions'; - $request = $this->updateOrCreateBankTransactionsRequest($xero_tenant_id, $bank_transactions, $summarize_errors, $unitdp); + $request = $this->updateOrCreateBankTransactionsRequest($xero_tenant_id, $bank_transactions, $summarize_errors, $unitdp, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -57147,9 +58991,10 @@ function ($exception) { * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransactions $bank_transactions (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateOrCreateBankTransactionsRequest($xero_tenant_id, $bank_transactions, $summarize_errors = false, $unitdp = null) + protected function updateOrCreateBankTransactionsRequest($xero_tenant_id, $bank_transactions, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -57181,6 +59026,10 @@ protected function updateOrCreateBankTransactionsRequest($xero_tenant_id, $bank_ if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($bank_transactions)) { @@ -57250,13 +59099,14 @@ protected function updateOrCreateBankTransactionsRequest($xero_tenant_id, $bank_ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts $contacts contacts (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updateOrCreateContacts($xero_tenant_id, $contacts, $summarize_errors = false) + public function updateOrCreateContacts($xero_tenant_id, $contacts, $summarize_errors = false, $idempotency_key = null) { - list($response) = $this->updateOrCreateContactsWithHttpInfo($xero_tenant_id, $contacts, $summarize_errors); + list($response) = $this->updateOrCreateContactsWithHttpInfo($xero_tenant_id, $contacts, $summarize_errors, $idempotency_key); return $response; } /** @@ -57265,13 +59115,14 @@ public function updateOrCreateContacts($xero_tenant_id, $contacts, $summarize_er * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts $contacts (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Contacts|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateOrCreateContactsWithHttpInfo($xero_tenant_id, $contacts, $summarize_errors = false) + public function updateOrCreateContactsWithHttpInfo($xero_tenant_id, $contacts, $summarize_errors = false, $idempotency_key = null) { - $request = $this->updateOrCreateContactsRequest($xero_tenant_id, $contacts, $summarize_errors); + $request = $this->updateOrCreateContactsRequest($xero_tenant_id, $contacts, $summarize_errors, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -57362,12 +59213,13 @@ public function updateOrCreateContactsWithHttpInfo($xero_tenant_id, $contacts, $ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts $contacts (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateOrCreateContactsAsync($xero_tenant_id, $contacts, $summarize_errors = false) + public function updateOrCreateContactsAsync($xero_tenant_id, $contacts, $summarize_errors = false, $idempotency_key = null) { - return $this->updateOrCreateContactsAsyncWithHttpInfo($xero_tenant_id, $contacts, $summarize_errors) + return $this->updateOrCreateContactsAsyncWithHttpInfo($xero_tenant_id, $contacts, $summarize_errors, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -57380,12 +59232,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts $contacts (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateOrCreateContactsAsyncWithHttpInfo($xero_tenant_id, $contacts, $summarize_errors = false) + public function updateOrCreateContactsAsyncWithHttpInfo($xero_tenant_id, $contacts, $summarize_errors = false, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts'; - $request = $this->updateOrCreateContactsRequest($xero_tenant_id, $contacts, $summarize_errors); + $request = $this->updateOrCreateContactsRequest($xero_tenant_id, $contacts, $summarize_errors, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -57424,9 +59277,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contacts $contacts (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateOrCreateContactsRequest($xero_tenant_id, $contacts, $summarize_errors = false) + protected function updateOrCreateContactsRequest($xero_tenant_id, $contacts, $summarize_errors = false, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -57454,6 +59308,10 @@ protected function updateOrCreateContactsRequest($xero_tenant_id, $contacts, $su if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($contacts)) { @@ -57524,13 +59382,14 @@ protected function updateOrCreateContactsRequest($xero_tenant_id, $contacts, $su * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CreditNotes $credit_notes an array of Credit Notes with a single CreditNote object. (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CreditNotes|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updateOrCreateCreditNotes($xero_tenant_id, $credit_notes, $summarize_errors = false, $unitdp = null) + public function updateOrCreateCreditNotes($xero_tenant_id, $credit_notes, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { - list($response) = $this->updateOrCreateCreditNotesWithHttpInfo($xero_tenant_id, $credit_notes, $summarize_errors, $unitdp); + list($response) = $this->updateOrCreateCreditNotesWithHttpInfo($xero_tenant_id, $credit_notes, $summarize_errors, $unitdp, $idempotency_key); return $response; } /** @@ -57540,13 +59399,14 @@ public function updateOrCreateCreditNotes($xero_tenant_id, $credit_notes, $summa * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CreditNotes $credit_notes an array of Credit Notes with a single CreditNote object. (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\CreditNotes|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateOrCreateCreditNotesWithHttpInfo($xero_tenant_id, $credit_notes, $summarize_errors = false, $unitdp = null) + public function updateOrCreateCreditNotesWithHttpInfo($xero_tenant_id, $credit_notes, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { - $request = $this->updateOrCreateCreditNotesRequest($xero_tenant_id, $credit_notes, $summarize_errors, $unitdp); + $request = $this->updateOrCreateCreditNotesRequest($xero_tenant_id, $credit_notes, $summarize_errors, $unitdp, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -57638,12 +59498,13 @@ public function updateOrCreateCreditNotesWithHttpInfo($xero_tenant_id, $credit_n * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CreditNotes $credit_notes an array of Credit Notes with a single CreditNote object. (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateOrCreateCreditNotesAsync($xero_tenant_id, $credit_notes, $summarize_errors = false, $unitdp = null) + public function updateOrCreateCreditNotesAsync($xero_tenant_id, $credit_notes, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { - return $this->updateOrCreateCreditNotesAsyncWithHttpInfo($xero_tenant_id, $credit_notes, $summarize_errors, $unitdp) + return $this->updateOrCreateCreditNotesAsyncWithHttpInfo($xero_tenant_id, $credit_notes, $summarize_errors, $unitdp, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -57657,12 +59518,13 @@ function ($response) { * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CreditNotes $credit_notes an array of Credit Notes with a single CreditNote object. (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateOrCreateCreditNotesAsyncWithHttpInfo($xero_tenant_id, $credit_notes, $summarize_errors = false, $unitdp = null) + public function updateOrCreateCreditNotesAsyncWithHttpInfo($xero_tenant_id, $credit_notes, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CreditNotes'; - $request = $this->updateOrCreateCreditNotesRequest($xero_tenant_id, $credit_notes, $summarize_errors, $unitdp); + $request = $this->updateOrCreateCreditNotesRequest($xero_tenant_id, $credit_notes, $summarize_errors, $unitdp, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -57702,9 +59564,10 @@ function ($exception) { * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CreditNotes $credit_notes an array of Credit Notes with a single CreditNote object. (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateOrCreateCreditNotesRequest($xero_tenant_id, $credit_notes, $summarize_errors = false, $unitdp = null) + protected function updateOrCreateCreditNotesRequest($xero_tenant_id, $credit_notes, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -57736,6 +59599,10 @@ protected function updateOrCreateCreditNotesRequest($xero_tenant_id, $credit_not if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($credit_notes)) { @@ -57805,13 +59672,14 @@ protected function updateOrCreateCreditNotesRequest($xero_tenant_id, $credit_not * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Employees $employees Employees with array of Employee object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Employees|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updateOrCreateEmployees($xero_tenant_id, $employees, $summarize_errors = false) + public function updateOrCreateEmployees($xero_tenant_id, $employees, $summarize_errors = false, $idempotency_key = null) { - list($response) = $this->updateOrCreateEmployeesWithHttpInfo($xero_tenant_id, $employees, $summarize_errors); + list($response) = $this->updateOrCreateEmployeesWithHttpInfo($xero_tenant_id, $employees, $summarize_errors, $idempotency_key); return $response; } /** @@ -57820,13 +59688,14 @@ public function updateOrCreateEmployees($xero_tenant_id, $employees, $summarize_ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Employees $employees Employees with array of Employee object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Employees|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateOrCreateEmployeesWithHttpInfo($xero_tenant_id, $employees, $summarize_errors = false) + public function updateOrCreateEmployeesWithHttpInfo($xero_tenant_id, $employees, $summarize_errors = false, $idempotency_key = null) { - $request = $this->updateOrCreateEmployeesRequest($xero_tenant_id, $employees, $summarize_errors); + $request = $this->updateOrCreateEmployeesRequest($xero_tenant_id, $employees, $summarize_errors, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -57917,12 +59786,13 @@ public function updateOrCreateEmployeesWithHttpInfo($xero_tenant_id, $employees, * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Employees $employees Employees with array of Employee object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateOrCreateEmployeesAsync($xero_tenant_id, $employees, $summarize_errors = false) + public function updateOrCreateEmployeesAsync($xero_tenant_id, $employees, $summarize_errors = false, $idempotency_key = null) { - return $this->updateOrCreateEmployeesAsyncWithHttpInfo($xero_tenant_id, $employees, $summarize_errors) + return $this->updateOrCreateEmployeesAsyncWithHttpInfo($xero_tenant_id, $employees, $summarize_errors, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -57935,12 +59805,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Employees $employees Employees with array of Employee object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateOrCreateEmployeesAsyncWithHttpInfo($xero_tenant_id, $employees, $summarize_errors = false) + public function updateOrCreateEmployeesAsyncWithHttpInfo($xero_tenant_id, $employees, $summarize_errors = false, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Employees'; - $request = $this->updateOrCreateEmployeesRequest($xero_tenant_id, $employees, $summarize_errors); + $request = $this->updateOrCreateEmployeesRequest($xero_tenant_id, $employees, $summarize_errors, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -57979,9 +59850,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Employees $employees Employees with array of Employee object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateOrCreateEmployeesRequest($xero_tenant_id, $employees, $summarize_errors = false) + protected function updateOrCreateEmployeesRequest($xero_tenant_id, $employees, $summarize_errors = false, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -58009,6 +59881,10 @@ protected function updateOrCreateEmployeesRequest($xero_tenant_id, $employees, $ if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($employees)) { @@ -58079,13 +59955,14 @@ protected function updateOrCreateEmployeesRequest($xero_tenant_id, $employees, $ * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Invoices $invoices invoices (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Invoices|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updateOrCreateInvoices($xero_tenant_id, $invoices, $summarize_errors = false, $unitdp = null) + public function updateOrCreateInvoices($xero_tenant_id, $invoices, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { - list($response) = $this->updateOrCreateInvoicesWithHttpInfo($xero_tenant_id, $invoices, $summarize_errors, $unitdp); + list($response) = $this->updateOrCreateInvoicesWithHttpInfo($xero_tenant_id, $invoices, $summarize_errors, $unitdp, $idempotency_key); return $response; } /** @@ -58095,13 +59972,14 @@ public function updateOrCreateInvoices($xero_tenant_id, $invoices, $summarize_er * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Invoices $invoices (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Invoices|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateOrCreateInvoicesWithHttpInfo($xero_tenant_id, $invoices, $summarize_errors = false, $unitdp = null) + public function updateOrCreateInvoicesWithHttpInfo($xero_tenant_id, $invoices, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { - $request = $this->updateOrCreateInvoicesRequest($xero_tenant_id, $invoices, $summarize_errors, $unitdp); + $request = $this->updateOrCreateInvoicesRequest($xero_tenant_id, $invoices, $summarize_errors, $unitdp, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -58193,12 +60071,13 @@ public function updateOrCreateInvoicesWithHttpInfo($xero_tenant_id, $invoices, $ * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Invoices $invoices (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateOrCreateInvoicesAsync($xero_tenant_id, $invoices, $summarize_errors = false, $unitdp = null) + public function updateOrCreateInvoicesAsync($xero_tenant_id, $invoices, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { - return $this->updateOrCreateInvoicesAsyncWithHttpInfo($xero_tenant_id, $invoices, $summarize_errors, $unitdp) + return $this->updateOrCreateInvoicesAsyncWithHttpInfo($xero_tenant_id, $invoices, $summarize_errors, $unitdp, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -58212,12 +60091,13 @@ function ($response) { * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Invoices $invoices (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateOrCreateInvoicesAsyncWithHttpInfo($xero_tenant_id, $invoices, $summarize_errors = false, $unitdp = null) + public function updateOrCreateInvoicesAsyncWithHttpInfo($xero_tenant_id, $invoices, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Invoices'; - $request = $this->updateOrCreateInvoicesRequest($xero_tenant_id, $invoices, $summarize_errors, $unitdp); + $request = $this->updateOrCreateInvoicesRequest($xero_tenant_id, $invoices, $summarize_errors, $unitdp, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -58257,9 +60137,10 @@ function ($exception) { * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Invoices $invoices (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateOrCreateInvoicesRequest($xero_tenant_id, $invoices, $summarize_errors = false, $unitdp = null) + protected function updateOrCreateInvoicesRequest($xero_tenant_id, $invoices, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -58291,6 +60172,10 @@ protected function updateOrCreateInvoicesRequest($xero_tenant_id, $invoices, $su if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($invoices)) { @@ -58361,13 +60246,14 @@ protected function updateOrCreateInvoicesRequest($xero_tenant_id, $invoices, $su * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Items $items items (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Items|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updateOrCreateItems($xero_tenant_id, $items, $summarize_errors = false, $unitdp = null) + public function updateOrCreateItems($xero_tenant_id, $items, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { - list($response) = $this->updateOrCreateItemsWithHttpInfo($xero_tenant_id, $items, $summarize_errors, $unitdp); + list($response) = $this->updateOrCreateItemsWithHttpInfo($xero_tenant_id, $items, $summarize_errors, $unitdp, $idempotency_key); return $response; } /** @@ -58377,13 +60263,14 @@ public function updateOrCreateItems($xero_tenant_id, $items, $summarize_errors = * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Items $items (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Items|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateOrCreateItemsWithHttpInfo($xero_tenant_id, $items, $summarize_errors = false, $unitdp = null) + public function updateOrCreateItemsWithHttpInfo($xero_tenant_id, $items, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { - $request = $this->updateOrCreateItemsRequest($xero_tenant_id, $items, $summarize_errors, $unitdp); + $request = $this->updateOrCreateItemsRequest($xero_tenant_id, $items, $summarize_errors, $unitdp, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -58475,12 +60362,13 @@ public function updateOrCreateItemsWithHttpInfo($xero_tenant_id, $items, $summar * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Items $items (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateOrCreateItemsAsync($xero_tenant_id, $items, $summarize_errors = false, $unitdp = null) + public function updateOrCreateItemsAsync($xero_tenant_id, $items, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { - return $this->updateOrCreateItemsAsyncWithHttpInfo($xero_tenant_id, $items, $summarize_errors, $unitdp) + return $this->updateOrCreateItemsAsyncWithHttpInfo($xero_tenant_id, $items, $summarize_errors, $unitdp, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -58494,12 +60382,13 @@ function ($response) { * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Items $items (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateOrCreateItemsAsyncWithHttpInfo($xero_tenant_id, $items, $summarize_errors = false, $unitdp = null) + public function updateOrCreateItemsAsyncWithHttpInfo($xero_tenant_id, $items, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Items'; - $request = $this->updateOrCreateItemsRequest($xero_tenant_id, $items, $summarize_errors, $unitdp); + $request = $this->updateOrCreateItemsRequest($xero_tenant_id, $items, $summarize_errors, $unitdp, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -58539,9 +60428,10 @@ function ($exception) { * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Items $items (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateOrCreateItemsRequest($xero_tenant_id, $items, $summarize_errors = false, $unitdp = null) + protected function updateOrCreateItemsRequest($xero_tenant_id, $items, $summarize_errors = false, $unitdp = null, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -58573,6 +60463,10 @@ protected function updateOrCreateItemsRequest($xero_tenant_id, $items, $summariz if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($items)) { @@ -58642,13 +60536,14 @@ protected function updateOrCreateItemsRequest($xero_tenant_id, $items, $summariz * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ManualJournals $manual_journals ManualJournals array with ManualJournal object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ManualJournals|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updateOrCreateManualJournals($xero_tenant_id, $manual_journals, $summarize_errors = false) + public function updateOrCreateManualJournals($xero_tenant_id, $manual_journals, $summarize_errors = false, $idempotency_key = null) { - list($response) = $this->updateOrCreateManualJournalsWithHttpInfo($xero_tenant_id, $manual_journals, $summarize_errors); + list($response) = $this->updateOrCreateManualJournalsWithHttpInfo($xero_tenant_id, $manual_journals, $summarize_errors, $idempotency_key); return $response; } /** @@ -58657,13 +60552,14 @@ public function updateOrCreateManualJournals($xero_tenant_id, $manual_journals, * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ManualJournals $manual_journals ManualJournals array with ManualJournal object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\ManualJournals|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateOrCreateManualJournalsWithHttpInfo($xero_tenant_id, $manual_journals, $summarize_errors = false) + public function updateOrCreateManualJournalsWithHttpInfo($xero_tenant_id, $manual_journals, $summarize_errors = false, $idempotency_key = null) { - $request = $this->updateOrCreateManualJournalsRequest($xero_tenant_id, $manual_journals, $summarize_errors); + $request = $this->updateOrCreateManualJournalsRequest($xero_tenant_id, $manual_journals, $summarize_errors, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -58754,12 +60650,13 @@ public function updateOrCreateManualJournalsWithHttpInfo($xero_tenant_id, $manua * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ManualJournals $manual_journals ManualJournals array with ManualJournal object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateOrCreateManualJournalsAsync($xero_tenant_id, $manual_journals, $summarize_errors = false) + public function updateOrCreateManualJournalsAsync($xero_tenant_id, $manual_journals, $summarize_errors = false, $idempotency_key = null) { - return $this->updateOrCreateManualJournalsAsyncWithHttpInfo($xero_tenant_id, $manual_journals, $summarize_errors) + return $this->updateOrCreateManualJournalsAsyncWithHttpInfo($xero_tenant_id, $manual_journals, $summarize_errors, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -58772,12 +60669,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ManualJournals $manual_journals ManualJournals array with ManualJournal object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateOrCreateManualJournalsAsyncWithHttpInfo($xero_tenant_id, $manual_journals, $summarize_errors = false) + public function updateOrCreateManualJournalsAsyncWithHttpInfo($xero_tenant_id, $manual_journals, $summarize_errors = false, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ManualJournals'; - $request = $this->updateOrCreateManualJournalsRequest($xero_tenant_id, $manual_journals, $summarize_errors); + $request = $this->updateOrCreateManualJournalsRequest($xero_tenant_id, $manual_journals, $summarize_errors, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -58816,9 +60714,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ManualJournals $manual_journals ManualJournals array with ManualJournal object in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateOrCreateManualJournalsRequest($xero_tenant_id, $manual_journals, $summarize_errors = false) + protected function updateOrCreateManualJournalsRequest($xero_tenant_id, $manual_journals, $summarize_errors = false, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -58846,6 +60745,10 @@ protected function updateOrCreateManualJournalsRequest($xero_tenant_id, $manual_ if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($manual_journals)) { @@ -58915,13 +60818,14 @@ protected function updateOrCreateManualJournalsRequest($xero_tenant_id, $manual_ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PurchaseOrders $purchase_orders purchase_orders (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PurchaseOrders|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updateOrCreatePurchaseOrders($xero_tenant_id, $purchase_orders, $summarize_errors = false) + public function updateOrCreatePurchaseOrders($xero_tenant_id, $purchase_orders, $summarize_errors = false, $idempotency_key = null) { - list($response) = $this->updateOrCreatePurchaseOrdersWithHttpInfo($xero_tenant_id, $purchase_orders, $summarize_errors); + list($response) = $this->updateOrCreatePurchaseOrdersWithHttpInfo($xero_tenant_id, $purchase_orders, $summarize_errors, $idempotency_key); return $response; } /** @@ -58930,13 +60834,14 @@ public function updateOrCreatePurchaseOrders($xero_tenant_id, $purchase_orders, * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PurchaseOrders $purchase_orders (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\PurchaseOrders|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateOrCreatePurchaseOrdersWithHttpInfo($xero_tenant_id, $purchase_orders, $summarize_errors = false) + public function updateOrCreatePurchaseOrdersWithHttpInfo($xero_tenant_id, $purchase_orders, $summarize_errors = false, $idempotency_key = null) { - $request = $this->updateOrCreatePurchaseOrdersRequest($xero_tenant_id, $purchase_orders, $summarize_errors); + $request = $this->updateOrCreatePurchaseOrdersRequest($xero_tenant_id, $purchase_orders, $summarize_errors, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -59027,12 +60932,13 @@ public function updateOrCreatePurchaseOrdersWithHttpInfo($xero_tenant_id, $purch * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PurchaseOrders $purchase_orders (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateOrCreatePurchaseOrdersAsync($xero_tenant_id, $purchase_orders, $summarize_errors = false) + public function updateOrCreatePurchaseOrdersAsync($xero_tenant_id, $purchase_orders, $summarize_errors = false, $idempotency_key = null) { - return $this->updateOrCreatePurchaseOrdersAsyncWithHttpInfo($xero_tenant_id, $purchase_orders, $summarize_errors) + return $this->updateOrCreatePurchaseOrdersAsyncWithHttpInfo($xero_tenant_id, $purchase_orders, $summarize_errors, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -59045,12 +60951,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PurchaseOrders $purchase_orders (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateOrCreatePurchaseOrdersAsyncWithHttpInfo($xero_tenant_id, $purchase_orders, $summarize_errors = false) + public function updateOrCreatePurchaseOrdersAsyncWithHttpInfo($xero_tenant_id, $purchase_orders, $summarize_errors = false, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PurchaseOrders'; - $request = $this->updateOrCreatePurchaseOrdersRequest($xero_tenant_id, $purchase_orders, $summarize_errors); + $request = $this->updateOrCreatePurchaseOrdersRequest($xero_tenant_id, $purchase_orders, $summarize_errors, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -59089,9 +60996,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PurchaseOrders $purchase_orders (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateOrCreatePurchaseOrdersRequest($xero_tenant_id, $purchase_orders, $summarize_errors = false) + protected function updateOrCreatePurchaseOrdersRequest($xero_tenant_id, $purchase_orders, $summarize_errors = false, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -59119,6 +61027,10 @@ protected function updateOrCreatePurchaseOrdersRequest($xero_tenant_id, $purchas if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($purchase_orders)) { @@ -59188,13 +61100,14 @@ protected function updateOrCreatePurchaseOrdersRequest($xero_tenant_id, $purchas * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Quotes $quotes quotes (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Quotes|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updateOrCreateQuotes($xero_tenant_id, $quotes, $summarize_errors = false) + public function updateOrCreateQuotes($xero_tenant_id, $quotes, $summarize_errors = false, $idempotency_key = null) { - list($response) = $this->updateOrCreateQuotesWithHttpInfo($xero_tenant_id, $quotes, $summarize_errors); + list($response) = $this->updateOrCreateQuotesWithHttpInfo($xero_tenant_id, $quotes, $summarize_errors, $idempotency_key); return $response; } /** @@ -59203,13 +61116,14 @@ public function updateOrCreateQuotes($xero_tenant_id, $quotes, $summarize_errors * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Quotes $quotes (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Quotes|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateOrCreateQuotesWithHttpInfo($xero_tenant_id, $quotes, $summarize_errors = false) + public function updateOrCreateQuotesWithHttpInfo($xero_tenant_id, $quotes, $summarize_errors = false, $idempotency_key = null) { - $request = $this->updateOrCreateQuotesRequest($xero_tenant_id, $quotes, $summarize_errors); + $request = $this->updateOrCreateQuotesRequest($xero_tenant_id, $quotes, $summarize_errors, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -59300,12 +61214,13 @@ public function updateOrCreateQuotesWithHttpInfo($xero_tenant_id, $quotes, $summ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Quotes $quotes (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateOrCreateQuotesAsync($xero_tenant_id, $quotes, $summarize_errors = false) + public function updateOrCreateQuotesAsync($xero_tenant_id, $quotes, $summarize_errors = false, $idempotency_key = null) { - return $this->updateOrCreateQuotesAsyncWithHttpInfo($xero_tenant_id, $quotes, $summarize_errors) + return $this->updateOrCreateQuotesAsyncWithHttpInfo($xero_tenant_id, $quotes, $summarize_errors, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -59318,12 +61233,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Quotes $quotes (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateOrCreateQuotesAsyncWithHttpInfo($xero_tenant_id, $quotes, $summarize_errors = false) + public function updateOrCreateQuotesAsyncWithHttpInfo($xero_tenant_id, $quotes, $summarize_errors = false, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Quotes'; - $request = $this->updateOrCreateQuotesRequest($xero_tenant_id, $quotes, $summarize_errors); + $request = $this->updateOrCreateQuotesRequest($xero_tenant_id, $quotes, $summarize_errors, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -59362,9 +61278,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Quotes $quotes (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateOrCreateQuotesRequest($xero_tenant_id, $quotes, $summarize_errors = false) + protected function updateOrCreateQuotesRequest($xero_tenant_id, $quotes, $summarize_errors = false, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -59392,6 +61309,10 @@ protected function updateOrCreateQuotesRequest($xero_tenant_id, $quotes, $summar if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($quotes)) { @@ -59461,13 +61382,14 @@ protected function updateOrCreateQuotesRequest($xero_tenant_id, $quotes, $summar * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\RepeatingInvoices $repeating_invoices RepeatingInvoices with an array of repeating invoice objects in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\RepeatingInvoices|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updateOrCreateRepeatingInvoices($xero_tenant_id, $repeating_invoices, $summarize_errors = false) + public function updateOrCreateRepeatingInvoices($xero_tenant_id, $repeating_invoices, $summarize_errors = false, $idempotency_key = null) { - list($response) = $this->updateOrCreateRepeatingInvoicesWithHttpInfo($xero_tenant_id, $repeating_invoices, $summarize_errors); + list($response) = $this->updateOrCreateRepeatingInvoicesWithHttpInfo($xero_tenant_id, $repeating_invoices, $summarize_errors, $idempotency_key); return $response; } /** @@ -59476,13 +61398,14 @@ public function updateOrCreateRepeatingInvoices($xero_tenant_id, $repeating_invo * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\RepeatingInvoices $repeating_invoices RepeatingInvoices with an array of repeating invoice objects in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\RepeatingInvoices|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateOrCreateRepeatingInvoicesWithHttpInfo($xero_tenant_id, $repeating_invoices, $summarize_errors = false) + public function updateOrCreateRepeatingInvoicesWithHttpInfo($xero_tenant_id, $repeating_invoices, $summarize_errors = false, $idempotency_key = null) { - $request = $this->updateOrCreateRepeatingInvoicesRequest($xero_tenant_id, $repeating_invoices, $summarize_errors); + $request = $this->updateOrCreateRepeatingInvoicesRequest($xero_tenant_id, $repeating_invoices, $summarize_errors, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -59573,12 +61496,13 @@ public function updateOrCreateRepeatingInvoicesWithHttpInfo($xero_tenant_id, $re * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\RepeatingInvoices $repeating_invoices RepeatingInvoices with an array of repeating invoice objects in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateOrCreateRepeatingInvoicesAsync($xero_tenant_id, $repeating_invoices, $summarize_errors = false) + public function updateOrCreateRepeatingInvoicesAsync($xero_tenant_id, $repeating_invoices, $summarize_errors = false, $idempotency_key = null) { - return $this->updateOrCreateRepeatingInvoicesAsyncWithHttpInfo($xero_tenant_id, $repeating_invoices, $summarize_errors) + return $this->updateOrCreateRepeatingInvoicesAsyncWithHttpInfo($xero_tenant_id, $repeating_invoices, $summarize_errors, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -59591,12 +61515,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\RepeatingInvoices $repeating_invoices RepeatingInvoices with an array of repeating invoice objects in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateOrCreateRepeatingInvoicesAsyncWithHttpInfo($xero_tenant_id, $repeating_invoices, $summarize_errors = false) + public function updateOrCreateRepeatingInvoicesAsyncWithHttpInfo($xero_tenant_id, $repeating_invoices, $summarize_errors = false, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\RepeatingInvoices'; - $request = $this->updateOrCreateRepeatingInvoicesRequest($xero_tenant_id, $repeating_invoices, $summarize_errors); + $request = $this->updateOrCreateRepeatingInvoicesRequest($xero_tenant_id, $repeating_invoices, $summarize_errors, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -59635,9 +61560,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\RepeatingInvoices $repeating_invoices RepeatingInvoices with an array of repeating invoice objects in body of request (required) * @param bool $summarize_errors If false return 200 OK and mix of successfully created objects and any with validation errors (optional, default to false) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateOrCreateRepeatingInvoicesRequest($xero_tenant_id, $repeating_invoices, $summarize_errors = false) + protected function updateOrCreateRepeatingInvoicesRequest($xero_tenant_id, $repeating_invoices, $summarize_errors = false, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -59665,6 +61591,10 @@ protected function updateOrCreateRepeatingInvoicesRequest($xero_tenant_id, $repe if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($repeating_invoices)) { @@ -59734,13 +61664,14 @@ protected function updateOrCreateRepeatingInvoicesRequest($xero_tenant_id, $repe * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $purchase_order_id Unique identifier for an Purchase Order (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PurchaseOrders $purchase_orders purchase_orders (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PurchaseOrders|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updatePurchaseOrder($xero_tenant_id, $purchase_order_id, $purchase_orders) + public function updatePurchaseOrder($xero_tenant_id, $purchase_order_id, $purchase_orders, $idempotency_key = null) { - list($response) = $this->updatePurchaseOrderWithHttpInfo($xero_tenant_id, $purchase_order_id, $purchase_orders); + list($response) = $this->updatePurchaseOrderWithHttpInfo($xero_tenant_id, $purchase_order_id, $purchase_orders, $idempotency_key); return $response; } /** @@ -59749,13 +61680,14 @@ public function updatePurchaseOrder($xero_tenant_id, $purchase_order_id, $purcha * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $purchase_order_id Unique identifier for an Purchase Order (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PurchaseOrders $purchase_orders (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\PurchaseOrders|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updatePurchaseOrderWithHttpInfo($xero_tenant_id, $purchase_order_id, $purchase_orders) + public function updatePurchaseOrderWithHttpInfo($xero_tenant_id, $purchase_order_id, $purchase_orders, $idempotency_key = null) { - $request = $this->updatePurchaseOrderRequest($xero_tenant_id, $purchase_order_id, $purchase_orders); + $request = $this->updatePurchaseOrderRequest($xero_tenant_id, $purchase_order_id, $purchase_orders, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -59846,12 +61778,13 @@ public function updatePurchaseOrderWithHttpInfo($xero_tenant_id, $purchase_order * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $purchase_order_id Unique identifier for an Purchase Order (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PurchaseOrders $purchase_orders (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updatePurchaseOrderAsync($xero_tenant_id, $purchase_order_id, $purchase_orders) + public function updatePurchaseOrderAsync($xero_tenant_id, $purchase_order_id, $purchase_orders, $idempotency_key = null) { - return $this->updatePurchaseOrderAsyncWithHttpInfo($xero_tenant_id, $purchase_order_id, $purchase_orders) + return $this->updatePurchaseOrderAsyncWithHttpInfo($xero_tenant_id, $purchase_order_id, $purchase_orders, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -59864,12 +61797,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $purchase_order_id Unique identifier for an Purchase Order (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PurchaseOrders $purchase_orders (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updatePurchaseOrderAsyncWithHttpInfo($xero_tenant_id, $purchase_order_id, $purchase_orders) + public function updatePurchaseOrderAsyncWithHttpInfo($xero_tenant_id, $purchase_order_id, $purchase_orders, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PurchaseOrders'; - $request = $this->updatePurchaseOrderRequest($xero_tenant_id, $purchase_order_id, $purchase_orders); + $request = $this->updatePurchaseOrderRequest($xero_tenant_id, $purchase_order_id, $purchase_orders, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -59908,9 +61842,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $purchase_order_id Unique identifier for an Purchase Order (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PurchaseOrders $purchase_orders (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updatePurchaseOrderRequest($xero_tenant_id, $purchase_order_id, $purchase_orders) + protected function updatePurchaseOrderRequest($xero_tenant_id, $purchase_order_id, $purchase_orders, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -59940,6 +61875,10 @@ protected function updatePurchaseOrderRequest($xero_tenant_id, $purchase_order_i if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($purchase_order_id !== null) { $resourcePath = str_replace( @@ -60018,13 +61957,14 @@ protected function updatePurchaseOrderRequest($xero_tenant_id, $purchase_order_i * @param string $purchase_order_id Unique identifier for an Purchase Order (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updatePurchaseOrderAttachmentByFileName($xero_tenant_id, $purchase_order_id, $file_name, $body) + public function updatePurchaseOrderAttachmentByFileName($xero_tenant_id, $purchase_order_id, $file_name, $body, $idempotency_key = null) { - list($response) = $this->updatePurchaseOrderAttachmentByFileNameWithHttpInfo($xero_tenant_id, $purchase_order_id, $file_name, $body); + list($response) = $this->updatePurchaseOrderAttachmentByFileNameWithHttpInfo($xero_tenant_id, $purchase_order_id, $file_name, $body, $idempotency_key); return $response; } /** @@ -60034,13 +61974,14 @@ public function updatePurchaseOrderAttachmentByFileName($xero_tenant_id, $purcha * @param string $purchase_order_id Unique identifier for an Purchase Order (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updatePurchaseOrderAttachmentByFileNameWithHttpInfo($xero_tenant_id, $purchase_order_id, $file_name, $body) + public function updatePurchaseOrderAttachmentByFileNameWithHttpInfo($xero_tenant_id, $purchase_order_id, $file_name, $body, $idempotency_key = null) { - $request = $this->updatePurchaseOrderAttachmentByFileNameRequest($xero_tenant_id, $purchase_order_id, $file_name, $body); + $request = $this->updatePurchaseOrderAttachmentByFileNameRequest($xero_tenant_id, $purchase_order_id, $file_name, $body, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -60132,12 +62073,13 @@ public function updatePurchaseOrderAttachmentByFileNameWithHttpInfo($xero_tenant * @param string $purchase_order_id Unique identifier for an Purchase Order (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updatePurchaseOrderAttachmentByFileNameAsync($xero_tenant_id, $purchase_order_id, $file_name, $body) + public function updatePurchaseOrderAttachmentByFileNameAsync($xero_tenant_id, $purchase_order_id, $file_name, $body, $idempotency_key = null) { - return $this->updatePurchaseOrderAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $purchase_order_id, $file_name, $body) + return $this->updatePurchaseOrderAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $purchase_order_id, $file_name, $body, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -60151,12 +62093,13 @@ function ($response) { * @param string $purchase_order_id Unique identifier for an Purchase Order (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updatePurchaseOrderAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $purchase_order_id, $file_name, $body) + public function updatePurchaseOrderAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $purchase_order_id, $file_name, $body, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; - $request = $this->updatePurchaseOrderAttachmentByFileNameRequest($xero_tenant_id, $purchase_order_id, $file_name, $body); + $request = $this->updatePurchaseOrderAttachmentByFileNameRequest($xero_tenant_id, $purchase_order_id, $file_name, $body, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -60196,9 +62139,10 @@ function ($exception) { * @param string $purchase_order_id Unique identifier for an Purchase Order (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updatePurchaseOrderAttachmentByFileNameRequest($xero_tenant_id, $purchase_order_id, $file_name, $body) + protected function updatePurchaseOrderAttachmentByFileNameRequest($xero_tenant_id, $purchase_order_id, $file_name, $body, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -60234,6 +62178,10 @@ protected function updatePurchaseOrderAttachmentByFileNameRequest($xero_tenant_i if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($purchase_order_id !== null) { $resourcePath = str_replace( @@ -60319,13 +62267,14 @@ protected function updatePurchaseOrderAttachmentByFileNameRequest($xero_tenant_i * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $quote_id Unique identifier for an Quote (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Quotes $quotes quotes (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Quotes|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updateQuote($xero_tenant_id, $quote_id, $quotes) + public function updateQuote($xero_tenant_id, $quote_id, $quotes, $idempotency_key = null) { - list($response) = $this->updateQuoteWithHttpInfo($xero_tenant_id, $quote_id, $quotes); + list($response) = $this->updateQuoteWithHttpInfo($xero_tenant_id, $quote_id, $quotes, $idempotency_key); return $response; } /** @@ -60334,13 +62283,14 @@ public function updateQuote($xero_tenant_id, $quote_id, $quotes) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $quote_id Unique identifier for an Quote (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Quotes $quotes (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Quotes|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateQuoteWithHttpInfo($xero_tenant_id, $quote_id, $quotes) + public function updateQuoteWithHttpInfo($xero_tenant_id, $quote_id, $quotes, $idempotency_key = null) { - $request = $this->updateQuoteRequest($xero_tenant_id, $quote_id, $quotes); + $request = $this->updateQuoteRequest($xero_tenant_id, $quote_id, $quotes, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -60431,12 +62381,13 @@ public function updateQuoteWithHttpInfo($xero_tenant_id, $quote_id, $quotes) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $quote_id Unique identifier for an Quote (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Quotes $quotes (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateQuoteAsync($xero_tenant_id, $quote_id, $quotes) + public function updateQuoteAsync($xero_tenant_id, $quote_id, $quotes, $idempotency_key = null) { - return $this->updateQuoteAsyncWithHttpInfo($xero_tenant_id, $quote_id, $quotes) + return $this->updateQuoteAsyncWithHttpInfo($xero_tenant_id, $quote_id, $quotes, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -60449,12 +62400,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $quote_id Unique identifier for an Quote (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Quotes $quotes (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateQuoteAsyncWithHttpInfo($xero_tenant_id, $quote_id, $quotes) + public function updateQuoteAsyncWithHttpInfo($xero_tenant_id, $quote_id, $quotes, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Quotes'; - $request = $this->updateQuoteRequest($xero_tenant_id, $quote_id, $quotes); + $request = $this->updateQuoteRequest($xero_tenant_id, $quote_id, $quotes, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -60493,9 +62445,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $quote_id Unique identifier for an Quote (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Quotes $quotes (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateQuoteRequest($xero_tenant_id, $quote_id, $quotes) + protected function updateQuoteRequest($xero_tenant_id, $quote_id, $quotes, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -60525,6 +62478,10 @@ protected function updateQuoteRequest($xero_tenant_id, $quote_id, $quotes) if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($quote_id !== null) { $resourcePath = str_replace( @@ -60603,13 +62560,14 @@ protected function updateQuoteRequest($xero_tenant_id, $quote_id, $quotes) * @param string $quote_id Unique identifier for an Quote (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updateQuoteAttachmentByFileName($xero_tenant_id, $quote_id, $file_name, $body) + public function updateQuoteAttachmentByFileName($xero_tenant_id, $quote_id, $file_name, $body, $idempotency_key = null) { - list($response) = $this->updateQuoteAttachmentByFileNameWithHttpInfo($xero_tenant_id, $quote_id, $file_name, $body); + list($response) = $this->updateQuoteAttachmentByFileNameWithHttpInfo($xero_tenant_id, $quote_id, $file_name, $body, $idempotency_key); return $response; } /** @@ -60619,13 +62577,14 @@ public function updateQuoteAttachmentByFileName($xero_tenant_id, $quote_id, $fil * @param string $quote_id Unique identifier for an Quote (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateQuoteAttachmentByFileNameWithHttpInfo($xero_tenant_id, $quote_id, $file_name, $body) + public function updateQuoteAttachmentByFileNameWithHttpInfo($xero_tenant_id, $quote_id, $file_name, $body, $idempotency_key = null) { - $request = $this->updateQuoteAttachmentByFileNameRequest($xero_tenant_id, $quote_id, $file_name, $body); + $request = $this->updateQuoteAttachmentByFileNameRequest($xero_tenant_id, $quote_id, $file_name, $body, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -60717,12 +62676,13 @@ public function updateQuoteAttachmentByFileNameWithHttpInfo($xero_tenant_id, $qu * @param string $quote_id Unique identifier for an Quote (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateQuoteAttachmentByFileNameAsync($xero_tenant_id, $quote_id, $file_name, $body) + public function updateQuoteAttachmentByFileNameAsync($xero_tenant_id, $quote_id, $file_name, $body, $idempotency_key = null) { - return $this->updateQuoteAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $quote_id, $file_name, $body) + return $this->updateQuoteAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $quote_id, $file_name, $body, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -60736,12 +62696,13 @@ function ($response) { * @param string $quote_id Unique identifier for an Quote (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateQuoteAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $quote_id, $file_name, $body) + public function updateQuoteAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $quote_id, $file_name, $body, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; - $request = $this->updateQuoteAttachmentByFileNameRequest($xero_tenant_id, $quote_id, $file_name, $body); + $request = $this->updateQuoteAttachmentByFileNameRequest($xero_tenant_id, $quote_id, $file_name, $body, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -60781,9 +62742,10 @@ function ($exception) { * @param string $quote_id Unique identifier for an Quote (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateQuoteAttachmentByFileNameRequest($xero_tenant_id, $quote_id, $file_name, $body) + protected function updateQuoteAttachmentByFileNameRequest($xero_tenant_id, $quote_id, $file_name, $body, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -60819,6 +62781,10 @@ protected function updateQuoteAttachmentByFileNameRequest($xero_tenant_id, $quot if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($quote_id !== null) { $resourcePath = str_replace( @@ -60905,13 +62871,14 @@ protected function updateQuoteAttachmentByFileNameRequest($xero_tenant_id, $quot * @param string $receipt_id Unique identifier for a Receipt (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Receipts $receipts receipts (required) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Receipts|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updateReceipt($xero_tenant_id, $receipt_id, $receipts, $unitdp = null) + public function updateReceipt($xero_tenant_id, $receipt_id, $receipts, $unitdp = null, $idempotency_key = null) { - list($response) = $this->updateReceiptWithHttpInfo($xero_tenant_id, $receipt_id, $receipts, $unitdp); + list($response) = $this->updateReceiptWithHttpInfo($xero_tenant_id, $receipt_id, $receipts, $unitdp, $idempotency_key); return $response; } /** @@ -60921,13 +62888,14 @@ public function updateReceipt($xero_tenant_id, $receipt_id, $receipts, $unitdp = * @param string $receipt_id Unique identifier for a Receipt (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Receipts $receipts (required) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Receipts|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateReceiptWithHttpInfo($xero_tenant_id, $receipt_id, $receipts, $unitdp = null) + public function updateReceiptWithHttpInfo($xero_tenant_id, $receipt_id, $receipts, $unitdp = null, $idempotency_key = null) { - $request = $this->updateReceiptRequest($xero_tenant_id, $receipt_id, $receipts, $unitdp); + $request = $this->updateReceiptRequest($xero_tenant_id, $receipt_id, $receipts, $unitdp, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -61019,12 +62987,13 @@ public function updateReceiptWithHttpInfo($xero_tenant_id, $receipt_id, $receipt * @param string $receipt_id Unique identifier for a Receipt (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Receipts $receipts (required) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateReceiptAsync($xero_tenant_id, $receipt_id, $receipts, $unitdp = null) + public function updateReceiptAsync($xero_tenant_id, $receipt_id, $receipts, $unitdp = null, $idempotency_key = null) { - return $this->updateReceiptAsyncWithHttpInfo($xero_tenant_id, $receipt_id, $receipts, $unitdp) + return $this->updateReceiptAsyncWithHttpInfo($xero_tenant_id, $receipt_id, $receipts, $unitdp, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -61038,12 +63007,13 @@ function ($response) { * @param string $receipt_id Unique identifier for a Receipt (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Receipts $receipts (required) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateReceiptAsyncWithHttpInfo($xero_tenant_id, $receipt_id, $receipts, $unitdp = null) + public function updateReceiptAsyncWithHttpInfo($xero_tenant_id, $receipt_id, $receipts, $unitdp = null, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Receipts'; - $request = $this->updateReceiptRequest($xero_tenant_id, $receipt_id, $receipts, $unitdp); + $request = $this->updateReceiptRequest($xero_tenant_id, $receipt_id, $receipts, $unitdp, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -61083,9 +63053,10 @@ function ($exception) { * @param string $receipt_id Unique identifier for a Receipt (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Receipts $receipts (required) * @param int $unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts (optional) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateReceiptRequest($xero_tenant_id, $receipt_id, $receipts, $unitdp = null) + protected function updateReceiptRequest($xero_tenant_id, $receipt_id, $receipts, $unitdp = null, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -61119,6 +63090,10 @@ protected function updateReceiptRequest($xero_tenant_id, $receipt_id, $receipts, if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($receipt_id !== null) { $resourcePath = str_replace( @@ -61197,13 +63172,14 @@ protected function updateReceiptRequest($xero_tenant_id, $receipt_id, $receipts, * @param string $receipt_id Unique identifier for a Receipt (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updateReceiptAttachmentByFileName($xero_tenant_id, $receipt_id, $file_name, $body) + public function updateReceiptAttachmentByFileName($xero_tenant_id, $receipt_id, $file_name, $body, $idempotency_key = null) { - list($response) = $this->updateReceiptAttachmentByFileNameWithHttpInfo($xero_tenant_id, $receipt_id, $file_name, $body); + list($response) = $this->updateReceiptAttachmentByFileNameWithHttpInfo($xero_tenant_id, $receipt_id, $file_name, $body, $idempotency_key); return $response; } /** @@ -61213,13 +63189,14 @@ public function updateReceiptAttachmentByFileName($xero_tenant_id, $receipt_id, * @param string $receipt_id Unique identifier for a Receipt (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateReceiptAttachmentByFileNameWithHttpInfo($xero_tenant_id, $receipt_id, $file_name, $body) + public function updateReceiptAttachmentByFileNameWithHttpInfo($xero_tenant_id, $receipt_id, $file_name, $body, $idempotency_key = null) { - $request = $this->updateReceiptAttachmentByFileNameRequest($xero_tenant_id, $receipt_id, $file_name, $body); + $request = $this->updateReceiptAttachmentByFileNameRequest($xero_tenant_id, $receipt_id, $file_name, $body, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -61311,12 +63288,13 @@ public function updateReceiptAttachmentByFileNameWithHttpInfo($xero_tenant_id, $ * @param string $receipt_id Unique identifier for a Receipt (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateReceiptAttachmentByFileNameAsync($xero_tenant_id, $receipt_id, $file_name, $body) + public function updateReceiptAttachmentByFileNameAsync($xero_tenant_id, $receipt_id, $file_name, $body, $idempotency_key = null) { - return $this->updateReceiptAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $receipt_id, $file_name, $body) + return $this->updateReceiptAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $receipt_id, $file_name, $body, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -61330,12 +63308,13 @@ function ($response) { * @param string $receipt_id Unique identifier for a Receipt (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateReceiptAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $receipt_id, $file_name, $body) + public function updateReceiptAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $receipt_id, $file_name, $body, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; - $request = $this->updateReceiptAttachmentByFileNameRequest($xero_tenant_id, $receipt_id, $file_name, $body); + $request = $this->updateReceiptAttachmentByFileNameRequest($xero_tenant_id, $receipt_id, $file_name, $body, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -61375,9 +63354,10 @@ function ($exception) { * @param string $receipt_id Unique identifier for a Receipt (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateReceiptAttachmentByFileNameRequest($xero_tenant_id, $receipt_id, $file_name, $body) + protected function updateReceiptAttachmentByFileNameRequest($xero_tenant_id, $receipt_id, $file_name, $body, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -61413,6 +63393,10 @@ protected function updateReceiptAttachmentByFileNameRequest($xero_tenant_id, $re if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($receipt_id !== null) { $resourcePath = str_replace( @@ -61498,13 +63482,14 @@ protected function updateReceiptAttachmentByFileNameRequest($xero_tenant_id, $re * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $repeating_invoice_id Unique identifier for a Repeating Invoice (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\RepeatingInvoices $repeating_invoices repeating_invoices (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\RepeatingInvoices|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updateRepeatingInvoice($xero_tenant_id, $repeating_invoice_id, $repeating_invoices) + public function updateRepeatingInvoice($xero_tenant_id, $repeating_invoice_id, $repeating_invoices, $idempotency_key = null) { - list($response) = $this->updateRepeatingInvoiceWithHttpInfo($xero_tenant_id, $repeating_invoice_id, $repeating_invoices); + list($response) = $this->updateRepeatingInvoiceWithHttpInfo($xero_tenant_id, $repeating_invoice_id, $repeating_invoices, $idempotency_key); return $response; } /** @@ -61513,13 +63498,14 @@ public function updateRepeatingInvoice($xero_tenant_id, $repeating_invoice_id, $ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $repeating_invoice_id Unique identifier for a Repeating Invoice (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\RepeatingInvoices $repeating_invoices (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\RepeatingInvoices|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateRepeatingInvoiceWithHttpInfo($xero_tenant_id, $repeating_invoice_id, $repeating_invoices) + public function updateRepeatingInvoiceWithHttpInfo($xero_tenant_id, $repeating_invoice_id, $repeating_invoices, $idempotency_key = null) { - $request = $this->updateRepeatingInvoiceRequest($xero_tenant_id, $repeating_invoice_id, $repeating_invoices); + $request = $this->updateRepeatingInvoiceRequest($xero_tenant_id, $repeating_invoice_id, $repeating_invoices, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -61610,12 +63596,13 @@ public function updateRepeatingInvoiceWithHttpInfo($xero_tenant_id, $repeating_i * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $repeating_invoice_id Unique identifier for a Repeating Invoice (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\RepeatingInvoices $repeating_invoices (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateRepeatingInvoiceAsync($xero_tenant_id, $repeating_invoice_id, $repeating_invoices) + public function updateRepeatingInvoiceAsync($xero_tenant_id, $repeating_invoice_id, $repeating_invoices, $idempotency_key = null) { - return $this->updateRepeatingInvoiceAsyncWithHttpInfo($xero_tenant_id, $repeating_invoice_id, $repeating_invoices) + return $this->updateRepeatingInvoiceAsyncWithHttpInfo($xero_tenant_id, $repeating_invoice_id, $repeating_invoices, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -61628,12 +63615,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $repeating_invoice_id Unique identifier for a Repeating Invoice (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\RepeatingInvoices $repeating_invoices (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateRepeatingInvoiceAsyncWithHttpInfo($xero_tenant_id, $repeating_invoice_id, $repeating_invoices) + public function updateRepeatingInvoiceAsyncWithHttpInfo($xero_tenant_id, $repeating_invoice_id, $repeating_invoices, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\RepeatingInvoices'; - $request = $this->updateRepeatingInvoiceRequest($xero_tenant_id, $repeating_invoice_id, $repeating_invoices); + $request = $this->updateRepeatingInvoiceRequest($xero_tenant_id, $repeating_invoice_id, $repeating_invoices, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -61672,9 +63660,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $repeating_invoice_id Unique identifier for a Repeating Invoice (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\RepeatingInvoices $repeating_invoices (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateRepeatingInvoiceRequest($xero_tenant_id, $repeating_invoice_id, $repeating_invoices) + protected function updateRepeatingInvoiceRequest($xero_tenant_id, $repeating_invoice_id, $repeating_invoices, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -61704,6 +63693,10 @@ protected function updateRepeatingInvoiceRequest($xero_tenant_id, $repeating_inv if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($repeating_invoice_id !== null) { $resourcePath = str_replace( @@ -61782,13 +63775,14 @@ protected function updateRepeatingInvoiceRequest($xero_tenant_id, $repeating_inv * @param string $repeating_invoice_id Unique identifier for a Repeating Invoice (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updateRepeatingInvoiceAttachmentByFileName($xero_tenant_id, $repeating_invoice_id, $file_name, $body) + public function updateRepeatingInvoiceAttachmentByFileName($xero_tenant_id, $repeating_invoice_id, $file_name, $body, $idempotency_key = null) { - list($response) = $this->updateRepeatingInvoiceAttachmentByFileNameWithHttpInfo($xero_tenant_id, $repeating_invoice_id, $file_name, $body); + list($response) = $this->updateRepeatingInvoiceAttachmentByFileNameWithHttpInfo($xero_tenant_id, $repeating_invoice_id, $file_name, $body, $idempotency_key); return $response; } /** @@ -61798,13 +63792,14 @@ public function updateRepeatingInvoiceAttachmentByFileName($xero_tenant_id, $rep * @param string $repeating_invoice_id Unique identifier for a Repeating Invoice (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\Attachments|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateRepeatingInvoiceAttachmentByFileNameWithHttpInfo($xero_tenant_id, $repeating_invoice_id, $file_name, $body) + public function updateRepeatingInvoiceAttachmentByFileNameWithHttpInfo($xero_tenant_id, $repeating_invoice_id, $file_name, $body, $idempotency_key = null) { - $request = $this->updateRepeatingInvoiceAttachmentByFileNameRequest($xero_tenant_id, $repeating_invoice_id, $file_name, $body); + $request = $this->updateRepeatingInvoiceAttachmentByFileNameRequest($xero_tenant_id, $repeating_invoice_id, $file_name, $body, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -61896,12 +63891,13 @@ public function updateRepeatingInvoiceAttachmentByFileNameWithHttpInfo($xero_ten * @param string $repeating_invoice_id Unique identifier for a Repeating Invoice (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateRepeatingInvoiceAttachmentByFileNameAsync($xero_tenant_id, $repeating_invoice_id, $file_name, $body) + public function updateRepeatingInvoiceAttachmentByFileNameAsync($xero_tenant_id, $repeating_invoice_id, $file_name, $body, $idempotency_key = null) { - return $this->updateRepeatingInvoiceAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $repeating_invoice_id, $file_name, $body) + return $this->updateRepeatingInvoiceAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $repeating_invoice_id, $file_name, $body, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -61915,12 +63911,13 @@ function ($response) { * @param string $repeating_invoice_id Unique identifier for a Repeating Invoice (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateRepeatingInvoiceAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $repeating_invoice_id, $file_name, $body) + public function updateRepeatingInvoiceAttachmentByFileNameAsyncWithHttpInfo($xero_tenant_id, $repeating_invoice_id, $file_name, $body, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Attachments'; - $request = $this->updateRepeatingInvoiceAttachmentByFileNameRequest($xero_tenant_id, $repeating_invoice_id, $file_name, $body); + $request = $this->updateRepeatingInvoiceAttachmentByFileNameRequest($xero_tenant_id, $repeating_invoice_id, $file_name, $body, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -61960,9 +63957,10 @@ function ($exception) { * @param string $repeating_invoice_id Unique identifier for a Repeating Invoice (required) * @param string $file_name Name of the attachment (required) * @param string $body Byte array of file in body of request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateRepeatingInvoiceAttachmentByFileNameRequest($xero_tenant_id, $repeating_invoice_id, $file_name, $body) + protected function updateRepeatingInvoiceAttachmentByFileNameRequest($xero_tenant_id, $repeating_invoice_id, $file_name, $body, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -61998,6 +63996,10 @@ protected function updateRepeatingInvoiceAttachmentByFileNameRequest($xero_tenan if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($repeating_invoice_id !== null) { $resourcePath = str_replace( @@ -62082,13 +64084,14 @@ protected function updateRepeatingInvoiceAttachmentByFileNameRequest($xero_tenan * Updates tax rates * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TaxRates $tax_rates tax_rates (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TaxRates|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updateTaxRate($xero_tenant_id, $tax_rates) + public function updateTaxRate($xero_tenant_id, $tax_rates, $idempotency_key = null) { - list($response) = $this->updateTaxRateWithHttpInfo($xero_tenant_id, $tax_rates); + list($response) = $this->updateTaxRateWithHttpInfo($xero_tenant_id, $tax_rates, $idempotency_key); return $response; } /** @@ -62096,13 +64099,14 @@ public function updateTaxRate($xero_tenant_id, $tax_rates) * Updates tax rates * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TaxRates $tax_rates (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\TaxRates|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateTaxRateWithHttpInfo($xero_tenant_id, $tax_rates) + public function updateTaxRateWithHttpInfo($xero_tenant_id, $tax_rates, $idempotency_key = null) { - $request = $this->updateTaxRateRequest($xero_tenant_id, $tax_rates); + $request = $this->updateTaxRateRequest($xero_tenant_id, $tax_rates, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -62192,12 +64196,13 @@ public function updateTaxRateWithHttpInfo($xero_tenant_id, $tax_rates) * Updates tax rates * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TaxRates $tax_rates (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateTaxRateAsync($xero_tenant_id, $tax_rates) + public function updateTaxRateAsync($xero_tenant_id, $tax_rates, $idempotency_key = null) { - return $this->updateTaxRateAsyncWithHttpInfo($xero_tenant_id, $tax_rates) + return $this->updateTaxRateAsyncWithHttpInfo($xero_tenant_id, $tax_rates, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -62209,12 +64214,13 @@ function ($response) { * Updates tax rates * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TaxRates $tax_rates (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateTaxRateAsyncWithHttpInfo($xero_tenant_id, $tax_rates) + public function updateTaxRateAsyncWithHttpInfo($xero_tenant_id, $tax_rates, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TaxRates'; - $request = $this->updateTaxRateRequest($xero_tenant_id, $tax_rates); + $request = $this->updateTaxRateRequest($xero_tenant_id, $tax_rates, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -62252,9 +64258,10 @@ function ($exception) { * Create request for operation 'updateTaxRate' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TaxRates $tax_rates (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateTaxRateRequest($xero_tenant_id, $tax_rates) + protected function updateTaxRateRequest($xero_tenant_id, $tax_rates, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -62278,6 +64285,10 @@ protected function updateTaxRateRequest($xero_tenant_id, $tax_rates) if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($tax_rates)) { @@ -62347,13 +64358,14 @@ protected function updateTaxRateRequest($xero_tenant_id, $tax_rates) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $tracking_category_id Unique identifier for a TrackingCategory (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingCategory $tracking_category tracking_category (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingCategories|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updateTrackingCategory($xero_tenant_id, $tracking_category_id, $tracking_category) + public function updateTrackingCategory($xero_tenant_id, $tracking_category_id, $tracking_category, $idempotency_key = null) { - list($response) = $this->updateTrackingCategoryWithHttpInfo($xero_tenant_id, $tracking_category_id, $tracking_category); + list($response) = $this->updateTrackingCategoryWithHttpInfo($xero_tenant_id, $tracking_category_id, $tracking_category, $idempotency_key); return $response; } /** @@ -62362,13 +64374,14 @@ public function updateTrackingCategory($xero_tenant_id, $tracking_category_id, $ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $tracking_category_id Unique identifier for a TrackingCategory (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingCategory $tracking_category (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\TrackingCategories|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateTrackingCategoryWithHttpInfo($xero_tenant_id, $tracking_category_id, $tracking_category) + public function updateTrackingCategoryWithHttpInfo($xero_tenant_id, $tracking_category_id, $tracking_category, $idempotency_key = null) { - $request = $this->updateTrackingCategoryRequest($xero_tenant_id, $tracking_category_id, $tracking_category); + $request = $this->updateTrackingCategoryRequest($xero_tenant_id, $tracking_category_id, $tracking_category, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -62459,12 +64472,13 @@ public function updateTrackingCategoryWithHttpInfo($xero_tenant_id, $tracking_ca * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $tracking_category_id Unique identifier for a TrackingCategory (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingCategory $tracking_category (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateTrackingCategoryAsync($xero_tenant_id, $tracking_category_id, $tracking_category) + public function updateTrackingCategoryAsync($xero_tenant_id, $tracking_category_id, $tracking_category, $idempotency_key = null) { - return $this->updateTrackingCategoryAsyncWithHttpInfo($xero_tenant_id, $tracking_category_id, $tracking_category) + return $this->updateTrackingCategoryAsyncWithHttpInfo($xero_tenant_id, $tracking_category_id, $tracking_category, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -62477,12 +64491,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $tracking_category_id Unique identifier for a TrackingCategory (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingCategory $tracking_category (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateTrackingCategoryAsyncWithHttpInfo($xero_tenant_id, $tracking_category_id, $tracking_category) + public function updateTrackingCategoryAsyncWithHttpInfo($xero_tenant_id, $tracking_category_id, $tracking_category, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingCategories'; - $request = $this->updateTrackingCategoryRequest($xero_tenant_id, $tracking_category_id, $tracking_category); + $request = $this->updateTrackingCategoryRequest($xero_tenant_id, $tracking_category_id, $tracking_category, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -62521,9 +64536,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $tracking_category_id Unique identifier for a TrackingCategory (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingCategory $tracking_category (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateTrackingCategoryRequest($xero_tenant_id, $tracking_category_id, $tracking_category) + protected function updateTrackingCategoryRequest($xero_tenant_id, $tracking_category_id, $tracking_category, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -62553,6 +64569,10 @@ protected function updateTrackingCategoryRequest($xero_tenant_id, $tracking_cate if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($tracking_category_id !== null) { $resourcePath = str_replace( @@ -62631,13 +64651,14 @@ protected function updateTrackingCategoryRequest($xero_tenant_id, $tracking_cate * @param string $tracking_category_id Unique identifier for a TrackingCategory (required) * @param string $tracking_option_id Unique identifier for a Tracking Option (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingOption $tracking_option tracking_option (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingOptions|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error */ - public function updateTrackingOptions($xero_tenant_id, $tracking_category_id, $tracking_option_id, $tracking_option) + public function updateTrackingOptions($xero_tenant_id, $tracking_category_id, $tracking_option_id, $tracking_option, $idempotency_key = null) { - list($response) = $this->updateTrackingOptionsWithHttpInfo($xero_tenant_id, $tracking_category_id, $tracking_option_id, $tracking_option); + list($response) = $this->updateTrackingOptionsWithHttpInfo($xero_tenant_id, $tracking_category_id, $tracking_option_id, $tracking_option, $idempotency_key); return $response; } /** @@ -62647,13 +64668,14 @@ public function updateTrackingOptions($xero_tenant_id, $tracking_category_id, $t * @param string $tracking_category_id Unique identifier for a TrackingCategory (required) * @param string $tracking_option_id Unique identifier for a Tracking Option (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingOption $tracking_option (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Accounting\TrackingOptions|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Error, HTTP status code, HTTP response headers (array of strings) */ - public function updateTrackingOptionsWithHttpInfo($xero_tenant_id, $tracking_category_id, $tracking_option_id, $tracking_option) + public function updateTrackingOptionsWithHttpInfo($xero_tenant_id, $tracking_category_id, $tracking_option_id, $tracking_option, $idempotency_key = null) { - $request = $this->updateTrackingOptionsRequest($xero_tenant_id, $tracking_category_id, $tracking_option_id, $tracking_option); + $request = $this->updateTrackingOptionsRequest($xero_tenant_id, $tracking_category_id, $tracking_option_id, $tracking_option, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -62745,12 +64767,13 @@ public function updateTrackingOptionsWithHttpInfo($xero_tenant_id, $tracking_cat * @param string $tracking_category_id Unique identifier for a TrackingCategory (required) * @param string $tracking_option_id Unique identifier for a Tracking Option (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingOption $tracking_option (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateTrackingOptionsAsync($xero_tenant_id, $tracking_category_id, $tracking_option_id, $tracking_option) + public function updateTrackingOptionsAsync($xero_tenant_id, $tracking_category_id, $tracking_option_id, $tracking_option, $idempotency_key = null) { - return $this->updateTrackingOptionsAsyncWithHttpInfo($xero_tenant_id, $tracking_category_id, $tracking_option_id, $tracking_option) + return $this->updateTrackingOptionsAsyncWithHttpInfo($xero_tenant_id, $tracking_category_id, $tracking_option_id, $tracking_option, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -62764,12 +64787,13 @@ function ($response) { * @param string $tracking_category_id Unique identifier for a TrackingCategory (required) * @param string $tracking_option_id Unique identifier for a Tracking Option (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingOption $tracking_option (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateTrackingOptionsAsyncWithHttpInfo($xero_tenant_id, $tracking_category_id, $tracking_option_id, $tracking_option) + public function updateTrackingOptionsAsyncWithHttpInfo($xero_tenant_id, $tracking_category_id, $tracking_option_id, $tracking_option, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingOptions'; - $request = $this->updateTrackingOptionsRequest($xero_tenant_id, $tracking_category_id, $tracking_option_id, $tracking_option); + $request = $this->updateTrackingOptionsRequest($xero_tenant_id, $tracking_category_id, $tracking_option_id, $tracking_option, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -62809,9 +64833,10 @@ function ($exception) { * @param string $tracking_category_id Unique identifier for a TrackingCategory (required) * @param string $tracking_option_id Unique identifier for a Tracking Option (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\TrackingOption $tracking_option (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateTrackingOptionsRequest($xero_tenant_id, $tracking_category_id, $tracking_option_id, $tracking_option) + protected function updateTrackingOptionsRequest($xero_tenant_id, $tracking_category_id, $tracking_option_id, $tracking_option, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -62847,6 +64872,10 @@ protected function updateTrackingOptionsRequest($xero_tenant_id, $tracking_categ if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AccountingObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AccountingObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($tracking_category_id !== null) { $resourcePath = str_replace( diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Api/AppStoreApi.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Api/AppStoreApi.php index d7f038a..409e6a2 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Api/AppStoreApi.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Api/AppStoreApi.php @@ -9,7 +9,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -18,7 +18,7 @@ * * These endpoints are for Xero Partners to interact with the App Store Billing platform * - * OpenAPI spec version: 2.35.0 + * OpenAPI spec version: 6.2.0 * Contact: api@xero.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 5.4.0 @@ -603,13 +603,14 @@ protected function getUsageRecordsRequest($subscription_id) * @param string $subscription_id Unique identifier for Subscription object (required) * @param string $subscription_item_id The unique identifier of the subscriptionItem (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\AppStore\CreateUsageRecord $create_usage_record Contains the quantity for the usage record to create (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\AppStore\UsageRecord|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\AppStore\ProblemDetails */ - public function postUsageRecords($subscription_id, $subscription_item_id, $create_usage_record) + public function postUsageRecords($subscription_id, $subscription_item_id, $create_usage_record, $idempotency_key = null) { - list($response) = $this->postUsageRecordsWithHttpInfo($subscription_id, $subscription_item_id, $create_usage_record); + list($response) = $this->postUsageRecordsWithHttpInfo($subscription_id, $subscription_item_id, $create_usage_record, $idempotency_key); return $response; } /** @@ -618,13 +619,14 @@ public function postUsageRecords($subscription_id, $subscription_item_id, $creat * @param string $subscription_id Unique identifier for Subscription object (required) * @param string $subscription_item_id The unique identifier of the subscriptionItem (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\AppStore\CreateUsageRecord $create_usage_record Contains the quantity for the usage record to create (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\AppStore\UsageRecord|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\AppStore\ProblemDetails, HTTP status code, HTTP response headers (array of strings) */ - public function postUsageRecordsWithHttpInfo($subscription_id, $subscription_item_id, $create_usage_record) + public function postUsageRecordsWithHttpInfo($subscription_id, $subscription_item_id, $create_usage_record, $idempotency_key = null) { - $request = $this->postUsageRecordsRequest($subscription_id, $subscription_item_id, $create_usage_record); + $request = $this->postUsageRecordsRequest($subscription_id, $subscription_item_id, $create_usage_record, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -715,12 +717,13 @@ public function postUsageRecordsWithHttpInfo($subscription_id, $subscription_ite * @param string $subscription_id Unique identifier for Subscription object (required) * @param string $subscription_item_id The unique identifier of the subscriptionItem (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\AppStore\CreateUsageRecord $create_usage_record Contains the quantity for the usage record to create (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function postUsageRecordsAsync($subscription_id, $subscription_item_id, $create_usage_record) + public function postUsageRecordsAsync($subscription_id, $subscription_item_id, $create_usage_record, $idempotency_key = null) { - return $this->postUsageRecordsAsyncWithHttpInfo($subscription_id, $subscription_item_id, $create_usage_record) + return $this->postUsageRecordsAsyncWithHttpInfo($subscription_id, $subscription_item_id, $create_usage_record, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -733,12 +736,13 @@ function ($response) { * @param string $subscription_id Unique identifier for Subscription object (required) * @param string $subscription_item_id The unique identifier of the subscriptionItem (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\AppStore\CreateUsageRecord $create_usage_record Contains the quantity for the usage record to create (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function postUsageRecordsAsyncWithHttpInfo($subscription_id, $subscription_item_id, $create_usage_record) + public function postUsageRecordsAsyncWithHttpInfo($subscription_id, $subscription_item_id, $create_usage_record, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\AppStore\UsageRecord'; - $request = $this->postUsageRecordsRequest($subscription_id, $subscription_item_id, $create_usage_record); + $request = $this->postUsageRecordsRequest($subscription_id, $subscription_item_id, $create_usage_record, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -777,9 +781,10 @@ function ($exception) { * @param string $subscription_id Unique identifier for Subscription object (required) * @param string $subscription_item_id The unique identifier of the subscriptionItem (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\AppStore\CreateUsageRecord $create_usage_record Contains the quantity for the usage record to create (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function postUsageRecordsRequest($subscription_id, $subscription_item_id, $create_usage_record) + protected function postUsageRecordsRequest($subscription_id, $subscription_item_id, $create_usage_record, $idempotency_key = null) { // verify the required parameter 'subscription_id' is set if ($subscription_id === null || (is_array($subscription_id) && count($subscription_id) === 0)) { @@ -805,6 +810,10 @@ protected function postUsageRecordsRequest($subscription_id, $subscription_item_ $headerParams = []; $httpBody = ''; $multipart = false; + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AppStoreObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($subscription_id !== null) { $resourcePath = str_replace( @@ -891,13 +900,14 @@ protected function postUsageRecordsRequest($subscription_id, $subscription_item_ * @param string $subscription_item_id The unique identifier of the subscriptionItem (required) * @param string $usage_record_id The unique identifier of the usage record (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\AppStore\UpdateUsageRecord $update_usage_record Contains the quantity for the usage record to update (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\AppStore\UsageRecord|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\AppStore\ProblemDetails */ - public function putUsageRecords($subscription_id, $subscription_item_id, $usage_record_id, $update_usage_record) + public function putUsageRecords($subscription_id, $subscription_item_id, $usage_record_id, $update_usage_record, $idempotency_key = null) { - list($response) = $this->putUsageRecordsWithHttpInfo($subscription_id, $subscription_item_id, $usage_record_id, $update_usage_record); + list($response) = $this->putUsageRecordsWithHttpInfo($subscription_id, $subscription_item_id, $usage_record_id, $update_usage_record, $idempotency_key); return $response; } /** @@ -907,13 +917,14 @@ public function putUsageRecords($subscription_id, $subscription_item_id, $usage_ * @param string $subscription_item_id The unique identifier of the subscriptionItem (required) * @param string $usage_record_id The unique identifier of the usage record (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\AppStore\UpdateUsageRecord $update_usage_record Contains the quantity for the usage record to update (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\AppStore\UsageRecord|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\AppStore\ProblemDetails, HTTP status code, HTTP response headers (array of strings) */ - public function putUsageRecordsWithHttpInfo($subscription_id, $subscription_item_id, $usage_record_id, $update_usage_record) + public function putUsageRecordsWithHttpInfo($subscription_id, $subscription_item_id, $usage_record_id, $update_usage_record, $idempotency_key = null) { - $request = $this->putUsageRecordsRequest($subscription_id, $subscription_item_id, $usage_record_id, $update_usage_record); + $request = $this->putUsageRecordsRequest($subscription_id, $subscription_item_id, $usage_record_id, $update_usage_record, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -1005,12 +1016,13 @@ public function putUsageRecordsWithHttpInfo($subscription_id, $subscription_item * @param string $subscription_item_id The unique identifier of the subscriptionItem (required) * @param string $usage_record_id The unique identifier of the usage record (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\AppStore\UpdateUsageRecord $update_usage_record Contains the quantity for the usage record to update (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function putUsageRecordsAsync($subscription_id, $subscription_item_id, $usage_record_id, $update_usage_record) + public function putUsageRecordsAsync($subscription_id, $subscription_item_id, $usage_record_id, $update_usage_record, $idempotency_key = null) { - return $this->putUsageRecordsAsyncWithHttpInfo($subscription_id, $subscription_item_id, $usage_record_id, $update_usage_record) + return $this->putUsageRecordsAsyncWithHttpInfo($subscription_id, $subscription_item_id, $usage_record_id, $update_usage_record, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -1024,12 +1036,13 @@ function ($response) { * @param string $subscription_item_id The unique identifier of the subscriptionItem (required) * @param string $usage_record_id The unique identifier of the usage record (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\AppStore\UpdateUsageRecord $update_usage_record Contains the quantity for the usage record to update (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function putUsageRecordsAsyncWithHttpInfo($subscription_id, $subscription_item_id, $usage_record_id, $update_usage_record) + public function putUsageRecordsAsyncWithHttpInfo($subscription_id, $subscription_item_id, $usage_record_id, $update_usage_record, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\AppStore\UsageRecord'; - $request = $this->putUsageRecordsRequest($subscription_id, $subscription_item_id, $usage_record_id, $update_usage_record); + $request = $this->putUsageRecordsRequest($subscription_id, $subscription_item_id, $usage_record_id, $update_usage_record, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -1069,9 +1082,10 @@ function ($exception) { * @param string $subscription_item_id The unique identifier of the subscriptionItem (required) * @param string $usage_record_id The unique identifier of the usage record (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\AppStore\UpdateUsageRecord $update_usage_record Contains the quantity for the usage record to update (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function putUsageRecordsRequest($subscription_id, $subscription_item_id, $usage_record_id, $update_usage_record) + protected function putUsageRecordsRequest($subscription_id, $subscription_item_id, $usage_record_id, $update_usage_record, $idempotency_key = null) { // verify the required parameter 'subscription_id' is set if ($subscription_id === null || (is_array($subscription_id) && count($subscription_id) === 0)) { @@ -1103,6 +1117,10 @@ protected function putUsageRecordsRequest($subscription_id, $subscription_item_i $headerParams = []; $httpBody = ''; $multipart = false; + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AppStoreObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($subscription_id !== null) { $resourcePath = str_replace( diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Api/AssetApi.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Api/AssetApi.php index 647af5d..800abdf 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Api/AssetApi.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Api/AssetApi.php @@ -9,7 +9,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -18,7 +18,7 @@ * * The Assets API exposes fixed asset related functions of the Xero Accounting application and can be used for a variety of purposes such as creating assets, retrieving asset valuations etc. * - * OpenAPI spec version: 2.35.0 + * OpenAPI spec version: 6.2.0 * Contact: api@xero.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 5.4.0 @@ -94,13 +94,14 @@ public function getConfig() * adds a fixed asset * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Asset\Asset $asset Fixed asset you are creating (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Asset\Asset */ - public function createAsset($xero_tenant_id, $asset) + public function createAsset($xero_tenant_id, $asset, $idempotency_key = null) { - list($response) = $this->createAssetWithHttpInfo($xero_tenant_id, $asset); + list($response) = $this->createAssetWithHttpInfo($xero_tenant_id, $asset, $idempotency_key); return $response; } /** @@ -108,13 +109,14 @@ public function createAsset($xero_tenant_id, $asset) * adds a fixed asset * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Asset\Asset $asset Fixed asset you are creating (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Asset\Asset, HTTP status code, HTTP response headers (array of strings) */ - public function createAssetWithHttpInfo($xero_tenant_id, $asset) + public function createAssetWithHttpInfo($xero_tenant_id, $asset, $idempotency_key = null) { - $request = $this->createAssetRequest($xero_tenant_id, $asset); + $request = $this->createAssetRequest($xero_tenant_id, $asset, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -185,12 +187,13 @@ public function createAssetWithHttpInfo($xero_tenant_id, $asset) * adds a fixed asset * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Asset\Asset $asset Fixed asset you are creating (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createAssetAsync($xero_tenant_id, $asset) + public function createAssetAsync($xero_tenant_id, $asset, $idempotency_key = null) { - return $this->createAssetAsyncWithHttpInfo($xero_tenant_id, $asset) + return $this->createAssetAsyncWithHttpInfo($xero_tenant_id, $asset, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -202,12 +205,13 @@ function ($response) { * adds a fixed asset * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Asset\Asset $asset Fixed asset you are creating (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createAssetAsyncWithHttpInfo($xero_tenant_id, $asset) + public function createAssetAsyncWithHttpInfo($xero_tenant_id, $asset, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Asset\Asset'; - $request = $this->createAssetRequest($xero_tenant_id, $asset); + $request = $this->createAssetRequest($xero_tenant_id, $asset, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -245,9 +249,10 @@ function ($exception) { * Create request for operation 'createAsset' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Asset\Asset $asset Fixed asset you are creating (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createAssetRequest($xero_tenant_id, $asset) + protected function createAssetRequest($xero_tenant_id, $asset, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -271,6 +276,10 @@ protected function createAssetRequest($xero_tenant_id, $asset) if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AssetObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AssetObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($asset)) { @@ -338,28 +347,30 @@ protected function createAssetRequest($xero_tenant_id, $asset) * Operation createAssetType * adds a fixed asset type * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Asset\AssetType $asset_type Asset type to add (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Asset\AssetType $asset_type Asset type to add (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Asset\AssetType */ - public function createAssetType($xero_tenant_id, $asset_type = null) + public function createAssetType($xero_tenant_id, $asset_type, $idempotency_key = null) { - list($response) = $this->createAssetTypeWithHttpInfo($xero_tenant_id, $asset_type); + list($response) = $this->createAssetTypeWithHttpInfo($xero_tenant_id, $asset_type, $idempotency_key); return $response; } /** * Operation createAssetTypeWithHttpInfo * adds a fixed asset type * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Asset\AssetType $asset_type Asset type to add (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Asset\AssetType $asset_type Asset type to add (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Asset\AssetType, HTTP status code, HTTP response headers (array of strings) */ - public function createAssetTypeWithHttpInfo($xero_tenant_id, $asset_type = null) + public function createAssetTypeWithHttpInfo($xero_tenant_id, $asset_type, $idempotency_key = null) { - $request = $this->createAssetTypeRequest($xero_tenant_id, $asset_type); + $request = $this->createAssetTypeRequest($xero_tenant_id, $asset_type, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -429,13 +440,14 @@ public function createAssetTypeWithHttpInfo($xero_tenant_id, $asset_type = null) * Operation createAssetTypeAsync * adds a fixed asset type * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Asset\AssetType $asset_type Asset type to add (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Asset\AssetType $asset_type Asset type to add (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createAssetTypeAsync($xero_tenant_id, $asset_type = null) + public function createAssetTypeAsync($xero_tenant_id, $asset_type, $idempotency_key = null) { - return $this->createAssetTypeAsyncWithHttpInfo($xero_tenant_id, $asset_type) + return $this->createAssetTypeAsyncWithHttpInfo($xero_tenant_id, $asset_type, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -446,13 +458,14 @@ function ($response) { * Operation createAssetTypeAsyncWithHttpInfo * adds a fixed asset type * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Asset\AssetType $asset_type Asset type to add (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Asset\AssetType $asset_type Asset type to add (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createAssetTypeAsyncWithHttpInfo($xero_tenant_id, $asset_type = null) + public function createAssetTypeAsyncWithHttpInfo($xero_tenant_id, $asset_type, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Asset\AssetType'; - $request = $this->createAssetTypeRequest($xero_tenant_id, $asset_type); + $request = $this->createAssetTypeRequest($xero_tenant_id, $asset_type, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -489,10 +502,11 @@ function ($exception) { /** * Create request for operation 'createAssetType' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Asset\AssetType $asset_type Asset type to add (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Asset\AssetType $asset_type Asset type to add (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createAssetTypeRequest($xero_tenant_id, $asset_type = null) + protected function createAssetTypeRequest($xero_tenant_id, $asset_type, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -500,6 +514,12 @@ protected function createAssetTypeRequest($xero_tenant_id, $asset_type = null) 'Missing the required parameter $xero_tenant_id when calling createAssetType' ); } + // verify the required parameter 'asset_type' is set + if ($asset_type === null || (is_array($asset_type) && count($asset_type) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $asset_type when calling createAssetType' + ); + } $resourcePath = '/AssetTypes'; $formParams = []; $queryParams = []; @@ -510,6 +530,10 @@ protected function createAssetTypeRequest($xero_tenant_id, $asset_type = null) if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = AssetObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = AssetObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($asset_type)) { diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Api/FilesApi.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Api/FilesApi.php index 351e876..5eccd5e 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Api/FilesApi.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Api/FilesApi.php @@ -9,7 +9,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -18,7 +18,7 @@ * * These endpoints are specific to Xero Files API * - * OpenAPI spec version: 2.35.0 + * OpenAPI spec version: 6.2.0 * Contact: api@xero.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 5.4.0 @@ -94,14 +94,15 @@ public function getConfig() * Creates a new file association * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $file_id File id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\Association $association association (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\Association $association association (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\Association */ - public function createFileAssociation($xero_tenant_id, $file_id, $association = null) + public function createFileAssociation($xero_tenant_id, $file_id, $association, $idempotency_key = null) { - list($response) = $this->createFileAssociationWithHttpInfo($xero_tenant_id, $file_id, $association); + list($response) = $this->createFileAssociationWithHttpInfo($xero_tenant_id, $file_id, $association, $idempotency_key); return $response; } /** @@ -109,14 +110,15 @@ public function createFileAssociation($xero_tenant_id, $file_id, $association = * Creates a new file association * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $file_id File id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\Association $association (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\Association $association (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\File\Association, HTTP status code, HTTP response headers (array of strings) */ - public function createFileAssociationWithHttpInfo($xero_tenant_id, $file_id, $association = null) + public function createFileAssociationWithHttpInfo($xero_tenant_id, $file_id, $association, $idempotency_key = null) { - $request = $this->createFileAssociationRequest($xero_tenant_id, $file_id, $association); + $request = $this->createFileAssociationRequest($xero_tenant_id, $file_id, $association, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -187,13 +189,14 @@ public function createFileAssociationWithHttpInfo($xero_tenant_id, $file_id, $as * Creates a new file association * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $file_id File id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\Association $association (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\Association $association (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createFileAssociationAsync($xero_tenant_id, $file_id, $association = null) + public function createFileAssociationAsync($xero_tenant_id, $file_id, $association, $idempotency_key = null) { - return $this->createFileAssociationAsyncWithHttpInfo($xero_tenant_id, $file_id, $association) + return $this->createFileAssociationAsyncWithHttpInfo($xero_tenant_id, $file_id, $association, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -205,13 +208,14 @@ function ($response) { * Creates a new file association * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $file_id File id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\Association $association (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\Association $association (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createFileAssociationAsyncWithHttpInfo($xero_tenant_id, $file_id, $association = null) + public function createFileAssociationAsyncWithHttpInfo($xero_tenant_id, $file_id, $association, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\Association'; - $request = $this->createFileAssociationRequest($xero_tenant_id, $file_id, $association); + $request = $this->createFileAssociationRequest($xero_tenant_id, $file_id, $association, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -249,10 +253,11 @@ function ($exception) { * Create request for operation 'createFileAssociation' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $file_id File id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\Association $association (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\Association $association (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createFileAssociationRequest($xero_tenant_id, $file_id, $association = null) + protected function createFileAssociationRequest($xero_tenant_id, $file_id, $association, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -266,6 +271,12 @@ protected function createFileAssociationRequest($xero_tenant_id, $file_id, $asso 'Missing the required parameter $file_id when calling createFileAssociation' ); } + // verify the required parameter 'association' is set + if ($association === null || (is_array($association) && count($association) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $association when calling createFileAssociation' + ); + } $resourcePath = '/Files/{FileId}/Associations'; $formParams = []; $queryParams = []; @@ -276,6 +287,10 @@ protected function createFileAssociationRequest($xero_tenant_id, $file_id, $asso if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = FileObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = FileObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($file_id !== null) { $resourcePath = str_replace( @@ -351,28 +366,30 @@ protected function createFileAssociationRequest($xero_tenant_id, $file_id, $asso * Operation createFolder * Creates a new folder * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\Folder $folder folder (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\Folder $folder folder (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\Folder */ - public function createFolder($xero_tenant_id, $folder = null) + public function createFolder($xero_tenant_id, $folder, $idempotency_key = null) { - list($response) = $this->createFolderWithHttpInfo($xero_tenant_id, $folder); + list($response) = $this->createFolderWithHttpInfo($xero_tenant_id, $folder, $idempotency_key); return $response; } /** * Operation createFolderWithHttpInfo * Creates a new folder * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\Folder $folder (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\Folder $folder (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\File\Folder, HTTP status code, HTTP response headers (array of strings) */ - public function createFolderWithHttpInfo($xero_tenant_id, $folder = null) + public function createFolderWithHttpInfo($xero_tenant_id, $folder, $idempotency_key = null) { - $request = $this->createFolderRequest($xero_tenant_id, $folder); + $request = $this->createFolderRequest($xero_tenant_id, $folder, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -442,13 +459,14 @@ public function createFolderWithHttpInfo($xero_tenant_id, $folder = null) * Operation createFolderAsync * Creates a new folder * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\Folder $folder (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\Folder $folder (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createFolderAsync($xero_tenant_id, $folder = null) + public function createFolderAsync($xero_tenant_id, $folder, $idempotency_key = null) { - return $this->createFolderAsyncWithHttpInfo($xero_tenant_id, $folder) + return $this->createFolderAsyncWithHttpInfo($xero_tenant_id, $folder, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -459,13 +477,14 @@ function ($response) { * Operation createFolderAsyncWithHttpInfo * Creates a new folder * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\Folder $folder (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\Folder $folder (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createFolderAsyncWithHttpInfo($xero_tenant_id, $folder = null) + public function createFolderAsyncWithHttpInfo($xero_tenant_id, $folder, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\Folder'; - $request = $this->createFolderRequest($xero_tenant_id, $folder); + $request = $this->createFolderRequest($xero_tenant_id, $folder, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -502,10 +521,11 @@ function ($exception) { /** * Create request for operation 'createFolder' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\Folder $folder (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\Folder $folder (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createFolderRequest($xero_tenant_id, $folder = null) + protected function createFolderRequest($xero_tenant_id, $folder, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -513,6 +533,12 @@ protected function createFolderRequest($xero_tenant_id, $folder = null) 'Missing the required parameter $xero_tenant_id when calling createFolder' ); } + // verify the required parameter 'folder' is set + if ($folder === null || (is_array($folder) && count($folder) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $folder when calling createFolder' + ); + } $resourcePath = '/Folders'; $formParams = []; $queryParams = []; @@ -523,6 +549,10 @@ protected function createFolderRequest($xero_tenant_id, $folder = null) if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = FileObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = FileObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($folder)) { @@ -1228,13 +1258,17 @@ protected function deleteFolderRequest($xero_tenant_id, $folder_id) * Retrieves an association object using a unique object ID * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $object_id Object id for single object (required) + * @param int $pagesize pass an optional page size value (optional) + * @param int $page number of records to skip for pagination (optional) + * @param string $sort values to sort by (optional) + * @param string $direction direction to sort by (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\Association[] */ - public function getAssociationsByObject($xero_tenant_id, $object_id) + public function getAssociationsByObject($xero_tenant_id, $object_id, $pagesize = null, $page = null, $sort = null, $direction = null) { - list($response) = $this->getAssociationsByObjectWithHttpInfo($xero_tenant_id, $object_id); + list($response) = $this->getAssociationsByObjectWithHttpInfo($xero_tenant_id, $object_id, $pagesize, $page, $sort, $direction); return $response; } /** @@ -1242,13 +1276,17 @@ public function getAssociationsByObject($xero_tenant_id, $object_id) * Retrieves an association object using a unique object ID * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $object_id Object id for single object (required) + * @param int $pagesize pass an optional page size value (optional) + * @param int $page number of records to skip for pagination (optional) + * @param string $sort values to sort by (optional) + * @param string $direction direction to sort by (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\File\Association[], HTTP status code, HTTP response headers (array of strings) */ - public function getAssociationsByObjectWithHttpInfo($xero_tenant_id, $object_id) + public function getAssociationsByObjectWithHttpInfo($xero_tenant_id, $object_id, $pagesize = null, $page = null, $sort = null, $direction = null) { - $request = $this->getAssociationsByObjectRequest($xero_tenant_id, $object_id); + $request = $this->getAssociationsByObjectRequest($xero_tenant_id, $object_id, $pagesize, $page, $sort, $direction); try { $options = $this->createHttpClientOption(); try { @@ -1319,12 +1357,16 @@ public function getAssociationsByObjectWithHttpInfo($xero_tenant_id, $object_id) * Retrieves an association object using a unique object ID * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $object_id Object id for single object (required) + * @param int $pagesize pass an optional page size value (optional) + * @param int $page number of records to skip for pagination (optional) + * @param string $sort values to sort by (optional) + * @param string $direction direction to sort by (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getAssociationsByObjectAsync($xero_tenant_id, $object_id) + public function getAssociationsByObjectAsync($xero_tenant_id, $object_id, $pagesize = null, $page = null, $sort = null, $direction = null) { - return $this->getAssociationsByObjectAsyncWithHttpInfo($xero_tenant_id, $object_id) + return $this->getAssociationsByObjectAsyncWithHttpInfo($xero_tenant_id, $object_id, $pagesize, $page, $sort, $direction) ->then( function ($response) { return $response[0]; @@ -1336,12 +1378,16 @@ function ($response) { * Retrieves an association object using a unique object ID * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $object_id Object id for single object (required) + * @param int $pagesize pass an optional page size value (optional) + * @param int $page number of records to skip for pagination (optional) + * @param string $sort values to sort by (optional) + * @param string $direction direction to sort by (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getAssociationsByObjectAsyncWithHttpInfo($xero_tenant_id, $object_id) + public function getAssociationsByObjectAsyncWithHttpInfo($xero_tenant_id, $object_id, $pagesize = null, $page = null, $sort = null, $direction = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\Association[]'; - $request = $this->getAssociationsByObjectRequest($xero_tenant_id, $object_id); + $request = $this->getAssociationsByObjectRequest($xero_tenant_id, $object_id, $pagesize, $page, $sort, $direction); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -1379,9 +1425,13 @@ function ($exception) { * Create request for operation 'getAssociationsByObject' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $object_id Object id for single object (required) + * @param int $pagesize pass an optional page size value (optional) + * @param int $page number of records to skip for pagination (optional) + * @param string $sort values to sort by (optional) + * @param string $direction direction to sort by (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getAssociationsByObjectRequest($xero_tenant_id, $object_id) + protected function getAssociationsByObjectRequest($xero_tenant_id, $object_id, $pagesize = null, $page = null, $sort = null, $direction = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -1395,12 +1445,36 @@ protected function getAssociationsByObjectRequest($xero_tenant_id, $object_id) 'Missing the required parameter $object_id when calling getAssociationsByObject' ); } + if ($pagesize !== null && $pagesize > 100) { + throw new \InvalidArgumentException('invalid value for "$pagesize" when calling FilesApi.getAssociationsByObject, must be smaller than or equal to 100.'); + } + + if ($page !== null && $page < 1) { + throw new \InvalidArgumentException('invalid value for "$page" when calling FilesApi.getAssociationsByObject, must be bigger than or equal to 1.'); + } + $resourcePath = '/Associations/{ObjectId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if ($pagesize !== null) { + $queryParams['pagesize'] = FileObjectSerializer::toQueryValue($pagesize); + } + // query params + if ($page !== null) { + $queryParams['page'] = FileObjectSerializer::toQueryValue($page); + } + // query params + if ($sort !== null) { + $queryParams['sort'] = FileObjectSerializer::toQueryValue($sort); + } + // query params + if ($direction !== null) { + $queryParams['direction'] = FileObjectSerializer::toQueryValue($direction); + } // header params if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = FileObjectSerializer::toHeaderValue($xero_tenant_id); @@ -1473,6 +1547,255 @@ protected function getAssociationsByObjectRequest($xero_tenant_id, $object_id) ); } + /** + * Operation getAssociationsCount + * Retrieves a count of associations for a list of objects. + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string[] $object_ids A comma-separated list of object ids (required) + * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return object + */ + public function getAssociationsCount($xero_tenant_id, $object_ids) + { + list($response) = $this->getAssociationsCountWithHttpInfo($xero_tenant_id, $object_ids); + return $response; + } + /** + * Operation getAssociationsCountWithHttpInfo + * Retrieves a count of associations for a list of objects. + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string[] $object_ids A comma-separated list of object ids (required) + * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of object, HTTP status code, HTTP response headers (array of strings) + */ + public function getAssociationsCountWithHttpInfo($xero_tenant_id, $object_ids) + { + $request = $this->getAssociationsCountRequest($xero_tenant_id, $object_ids); + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + $statusCode = $response->getStatusCode(); + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('object' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + FileObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + $returnType = 'object'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + FileObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = FileObjectSerializer::deserialize( + $e->getResponseBody(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + /** + * Operation getAssociationsCountAsync + * Retrieves a count of associations for a list of objects. + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string[] $object_ids A comma-separated list of object ids (required) + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface + */ + public function getAssociationsCountAsync($xero_tenant_id, $object_ids) + { + return $this->getAssociationsCountAsyncWithHttpInfo($xero_tenant_id, $object_ids) + ->then( + function ($response) { + return $response[0]; + } + ); + } + /** + * Operation getAssociationsCountAsyncWithHttpInfo + * Retrieves a count of associations for a list of objects. + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string[] $object_ids A comma-separated list of object ids (required) + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ + public function getAssociationsCountAsyncWithHttpInfo($xero_tenant_id, $object_ids) + { + $returnType = 'object'; + $request = $this->getAssociationsCountRequest($xero_tenant_id, $object_ids); + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + FileObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getAssociationsCount' + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string[] $object_ids A comma-separated list of object ids (required) + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ + protected function getAssociationsCountRequest($xero_tenant_id, $object_ids) + { + // verify the required parameter 'xero_tenant_id' is set + if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $xero_tenant_id when calling getAssociationsCount' + ); + } + // verify the required parameter 'object_ids' is set + if ($object_ids === null || (is_array($object_ids) && count($object_ids) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $object_ids when calling getAssociationsCount' + ); + } + $resourcePath = '/Associations/Count'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + // query params + if (is_array($object_ids)) { + $object_ids = FileObjectSerializer::serializeCollection($object_ids, 'multi', true); + } + if ($object_ids !== null) { + $queryParams['ObjectIds'] = FileObjectSerializer::toQueryValue($object_ids); + } + // header params + if ($xero_tenant_id !== null) { + $headerParams['xero-tenant-id'] = FileObjectSerializer::toHeaderValue($xero_tenant_id); + } + // body params + $_tempBody = null; + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\json_encode(FileObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = [ + [ + 'Content-type' => 'multipart/form-data', + ] + ]; + + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\json_encode($formParams); + } else { + // for HTTP post (form) + $httpBody = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Query::build($formParams); + } + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + $query = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHostFile() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation getFile * Retrieves a file by a unique file ID @@ -3215,14 +3538,15 @@ protected function getInboxRequest($xero_tenant_id) * Update a file * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $file_id File id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\FileObject $file_object file_object (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\FileObject $file_object file_object (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\FileObject */ - public function updateFile($xero_tenant_id, $file_id, $file_object = null) + public function updateFile($xero_tenant_id, $file_id, $file_object, $idempotency_key = null) { - list($response) = $this->updateFileWithHttpInfo($xero_tenant_id, $file_id, $file_object); + list($response) = $this->updateFileWithHttpInfo($xero_tenant_id, $file_id, $file_object, $idempotency_key); return $response; } /** @@ -3230,14 +3554,15 @@ public function updateFile($xero_tenant_id, $file_id, $file_object = null) * Update a file * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $file_id File id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\FileObject $file_object (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\FileObject $file_object (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\File\FileObject, HTTP status code, HTTP response headers (array of strings) */ - public function updateFileWithHttpInfo($xero_tenant_id, $file_id, $file_object = null) + public function updateFileWithHttpInfo($xero_tenant_id, $file_id, $file_object, $idempotency_key = null) { - $request = $this->updateFileRequest($xero_tenant_id, $file_id, $file_object); + $request = $this->updateFileRequest($xero_tenant_id, $file_id, $file_object, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -3308,13 +3633,14 @@ public function updateFileWithHttpInfo($xero_tenant_id, $file_id, $file_object = * Update a file * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $file_id File id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\FileObject $file_object (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\FileObject $file_object (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateFileAsync($xero_tenant_id, $file_id, $file_object = null) + public function updateFileAsync($xero_tenant_id, $file_id, $file_object, $idempotency_key = null) { - return $this->updateFileAsyncWithHttpInfo($xero_tenant_id, $file_id, $file_object) + return $this->updateFileAsyncWithHttpInfo($xero_tenant_id, $file_id, $file_object, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -3326,13 +3652,14 @@ function ($response) { * Update a file * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $file_id File id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\FileObject $file_object (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\FileObject $file_object (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateFileAsyncWithHttpInfo($xero_tenant_id, $file_id, $file_object = null) + public function updateFileAsyncWithHttpInfo($xero_tenant_id, $file_id, $file_object, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\FileObject'; - $request = $this->updateFileRequest($xero_tenant_id, $file_id, $file_object); + $request = $this->updateFileRequest($xero_tenant_id, $file_id, $file_object, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -3370,10 +3697,11 @@ function ($exception) { * Create request for operation 'updateFile' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $file_id File id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\FileObject $file_object (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\FileObject $file_object (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateFileRequest($xero_tenant_id, $file_id, $file_object = null) + protected function updateFileRequest($xero_tenant_id, $file_id, $file_object, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -3387,6 +3715,12 @@ protected function updateFileRequest($xero_tenant_id, $file_id, $file_object = n 'Missing the required parameter $file_id when calling updateFile' ); } + // verify the required parameter 'file_object' is set + if ($file_object === null || (is_array($file_object) && count($file_object) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $file_object when calling updateFile' + ); + } $resourcePath = '/Files/{FileId}'; $formParams = []; $queryParams = []; @@ -3397,6 +3731,10 @@ protected function updateFileRequest($xero_tenant_id, $file_id, $file_object = n if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = FileObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = FileObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($file_id !== null) { $resourcePath = str_replace( @@ -3474,13 +3812,14 @@ protected function updateFileRequest($xero_tenant_id, $file_id, $file_object = n * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $folder_id Folder id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\Folder $folder folder (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\Folder */ - public function updateFolder($xero_tenant_id, $folder_id, $folder) + public function updateFolder($xero_tenant_id, $folder_id, $folder, $idempotency_key = null) { - list($response) = $this->updateFolderWithHttpInfo($xero_tenant_id, $folder_id, $folder); + list($response) = $this->updateFolderWithHttpInfo($xero_tenant_id, $folder_id, $folder, $idempotency_key); return $response; } /** @@ -3489,13 +3828,14 @@ public function updateFolder($xero_tenant_id, $folder_id, $folder) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $folder_id Folder id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\Folder $folder (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\File\Folder, HTTP status code, HTTP response headers (array of strings) */ - public function updateFolderWithHttpInfo($xero_tenant_id, $folder_id, $folder) + public function updateFolderWithHttpInfo($xero_tenant_id, $folder_id, $folder, $idempotency_key = null) { - $request = $this->updateFolderRequest($xero_tenant_id, $folder_id, $folder); + $request = $this->updateFolderRequest($xero_tenant_id, $folder_id, $folder, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -3567,12 +3907,13 @@ public function updateFolderWithHttpInfo($xero_tenant_id, $folder_id, $folder) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $folder_id Folder id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\Folder $folder (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateFolderAsync($xero_tenant_id, $folder_id, $folder) + public function updateFolderAsync($xero_tenant_id, $folder_id, $folder, $idempotency_key = null) { - return $this->updateFolderAsyncWithHttpInfo($xero_tenant_id, $folder_id, $folder) + return $this->updateFolderAsyncWithHttpInfo($xero_tenant_id, $folder_id, $folder, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -3585,12 +3926,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $folder_id Folder id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\Folder $folder (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateFolderAsyncWithHttpInfo($xero_tenant_id, $folder_id, $folder) + public function updateFolderAsyncWithHttpInfo($xero_tenant_id, $folder_id, $folder, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\Folder'; - $request = $this->updateFolderRequest($xero_tenant_id, $folder_id, $folder); + $request = $this->updateFolderRequest($xero_tenant_id, $folder_id, $folder, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -3629,9 +3971,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $folder_id Folder id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\Folder $folder (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateFolderRequest($xero_tenant_id, $folder_id, $folder) + protected function updateFolderRequest($xero_tenant_id, $folder_id, $folder, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -3661,6 +4004,10 @@ protected function updateFolderRequest($xero_tenant_id, $folder_id, $folder) if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = FileObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = FileObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($folder_id !== null) { $resourcePath = str_replace( @@ -3739,14 +4086,15 @@ protected function updateFolderRequest($xero_tenant_id, $folder_id, $folder) * @param string $body body (required) * @param string $name exact name of the file you are uploading (required) * @param string $filename filename (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @param string $mime_type mime_type (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\FileObject */ - public function uploadFile($xero_tenant_id, $body, $name, $filename, $mime_type = null) + public function uploadFile($xero_tenant_id, $body, $name, $filename, $idempotency_key = null, $mime_type = null) { - list($response) = $this->uploadFileWithHttpInfo($xero_tenant_id, $body, $name, $filename, $mime_type); + list($response) = $this->uploadFileWithHttpInfo($xero_tenant_id, $body, $name, $filename, $idempotency_key, $mime_type); return $response; } /** @@ -3756,14 +4104,15 @@ public function uploadFile($xero_tenant_id, $body, $name, $filename, $mime_type * @param string $body (required) * @param string $name exact name of the file you are uploading (required) * @param string $filename (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @param string $mime_type (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\File\FileObject, HTTP status code, HTTP response headers (array of strings) */ - public function uploadFileWithHttpInfo($xero_tenant_id, $body, $name, $filename, $mime_type = null) + public function uploadFileWithHttpInfo($xero_tenant_id, $body, $name, $filename, $idempotency_key = null, $mime_type = null) { - $request = $this->uploadFileRequest($xero_tenant_id, $body, $name, $filename, $mime_type); + $request = $this->uploadFileRequest($xero_tenant_id, $body, $name, $filename, $idempotency_key, $mime_type); try { $options = $this->createHttpClientOption(); try { @@ -3836,13 +4185,14 @@ public function uploadFileWithHttpInfo($xero_tenant_id, $body, $name, $filename, * @param string $body (required) * @param string $name exact name of the file you are uploading (required) * @param string $filename (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @param string $mime_type (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function uploadFileAsync($xero_tenant_id, $body, $name, $filename, $mime_type = null) + public function uploadFileAsync($xero_tenant_id, $body, $name, $filename, $idempotency_key = null, $mime_type = null) { - return $this->uploadFileAsyncWithHttpInfo($xero_tenant_id, $body, $name, $filename, $mime_type) + return $this->uploadFileAsyncWithHttpInfo($xero_tenant_id, $body, $name, $filename, $idempotency_key, $mime_type) ->then( function ($response) { return $response[0]; @@ -3856,13 +4206,14 @@ function ($response) { * @param string $body (required) * @param string $name exact name of the file you are uploading (required) * @param string $filename (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @param string $mime_type (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function uploadFileAsyncWithHttpInfo($xero_tenant_id, $body, $name, $filename, $mime_type = null) + public function uploadFileAsyncWithHttpInfo($xero_tenant_id, $body, $name, $filename, $idempotency_key = null, $mime_type = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\FileObject'; - $request = $this->uploadFileRequest($xero_tenant_id, $body, $name, $filename, $mime_type); + $request = $this->uploadFileRequest($xero_tenant_id, $body, $name, $filename, $idempotency_key, $mime_type); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -3902,10 +4253,11 @@ function ($exception) { * @param string $body (required) * @param string $name exact name of the file you are uploading (required) * @param string $filename (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @param string $mime_type (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function uploadFileRequest($xero_tenant_id, $body, $name, $filename, $mime_type = null) + protected function uploadFileRequest($xero_tenant_id, $body, $name, $filename, $idempotency_key = null, $mime_type = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -3941,6 +4293,10 @@ protected function uploadFileRequest($xero_tenant_id, $body, $name, $filename, $ if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = FileObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = FileObjectSerializer::toHeaderValue($idempotency_key); + } // form params if ($body !== null) { $multipart = true; @@ -4034,14 +4390,15 @@ protected function uploadFileRequest($xero_tenant_id, $body, $name, $filename, $ * @param string $body body (required) * @param string $name exact name of the file you are uploading (required) * @param string $filename filename (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @param string $mime_type mime_type (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\FileObject */ - public function uploadFileToFolder($xero_tenant_id, $folder_id, $body, $name, $filename, $mime_type = null) + public function uploadFileToFolder($xero_tenant_id, $folder_id, $body, $name, $filename, $idempotency_key = null, $mime_type = null) { - list($response) = $this->uploadFileToFolderWithHttpInfo($xero_tenant_id, $folder_id, $body, $name, $filename, $mime_type); + list($response) = $this->uploadFileToFolderWithHttpInfo($xero_tenant_id, $folder_id, $body, $name, $filename, $idempotency_key, $mime_type); return $response; } /** @@ -4052,14 +4409,15 @@ public function uploadFileToFolder($xero_tenant_id, $folder_id, $body, $name, $f * @param string $body (required) * @param string $name exact name of the file you are uploading (required) * @param string $filename (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @param string $mime_type (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\File\FileObject, HTTP status code, HTTP response headers (array of strings) */ - public function uploadFileToFolderWithHttpInfo($xero_tenant_id, $folder_id, $body, $name, $filename, $mime_type = null) + public function uploadFileToFolderWithHttpInfo($xero_tenant_id, $folder_id, $body, $name, $filename, $idempotency_key = null, $mime_type = null) { - $request = $this->uploadFileToFolderRequest($xero_tenant_id, $folder_id, $body, $name, $filename, $mime_type); + $request = $this->uploadFileToFolderRequest($xero_tenant_id, $folder_id, $body, $name, $filename, $idempotency_key, $mime_type); try { $options = $this->createHttpClientOption(); try { @@ -4133,13 +4491,14 @@ public function uploadFileToFolderWithHttpInfo($xero_tenant_id, $folder_id, $bod * @param string $body (required) * @param string $name exact name of the file you are uploading (required) * @param string $filename (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @param string $mime_type (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function uploadFileToFolderAsync($xero_tenant_id, $folder_id, $body, $name, $filename, $mime_type = null) + public function uploadFileToFolderAsync($xero_tenant_id, $folder_id, $body, $name, $filename, $idempotency_key = null, $mime_type = null) { - return $this->uploadFileToFolderAsyncWithHttpInfo($xero_tenant_id, $folder_id, $body, $name, $filename, $mime_type) + return $this->uploadFileToFolderAsyncWithHttpInfo($xero_tenant_id, $folder_id, $body, $name, $filename, $idempotency_key, $mime_type) ->then( function ($response) { return $response[0]; @@ -4154,13 +4513,14 @@ function ($response) { * @param string $body (required) * @param string $name exact name of the file you are uploading (required) * @param string $filename (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @param string $mime_type (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function uploadFileToFolderAsyncWithHttpInfo($xero_tenant_id, $folder_id, $body, $name, $filename, $mime_type = null) + public function uploadFileToFolderAsyncWithHttpInfo($xero_tenant_id, $folder_id, $body, $name, $filename, $idempotency_key = null, $mime_type = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\FileObject'; - $request = $this->uploadFileToFolderRequest($xero_tenant_id, $folder_id, $body, $name, $filename, $mime_type); + $request = $this->uploadFileToFolderRequest($xero_tenant_id, $folder_id, $body, $name, $filename, $idempotency_key, $mime_type); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -4201,10 +4561,11 @@ function ($exception) { * @param string $body (required) * @param string $name exact name of the file you are uploading (required) * @param string $filename (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @param string $mime_type (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function uploadFileToFolderRequest($xero_tenant_id, $folder_id, $body, $name, $filename, $mime_type = null) + protected function uploadFileToFolderRequest($xero_tenant_id, $folder_id, $body, $name, $filename, $idempotency_key = null, $mime_type = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -4246,6 +4607,10 @@ protected function uploadFileToFolderRequest($xero_tenant_id, $folder_id, $body, if ($xero_tenant_id !== null) { $headerParams['xero-tenant-id'] = FileObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = FileObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($folder_id !== null) { $resourcePath = str_replace( diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Api/FinanceApi.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Api/FinanceApi.php index 8384ac9..4ea4e93 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Api/FinanceApi.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Api/FinanceApi.php @@ -9,7 +9,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -18,7 +18,7 @@ * * The Finance API is a collection of endpoints which customers can use in the course of a loan application, which may assist lenders to gain the confidence they need to provide capital. * - * OpenAPI spec version: 2.35.0 + * OpenAPI spec version: 6.2.0 * Contact: api@xero.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 5.4.0 diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Api/IdentityApi.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Api/IdentityApi.php index e527140..ba18f62 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Api/IdentityApi.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Api/IdentityApi.php @@ -9,7 +9,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -18,7 +18,7 @@ * * These endpoints are related to managing authentication tokens and identity for Xero API * - * OpenAPI spec version: 2.35.0 + * OpenAPI spec version: 6.2.0 * Contact: api@xero.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 5.4.0 diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Api/PayrollAuApi.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Api/PayrollAuApi.php index bc394dc..5189309 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Api/PayrollAuApi.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Api/PayrollAuApi.php @@ -9,7 +9,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -18,7 +18,7 @@ * * This is the Xero Payroll API for orgs in Australia region. * - * OpenAPI spec version: 2.35.0 + * OpenAPI spec version: 6.2.0 * Contact: api@xero.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 5.4.0 @@ -89,18 +89,297 @@ public function getConfig() return $this->config; } + /** + * Operation approveLeaveApplication + * Approve a requested leave application by a unique leave application id + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $leave_application_id Leave Application id for single object (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) + * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplications|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\APIException + */ + public function approveLeaveApplication($xero_tenant_id, $leave_application_id, $idempotency_key = null) + { + list($response) = $this->approveLeaveApplicationWithHttpInfo($xero_tenant_id, $leave_application_id, $idempotency_key); + return $response; + } + /** + * Operation approveLeaveApplicationWithHttpInfo + * Approve a requested leave application by a unique leave application id + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $leave_application_id Leave Application id for single object (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) + * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplications|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\APIException, HTTP status code, HTTP response headers (array of strings) + */ + public function approveLeaveApplicationWithHttpInfo($xero_tenant_id, $leave_application_id, $idempotency_key = null) + { + $request = $this->approveLeaveApplicationRequest($xero_tenant_id, $leave_application_id, $idempotency_key); + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + $statusCode = $response->getStatusCode(); + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplications' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + PayrollAuObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplications', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\APIException' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + PayrollAuObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\APIException', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplications'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + PayrollAuObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = PayrollAuObjectSerializer::deserialize( + $e->getResponseBody(), + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplications', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = PayrollAuObjectSerializer::deserialize( + $e->getResponseBody(), + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\APIException', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + /** + * Operation approveLeaveApplicationAsync + * Approve a requested leave application by a unique leave application id + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $leave_application_id Leave Application id for single object (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface + */ + public function approveLeaveApplicationAsync($xero_tenant_id, $leave_application_id, $idempotency_key = null) + { + return $this->approveLeaveApplicationAsyncWithHttpInfo($xero_tenant_id, $leave_application_id, $idempotency_key) + ->then( + function ($response) { + return $response[0]; + } + ); + } + /** + * Operation approveLeaveApplicationAsyncWithHttpInfo + * Approve a requested leave application by a unique leave application id + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $leave_application_id Leave Application id for single object (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ + public function approveLeaveApplicationAsyncWithHttpInfo($xero_tenant_id, $leave_application_id, $idempotency_key = null) + { + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplications'; + $request = $this->approveLeaveApplicationRequest($xero_tenant_id, $leave_application_id, $idempotency_key); + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + PayrollAuObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'approveLeaveApplication' + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $leave_application_id Leave Application id for single object (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ + protected function approveLeaveApplicationRequest($xero_tenant_id, $leave_application_id, $idempotency_key = null) + { + // verify the required parameter 'xero_tenant_id' is set + if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $xero_tenant_id when calling approveLeaveApplication' + ); + } + // verify the required parameter 'leave_application_id' is set + if ($leave_application_id === null || (is_array($leave_application_id) && count($leave_application_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $leave_application_id when calling approveLeaveApplication' + ); + } + $resourcePath = '/LeaveApplications/{LeaveApplicationID}/approve'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + // header params + if ($xero_tenant_id !== null) { + $headerParams['Xero-Tenant-Id'] = PayrollAuObjectSerializer::toHeaderValue($xero_tenant_id); + } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollAuObjectSerializer::toHeaderValue($idempotency_key); + } + // path params + if ($leave_application_id !== null) { + $resourcePath = str_replace( + '{' . 'LeaveApplicationID' . '}', + PayrollAuObjectSerializer::toPathValue($leave_application_id), + $resourcePath + ); + } + // body params + $_tempBody = null; + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\json_encode(PayrollAuObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = [ + [ + 'Content-type' => 'multipart/form-data', + ] + ]; + + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\json_encode($formParams); + } else { + // for HTTP post (form) + $httpBody = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Query::build($formParams); + } + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + $query = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'POST', + $this->config->getHostPayrollAu() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation createEmployee * Creates a payroll employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Employee[] $employee employee (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Employees */ - public function createEmployee($xero_tenant_id, $employee) + public function createEmployee($xero_tenant_id, $employee, $idempotency_key = null) { - list($response) = $this->createEmployeeWithHttpInfo($xero_tenant_id, $employee); + list($response) = $this->createEmployeeWithHttpInfo($xero_tenant_id, $employee, $idempotency_key); return $response; } /** @@ -108,13 +387,14 @@ public function createEmployee($xero_tenant_id, $employee) * Creates a payroll employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Employee[] $employee (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollAu\Employees, HTTP status code, HTTP response headers (array of strings) */ - public function createEmployeeWithHttpInfo($xero_tenant_id, $employee) + public function createEmployeeWithHttpInfo($xero_tenant_id, $employee, $idempotency_key = null) { - $request = $this->createEmployeeRequest($xero_tenant_id, $employee); + $request = $this->createEmployeeRequest($xero_tenant_id, $employee, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -185,12 +465,13 @@ public function createEmployeeWithHttpInfo($xero_tenant_id, $employee) * Creates a payroll employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Employee[] $employee (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeeAsync($xero_tenant_id, $employee) + public function createEmployeeAsync($xero_tenant_id, $employee, $idempotency_key = null) { - return $this->createEmployeeAsyncWithHttpInfo($xero_tenant_id, $employee) + return $this->createEmployeeAsyncWithHttpInfo($xero_tenant_id, $employee, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -202,12 +483,13 @@ function ($response) { * Creates a payroll employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Employee[] $employee (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeeAsyncWithHttpInfo($xero_tenant_id, $employee) + public function createEmployeeAsyncWithHttpInfo($xero_tenant_id, $employee, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Employees'; - $request = $this->createEmployeeRequest($xero_tenant_id, $employee); + $request = $this->createEmployeeRequest($xero_tenant_id, $employee, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -245,9 +527,10 @@ function ($exception) { * Create request for operation 'createEmployee' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Employee[] $employee (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createEmployeeRequest($xero_tenant_id, $employee) + protected function createEmployeeRequest($xero_tenant_id, $employee, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -271,6 +554,10 @@ protected function createEmployeeRequest($xero_tenant_id, $employee) if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollAuObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollAuObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($employee)) { @@ -339,13 +626,14 @@ protected function createEmployeeRequest($xero_tenant_id, $employee) * Creates a leave application * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplication[] $leave_application leave_application (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplications */ - public function createLeaveApplication($xero_tenant_id, $leave_application) + public function createLeaveApplication($xero_tenant_id, $leave_application, $idempotency_key = null) { - list($response) = $this->createLeaveApplicationWithHttpInfo($xero_tenant_id, $leave_application); + list($response) = $this->createLeaveApplicationWithHttpInfo($xero_tenant_id, $leave_application, $idempotency_key); return $response; } /** @@ -353,13 +641,14 @@ public function createLeaveApplication($xero_tenant_id, $leave_application) * Creates a leave application * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplication[] $leave_application (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplications, HTTP status code, HTTP response headers (array of strings) */ - public function createLeaveApplicationWithHttpInfo($xero_tenant_id, $leave_application) + public function createLeaveApplicationWithHttpInfo($xero_tenant_id, $leave_application, $idempotency_key = null) { - $request = $this->createLeaveApplicationRequest($xero_tenant_id, $leave_application); + $request = $this->createLeaveApplicationRequest($xero_tenant_id, $leave_application, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -430,12 +719,13 @@ public function createLeaveApplicationWithHttpInfo($xero_tenant_id, $leave_appli * Creates a leave application * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplication[] $leave_application (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createLeaveApplicationAsync($xero_tenant_id, $leave_application) + public function createLeaveApplicationAsync($xero_tenant_id, $leave_application, $idempotency_key = null) { - return $this->createLeaveApplicationAsyncWithHttpInfo($xero_tenant_id, $leave_application) + return $this->createLeaveApplicationAsyncWithHttpInfo($xero_tenant_id, $leave_application, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -447,12 +737,13 @@ function ($response) { * Creates a leave application * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplication[] $leave_application (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createLeaveApplicationAsyncWithHttpInfo($xero_tenant_id, $leave_application) + public function createLeaveApplicationAsyncWithHttpInfo($xero_tenant_id, $leave_application, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplications'; - $request = $this->createLeaveApplicationRequest($xero_tenant_id, $leave_application); + $request = $this->createLeaveApplicationRequest($xero_tenant_id, $leave_application, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -490,9 +781,10 @@ function ($exception) { * Create request for operation 'createLeaveApplication' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplication[] $leave_application (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createLeaveApplicationRequest($xero_tenant_id, $leave_application) + protected function createLeaveApplicationRequest($xero_tenant_id, $leave_application, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -516,6 +808,10 @@ protected function createLeaveApplicationRequest($xero_tenant_id, $leave_applica if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollAuObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollAuObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($leave_application)) { @@ -584,13 +880,14 @@ protected function createLeaveApplicationRequest($xero_tenant_id, $leave_applica * Creates a pay item * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayItem $pay_item pay_item (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayItems */ - public function createPayItem($xero_tenant_id, $pay_item) + public function createPayItem($xero_tenant_id, $pay_item, $idempotency_key = null) { - list($response) = $this->createPayItemWithHttpInfo($xero_tenant_id, $pay_item); + list($response) = $this->createPayItemWithHttpInfo($xero_tenant_id, $pay_item, $idempotency_key); return $response; } /** @@ -598,13 +895,14 @@ public function createPayItem($xero_tenant_id, $pay_item) * Creates a pay item * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayItem $pay_item (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollAu\PayItems, HTTP status code, HTTP response headers (array of strings) */ - public function createPayItemWithHttpInfo($xero_tenant_id, $pay_item) + public function createPayItemWithHttpInfo($xero_tenant_id, $pay_item, $idempotency_key = null) { - $request = $this->createPayItemRequest($xero_tenant_id, $pay_item); + $request = $this->createPayItemRequest($xero_tenant_id, $pay_item, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -675,12 +973,13 @@ public function createPayItemWithHttpInfo($xero_tenant_id, $pay_item) * Creates a pay item * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayItem $pay_item (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createPayItemAsync($xero_tenant_id, $pay_item) + public function createPayItemAsync($xero_tenant_id, $pay_item, $idempotency_key = null) { - return $this->createPayItemAsyncWithHttpInfo($xero_tenant_id, $pay_item) + return $this->createPayItemAsyncWithHttpInfo($xero_tenant_id, $pay_item, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -692,12 +991,13 @@ function ($response) { * Creates a pay item * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayItem $pay_item (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createPayItemAsyncWithHttpInfo($xero_tenant_id, $pay_item) + public function createPayItemAsyncWithHttpInfo($xero_tenant_id, $pay_item, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayItems'; - $request = $this->createPayItemRequest($xero_tenant_id, $pay_item); + $request = $this->createPayItemRequest($xero_tenant_id, $pay_item, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -735,9 +1035,10 @@ function ($exception) { * Create request for operation 'createPayItem' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayItem $pay_item (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createPayItemRequest($xero_tenant_id, $pay_item) + protected function createPayItemRequest($xero_tenant_id, $pay_item, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -761,6 +1062,10 @@ protected function createPayItemRequest($xero_tenant_id, $pay_item) if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollAuObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollAuObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($pay_item)) { @@ -829,13 +1134,14 @@ protected function createPayItemRequest($xero_tenant_id, $pay_item) * Creates a pay run * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayRun[] $pay_run pay_run (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayRuns */ - public function createPayRun($xero_tenant_id, $pay_run) + public function createPayRun($xero_tenant_id, $pay_run, $idempotency_key = null) { - list($response) = $this->createPayRunWithHttpInfo($xero_tenant_id, $pay_run); + list($response) = $this->createPayRunWithHttpInfo($xero_tenant_id, $pay_run, $idempotency_key); return $response; } /** @@ -843,13 +1149,14 @@ public function createPayRun($xero_tenant_id, $pay_run) * Creates a pay run * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayRun[] $pay_run (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollAu\PayRuns, HTTP status code, HTTP response headers (array of strings) */ - public function createPayRunWithHttpInfo($xero_tenant_id, $pay_run) + public function createPayRunWithHttpInfo($xero_tenant_id, $pay_run, $idempotency_key = null) { - $request = $this->createPayRunRequest($xero_tenant_id, $pay_run); + $request = $this->createPayRunRequest($xero_tenant_id, $pay_run, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -920,12 +1227,13 @@ public function createPayRunWithHttpInfo($xero_tenant_id, $pay_run) * Creates a pay run * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayRun[] $pay_run (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createPayRunAsync($xero_tenant_id, $pay_run) + public function createPayRunAsync($xero_tenant_id, $pay_run, $idempotency_key = null) { - return $this->createPayRunAsyncWithHttpInfo($xero_tenant_id, $pay_run) + return $this->createPayRunAsyncWithHttpInfo($xero_tenant_id, $pay_run, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -937,12 +1245,13 @@ function ($response) { * Creates a pay run * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayRun[] $pay_run (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createPayRunAsyncWithHttpInfo($xero_tenant_id, $pay_run) + public function createPayRunAsyncWithHttpInfo($xero_tenant_id, $pay_run, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayRuns'; - $request = $this->createPayRunRequest($xero_tenant_id, $pay_run); + $request = $this->createPayRunRequest($xero_tenant_id, $pay_run, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -980,9 +1289,10 @@ function ($exception) { * Create request for operation 'createPayRun' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayRun[] $pay_run (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createPayRunRequest($xero_tenant_id, $pay_run) + protected function createPayRunRequest($xero_tenant_id, $pay_run, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -1006,6 +1316,10 @@ protected function createPayRunRequest($xero_tenant_id, $pay_run) if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollAuObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollAuObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($pay_run)) { @@ -1074,13 +1388,14 @@ protected function createPayRunRequest($xero_tenant_id, $pay_run) * Creates a Payroll Calendar * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayrollCalendar[] $payroll_calendar payroll_calendar (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayrollCalendars */ - public function createPayrollCalendar($xero_tenant_id, $payroll_calendar) + public function createPayrollCalendar($xero_tenant_id, $payroll_calendar, $idempotency_key = null) { - list($response) = $this->createPayrollCalendarWithHttpInfo($xero_tenant_id, $payroll_calendar); + list($response) = $this->createPayrollCalendarWithHttpInfo($xero_tenant_id, $payroll_calendar, $idempotency_key); return $response; } /** @@ -1088,13 +1403,14 @@ public function createPayrollCalendar($xero_tenant_id, $payroll_calendar) * Creates a Payroll Calendar * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayrollCalendar[] $payroll_calendar (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollAu\PayrollCalendars, HTTP status code, HTTP response headers (array of strings) */ - public function createPayrollCalendarWithHttpInfo($xero_tenant_id, $payroll_calendar) + public function createPayrollCalendarWithHttpInfo($xero_tenant_id, $payroll_calendar, $idempotency_key = null) { - $request = $this->createPayrollCalendarRequest($xero_tenant_id, $payroll_calendar); + $request = $this->createPayrollCalendarRequest($xero_tenant_id, $payroll_calendar, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -1165,12 +1481,13 @@ public function createPayrollCalendarWithHttpInfo($xero_tenant_id, $payroll_cale * Creates a Payroll Calendar * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayrollCalendar[] $payroll_calendar (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createPayrollCalendarAsync($xero_tenant_id, $payroll_calendar) + public function createPayrollCalendarAsync($xero_tenant_id, $payroll_calendar, $idempotency_key = null) { - return $this->createPayrollCalendarAsyncWithHttpInfo($xero_tenant_id, $payroll_calendar) + return $this->createPayrollCalendarAsyncWithHttpInfo($xero_tenant_id, $payroll_calendar, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -1182,12 +1499,13 @@ function ($response) { * Creates a Payroll Calendar * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayrollCalendar[] $payroll_calendar (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createPayrollCalendarAsyncWithHttpInfo($xero_tenant_id, $payroll_calendar) + public function createPayrollCalendarAsyncWithHttpInfo($xero_tenant_id, $payroll_calendar, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayrollCalendars'; - $request = $this->createPayrollCalendarRequest($xero_tenant_id, $payroll_calendar); + $request = $this->createPayrollCalendarRequest($xero_tenant_id, $payroll_calendar, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -1225,9 +1543,10 @@ function ($exception) { * Create request for operation 'createPayrollCalendar' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayrollCalendar[] $payroll_calendar (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createPayrollCalendarRequest($xero_tenant_id, $payroll_calendar) + protected function createPayrollCalendarRequest($xero_tenant_id, $payroll_calendar, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -1251,6 +1570,10 @@ protected function createPayrollCalendarRequest($xero_tenant_id, $payroll_calend if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollAuObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollAuObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($payroll_calendar)) { @@ -1319,13 +1642,14 @@ protected function createPayrollCalendarRequest($xero_tenant_id, $payroll_calend * Creates a superfund * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\SuperFund[] $super_fund super_fund (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\SuperFunds */ - public function createSuperfund($xero_tenant_id, $super_fund) + public function createSuperfund($xero_tenant_id, $super_fund, $idempotency_key = null) { - list($response) = $this->createSuperfundWithHttpInfo($xero_tenant_id, $super_fund); + list($response) = $this->createSuperfundWithHttpInfo($xero_tenant_id, $super_fund, $idempotency_key); return $response; } /** @@ -1333,13 +1657,14 @@ public function createSuperfund($xero_tenant_id, $super_fund) * Creates a superfund * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\SuperFund[] $super_fund (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollAu\SuperFunds, HTTP status code, HTTP response headers (array of strings) */ - public function createSuperfundWithHttpInfo($xero_tenant_id, $super_fund) + public function createSuperfundWithHttpInfo($xero_tenant_id, $super_fund, $idempotency_key = null) { - $request = $this->createSuperfundRequest($xero_tenant_id, $super_fund); + $request = $this->createSuperfundRequest($xero_tenant_id, $super_fund, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -1410,12 +1735,13 @@ public function createSuperfundWithHttpInfo($xero_tenant_id, $super_fund) * Creates a superfund * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\SuperFund[] $super_fund (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createSuperfundAsync($xero_tenant_id, $super_fund) + public function createSuperfundAsync($xero_tenant_id, $super_fund, $idempotency_key = null) { - return $this->createSuperfundAsyncWithHttpInfo($xero_tenant_id, $super_fund) + return $this->createSuperfundAsyncWithHttpInfo($xero_tenant_id, $super_fund, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -1427,12 +1753,13 @@ function ($response) { * Creates a superfund * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\SuperFund[] $super_fund (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createSuperfundAsyncWithHttpInfo($xero_tenant_id, $super_fund) + public function createSuperfundAsyncWithHttpInfo($xero_tenant_id, $super_fund, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\SuperFunds'; - $request = $this->createSuperfundRequest($xero_tenant_id, $super_fund); + $request = $this->createSuperfundRequest($xero_tenant_id, $super_fund, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -1470,9 +1797,10 @@ function ($exception) { * Create request for operation 'createSuperfund' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\SuperFund[] $super_fund (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createSuperfundRequest($xero_tenant_id, $super_fund) + protected function createSuperfundRequest($xero_tenant_id, $super_fund, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -1496,6 +1824,10 @@ protected function createSuperfundRequest($xero_tenant_id, $super_fund) if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollAuObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollAuObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($super_fund)) { @@ -1564,13 +1896,14 @@ protected function createSuperfundRequest($xero_tenant_id, $super_fund) * Creates a timesheet * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Timesheet[] $timesheet timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Timesheets */ - public function createTimesheet($xero_tenant_id, $timesheet) + public function createTimesheet($xero_tenant_id, $timesheet, $idempotency_key = null) { - list($response) = $this->createTimesheetWithHttpInfo($xero_tenant_id, $timesheet); + list($response) = $this->createTimesheetWithHttpInfo($xero_tenant_id, $timesheet, $idempotency_key); return $response; } /** @@ -1578,13 +1911,14 @@ public function createTimesheet($xero_tenant_id, $timesheet) * Creates a timesheet * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Timesheet[] $timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollAu\Timesheets, HTTP status code, HTTP response headers (array of strings) */ - public function createTimesheetWithHttpInfo($xero_tenant_id, $timesheet) + public function createTimesheetWithHttpInfo($xero_tenant_id, $timesheet, $idempotency_key = null) { - $request = $this->createTimesheetRequest($xero_tenant_id, $timesheet); + $request = $this->createTimesheetRequest($xero_tenant_id, $timesheet, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -1655,12 +1989,13 @@ public function createTimesheetWithHttpInfo($xero_tenant_id, $timesheet) * Creates a timesheet * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Timesheet[] $timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createTimesheetAsync($xero_tenant_id, $timesheet) + public function createTimesheetAsync($xero_tenant_id, $timesheet, $idempotency_key = null) { - return $this->createTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet) + return $this->createTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -1672,12 +2007,13 @@ function ($response) { * Creates a timesheet * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Timesheet[] $timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet) + public function createTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Timesheets'; - $request = $this->createTimesheetRequest($xero_tenant_id, $timesheet); + $request = $this->createTimesheetRequest($xero_tenant_id, $timesheet, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -1715,9 +2051,10 @@ function ($exception) { * Create request for operation 'createTimesheet' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Timesheet[] $timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createTimesheetRequest($xero_tenant_id, $timesheet) + protected function createTimesheetRequest($xero_tenant_id, $timesheet, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -1741,6 +2078,10 @@ protected function createTimesheetRequest($xero_tenant_id, $timesheet) if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollAuObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollAuObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($timesheet)) { @@ -2782,15 +3123,301 @@ function ($exception) { * @param int $page e.g. page=1 – Up to 100 objects will be returned in a single API call (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getLeaveApplicationsRequest($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null) + protected function getLeaveApplicationsRequest($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null) + { + // verify the required parameter 'xero_tenant_id' is set + if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $xero_tenant_id when calling getLeaveApplications' + ); + } + $resourcePath = '/LeaveApplications'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + // query params + if ($where !== null) { + $queryParams['where'] = PayrollAuObjectSerializer::toQueryValue($where); + } + // query params + if ($order !== null) { + $queryParams['order'] = PayrollAuObjectSerializer::toQueryValue($order); + } + // query params + if ($page !== null) { + $queryParams['page'] = PayrollAuObjectSerializer::toQueryValue($page); + } + // header params + if ($xero_tenant_id !== null) { + $headerParams['Xero-Tenant-Id'] = PayrollAuObjectSerializer::toHeaderValue($xero_tenant_id); + } + // header params + if ($if_modified_since !== null) { + $headerParams['If-Modified-Since'] = PayrollAuObjectSerializer::toHeaderValue($if_modified_since); + } + // body params + $_tempBody = null; + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\json_encode(PayrollAuObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = [ + [ + 'Content-type' => 'multipart/form-data', + ] + ]; + + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\json_encode($formParams); + } else { + // for HTTP post (form) + $httpBody = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Query::build($formParams); + } + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + $query = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHostPayrollAu() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getLeaveApplicationsV2 + * Retrieves leave applications including leave requests + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) + * @param string $where Filter by an any element (optional) + * @param string $order Order by an any element (optional) + * @param int $page e.g. page=1 – Up to 100 objects will be returned in a single API call (optional) + * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplications|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\APIException + */ + public function getLeaveApplicationsV2($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null) + { + list($response) = $this->getLeaveApplicationsV2WithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $page); + return $response; + } + /** + * Operation getLeaveApplicationsV2WithHttpInfo + * Retrieves leave applications including leave requests + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) + * @param string $where Filter by an any element (optional) + * @param string $order Order by an any element (optional) + * @param int $page e.g. page=1 – Up to 100 objects will be returned in a single API call (optional) + * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplications|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\APIException, HTTP status code, HTTP response headers (array of strings) + */ + public function getLeaveApplicationsV2WithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null) + { + $request = $this->getLeaveApplicationsV2Request($xero_tenant_id, $if_modified_since, $where, $order, $page); + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + $statusCode = $response->getStatusCode(); + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplications' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + PayrollAuObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplications', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\APIException' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + PayrollAuObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\APIException', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplications'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + PayrollAuObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = PayrollAuObjectSerializer::deserialize( + $e->getResponseBody(), + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplications', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = PayrollAuObjectSerializer::deserialize( + $e->getResponseBody(), + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\APIException', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + /** + * Operation getLeaveApplicationsV2Async + * Retrieves leave applications including leave requests + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) + * @param string $where Filter by an any element (optional) + * @param string $order Order by an any element (optional) + * @param int $page e.g. page=1 – Up to 100 objects will be returned in a single API call (optional) + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface + */ + public function getLeaveApplicationsV2Async($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null) + { + return $this->getLeaveApplicationsV2AsyncWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $page) + ->then( + function ($response) { + return $response[0]; + } + ); + } + /** + * Operation getLeaveApplicationsV2AsyncWithHttpInfo + * Retrieves leave applications including leave requests + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) + * @param string $where Filter by an any element (optional) + * @param string $order Order by an any element (optional) + * @param int $page e.g. page=1 – Up to 100 objects will be returned in a single API call (optional) + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ + public function getLeaveApplicationsV2AsyncWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null) + { + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplications'; + $request = $this->getLeaveApplicationsV2Request($xero_tenant_id, $if_modified_since, $where, $order, $page); + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + PayrollAuObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getLeaveApplicationsV2' + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) + * @param string $where Filter by an any element (optional) + * @param string $order Order by an any element (optional) + * @param int $page e.g. page=1 – Up to 100 objects will be returned in a single API call (optional) + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ + protected function getLeaveApplicationsV2Request($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getLeaveApplications' + 'Missing the required parameter $xero_tenant_id when calling getLeaveApplicationsV2' ); } - $resourcePath = '/LeaveApplications'; + $resourcePath = '/LeaveApplications/v2'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5549,21 +6176,277 @@ protected function getSuperfundsRequest($xero_tenant_id, $if_modified_since = nu */ public function getTimesheet($xero_tenant_id, $timesheet_id) { - list($response) = $this->getTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id); + list($response) = $this->getTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id); + return $response; + } + /** + * Operation getTimesheetWithHttpInfo + * Retrieves a timesheet by using a unique timesheet id + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $timesheet_id Timesheet id for single object (required) + * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \XeroAPI\XeroPHP\Models\PayrollAu\TimesheetObject, HTTP status code, HTTP response headers (array of strings) + */ + public function getTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id) + { + $request = $this->getTimesheetRequest($xero_tenant_id, $timesheet_id); + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + $statusCode = $response->getStatusCode(); + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\TimesheetObject' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + PayrollAuObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\TimesheetObject', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\TimesheetObject'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + PayrollAuObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = PayrollAuObjectSerializer::deserialize( + $e->getResponseBody(), + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\TimesheetObject', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + /** + * Operation getTimesheetAsync + * Retrieves a timesheet by using a unique timesheet id + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $timesheet_id Timesheet id for single object (required) + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface + */ + public function getTimesheetAsync($xero_tenant_id, $timesheet_id) + { + return $this->getTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + /** + * Operation getTimesheetAsyncWithHttpInfo + * Retrieves a timesheet by using a unique timesheet id + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $timesheet_id Timesheet id for single object (required) + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ + public function getTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet_id) + { + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\TimesheetObject'; + $request = $this->getTimesheetRequest($xero_tenant_id, $timesheet_id); + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + PayrollAuObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getTimesheet' + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $timesheet_id Timesheet id for single object (required) + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ + protected function getTimesheetRequest($xero_tenant_id, $timesheet_id) + { + // verify the required parameter 'xero_tenant_id' is set + if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $xero_tenant_id when calling getTimesheet' + ); + } + // verify the required parameter 'timesheet_id' is set + if ($timesheet_id === null || (is_array($timesheet_id) && count($timesheet_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $timesheet_id when calling getTimesheet' + ); + } + $resourcePath = '/Timesheets/{TimesheetID}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + // header params + if ($xero_tenant_id !== null) { + $headerParams['Xero-Tenant-Id'] = PayrollAuObjectSerializer::toHeaderValue($xero_tenant_id); + } + // path params + if ($timesheet_id !== null) { + $resourcePath = str_replace( + '{' . 'TimesheetID' . '}', + PayrollAuObjectSerializer::toPathValue($timesheet_id), + $resourcePath + ); + } + // body params + $_tempBody = null; + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\json_encode(PayrollAuObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = [ + [ + 'Content-type' => 'multipart/form-data', + ] + ]; + + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\json_encode($formParams); + } else { + // for HTTP post (form) + $httpBody = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Query::build($formParams); + } + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + $query = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHostPayrollAu() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getTimesheets + * Retrieves timesheets + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) + * @param string $where Filter by an any element (optional) + * @param string $order Order by an any element (optional) + * @param int $page e.g. page=1 – Up to 100 timesheets will be returned in a single API call (optional) + * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Timesheets|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\APIException + */ + public function getTimesheets($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null) + { + list($response) = $this->getTimesheetsWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $page); return $response; } /** - * Operation getTimesheetWithHttpInfo - * Retrieves a timesheet by using a unique timesheet id + * Operation getTimesheetsWithHttpInfo + * Retrieves timesheets * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $timesheet_id Timesheet id for single object (required) + * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) + * @param string $where Filter by an any element (optional) + * @param string $order Order by an any element (optional) + * @param int $page e.g. page=1 – Up to 100 timesheets will be returned in a single API call (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\PayrollAu\TimesheetObject, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\PayrollAu\Timesheets|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\APIException, HTTP status code, HTTP response headers (array of strings) */ - public function getTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id) + public function getTimesheetsWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null) { - $request = $this->getTimesheetRequest($xero_tenant_id, $timesheet_id); + $request = $this->getTimesheetsRequest($xero_tenant_id, $if_modified_since, $where, $order, $page); try { $options = $this->createHttpClientOption(); try { @@ -5592,18 +6475,29 @@ public function getTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\TimesheetObject' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Timesheets' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - PayrollAuObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\TimesheetObject', []), + PayrollAuObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Timesheets', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\APIException' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + PayrollAuObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\APIException', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\TimesheetObject'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Timesheets'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -5620,7 +6514,15 @@ public function getTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id) case 200: $data = PayrollAuObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\TimesheetObject', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Timesheets', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = PayrollAuObjectSerializer::deserialize( + $e->getResponseBody(), + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\APIException', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -5630,16 +6532,19 @@ public function getTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id) } } /** - * Operation getTimesheetAsync - * Retrieves a timesheet by using a unique timesheet id + * Operation getTimesheetsAsync + * Retrieves timesheets * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $timesheet_id Timesheet id for single object (required) + * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) + * @param string $where Filter by an any element (optional) + * @param string $order Order by an any element (optional) + * @param int $page e.g. page=1 – Up to 100 timesheets will be returned in a single API call (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getTimesheetAsync($xero_tenant_id, $timesheet_id) + public function getTimesheetsAsync($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null) { - return $this->getTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet_id) + return $this->getTimesheetsAsyncWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $page) ->then( function ($response) { return $response[0]; @@ -5647,16 +6552,19 @@ function ($response) { ); } /** - * Operation getTimesheetAsyncWithHttpInfo - * Retrieves a timesheet by using a unique timesheet id + * Operation getTimesheetsAsyncWithHttpInfo + * Retrieves timesheets * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $timesheet_id Timesheet id for single object (required) + * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) + * @param string $where Filter by an any element (optional) + * @param string $order Order by an any element (optional) + * @param int $page e.g. page=1 – Up to 100 timesheets will be returned in a single API call (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet_id) + public function getTimesheetsAsyncWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\TimesheetObject'; - $request = $this->getTimesheetRequest($xero_tenant_id, $timesheet_id); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Timesheets'; + $request = $this->getTimesheetsRequest($xero_tenant_id, $if_modified_since, $where, $order, $page); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -5691,42 +6599,47 @@ function ($exception) { } /** - * Create request for operation 'getTimesheet' + * Create request for operation 'getTimesheets' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $timesheet_id Timesheet id for single object (required) + * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) + * @param string $where Filter by an any element (optional) + * @param string $order Order by an any element (optional) + * @param int $page e.g. page=1 – Up to 100 timesheets will be returned in a single API call (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getTimesheetRequest($xero_tenant_id, $timesheet_id) + protected function getTimesheetsRequest($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getTimesheet' - ); - } - // verify the required parameter 'timesheet_id' is set - if ($timesheet_id === null || (is_array($timesheet_id) && count($timesheet_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $timesheet_id when calling getTimesheet' + 'Missing the required parameter $xero_tenant_id when calling getTimesheets' ); } - $resourcePath = '/Timesheets/{TimesheetID}'; + $resourcePath = '/Timesheets'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if ($where !== null) { + $queryParams['where'] = PayrollAuObjectSerializer::toQueryValue($where); + } + // query params + if ($order !== null) { + $queryParams['order'] = PayrollAuObjectSerializer::toQueryValue($order); + } + // query params + if ($page !== null) { + $queryParams['page'] = PayrollAuObjectSerializer::toQueryValue($page); + } // header params if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollAuObjectSerializer::toHeaderValue($xero_tenant_id); } - // path params - if ($timesheet_id !== null) { - $resourcePath = str_replace( - '{' . 'TimesheetID' . '}', - PayrollAuObjectSerializer::toPathValue($timesheet_id), - $resourcePath - ); + // header params + if ($if_modified_since !== null) { + $headerParams['If-Modified-Since'] = PayrollAuObjectSerializer::toHeaderValue($if_modified_since); } // body params $_tempBody = null; @@ -5789,37 +6702,33 @@ protected function getTimesheetRequest($xero_tenant_id, $timesheet_id) } /** - * Operation getTimesheets - * Retrieves timesheets + * Operation rejectLeaveApplication + * Reject a leave application by a unique leave application id * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) - * @param string $where Filter by an any element (optional) - * @param string $order Order by an any element (optional) - * @param int $page e.g. page=1 – Up to 100 timesheets will be returned in a single API call (optional) + * @param string $leave_application_id Leave Application id for single object (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Timesheets|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\APIException + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplications|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\APIException */ - public function getTimesheets($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null) + public function rejectLeaveApplication($xero_tenant_id, $leave_application_id, $idempotency_key = null) { - list($response) = $this->getTimesheetsWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $page); + list($response) = $this->rejectLeaveApplicationWithHttpInfo($xero_tenant_id, $leave_application_id, $idempotency_key); return $response; } /** - * Operation getTimesheetsWithHttpInfo - * Retrieves timesheets + * Operation rejectLeaveApplicationWithHttpInfo + * Reject a leave application by a unique leave application id * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) - * @param string $where Filter by an any element (optional) - * @param string $order Order by an any element (optional) - * @param int $page e.g. page=1 – Up to 100 timesheets will be returned in a single API call (optional) + * @param string $leave_application_id Leave Application id for single object (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\PayrollAu\Timesheets|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\APIException, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplications|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\APIException, HTTP status code, HTTP response headers (array of strings) */ - public function getTimesheetsWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null) + public function rejectLeaveApplicationWithHttpInfo($xero_tenant_id, $leave_application_id, $idempotency_key = null) { - $request = $this->getTimesheetsRequest($xero_tenant_id, $if_modified_since, $where, $order, $page); + $request = $this->rejectLeaveApplicationRequest($xero_tenant_id, $leave_application_id, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -5848,13 +6757,13 @@ public function getTimesheetsWithHttpInfo($xero_tenant_id, $if_modified_since = $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Timesheets' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplications' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - PayrollAuObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Timesheets', []), + PayrollAuObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplications', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -5870,7 +6779,7 @@ public function getTimesheetsWithHttpInfo($xero_tenant_id, $if_modified_since = $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Timesheets'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplications'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -5887,7 +6796,7 @@ public function getTimesheetsWithHttpInfo($xero_tenant_id, $if_modified_since = case 200: $data = PayrollAuObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Timesheets', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplications', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -5905,19 +6814,17 @@ public function getTimesheetsWithHttpInfo($xero_tenant_id, $if_modified_since = } } /** - * Operation getTimesheetsAsync - * Retrieves timesheets + * Operation rejectLeaveApplicationAsync + * Reject a leave application by a unique leave application id * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) - * @param string $where Filter by an any element (optional) - * @param string $order Order by an any element (optional) - * @param int $page e.g. page=1 – Up to 100 timesheets will be returned in a single API call (optional) + * @param string $leave_application_id Leave Application id for single object (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getTimesheetsAsync($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null) + public function rejectLeaveApplicationAsync($xero_tenant_id, $leave_application_id, $idempotency_key = null) { - return $this->getTimesheetsAsyncWithHttpInfo($xero_tenant_id, $if_modified_since, $where, $order, $page) + return $this->rejectLeaveApplicationAsyncWithHttpInfo($xero_tenant_id, $leave_application_id, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -5925,19 +6832,17 @@ function ($response) { ); } /** - * Operation getTimesheetsAsyncWithHttpInfo - * Retrieves timesheets + * Operation rejectLeaveApplicationAsyncWithHttpInfo + * Reject a leave application by a unique leave application id * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) - * @param string $where Filter by an any element (optional) - * @param string $order Order by an any element (optional) - * @param int $page e.g. page=1 – Up to 100 timesheets will be returned in a single API call (optional) + * @param string $leave_application_id Leave Application id for single object (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getTimesheetsAsyncWithHttpInfo($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null) + public function rejectLeaveApplicationAsyncWithHttpInfo($xero_tenant_id, $leave_application_id, $idempotency_key = null) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Timesheets'; - $request = $this->getTimesheetsRequest($xero_tenant_id, $if_modified_since, $where, $order, $page); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplications'; + $request = $this->rejectLeaveApplicationRequest($xero_tenant_id, $leave_application_id, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -5972,47 +6877,47 @@ function ($exception) { } /** - * Create request for operation 'getTimesheets' + * Create request for operation 'rejectLeaveApplication' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \DateTime $if_modified_since Only records created or modified since this timestamp will be returned (optional) - * @param string $where Filter by an any element (optional) - * @param string $order Order by an any element (optional) - * @param int $page e.g. page=1 – Up to 100 timesheets will be returned in a single API call (optional) + * @param string $leave_application_id Leave Application id for single object (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getTimesheetsRequest($xero_tenant_id, $if_modified_since = null, $where = null, $order = null, $page = null) + protected function rejectLeaveApplicationRequest($xero_tenant_id, $leave_application_id, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getTimesheets' + 'Missing the required parameter $xero_tenant_id when calling rejectLeaveApplication' ); } - $resourcePath = '/Timesheets'; + // verify the required parameter 'leave_application_id' is set + if ($leave_application_id === null || (is_array($leave_application_id) && count($leave_application_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $leave_application_id when calling rejectLeaveApplication' + ); + } + $resourcePath = '/LeaveApplications/{LeaveApplicationID}/reject'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if ($where !== null) { - $queryParams['where'] = PayrollAuObjectSerializer::toQueryValue($where); - } - // query params - if ($order !== null) { - $queryParams['order'] = PayrollAuObjectSerializer::toQueryValue($order); - } - // query params - if ($page !== null) { - $queryParams['page'] = PayrollAuObjectSerializer::toQueryValue($page); - } // header params if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollAuObjectSerializer::toHeaderValue($xero_tenant_id); } // header params - if ($if_modified_since !== null) { - $headerParams['If-Modified-Since'] = PayrollAuObjectSerializer::toHeaderValue($if_modified_since); + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollAuObjectSerializer::toHeaderValue($idempotency_key); + } + // path params + if ($leave_application_id !== null) { + $resourcePath = str_replace( + '{' . 'LeaveApplicationID' . '}', + PayrollAuObjectSerializer::toPathValue($leave_application_id), + $resourcePath + ); } // body params $_tempBody = null; @@ -6067,7 +6972,7 @@ protected function getTimesheetsRequest($xero_tenant_id, $if_modified_since = nu ); $query = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Query::build($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHostPayrollAu() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -6079,14 +6984,15 @@ protected function getTimesheetsRequest($xero_tenant_id, $if_modified_since = nu * Updates an employee's detail * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Employee[] $employee employee (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Employee[] $employee employee (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Employees */ - public function updateEmployee($xero_tenant_id, $employee_id, $employee = null) + public function updateEmployee($xero_tenant_id, $employee_id, $employee, $idempotency_key = null) { - list($response) = $this->updateEmployeeWithHttpInfo($xero_tenant_id, $employee_id, $employee); + list($response) = $this->updateEmployeeWithHttpInfo($xero_tenant_id, $employee_id, $employee, $idempotency_key); return $response; } /** @@ -6094,14 +7000,15 @@ public function updateEmployee($xero_tenant_id, $employee_id, $employee = null) * Updates an employee's detail * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Employee[] $employee (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Employee[] $employee (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollAu\Employees, HTTP status code, HTTP response headers (array of strings) */ - public function updateEmployeeWithHttpInfo($xero_tenant_id, $employee_id, $employee = null) + public function updateEmployeeWithHttpInfo($xero_tenant_id, $employee_id, $employee, $idempotency_key = null) { - $request = $this->updateEmployeeRequest($xero_tenant_id, $employee_id, $employee); + $request = $this->updateEmployeeRequest($xero_tenant_id, $employee_id, $employee, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -6172,13 +7079,14 @@ public function updateEmployeeWithHttpInfo($xero_tenant_id, $employee_id, $emplo * Updates an employee's detail * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Employee[] $employee (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Employee[] $employee (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateEmployeeAsync($xero_tenant_id, $employee_id, $employee = null) + public function updateEmployeeAsync($xero_tenant_id, $employee_id, $employee, $idempotency_key = null) { - return $this->updateEmployeeAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee) + return $this->updateEmployeeAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -6190,13 +7098,14 @@ function ($response) { * Updates an employee's detail * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Employee[] $employee (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Employee[] $employee (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateEmployeeAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee = null) + public function updateEmployeeAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Employees'; - $request = $this->updateEmployeeRequest($xero_tenant_id, $employee_id, $employee); + $request = $this->updateEmployeeRequest($xero_tenant_id, $employee_id, $employee, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -6234,10 +7143,11 @@ function ($exception) { * Create request for operation 'updateEmployee' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Employee[] $employee (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Employee[] $employee (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateEmployeeRequest($xero_tenant_id, $employee_id, $employee = null) + protected function updateEmployeeRequest($xero_tenant_id, $employee_id, $employee, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -6251,6 +7161,12 @@ protected function updateEmployeeRequest($xero_tenant_id, $employee_id, $employe 'Missing the required parameter $employee_id when calling updateEmployee' ); } + // verify the required parameter 'employee' is set + if ($employee === null || (is_array($employee) && count($employee) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $employee when calling updateEmployee' + ); + } $resourcePath = '/Employees/{EmployeeID}'; $formParams = []; $queryParams = []; @@ -6261,6 +7177,10 @@ protected function updateEmployeeRequest($xero_tenant_id, $employee_id, $employe if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollAuObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollAuObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($employee_id !== null) { $resourcePath = str_replace( @@ -6338,13 +7258,14 @@ protected function updateEmployeeRequest($xero_tenant_id, $employee_id, $employe * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $leave_application_id Leave Application id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplication[] $leave_application leave_application (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplications */ - public function updateLeaveApplication($xero_tenant_id, $leave_application_id, $leave_application) + public function updateLeaveApplication($xero_tenant_id, $leave_application_id, $leave_application, $idempotency_key = null) { - list($response) = $this->updateLeaveApplicationWithHttpInfo($xero_tenant_id, $leave_application_id, $leave_application); + list($response) = $this->updateLeaveApplicationWithHttpInfo($xero_tenant_id, $leave_application_id, $leave_application, $idempotency_key); return $response; } /** @@ -6353,13 +7274,14 @@ public function updateLeaveApplication($xero_tenant_id, $leave_application_id, $ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $leave_application_id Leave Application id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplication[] $leave_application (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplications, HTTP status code, HTTP response headers (array of strings) */ - public function updateLeaveApplicationWithHttpInfo($xero_tenant_id, $leave_application_id, $leave_application) + public function updateLeaveApplicationWithHttpInfo($xero_tenant_id, $leave_application_id, $leave_application, $idempotency_key = null) { - $request = $this->updateLeaveApplicationRequest($xero_tenant_id, $leave_application_id, $leave_application); + $request = $this->updateLeaveApplicationRequest($xero_tenant_id, $leave_application_id, $leave_application, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -6431,12 +7353,13 @@ public function updateLeaveApplicationWithHttpInfo($xero_tenant_id, $leave_appli * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $leave_application_id Leave Application id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplication[] $leave_application (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateLeaveApplicationAsync($xero_tenant_id, $leave_application_id, $leave_application) + public function updateLeaveApplicationAsync($xero_tenant_id, $leave_application_id, $leave_application, $idempotency_key = null) { - return $this->updateLeaveApplicationAsyncWithHttpInfo($xero_tenant_id, $leave_application_id, $leave_application) + return $this->updateLeaveApplicationAsyncWithHttpInfo($xero_tenant_id, $leave_application_id, $leave_application, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -6449,12 +7372,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $leave_application_id Leave Application id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplication[] $leave_application (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateLeaveApplicationAsyncWithHttpInfo($xero_tenant_id, $leave_application_id, $leave_application) + public function updateLeaveApplicationAsyncWithHttpInfo($xero_tenant_id, $leave_application_id, $leave_application, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplications'; - $request = $this->updateLeaveApplicationRequest($xero_tenant_id, $leave_application_id, $leave_application); + $request = $this->updateLeaveApplicationRequest($xero_tenant_id, $leave_application_id, $leave_application, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -6493,9 +7417,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $leave_application_id Leave Application id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\LeaveApplication[] $leave_application (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateLeaveApplicationRequest($xero_tenant_id, $leave_application_id, $leave_application) + protected function updateLeaveApplicationRequest($xero_tenant_id, $leave_application_id, $leave_application, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -6525,6 +7450,10 @@ protected function updateLeaveApplicationRequest($xero_tenant_id, $leave_applica if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollAuObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollAuObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($leave_application_id !== null) { $resourcePath = str_replace( @@ -6601,14 +7530,15 @@ protected function updateLeaveApplicationRequest($xero_tenant_id, $leave_applica * Updates a pay run * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $pay_run_id PayRun id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayRun[] $pay_run pay_run (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayRun[] $pay_run pay_run (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayRuns */ - public function updatePayRun($xero_tenant_id, $pay_run_id, $pay_run = null) + public function updatePayRun($xero_tenant_id, $pay_run_id, $pay_run, $idempotency_key = null) { - list($response) = $this->updatePayRunWithHttpInfo($xero_tenant_id, $pay_run_id, $pay_run); + list($response) = $this->updatePayRunWithHttpInfo($xero_tenant_id, $pay_run_id, $pay_run, $idempotency_key); return $response; } /** @@ -6616,14 +7546,15 @@ public function updatePayRun($xero_tenant_id, $pay_run_id, $pay_run = null) * Updates a pay run * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $pay_run_id PayRun id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayRun[] $pay_run (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayRun[] $pay_run (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollAu\PayRuns, HTTP status code, HTTP response headers (array of strings) */ - public function updatePayRunWithHttpInfo($xero_tenant_id, $pay_run_id, $pay_run = null) + public function updatePayRunWithHttpInfo($xero_tenant_id, $pay_run_id, $pay_run, $idempotency_key = null) { - $request = $this->updatePayRunRequest($xero_tenant_id, $pay_run_id, $pay_run); + $request = $this->updatePayRunRequest($xero_tenant_id, $pay_run_id, $pay_run, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -6694,13 +7625,14 @@ public function updatePayRunWithHttpInfo($xero_tenant_id, $pay_run_id, $pay_run * Updates a pay run * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $pay_run_id PayRun id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayRun[] $pay_run (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayRun[] $pay_run (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updatePayRunAsync($xero_tenant_id, $pay_run_id, $pay_run = null) + public function updatePayRunAsync($xero_tenant_id, $pay_run_id, $pay_run, $idempotency_key = null) { - return $this->updatePayRunAsyncWithHttpInfo($xero_tenant_id, $pay_run_id, $pay_run) + return $this->updatePayRunAsyncWithHttpInfo($xero_tenant_id, $pay_run_id, $pay_run, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -6712,13 +7644,14 @@ function ($response) { * Updates a pay run * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $pay_run_id PayRun id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayRun[] $pay_run (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayRun[] $pay_run (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updatePayRunAsyncWithHttpInfo($xero_tenant_id, $pay_run_id, $pay_run = null) + public function updatePayRunAsyncWithHttpInfo($xero_tenant_id, $pay_run_id, $pay_run, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayRuns'; - $request = $this->updatePayRunRequest($xero_tenant_id, $pay_run_id, $pay_run); + $request = $this->updatePayRunRequest($xero_tenant_id, $pay_run_id, $pay_run, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -6756,10 +7689,11 @@ function ($exception) { * Create request for operation 'updatePayRun' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $pay_run_id PayRun id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayRun[] $pay_run (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayRun[] $pay_run (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updatePayRunRequest($xero_tenant_id, $pay_run_id, $pay_run = null) + protected function updatePayRunRequest($xero_tenant_id, $pay_run_id, $pay_run, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -6773,6 +7707,12 @@ protected function updatePayRunRequest($xero_tenant_id, $pay_run_id, $pay_run = 'Missing the required parameter $pay_run_id when calling updatePayRun' ); } + // verify the required parameter 'pay_run' is set + if ($pay_run === null || (is_array($pay_run) && count($pay_run) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $pay_run when calling updatePayRun' + ); + } $resourcePath = '/PayRuns/{PayRunID}'; $formParams = []; $queryParams = []; @@ -6783,6 +7723,10 @@ protected function updatePayRunRequest($xero_tenant_id, $pay_run_id, $pay_run = if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollAuObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollAuObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($pay_run_id !== null) { $resourcePath = str_replace( @@ -6859,14 +7803,15 @@ protected function updatePayRunRequest($xero_tenant_id, $pay_run_id, $pay_run = * Updates a payslip * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $payslip_id Payslip id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayslipLines[] $payslip_lines payslip_lines (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayslipLines[] $payslip_lines payslip_lines (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Payslips */ - public function updatePayslip($xero_tenant_id, $payslip_id, $payslip_lines = null) + public function updatePayslip($xero_tenant_id, $payslip_id, $payslip_lines, $idempotency_key = null) { - list($response) = $this->updatePayslipWithHttpInfo($xero_tenant_id, $payslip_id, $payslip_lines); + list($response) = $this->updatePayslipWithHttpInfo($xero_tenant_id, $payslip_id, $payslip_lines, $idempotency_key); return $response; } /** @@ -6874,14 +7819,15 @@ public function updatePayslip($xero_tenant_id, $payslip_id, $payslip_lines = nul * Updates a payslip * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $payslip_id Payslip id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayslipLines[] $payslip_lines (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayslipLines[] $payslip_lines (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollAu\Payslips, HTTP status code, HTTP response headers (array of strings) */ - public function updatePayslipWithHttpInfo($xero_tenant_id, $payslip_id, $payslip_lines = null) + public function updatePayslipWithHttpInfo($xero_tenant_id, $payslip_id, $payslip_lines, $idempotency_key = null) { - $request = $this->updatePayslipRequest($xero_tenant_id, $payslip_id, $payslip_lines); + $request = $this->updatePayslipRequest($xero_tenant_id, $payslip_id, $payslip_lines, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -6952,13 +7898,14 @@ public function updatePayslipWithHttpInfo($xero_tenant_id, $payslip_id, $payslip * Updates a payslip * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $payslip_id Payslip id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayslipLines[] $payslip_lines (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayslipLines[] $payslip_lines (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updatePayslipAsync($xero_tenant_id, $payslip_id, $payslip_lines = null) + public function updatePayslipAsync($xero_tenant_id, $payslip_id, $payslip_lines, $idempotency_key = null) { - return $this->updatePayslipAsyncWithHttpInfo($xero_tenant_id, $payslip_id, $payslip_lines) + return $this->updatePayslipAsyncWithHttpInfo($xero_tenant_id, $payslip_id, $payslip_lines, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -6970,13 +7917,14 @@ function ($response) { * Updates a payslip * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $payslip_id Payslip id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayslipLines[] $payslip_lines (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayslipLines[] $payslip_lines (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updatePayslipAsyncWithHttpInfo($xero_tenant_id, $payslip_id, $payslip_lines = null) + public function updatePayslipAsyncWithHttpInfo($xero_tenant_id, $payslip_id, $payslip_lines, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Payslips'; - $request = $this->updatePayslipRequest($xero_tenant_id, $payslip_id, $payslip_lines); + $request = $this->updatePayslipRequest($xero_tenant_id, $payslip_id, $payslip_lines, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -7014,10 +7962,11 @@ function ($exception) { * Create request for operation 'updatePayslip' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $payslip_id Payslip id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayslipLines[] $payslip_lines (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayslipLines[] $payslip_lines (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updatePayslipRequest($xero_tenant_id, $payslip_id, $payslip_lines = null) + protected function updatePayslipRequest($xero_tenant_id, $payslip_id, $payslip_lines, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -7031,6 +7980,12 @@ protected function updatePayslipRequest($xero_tenant_id, $payslip_id, $payslip_l 'Missing the required parameter $payslip_id when calling updatePayslip' ); } + // verify the required parameter 'payslip_lines' is set + if ($payslip_lines === null || (is_array($payslip_lines) && count($payslip_lines) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $payslip_lines when calling updatePayslip' + ); + } $resourcePath = '/Payslip/{PayslipID}'; $formParams = []; $queryParams = []; @@ -7041,6 +7996,10 @@ protected function updatePayslipRequest($xero_tenant_id, $payslip_id, $payslip_l if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollAuObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollAuObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($payslip_id !== null) { $resourcePath = str_replace( @@ -7117,14 +8076,15 @@ protected function updatePayslipRequest($xero_tenant_id, $payslip_id, $payslip_l * Updates a superfund * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $super_fund_id Superfund id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\SuperFund[] $super_fund super_fund (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\SuperFund[] $super_fund super_fund (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\SuperFunds */ - public function updateSuperfund($xero_tenant_id, $super_fund_id, $super_fund = null) + public function updateSuperfund($xero_tenant_id, $super_fund_id, $super_fund, $idempotency_key = null) { - list($response) = $this->updateSuperfundWithHttpInfo($xero_tenant_id, $super_fund_id, $super_fund); + list($response) = $this->updateSuperfundWithHttpInfo($xero_tenant_id, $super_fund_id, $super_fund, $idempotency_key); return $response; } /** @@ -7132,14 +8092,15 @@ public function updateSuperfund($xero_tenant_id, $super_fund_id, $super_fund = n * Updates a superfund * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $super_fund_id Superfund id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\SuperFund[] $super_fund (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\SuperFund[] $super_fund (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollAu\SuperFunds, HTTP status code, HTTP response headers (array of strings) */ - public function updateSuperfundWithHttpInfo($xero_tenant_id, $super_fund_id, $super_fund = null) + public function updateSuperfundWithHttpInfo($xero_tenant_id, $super_fund_id, $super_fund, $idempotency_key = null) { - $request = $this->updateSuperfundRequest($xero_tenant_id, $super_fund_id, $super_fund); + $request = $this->updateSuperfundRequest($xero_tenant_id, $super_fund_id, $super_fund, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -7210,13 +8171,14 @@ public function updateSuperfundWithHttpInfo($xero_tenant_id, $super_fund_id, $su * Updates a superfund * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $super_fund_id Superfund id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\SuperFund[] $super_fund (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\SuperFund[] $super_fund (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateSuperfundAsync($xero_tenant_id, $super_fund_id, $super_fund = null) + public function updateSuperfundAsync($xero_tenant_id, $super_fund_id, $super_fund, $idempotency_key = null) { - return $this->updateSuperfundAsyncWithHttpInfo($xero_tenant_id, $super_fund_id, $super_fund) + return $this->updateSuperfundAsyncWithHttpInfo($xero_tenant_id, $super_fund_id, $super_fund, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -7228,13 +8190,14 @@ function ($response) { * Updates a superfund * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $super_fund_id Superfund id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\SuperFund[] $super_fund (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\SuperFund[] $super_fund (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateSuperfundAsyncWithHttpInfo($xero_tenant_id, $super_fund_id, $super_fund = null) + public function updateSuperfundAsyncWithHttpInfo($xero_tenant_id, $super_fund_id, $super_fund, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\SuperFunds'; - $request = $this->updateSuperfundRequest($xero_tenant_id, $super_fund_id, $super_fund); + $request = $this->updateSuperfundRequest($xero_tenant_id, $super_fund_id, $super_fund, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -7272,10 +8235,11 @@ function ($exception) { * Create request for operation 'updateSuperfund' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $super_fund_id Superfund id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\SuperFund[] $super_fund (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\SuperFund[] $super_fund (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateSuperfundRequest($xero_tenant_id, $super_fund_id, $super_fund = null) + protected function updateSuperfundRequest($xero_tenant_id, $super_fund_id, $super_fund, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -7289,6 +8253,12 @@ protected function updateSuperfundRequest($xero_tenant_id, $super_fund_id, $supe 'Missing the required parameter $super_fund_id when calling updateSuperfund' ); } + // verify the required parameter 'super_fund' is set + if ($super_fund === null || (is_array($super_fund) && count($super_fund) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $super_fund when calling updateSuperfund' + ); + } $resourcePath = '/Superfunds/{SuperFundID}'; $formParams = []; $queryParams = []; @@ -7299,6 +8269,10 @@ protected function updateSuperfundRequest($xero_tenant_id, $super_fund_id, $supe if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollAuObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollAuObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($super_fund_id !== null) { $resourcePath = str_replace( @@ -7375,14 +8349,15 @@ protected function updateSuperfundRequest($xero_tenant_id, $super_fund_id, $supe * Updates a timesheet * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $timesheet_id Timesheet id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Timesheet[] $timesheet timesheet (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Timesheet[] $timesheet timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Timesheets */ - public function updateTimesheet($xero_tenant_id, $timesheet_id, $timesheet = null) + public function updateTimesheet($xero_tenant_id, $timesheet_id, $timesheet, $idempotency_key = null) { - list($response) = $this->updateTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet); + list($response) = $this->updateTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet, $idempotency_key); return $response; } /** @@ -7390,14 +8365,15 @@ public function updateTimesheet($xero_tenant_id, $timesheet_id, $timesheet = nul * Updates a timesheet * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $timesheet_id Timesheet id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Timesheet[] $timesheet (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Timesheet[] $timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollAu\Timesheets, HTTP status code, HTTP response headers (array of strings) */ - public function updateTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet = null) + public function updateTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet, $idempotency_key = null) { - $request = $this->updateTimesheetRequest($xero_tenant_id, $timesheet_id, $timesheet); + $request = $this->updateTimesheetRequest($xero_tenant_id, $timesheet_id, $timesheet, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -7468,13 +8444,14 @@ public function updateTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id, $tim * Updates a timesheet * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $timesheet_id Timesheet id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Timesheet[] $timesheet (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Timesheet[] $timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateTimesheetAsync($xero_tenant_id, $timesheet_id, $timesheet = null) + public function updateTimesheetAsync($xero_tenant_id, $timesheet_id, $timesheet, $idempotency_key = null) { - return $this->updateTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet) + return $this->updateTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -7486,13 +8463,14 @@ function ($response) { * Updates a timesheet * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $timesheet_id Timesheet id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Timesheet[] $timesheet (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Timesheet[] $timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet = null) + public function updateTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Timesheets'; - $request = $this->updateTimesheetRequest($xero_tenant_id, $timesheet_id, $timesheet); + $request = $this->updateTimesheetRequest($xero_tenant_id, $timesheet_id, $timesheet, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -7530,10 +8508,11 @@ function ($exception) { * Create request for operation 'updateTimesheet' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $timesheet_id Timesheet id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Timesheet[] $timesheet (optional) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\Timesheet[] $timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateTimesheetRequest($xero_tenant_id, $timesheet_id, $timesheet = null) + protected function updateTimesheetRequest($xero_tenant_id, $timesheet_id, $timesheet, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -7547,6 +8526,12 @@ protected function updateTimesheetRequest($xero_tenant_id, $timesheet_id, $times 'Missing the required parameter $timesheet_id when calling updateTimesheet' ); } + // verify the required parameter 'timesheet' is set + if ($timesheet === null || (is_array($timesheet) && count($timesheet) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $timesheet when calling updateTimesheet' + ); + } $resourcePath = '/Timesheets/{TimesheetID}'; $formParams = []; $queryParams = []; @@ -7557,6 +8542,10 @@ protected function updateTimesheetRequest($xero_tenant_id, $timesheet_id, $times if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollAuObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollAuObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($timesheet_id !== null) { $resourcePath = str_replace( diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Api/PayrollNzApi.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Api/PayrollNzApi.php index 069fa98..76f87e1 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Api/PayrollNzApi.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Api/PayrollNzApi.php @@ -9,7 +9,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -18,7 +18,7 @@ * * This is the Xero Payroll API for orgs in the NZ region. * - * OpenAPI spec version: 2.35.0 + * OpenAPI spec version: 6.2.0 * Contact: api@xero.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 5.4.0 @@ -94,13 +94,14 @@ public function getConfig() * Approves a timesheet * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $timesheet_id Identifier for the timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function approveTimesheet($xero_tenant_id, $timesheet_id) + public function approveTimesheet($xero_tenant_id, $timesheet_id, $idempotency_key = null) { - list($response) = $this->approveTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id); + list($response) = $this->approveTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id, $idempotency_key); return $response; } /** @@ -108,13 +109,14 @@ public function approveTimesheet($xero_tenant_id, $timesheet_id) * Approves a timesheet * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $timesheet_id Identifier for the timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\TimesheetObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function approveTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id) + public function approveTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id, $idempotency_key = null) { - $request = $this->approveTimesheetRequest($xero_tenant_id, $timesheet_id); + $request = $this->approveTimesheetRequest($xero_tenant_id, $timesheet_id, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -204,12 +206,13 @@ public function approveTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id) * Approves a timesheet * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $timesheet_id Identifier for the timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function approveTimesheetAsync($xero_tenant_id, $timesheet_id) + public function approveTimesheetAsync($xero_tenant_id, $timesheet_id, $idempotency_key = null) { - return $this->approveTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet_id) + return $this->approveTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet_id, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -221,12 +224,13 @@ function ($response) { * Approves a timesheet * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $timesheet_id Identifier for the timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function approveTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet_id) + public function approveTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet_id, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetObject'; - $request = $this->approveTimesheetRequest($xero_tenant_id, $timesheet_id); + $request = $this->approveTimesheetRequest($xero_tenant_id, $timesheet_id, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -264,9 +268,10 @@ function ($exception) { * Create request for operation 'approveTimesheet' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $timesheet_id Identifier for the timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function approveTimesheetRequest($xero_tenant_id, $timesheet_id) + protected function approveTimesheetRequest($xero_tenant_id, $timesheet_id, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -290,6 +295,10 @@ protected function approveTimesheetRequest($xero_tenant_id, $timesheet_id) if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollNzObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($timesheet_id !== null) { $resourcePath = str_replace( @@ -363,13 +372,14 @@ protected function approveTimesheetRequest($xero_tenant_id, $timesheet_id) * Creates a new deduction for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Deduction $deduction deduction (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\DeductionObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function createDeduction($xero_tenant_id, $deduction) + public function createDeduction($xero_tenant_id, $deduction, $idempotency_key = null) { - list($response) = $this->createDeductionWithHttpInfo($xero_tenant_id, $deduction); + list($response) = $this->createDeductionWithHttpInfo($xero_tenant_id, $deduction, $idempotency_key); return $response; } /** @@ -377,13 +387,14 @@ public function createDeduction($xero_tenant_id, $deduction) * Creates a new deduction for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Deduction $deduction (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\DeductionObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createDeductionWithHttpInfo($xero_tenant_id, $deduction) + public function createDeductionWithHttpInfo($xero_tenant_id, $deduction, $idempotency_key = null) { - $request = $this->createDeductionRequest($xero_tenant_id, $deduction); + $request = $this->createDeductionRequest($xero_tenant_id, $deduction, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -473,12 +484,13 @@ public function createDeductionWithHttpInfo($xero_tenant_id, $deduction) * Creates a new deduction for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Deduction $deduction (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createDeductionAsync($xero_tenant_id, $deduction) + public function createDeductionAsync($xero_tenant_id, $deduction, $idempotency_key = null) { - return $this->createDeductionAsyncWithHttpInfo($xero_tenant_id, $deduction) + return $this->createDeductionAsyncWithHttpInfo($xero_tenant_id, $deduction, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -490,12 +502,13 @@ function ($response) { * Creates a new deduction for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Deduction $deduction (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createDeductionAsyncWithHttpInfo($xero_tenant_id, $deduction) + public function createDeductionAsyncWithHttpInfo($xero_tenant_id, $deduction, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\DeductionObject'; - $request = $this->createDeductionRequest($xero_tenant_id, $deduction); + $request = $this->createDeductionRequest($xero_tenant_id, $deduction, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -533,9 +546,10 @@ function ($exception) { * Create request for operation 'createDeduction' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Deduction $deduction (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createDeductionRequest($xero_tenant_id, $deduction) + protected function createDeductionRequest($xero_tenant_id, $deduction, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -559,6 +573,10 @@ protected function createDeductionRequest($xero_tenant_id, $deduction) if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollNzObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($deduction)) { @@ -627,13 +645,14 @@ protected function createDeductionRequest($xero_tenant_id, $deduction) * Creates a new earnings rate * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsRate $earnings_rate earnings_rate (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsRateObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function createEarningsRate($xero_tenant_id, $earnings_rate) + public function createEarningsRate($xero_tenant_id, $earnings_rate, $idempotency_key = null) { - list($response) = $this->createEarningsRateWithHttpInfo($xero_tenant_id, $earnings_rate); + list($response) = $this->createEarningsRateWithHttpInfo($xero_tenant_id, $earnings_rate, $idempotency_key); return $response; } /** @@ -641,13 +660,14 @@ public function createEarningsRate($xero_tenant_id, $earnings_rate) * Creates a new earnings rate * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsRate $earnings_rate (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EarningsRateObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createEarningsRateWithHttpInfo($xero_tenant_id, $earnings_rate) + public function createEarningsRateWithHttpInfo($xero_tenant_id, $earnings_rate, $idempotency_key = null) { - $request = $this->createEarningsRateRequest($xero_tenant_id, $earnings_rate); + $request = $this->createEarningsRateRequest($xero_tenant_id, $earnings_rate, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -737,12 +757,13 @@ public function createEarningsRateWithHttpInfo($xero_tenant_id, $earnings_rate) * Creates a new earnings rate * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsRate $earnings_rate (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEarningsRateAsync($xero_tenant_id, $earnings_rate) + public function createEarningsRateAsync($xero_tenant_id, $earnings_rate, $idempotency_key = null) { - return $this->createEarningsRateAsyncWithHttpInfo($xero_tenant_id, $earnings_rate) + return $this->createEarningsRateAsyncWithHttpInfo($xero_tenant_id, $earnings_rate, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -754,12 +775,13 @@ function ($response) { * Creates a new earnings rate * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsRate $earnings_rate (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEarningsRateAsyncWithHttpInfo($xero_tenant_id, $earnings_rate) + public function createEarningsRateAsyncWithHttpInfo($xero_tenant_id, $earnings_rate, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsRateObject'; - $request = $this->createEarningsRateRequest($xero_tenant_id, $earnings_rate); + $request = $this->createEarningsRateRequest($xero_tenant_id, $earnings_rate, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -797,9 +819,10 @@ function ($exception) { * Create request for operation 'createEarningsRate' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsRate $earnings_rate (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createEarningsRateRequest($xero_tenant_id, $earnings_rate) + protected function createEarningsRateRequest($xero_tenant_id, $earnings_rate, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -823,6 +846,10 @@ protected function createEarningsRateRequest($xero_tenant_id, $earnings_rate) if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollNzObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($earnings_rate)) { @@ -891,13 +918,14 @@ protected function createEarningsRateRequest($xero_tenant_id, $earnings_rate) * Creates an employees * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Employee $employee employee (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function createEmployee($xero_tenant_id, $employee) + public function createEmployee($xero_tenant_id, $employee, $idempotency_key = null) { - list($response) = $this->createEmployeeWithHttpInfo($xero_tenant_id, $employee); + list($response) = $this->createEmployeeWithHttpInfo($xero_tenant_id, $employee, $idempotency_key); return $response; } /** @@ -905,13 +933,14 @@ public function createEmployee($xero_tenant_id, $employee) * Creates an employees * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Employee $employee (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EmployeeObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createEmployeeWithHttpInfo($xero_tenant_id, $employee) + public function createEmployeeWithHttpInfo($xero_tenant_id, $employee, $idempotency_key = null) { - $request = $this->createEmployeeRequest($xero_tenant_id, $employee); + $request = $this->createEmployeeRequest($xero_tenant_id, $employee, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -1001,12 +1030,13 @@ public function createEmployeeWithHttpInfo($xero_tenant_id, $employee) * Creates an employees * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Employee $employee (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeeAsync($xero_tenant_id, $employee) + public function createEmployeeAsync($xero_tenant_id, $employee, $idempotency_key = null) { - return $this->createEmployeeAsyncWithHttpInfo($xero_tenant_id, $employee) + return $this->createEmployeeAsyncWithHttpInfo($xero_tenant_id, $employee, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -1018,12 +1048,13 @@ function ($response) { * Creates an employees * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Employee $employee (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeeAsyncWithHttpInfo($xero_tenant_id, $employee) + public function createEmployeeAsyncWithHttpInfo($xero_tenant_id, $employee, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeObject'; - $request = $this->createEmployeeRequest($xero_tenant_id, $employee); + $request = $this->createEmployeeRequest($xero_tenant_id, $employee, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -1061,9 +1092,10 @@ function ($exception) { * Create request for operation 'createEmployee' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Employee $employee (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createEmployeeRequest($xero_tenant_id, $employee) + protected function createEmployeeRequest($xero_tenant_id, $employee, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -1087,6 +1119,10 @@ protected function createEmployeeRequest($xero_tenant_id, $employee) if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollNzObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($employee)) { @@ -1156,13 +1192,14 @@ protected function createEmployeeRequest($xero_tenant_id, $employee) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplate $earnings_template earnings_template (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplateObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function createEmployeeEarningsTemplate($xero_tenant_id, $employee_id, $earnings_template) + public function createEmployeeEarningsTemplate($xero_tenant_id, $employee_id, $earnings_template, $idempotency_key = null) { - list($response) = $this->createEmployeeEarningsTemplateWithHttpInfo($xero_tenant_id, $employee_id, $earnings_template); + list($response) = $this->createEmployeeEarningsTemplateWithHttpInfo($xero_tenant_id, $employee_id, $earnings_template, $idempotency_key); return $response; } /** @@ -1171,13 +1208,14 @@ public function createEmployeeEarningsTemplate($xero_tenant_id, $employee_id, $e * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplate $earnings_template (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplateObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createEmployeeEarningsTemplateWithHttpInfo($xero_tenant_id, $employee_id, $earnings_template) + public function createEmployeeEarningsTemplateWithHttpInfo($xero_tenant_id, $employee_id, $earnings_template, $idempotency_key = null) { - $request = $this->createEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $earnings_template); + $request = $this->createEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $earnings_template, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -1268,12 +1306,13 @@ public function createEmployeeEarningsTemplateWithHttpInfo($xero_tenant_id, $emp * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplate $earnings_template (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeeEarningsTemplateAsync($xero_tenant_id, $employee_id, $earnings_template) + public function createEmployeeEarningsTemplateAsync($xero_tenant_id, $employee_id, $earnings_template, $idempotency_key = null) { - return $this->createEmployeeEarningsTemplateAsyncWithHttpInfo($xero_tenant_id, $employee_id, $earnings_template) + return $this->createEmployeeEarningsTemplateAsyncWithHttpInfo($xero_tenant_id, $employee_id, $earnings_template, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -1286,12 +1325,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplate $earnings_template (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeeEarningsTemplateAsyncWithHttpInfo($xero_tenant_id, $employee_id, $earnings_template) + public function createEmployeeEarningsTemplateAsyncWithHttpInfo($xero_tenant_id, $employee_id, $earnings_template, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplateObject'; - $request = $this->createEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $earnings_template); + $request = $this->createEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $earnings_template, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -1330,9 +1370,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplate $earnings_template (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $earnings_template) + protected function createEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $earnings_template, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -1352,7 +1393,7 @@ protected function createEmployeeEarningsTemplateRequest($xero_tenant_id, $emplo 'Missing the required parameter $earnings_template when calling createEmployeeEarningsTemplate' ); } - $resourcePath = '/Employees/{EmployeeID}/PayTemplates/earnings'; + $resourcePath = '/Employees/{EmployeeID}/PayTemplates/Earnings'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1362,6 +1403,10 @@ protected function createEmployeeEarningsTemplateRequest($xero_tenant_id, $emplo if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollNzObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($employee_id !== null) { $resourcePath = str_replace( @@ -1439,13 +1484,14 @@ protected function createEmployeeEarningsTemplateRequest($xero_tenant_id, $emplo * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeave $employee_leave employee_leave (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function createEmployeeLeave($xero_tenant_id, $employee_id, $employee_leave) + public function createEmployeeLeave($xero_tenant_id, $employee_id, $employee_leave, $idempotency_key = null) { - list($response) = $this->createEmployeeLeaveWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave); + list($response) = $this->createEmployeeLeaveWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave, $idempotency_key); return $response; } /** @@ -1454,13 +1500,14 @@ public function createEmployeeLeave($xero_tenant_id, $employee_id, $employee_lea * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeave $employee_leave (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createEmployeeLeaveWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave) + public function createEmployeeLeaveWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave, $idempotency_key = null) { - $request = $this->createEmployeeLeaveRequest($xero_tenant_id, $employee_id, $employee_leave); + $request = $this->createEmployeeLeaveRequest($xero_tenant_id, $employee_id, $employee_leave, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -1551,12 +1598,13 @@ public function createEmployeeLeaveWithHttpInfo($xero_tenant_id, $employee_id, $ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeave $employee_leave (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeeLeaveAsync($xero_tenant_id, $employee_id, $employee_leave) + public function createEmployeeLeaveAsync($xero_tenant_id, $employee_id, $employee_leave, $idempotency_key = null) { - return $this->createEmployeeLeaveAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave) + return $this->createEmployeeLeaveAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -1569,12 +1617,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeave $employee_leave (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeeLeaveAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave) + public function createEmployeeLeaveAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveObject'; - $request = $this->createEmployeeLeaveRequest($xero_tenant_id, $employee_id, $employee_leave); + $request = $this->createEmployeeLeaveRequest($xero_tenant_id, $employee_id, $employee_leave, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -1613,9 +1662,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeave $employee_leave (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createEmployeeLeaveRequest($xero_tenant_id, $employee_id, $employee_leave) + protected function createEmployeeLeaveRequest($xero_tenant_id, $employee_id, $employee_leave, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -1645,6 +1695,10 @@ protected function createEmployeeLeaveRequest($xero_tenant_id, $employee_id, $em if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollNzObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($employee_id !== null) { $resourcePath = str_replace( @@ -1722,13 +1776,14 @@ protected function createEmployeeLeaveRequest($xero_tenant_id, $employee_id, $em * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveSetup $employee_leave_setup employee_leave_setup (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveSetupObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function createEmployeeLeaveSetup($xero_tenant_id, $employee_id, $employee_leave_setup) + public function createEmployeeLeaveSetup($xero_tenant_id, $employee_id, $employee_leave_setup, $idempotency_key = null) { - list($response) = $this->createEmployeeLeaveSetupWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave_setup); + list($response) = $this->createEmployeeLeaveSetupWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave_setup, $idempotency_key); return $response; } /** @@ -1737,13 +1792,14 @@ public function createEmployeeLeaveSetup($xero_tenant_id, $employee_id, $employe * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveSetup $employee_leave_setup (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveSetupObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createEmployeeLeaveSetupWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave_setup) + public function createEmployeeLeaveSetupWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave_setup, $idempotency_key = null) { - $request = $this->createEmployeeLeaveSetupRequest($xero_tenant_id, $employee_id, $employee_leave_setup); + $request = $this->createEmployeeLeaveSetupRequest($xero_tenant_id, $employee_id, $employee_leave_setup, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -1834,12 +1890,13 @@ public function createEmployeeLeaveSetupWithHttpInfo($xero_tenant_id, $employee_ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveSetup $employee_leave_setup (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeeLeaveSetupAsync($xero_tenant_id, $employee_id, $employee_leave_setup) + public function createEmployeeLeaveSetupAsync($xero_tenant_id, $employee_id, $employee_leave_setup, $idempotency_key = null) { - return $this->createEmployeeLeaveSetupAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave_setup) + return $this->createEmployeeLeaveSetupAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave_setup, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -1852,12 +1909,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveSetup $employee_leave_setup (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeeLeaveSetupAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave_setup) + public function createEmployeeLeaveSetupAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave_setup, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveSetupObject'; - $request = $this->createEmployeeLeaveSetupRequest($xero_tenant_id, $employee_id, $employee_leave_setup); + $request = $this->createEmployeeLeaveSetupRequest($xero_tenant_id, $employee_id, $employee_leave_setup, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -1896,9 +1954,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveSetup $employee_leave_setup (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createEmployeeLeaveSetupRequest($xero_tenant_id, $employee_id, $employee_leave_setup) + protected function createEmployeeLeaveSetupRequest($xero_tenant_id, $employee_id, $employee_leave_setup, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -1918,7 +1977,7 @@ protected function createEmployeeLeaveSetupRequest($xero_tenant_id, $employee_id 'Missing the required parameter $employee_leave_setup when calling createEmployeeLeaveSetup' ); } - $resourcePath = '/Employees/{EmployeeID}/leaveSetup'; + $resourcePath = '/Employees/{EmployeeID}/LeaveSetup'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1928,6 +1987,10 @@ protected function createEmployeeLeaveSetupRequest($xero_tenant_id, $employee_id if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollNzObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($employee_id !== null) { $resourcePath = str_replace( @@ -2005,13 +2068,14 @@ protected function createEmployeeLeaveSetupRequest($xero_tenant_id, $employee_id * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveType $employee_leave_type employee_leave_type (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveTypeObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function createEmployeeLeaveType($xero_tenant_id, $employee_id, $employee_leave_type) + public function createEmployeeLeaveType($xero_tenant_id, $employee_id, $employee_leave_type, $idempotency_key = null) { - list($response) = $this->createEmployeeLeaveTypeWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave_type); + list($response) = $this->createEmployeeLeaveTypeWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave_type, $idempotency_key); return $response; } /** @@ -2020,13 +2084,14 @@ public function createEmployeeLeaveType($xero_tenant_id, $employee_id, $employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveType $employee_leave_type (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveTypeObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createEmployeeLeaveTypeWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave_type) + public function createEmployeeLeaveTypeWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave_type, $idempotency_key = null) { - $request = $this->createEmployeeLeaveTypeRequest($xero_tenant_id, $employee_id, $employee_leave_type); + $request = $this->createEmployeeLeaveTypeRequest($xero_tenant_id, $employee_id, $employee_leave_type, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -2117,12 +2182,13 @@ public function createEmployeeLeaveTypeWithHttpInfo($xero_tenant_id, $employee_i * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveType $employee_leave_type (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeeLeaveTypeAsync($xero_tenant_id, $employee_id, $employee_leave_type) + public function createEmployeeLeaveTypeAsync($xero_tenant_id, $employee_id, $employee_leave_type, $idempotency_key = null) { - return $this->createEmployeeLeaveTypeAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave_type) + return $this->createEmployeeLeaveTypeAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave_type, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -2135,12 +2201,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveType $employee_leave_type (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeeLeaveTypeAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave_type) + public function createEmployeeLeaveTypeAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave_type, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveTypeObject'; - $request = $this->createEmployeeLeaveTypeRequest($xero_tenant_id, $employee_id, $employee_leave_type); + $request = $this->createEmployeeLeaveTypeRequest($xero_tenant_id, $employee_id, $employee_leave_type, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -2179,9 +2246,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveType $employee_leave_type (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createEmployeeLeaveTypeRequest($xero_tenant_id, $employee_id, $employee_leave_type) + protected function createEmployeeLeaveTypeRequest($xero_tenant_id, $employee_id, $employee_leave_type, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -2211,6 +2279,10 @@ protected function createEmployeeLeaveTypeRequest($xero_tenant_id, $employee_id, if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollNzObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($employee_id !== null) { $resourcePath = str_replace( @@ -2288,13 +2360,14 @@ protected function createEmployeeLeaveTypeRequest($xero_tenant_id, $employee_id, * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeOpeningBalance[] $employee_opening_balance employee_opening_balance (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeOpeningBalancesObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function createEmployeeOpeningBalances($xero_tenant_id, $employee_id, $employee_opening_balance) + public function createEmployeeOpeningBalances($xero_tenant_id, $employee_id, $employee_opening_balance, $idempotency_key = null) { - list($response) = $this->createEmployeeOpeningBalancesWithHttpInfo($xero_tenant_id, $employee_id, $employee_opening_balance); + list($response) = $this->createEmployeeOpeningBalancesWithHttpInfo($xero_tenant_id, $employee_id, $employee_opening_balance, $idempotency_key); return $response; } /** @@ -2303,13 +2376,14 @@ public function createEmployeeOpeningBalances($xero_tenant_id, $employee_id, $em * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeOpeningBalance[] $employee_opening_balance (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EmployeeOpeningBalancesObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createEmployeeOpeningBalancesWithHttpInfo($xero_tenant_id, $employee_id, $employee_opening_balance) + public function createEmployeeOpeningBalancesWithHttpInfo($xero_tenant_id, $employee_id, $employee_opening_balance, $idempotency_key = null) { - $request = $this->createEmployeeOpeningBalancesRequest($xero_tenant_id, $employee_id, $employee_opening_balance); + $request = $this->createEmployeeOpeningBalancesRequest($xero_tenant_id, $employee_id, $employee_opening_balance, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -2400,12 +2474,13 @@ public function createEmployeeOpeningBalancesWithHttpInfo($xero_tenant_id, $empl * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeOpeningBalance[] $employee_opening_balance (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeeOpeningBalancesAsync($xero_tenant_id, $employee_id, $employee_opening_balance) + public function createEmployeeOpeningBalancesAsync($xero_tenant_id, $employee_id, $employee_opening_balance, $idempotency_key = null) { - return $this->createEmployeeOpeningBalancesAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_opening_balance) + return $this->createEmployeeOpeningBalancesAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_opening_balance, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -2418,12 +2493,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeOpeningBalance[] $employee_opening_balance (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeeOpeningBalancesAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_opening_balance) + public function createEmployeeOpeningBalancesAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_opening_balance, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeOpeningBalancesObject'; - $request = $this->createEmployeeOpeningBalancesRequest($xero_tenant_id, $employee_id, $employee_opening_balance); + $request = $this->createEmployeeOpeningBalancesRequest($xero_tenant_id, $employee_id, $employee_opening_balance, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -2462,9 +2538,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeOpeningBalance[] $employee_opening_balance (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createEmployeeOpeningBalancesRequest($xero_tenant_id, $employee_id, $employee_opening_balance) + protected function createEmployeeOpeningBalancesRequest($xero_tenant_id, $employee_id, $employee_opening_balance, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -2484,7 +2561,7 @@ protected function createEmployeeOpeningBalancesRequest($xero_tenant_id, $employ 'Missing the required parameter $employee_opening_balance when calling createEmployeeOpeningBalances' ); } - $resourcePath = '/Employees/{EmployeeID}/openingBalances'; + $resourcePath = '/Employees/{EmployeeID}/OpeningBalances'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2494,6 +2571,10 @@ protected function createEmployeeOpeningBalancesRequest($xero_tenant_id, $employ if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollNzObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($employee_id !== null) { $resourcePath = str_replace( @@ -2571,13 +2652,14 @@ protected function createEmployeeOpeningBalancesRequest($xero_tenant_id, $employ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PaymentMethod $payment_method payment_method (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PaymentMethodObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function createEmployeePaymentMethod($xero_tenant_id, $employee_id, $payment_method) + public function createEmployeePaymentMethod($xero_tenant_id, $employee_id, $payment_method, $idempotency_key = null) { - list($response) = $this->createEmployeePaymentMethodWithHttpInfo($xero_tenant_id, $employee_id, $payment_method); + list($response) = $this->createEmployeePaymentMethodWithHttpInfo($xero_tenant_id, $employee_id, $payment_method, $idempotency_key); return $response; } /** @@ -2586,13 +2668,14 @@ public function createEmployeePaymentMethod($xero_tenant_id, $employee_id, $paym * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PaymentMethod $payment_method (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\PaymentMethodObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createEmployeePaymentMethodWithHttpInfo($xero_tenant_id, $employee_id, $payment_method) + public function createEmployeePaymentMethodWithHttpInfo($xero_tenant_id, $employee_id, $payment_method, $idempotency_key = null) { - $request = $this->createEmployeePaymentMethodRequest($xero_tenant_id, $employee_id, $payment_method); + $request = $this->createEmployeePaymentMethodRequest($xero_tenant_id, $employee_id, $payment_method, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -2683,12 +2766,13 @@ public function createEmployeePaymentMethodWithHttpInfo($xero_tenant_id, $employ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PaymentMethod $payment_method (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeePaymentMethodAsync($xero_tenant_id, $employee_id, $payment_method) + public function createEmployeePaymentMethodAsync($xero_tenant_id, $employee_id, $payment_method, $idempotency_key = null) { - return $this->createEmployeePaymentMethodAsyncWithHttpInfo($xero_tenant_id, $employee_id, $payment_method) + return $this->createEmployeePaymentMethodAsyncWithHttpInfo($xero_tenant_id, $employee_id, $payment_method, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -2701,12 +2785,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PaymentMethod $payment_method (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeePaymentMethodAsyncWithHttpInfo($xero_tenant_id, $employee_id, $payment_method) + public function createEmployeePaymentMethodAsyncWithHttpInfo($xero_tenant_id, $employee_id, $payment_method, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PaymentMethodObject'; - $request = $this->createEmployeePaymentMethodRequest($xero_tenant_id, $employee_id, $payment_method); + $request = $this->createEmployeePaymentMethodRequest($xero_tenant_id, $employee_id, $payment_method, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -2745,9 +2830,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PaymentMethod $payment_method (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createEmployeePaymentMethodRequest($xero_tenant_id, $employee_id, $payment_method) + protected function createEmployeePaymentMethodRequest($xero_tenant_id, $employee_id, $payment_method, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -2777,6 +2863,10 @@ protected function createEmployeePaymentMethodRequest($xero_tenant_id, $employee if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollNzObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($employee_id !== null) { $resourcePath = str_replace( @@ -2854,13 +2944,14 @@ protected function createEmployeePaymentMethodRequest($xero_tenant_id, $employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWage $salary_and_wage salary_and_wage (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWageObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function createEmployeeSalaryAndWage($xero_tenant_id, $employee_id, $salary_and_wage) + public function createEmployeeSalaryAndWage($xero_tenant_id, $employee_id, $salary_and_wage, $idempotency_key = null) { - list($response) = $this->createEmployeeSalaryAndWageWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wage); + list($response) = $this->createEmployeeSalaryAndWageWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wage, $idempotency_key); return $response; } /** @@ -2869,13 +2960,14 @@ public function createEmployeeSalaryAndWage($xero_tenant_id, $employee_id, $sala * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWage $salary_and_wage (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWageObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createEmployeeSalaryAndWageWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wage) + public function createEmployeeSalaryAndWageWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wage, $idempotency_key = null) { - $request = $this->createEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id, $salary_and_wage); + $request = $this->createEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id, $salary_and_wage, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -2966,12 +3058,13 @@ public function createEmployeeSalaryAndWageWithHttpInfo($xero_tenant_id, $employ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWage $salary_and_wage (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeeSalaryAndWageAsync($xero_tenant_id, $employee_id, $salary_and_wage) + public function createEmployeeSalaryAndWageAsync($xero_tenant_id, $employee_id, $salary_and_wage, $idempotency_key = null) { - return $this->createEmployeeSalaryAndWageAsyncWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wage) + return $this->createEmployeeSalaryAndWageAsyncWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wage, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -2984,12 +3077,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWage $salary_and_wage (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeeSalaryAndWageAsyncWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wage) + public function createEmployeeSalaryAndWageAsyncWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wage, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWageObject'; - $request = $this->createEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id, $salary_and_wage); + $request = $this->createEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id, $salary_and_wage, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -3028,9 +3122,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWage $salary_and_wage (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id, $salary_and_wage) + protected function createEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id, $salary_and_wage, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -3060,6 +3155,10 @@ protected function createEmployeeSalaryAndWageRequest($xero_tenant_id, $employee if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollNzObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($employee_id !== null) { $resourcePath = str_replace( @@ -3132,33 +3231,35 @@ protected function createEmployeeSalaryAndWageRequest($xero_tenant_id, $employee } /** - * Operation createEmployment - * Creates an employment detail for a specific employee + * Operation createEmployeeWorkingPattern + * Creates an employee working pattern * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Employment $employment employment (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPatternWithWorkingWeeksRequest $employee_working_pattern_with_working_weeks_request employee_working_pattern_with_working_weeks_request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmploymentObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPatternWithWorkingWeeksObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function createEmployment($xero_tenant_id, $employee_id, $employment) + public function createEmployeeWorkingPattern($xero_tenant_id, $employee_id, $employee_working_pattern_with_working_weeks_request, $idempotency_key = null) { - list($response) = $this->createEmploymentWithHttpInfo($xero_tenant_id, $employee_id, $employment); + list($response) = $this->createEmployeeWorkingPatternWithHttpInfo($xero_tenant_id, $employee_id, $employee_working_pattern_with_working_weeks_request, $idempotency_key); return $response; } /** - * Operation createEmploymentWithHttpInfo - * Creates an employment detail for a specific employee + * Operation createEmployeeWorkingPatternWithHttpInfo + * Creates an employee working pattern * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Employment $employment (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPatternWithWorkingWeeksRequest $employee_working_pattern_with_working_weeks_request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EmploymentObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPatternWithWorkingWeeksObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createEmploymentWithHttpInfo($xero_tenant_id, $employee_id, $employment) + public function createEmployeeWorkingPatternWithHttpInfo($xero_tenant_id, $employee_id, $employee_working_pattern_with_working_weeks_request, $idempotency_key = null) { - $request = $this->createEmploymentRequest($xero_tenant_id, $employee_id, $employment); + $request = $this->createEmployeeWorkingPatternRequest($xero_tenant_id, $employee_id, $employee_working_pattern_with_working_weeks_request, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -3187,13 +3288,13 @@ public function createEmploymentWithHttpInfo($xero_tenant_id, $employee_id, $emp $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmploymentObject' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPatternWithWorkingWeeksObject' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmploymentObject', []), + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPatternWithWorkingWeeksObject', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -3209,7 +3310,7 @@ public function createEmploymentWithHttpInfo($xero_tenant_id, $employee_id, $emp $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmploymentObject'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPatternWithWorkingWeeksObject'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -3226,7 +3327,7 @@ public function createEmploymentWithHttpInfo($xero_tenant_id, $employee_id, $emp case 200: $data = PayrollNzObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmploymentObject', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPatternWithWorkingWeeksObject', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -3244,17 +3345,18 @@ public function createEmploymentWithHttpInfo($xero_tenant_id, $employee_id, $emp } } /** - * Operation createEmploymentAsync - * Creates an employment detail for a specific employee + * Operation createEmployeeWorkingPatternAsync + * Creates an employee working pattern * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Employment $employment (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPatternWithWorkingWeeksRequest $employee_working_pattern_with_working_weeks_request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmploymentAsync($xero_tenant_id, $employee_id, $employment) + public function createEmployeeWorkingPatternAsync($xero_tenant_id, $employee_id, $employee_working_pattern_with_working_weeks_request, $idempotency_key = null) { - return $this->createEmploymentAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employment) + return $this->createEmployeeWorkingPatternAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_working_pattern_with_working_weeks_request, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -3262,17 +3364,18 @@ function ($response) { ); } /** - * Operation createEmploymentAsyncWithHttpInfo - * Creates an employment detail for a specific employee + * Operation createEmployeeWorkingPatternAsyncWithHttpInfo + * Creates an employee working pattern * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Employment $employment (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPatternWithWorkingWeeksRequest $employee_working_pattern_with_working_weeks_request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmploymentAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employment) + public function createEmployeeWorkingPatternAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_working_pattern_with_working_weeks_request, $idempotency_key = null) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmploymentObject'; - $request = $this->createEmploymentRequest($xero_tenant_id, $employee_id, $employment); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPatternWithWorkingWeeksObject'; + $request = $this->createEmployeeWorkingPatternRequest($xero_tenant_id, $employee_id, $employee_working_pattern_with_working_weeks_request, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -3307,33 +3410,34 @@ function ($exception) { } /** - * Create request for operation 'createEmployment' + * Create request for operation 'createEmployeeWorkingPattern' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Employment $employment (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPatternWithWorkingWeeksRequest $employee_working_pattern_with_working_weeks_request (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createEmploymentRequest($xero_tenant_id, $employee_id, $employment) + protected function createEmployeeWorkingPatternRequest($xero_tenant_id, $employee_id, $employee_working_pattern_with_working_weeks_request, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling createEmployment' + 'Missing the required parameter $xero_tenant_id when calling createEmployeeWorkingPattern' ); } // verify the required parameter 'employee_id' is set if ($employee_id === null || (is_array($employee_id) && count($employee_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $employee_id when calling createEmployment' + 'Missing the required parameter $employee_id when calling createEmployeeWorkingPattern' ); } - // verify the required parameter 'employment' is set - if ($employment === null || (is_array($employment) && count($employment) === 0)) { + // verify the required parameter 'employee_working_pattern_with_working_weeks_request' is set + if ($employee_working_pattern_with_working_weeks_request === null || (is_array($employee_working_pattern_with_working_weeks_request) && count($employee_working_pattern_with_working_weeks_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $employment when calling createEmployment' + 'Missing the required parameter $employee_working_pattern_with_working_weeks_request when calling createEmployeeWorkingPattern' ); } - $resourcePath = '/Employees/{EmployeeID}/Employment'; + $resourcePath = '/Employees/{EmployeeID}/Working-Patterns'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3343,6 +3447,10 @@ protected function createEmploymentRequest($xero_tenant_id, $employee_id, $emplo if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollNzObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($employee_id !== null) { $resourcePath = str_replace( @@ -3353,8 +3461,8 @@ protected function createEmploymentRequest($xero_tenant_id, $employee_id, $emplo } // body params $_tempBody = null; - if (isset($employment)) { - $_tempBody = $employment; + if (isset($employee_working_pattern_with_working_weeks_request)) { + $_tempBody = $employee_working_pattern_with_working_weeks_request; } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -3415,31 +3523,35 @@ protected function createEmploymentRequest($xero_tenant_id, $employee_id, $emplo } /** - * Operation createLeaveType - * Creates a new leave type + * Operation createEmployment + * Creates an employment detail for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\LeaveType $leave_type leave_type (required) + * @param string $employee_id Employee id for single object (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Employment $employment employment (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\LeaveTypeObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmploymentObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function createLeaveType($xero_tenant_id, $leave_type) + public function createEmployment($xero_tenant_id, $employee_id, $employment, $idempotency_key = null) { - list($response) = $this->createLeaveTypeWithHttpInfo($xero_tenant_id, $leave_type); + list($response) = $this->createEmploymentWithHttpInfo($xero_tenant_id, $employee_id, $employment, $idempotency_key); return $response; } /** - * Operation createLeaveTypeWithHttpInfo - * Creates a new leave type + * Operation createEmploymentWithHttpInfo + * Creates an employment detail for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\LeaveType $leave_type (required) + * @param string $employee_id Employee id for single object (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Employment $employment (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\LeaveTypeObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EmploymentObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createLeaveTypeWithHttpInfo($xero_tenant_id, $leave_type) + public function createEmploymentWithHttpInfo($xero_tenant_id, $employee_id, $employment, $idempotency_key = null) { - $request = $this->createLeaveTypeRequest($xero_tenant_id, $leave_type); + $request = $this->createEmploymentRequest($xero_tenant_id, $employee_id, $employment, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -3468,13 +3580,13 @@ public function createLeaveTypeWithHttpInfo($xero_tenant_id, $leave_type) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\LeaveTypeObject' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmploymentObject' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\LeaveTypeObject', []), + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmploymentObject', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -3490,7 +3602,7 @@ public function createLeaveTypeWithHttpInfo($xero_tenant_id, $leave_type) $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\LeaveTypeObject'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmploymentObject'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -3507,7 +3619,7 @@ public function createLeaveTypeWithHttpInfo($xero_tenant_id, $leave_type) case 200: $data = PayrollNzObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\LeaveTypeObject', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmploymentObject', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -3525,16 +3637,18 @@ public function createLeaveTypeWithHttpInfo($xero_tenant_id, $leave_type) } } /** - * Operation createLeaveTypeAsync - * Creates a new leave type + * Operation createEmploymentAsync + * Creates an employment detail for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\LeaveType $leave_type (required) + * @param string $employee_id Employee id for single object (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Employment $employment (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createLeaveTypeAsync($xero_tenant_id, $leave_type) + public function createEmploymentAsync($xero_tenant_id, $employee_id, $employment, $idempotency_key = null) { - return $this->createLeaveTypeAsyncWithHttpInfo($xero_tenant_id, $leave_type) + return $this->createEmploymentAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employment, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -3542,16 +3656,18 @@ function ($response) { ); } /** - * Operation createLeaveTypeAsyncWithHttpInfo - * Creates a new leave type + * Operation createEmploymentAsyncWithHttpInfo + * Creates an employment detail for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\LeaveType $leave_type (required) + * @param string $employee_id Employee id for single object (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Employment $employment (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createLeaveTypeAsyncWithHttpInfo($xero_tenant_id, $leave_type) + public function createEmploymentAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employment, $idempotency_key = null) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\LeaveTypeObject'; - $request = $this->createLeaveTypeRequest($xero_tenant_id, $leave_type); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmploymentObject'; + $request = $this->createEmploymentRequest($xero_tenant_id, $employee_id, $employment, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -3586,26 +3702,34 @@ function ($exception) { } /** - * Create request for operation 'createLeaveType' + * Create request for operation 'createEmployment' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\LeaveType $leave_type (required) + * @param string $employee_id Employee id for single object (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Employment $employment (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createLeaveTypeRequest($xero_tenant_id, $leave_type) + protected function createEmploymentRequest($xero_tenant_id, $employee_id, $employment, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling createLeaveType' + 'Missing the required parameter $xero_tenant_id when calling createEmployment' ); } - // verify the required parameter 'leave_type' is set - if ($leave_type === null || (is_array($leave_type) && count($leave_type) === 0)) { + // verify the required parameter 'employee_id' is set + if ($employee_id === null || (is_array($employee_id) && count($employee_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $leave_type when calling createLeaveType' + 'Missing the required parameter $employee_id when calling createEmployment' ); } - $resourcePath = '/LeaveTypes'; + // verify the required parameter 'employment' is set + if ($employment === null || (is_array($employment) && count($employment) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $employment when calling createEmployment' + ); + } + $resourcePath = '/Employees/{EmployeeID}/Employment'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3615,10 +3739,22 @@ protected function createLeaveTypeRequest($xero_tenant_id, $leave_type) if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollNzObjectSerializer::toHeaderValue($idempotency_key); + } + // path params + if ($employee_id !== null) { + $resourcePath = str_replace( + '{' . 'EmployeeID' . '}', + PayrollNzObjectSerializer::toPathValue($employee_id), + $resourcePath + ); + } // body params $_tempBody = null; - if (isset($leave_type)) { - $_tempBody = $leave_type; + if (isset($employment)) { + $_tempBody = $employment; } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -3679,33 +3815,33 @@ protected function createLeaveTypeRequest($xero_tenant_id, $leave_type) } /** - * Operation createMultipleEmployeeEarningsTemplate - * Creates multiple employee earnings template records for a specific employee + * Operation createLeaveType + * Creates a new leave type * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $employee_id Employee id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplate[] $earnings_template earnings_template (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\LeaveType $leave_type leave_type (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeEarningsTemplates|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\LeaveTypeObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function createMultipleEmployeeEarningsTemplate($xero_tenant_id, $employee_id, $earnings_template) + public function createLeaveType($xero_tenant_id, $leave_type, $idempotency_key = null) { - list($response) = $this->createMultipleEmployeeEarningsTemplateWithHttpInfo($xero_tenant_id, $employee_id, $earnings_template); + list($response) = $this->createLeaveTypeWithHttpInfo($xero_tenant_id, $leave_type, $idempotency_key); return $response; } /** - * Operation createMultipleEmployeeEarningsTemplateWithHttpInfo - * Creates multiple employee earnings template records for a specific employee + * Operation createLeaveTypeWithHttpInfo + * Creates a new leave type * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $employee_id Employee id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplate[] $earnings_template (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\LeaveType $leave_type (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EmployeeEarningsTemplates|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\LeaveTypeObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createMultipleEmployeeEarningsTemplateWithHttpInfo($xero_tenant_id, $employee_id, $earnings_template) + public function createLeaveTypeWithHttpInfo($xero_tenant_id, $leave_type, $idempotency_key = null) { - $request = $this->createMultipleEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $earnings_template); + $request = $this->createLeaveTypeRequest($xero_tenant_id, $leave_type, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -3734,13 +3870,13 @@ public function createMultipleEmployeeEarningsTemplateWithHttpInfo($xero_tenant_ $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeEarningsTemplates' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\LeaveTypeObject' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeEarningsTemplates', []), + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\LeaveTypeObject', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -3756,7 +3892,7 @@ public function createMultipleEmployeeEarningsTemplateWithHttpInfo($xero_tenant_ $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeEarningsTemplates'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\LeaveTypeObject'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -3773,7 +3909,7 @@ public function createMultipleEmployeeEarningsTemplateWithHttpInfo($xero_tenant_ case 200: $data = PayrollNzObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeEarningsTemplates', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\LeaveTypeObject', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -3791,17 +3927,17 @@ public function createMultipleEmployeeEarningsTemplateWithHttpInfo($xero_tenant_ } } /** - * Operation createMultipleEmployeeEarningsTemplateAsync - * Creates multiple employee earnings template records for a specific employee + * Operation createLeaveTypeAsync + * Creates a new leave type * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $employee_id Employee id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplate[] $earnings_template (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\LeaveType $leave_type (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createMultipleEmployeeEarningsTemplateAsync($xero_tenant_id, $employee_id, $earnings_template) + public function createLeaveTypeAsync($xero_tenant_id, $leave_type, $idempotency_key = null) { - return $this->createMultipleEmployeeEarningsTemplateAsyncWithHttpInfo($xero_tenant_id, $employee_id, $earnings_template) + return $this->createLeaveTypeAsyncWithHttpInfo($xero_tenant_id, $leave_type, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -3809,17 +3945,17 @@ function ($response) { ); } /** - * Operation createMultipleEmployeeEarningsTemplateAsyncWithHttpInfo - * Creates multiple employee earnings template records for a specific employee + * Operation createLeaveTypeAsyncWithHttpInfo + * Creates a new leave type * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $employee_id Employee id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplate[] $earnings_template (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\LeaveType $leave_type (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createMultipleEmployeeEarningsTemplateAsyncWithHttpInfo($xero_tenant_id, $employee_id, $earnings_template) + public function createLeaveTypeAsyncWithHttpInfo($xero_tenant_id, $leave_type, $idempotency_key = null) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeEarningsTemplates'; - $request = $this->createMultipleEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $earnings_template); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\LeaveTypeObject'; + $request = $this->createLeaveTypeRequest($xero_tenant_id, $leave_type, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -3854,33 +3990,27 @@ function ($exception) { } /** - * Create request for operation 'createMultipleEmployeeEarningsTemplate' + * Create request for operation 'createLeaveType' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $employee_id Employee id for single object (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplate[] $earnings_template (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\LeaveType $leave_type (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createMultipleEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $earnings_template) + protected function createLeaveTypeRequest($xero_tenant_id, $leave_type, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling createMultipleEmployeeEarningsTemplate' - ); - } - // verify the required parameter 'employee_id' is set - if ($employee_id === null || (is_array($employee_id) && count($employee_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $employee_id when calling createMultipleEmployeeEarningsTemplate' + 'Missing the required parameter $xero_tenant_id when calling createLeaveType' ); } - // verify the required parameter 'earnings_template' is set - if ($earnings_template === null || (is_array($earnings_template) && count($earnings_template) === 0)) { + // verify the required parameter 'leave_type' is set + if ($leave_type === null || (is_array($leave_type) && count($leave_type) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $earnings_template when calling createMultipleEmployeeEarningsTemplate' + 'Missing the required parameter $leave_type when calling createLeaveType' ); } - $resourcePath = '/Employees/{EmployeeID}/paytemplateearnings'; + $resourcePath = '/LeaveTypes'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3890,18 +4020,14 @@ protected function createMultipleEmployeeEarningsTemplateRequest($xero_tenant_id if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); } - // path params - if ($employee_id !== null) { - $resourcePath = str_replace( - '{' . 'EmployeeID' . '}', - PayrollNzObjectSerializer::toPathValue($employee_id), - $resourcePath - ); + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollNzObjectSerializer::toHeaderValue($idempotency_key); } // body params $_tempBody = null; - if (isset($earnings_template)) { - $_tempBody = $earnings_template; + if (isset($leave_type)) { + $_tempBody = $leave_type; } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -3962,31 +4088,35 @@ protected function createMultipleEmployeeEarningsTemplateRequest($xero_tenant_id } /** - * Operation createPayRun - * Creates a pay run + * Operation createMultipleEmployeeEarningsTemplate + * Creates multiple employee earnings template records for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRun $pay_run pay_run (required) + * @param string $employee_id Employee id for single object (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplate[] $earnings_template earnings_template (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRunObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeEarningsTemplates|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function createPayRun($xero_tenant_id, $pay_run) + public function createMultipleEmployeeEarningsTemplate($xero_tenant_id, $employee_id, $earnings_template, $idempotency_key = null) { - list($response) = $this->createPayRunWithHttpInfo($xero_tenant_id, $pay_run); + list($response) = $this->createMultipleEmployeeEarningsTemplateWithHttpInfo($xero_tenant_id, $employee_id, $earnings_template, $idempotency_key); return $response; } /** - * Operation createPayRunWithHttpInfo - * Creates a pay run + * Operation createMultipleEmployeeEarningsTemplateWithHttpInfo + * Creates multiple employee earnings template records for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRun $pay_run (required) + * @param string $employee_id Employee id for single object (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplate[] $earnings_template (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\PayRunObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EmployeeEarningsTemplates|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createPayRunWithHttpInfo($xero_tenant_id, $pay_run) + public function createMultipleEmployeeEarningsTemplateWithHttpInfo($xero_tenant_id, $employee_id, $earnings_template, $idempotency_key = null) { - $request = $this->createPayRunRequest($xero_tenant_id, $pay_run); + $request = $this->createMultipleEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $earnings_template, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -4015,13 +4145,13 @@ public function createPayRunWithHttpInfo($xero_tenant_id, $pay_run) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRunObject' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeEarningsTemplates' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRunObject', []), + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeEarningsTemplates', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -4037,7 +4167,7 @@ public function createPayRunWithHttpInfo($xero_tenant_id, $pay_run) $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRunObject'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeEarningsTemplates'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -4054,7 +4184,7 @@ public function createPayRunWithHttpInfo($xero_tenant_id, $pay_run) case 200: $data = PayrollNzObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRunObject', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeEarningsTemplates', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -4072,16 +4202,18 @@ public function createPayRunWithHttpInfo($xero_tenant_id, $pay_run) } } /** - * Operation createPayRunAsync - * Creates a pay run + * Operation createMultipleEmployeeEarningsTemplateAsync + * Creates multiple employee earnings template records for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRun $pay_run (required) + * @param string $employee_id Employee id for single object (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplate[] $earnings_template (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createPayRunAsync($xero_tenant_id, $pay_run) + public function createMultipleEmployeeEarningsTemplateAsync($xero_tenant_id, $employee_id, $earnings_template, $idempotency_key = null) { - return $this->createPayRunAsyncWithHttpInfo($xero_tenant_id, $pay_run) + return $this->createMultipleEmployeeEarningsTemplateAsyncWithHttpInfo($xero_tenant_id, $employee_id, $earnings_template, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -4089,16 +4221,18 @@ function ($response) { ); } /** - * Operation createPayRunAsyncWithHttpInfo - * Creates a pay run + * Operation createMultipleEmployeeEarningsTemplateAsyncWithHttpInfo + * Creates multiple employee earnings template records for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRun $pay_run (required) + * @param string $employee_id Employee id for single object (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplate[] $earnings_template (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createPayRunAsyncWithHttpInfo($xero_tenant_id, $pay_run) + public function createMultipleEmployeeEarningsTemplateAsyncWithHttpInfo($xero_tenant_id, $employee_id, $earnings_template, $idempotency_key = null) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRunObject'; - $request = $this->createPayRunRequest($xero_tenant_id, $pay_run); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeEarningsTemplates'; + $request = $this->createMultipleEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $earnings_template, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -4133,26 +4267,34 @@ function ($exception) { } /** - * Create request for operation 'createPayRun' + * Create request for operation 'createMultipleEmployeeEarningsTemplate' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRun $pay_run (required) + * @param string $employee_id Employee id for single object (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplate[] $earnings_template (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createPayRunRequest($xero_tenant_id, $pay_run) + protected function createMultipleEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $earnings_template, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling createPayRun' + 'Missing the required parameter $xero_tenant_id when calling createMultipleEmployeeEarningsTemplate' ); } - // verify the required parameter 'pay_run' is set - if ($pay_run === null || (is_array($pay_run) && count($pay_run) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $pay_run when calling createPayRun' + // verify the required parameter 'employee_id' is set + if ($employee_id === null || (is_array($employee_id) && count($employee_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $employee_id when calling createMultipleEmployeeEarningsTemplate' ); } - $resourcePath = '/PayRuns'; + // verify the required parameter 'earnings_template' is set + if ($earnings_template === null || (is_array($earnings_template) && count($earnings_template) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $earnings_template when calling createMultipleEmployeeEarningsTemplate' + ); + } + $resourcePath = '/Employees/{EmployeeID}/PayTemplateEarnings'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4162,10 +4304,22 @@ protected function createPayRunRequest($xero_tenant_id, $pay_run) if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollNzObjectSerializer::toHeaderValue($idempotency_key); + } + // path params + if ($employee_id !== null) { + $resourcePath = str_replace( + '{' . 'EmployeeID' . '}', + PayrollNzObjectSerializer::toPathValue($employee_id), + $resourcePath + ); + } // body params $_tempBody = null; - if (isset($pay_run)) { - $_tempBody = $pay_run; + if (isset($earnings_template)) { + $_tempBody = $earnings_template; } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -4226,31 +4380,33 @@ protected function createPayRunRequest($xero_tenant_id, $pay_run) } /** - * Operation createPayRunCalendar - * Creates a new payrun calendar + * Operation createPayRun + * Creates a pay run * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRunCalendar $pay_run_calendar pay_run_calendar (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRun $pay_run pay_run (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRunCalendarObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRunObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function createPayRunCalendar($xero_tenant_id, $pay_run_calendar) + public function createPayRun($xero_tenant_id, $pay_run, $idempotency_key = null) { - list($response) = $this->createPayRunCalendarWithHttpInfo($xero_tenant_id, $pay_run_calendar); + list($response) = $this->createPayRunWithHttpInfo($xero_tenant_id, $pay_run, $idempotency_key); return $response; } /** - * Operation createPayRunCalendarWithHttpInfo - * Creates a new payrun calendar + * Operation createPayRunWithHttpInfo + * Creates a pay run * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRunCalendar $pay_run_calendar (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRun $pay_run (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\PayRunCalendarObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\PayRunObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createPayRunCalendarWithHttpInfo($xero_tenant_id, $pay_run_calendar) + public function createPayRunWithHttpInfo($xero_tenant_id, $pay_run, $idempotency_key = null) { - $request = $this->createPayRunCalendarRequest($xero_tenant_id, $pay_run_calendar); + $request = $this->createPayRunRequest($xero_tenant_id, $pay_run, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -4279,13 +4435,13 @@ public function createPayRunCalendarWithHttpInfo($xero_tenant_id, $pay_run_calen $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRunCalendarObject' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRunObject' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRunCalendarObject', []), + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRunObject', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -4301,7 +4457,7 @@ public function createPayRunCalendarWithHttpInfo($xero_tenant_id, $pay_run_calen $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRunCalendarObject'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRunObject'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -4318,7 +4474,7 @@ public function createPayRunCalendarWithHttpInfo($xero_tenant_id, $pay_run_calen case 200: $data = PayrollNzObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRunCalendarObject', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRunObject', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -4336,16 +4492,17 @@ public function createPayRunCalendarWithHttpInfo($xero_tenant_id, $pay_run_calen } } /** - * Operation createPayRunCalendarAsync - * Creates a new payrun calendar + * Operation createPayRunAsync + * Creates a pay run * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRunCalendar $pay_run_calendar (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRun $pay_run (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createPayRunCalendarAsync($xero_tenant_id, $pay_run_calendar) + public function createPayRunAsync($xero_tenant_id, $pay_run, $idempotency_key = null) { - return $this->createPayRunCalendarAsyncWithHttpInfo($xero_tenant_id, $pay_run_calendar) + return $this->createPayRunAsyncWithHttpInfo($xero_tenant_id, $pay_run, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -4353,16 +4510,17 @@ function ($response) { ); } /** - * Operation createPayRunCalendarAsyncWithHttpInfo - * Creates a new payrun calendar + * Operation createPayRunAsyncWithHttpInfo + * Creates a pay run * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRunCalendar $pay_run_calendar (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRun $pay_run (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createPayRunCalendarAsyncWithHttpInfo($xero_tenant_id, $pay_run_calendar) + public function createPayRunAsyncWithHttpInfo($xero_tenant_id, $pay_run, $idempotency_key = null) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRunCalendarObject'; - $request = $this->createPayRunCalendarRequest($xero_tenant_id, $pay_run_calendar); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRunObject'; + $request = $this->createPayRunRequest($xero_tenant_id, $pay_run, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -4397,26 +4555,27 @@ function ($exception) { } /** - * Create request for operation 'createPayRunCalendar' + * Create request for operation 'createPayRun' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRunCalendar $pay_run_calendar (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRun $pay_run (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createPayRunCalendarRequest($xero_tenant_id, $pay_run_calendar) + protected function createPayRunRequest($xero_tenant_id, $pay_run, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling createPayRunCalendar' + 'Missing the required parameter $xero_tenant_id when calling createPayRun' ); } - // verify the required parameter 'pay_run_calendar' is set - if ($pay_run_calendar === null || (is_array($pay_run_calendar) && count($pay_run_calendar) === 0)) { + // verify the required parameter 'pay_run' is set + if ($pay_run === null || (is_array($pay_run) && count($pay_run) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $pay_run_calendar when calling createPayRunCalendar' + 'Missing the required parameter $pay_run when calling createPayRun' ); } - $resourcePath = '/PayRunCalendars'; + $resourcePath = '/PayRuns'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4426,10 +4585,14 @@ protected function createPayRunCalendarRequest($xero_tenant_id, $pay_run_calenda if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollNzObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; - if (isset($pay_run_calendar)) { - $_tempBody = $pay_run_calendar; + if (isset($pay_run)) { + $_tempBody = $pay_run; } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -4490,31 +4653,33 @@ protected function createPayRunCalendarRequest($xero_tenant_id, $pay_run_calenda } /** - * Operation createReimbursement - * Creates a new reimbursement + * Operation createPayRunCalendar + * Creates a new payrun calendar * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Reimbursement $reimbursement reimbursement (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRunCalendar $pay_run_calendar pay_run_calendar (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\ReimbursementObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRunCalendarObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function createReimbursement($xero_tenant_id, $reimbursement) + public function createPayRunCalendar($xero_tenant_id, $pay_run_calendar, $idempotency_key = null) { - list($response) = $this->createReimbursementWithHttpInfo($xero_tenant_id, $reimbursement); + list($response) = $this->createPayRunCalendarWithHttpInfo($xero_tenant_id, $pay_run_calendar, $idempotency_key); return $response; } /** - * Operation createReimbursementWithHttpInfo - * Creates a new reimbursement + * Operation createPayRunCalendarWithHttpInfo + * Creates a new payrun calendar * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Reimbursement $reimbursement (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRunCalendar $pay_run_calendar (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\ReimbursementObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\PayRunCalendarObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createReimbursementWithHttpInfo($xero_tenant_id, $reimbursement) + public function createPayRunCalendarWithHttpInfo($xero_tenant_id, $pay_run_calendar, $idempotency_key = null) { - $request = $this->createReimbursementRequest($xero_tenant_id, $reimbursement); + $request = $this->createPayRunCalendarRequest($xero_tenant_id, $pay_run_calendar, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -4543,13 +4708,13 @@ public function createReimbursementWithHttpInfo($xero_tenant_id, $reimbursement) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\ReimbursementObject' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRunCalendarObject' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\ReimbursementObject', []), + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRunCalendarObject', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -4565,7 +4730,7 @@ public function createReimbursementWithHttpInfo($xero_tenant_id, $reimbursement) $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\ReimbursementObject'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRunCalendarObject'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -4582,7 +4747,7 @@ public function createReimbursementWithHttpInfo($xero_tenant_id, $reimbursement) case 200: $data = PayrollNzObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\ReimbursementObject', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRunCalendarObject', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -4600,16 +4765,17 @@ public function createReimbursementWithHttpInfo($xero_tenant_id, $reimbursement) } } /** - * Operation createReimbursementAsync - * Creates a new reimbursement + * Operation createPayRunCalendarAsync + * Creates a new payrun calendar * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Reimbursement $reimbursement (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRunCalendar $pay_run_calendar (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createReimbursementAsync($xero_tenant_id, $reimbursement) + public function createPayRunCalendarAsync($xero_tenant_id, $pay_run_calendar, $idempotency_key = null) { - return $this->createReimbursementAsyncWithHttpInfo($xero_tenant_id, $reimbursement) + return $this->createPayRunCalendarAsyncWithHttpInfo($xero_tenant_id, $pay_run_calendar, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -4617,16 +4783,17 @@ function ($response) { ); } /** - * Operation createReimbursementAsyncWithHttpInfo - * Creates a new reimbursement + * Operation createPayRunCalendarAsyncWithHttpInfo + * Creates a new payrun calendar * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Reimbursement $reimbursement (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRunCalendar $pay_run_calendar (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createReimbursementAsyncWithHttpInfo($xero_tenant_id, $reimbursement) + public function createPayRunCalendarAsyncWithHttpInfo($xero_tenant_id, $pay_run_calendar, $idempotency_key = null) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\ReimbursementObject'; - $request = $this->createReimbursementRequest($xero_tenant_id, $reimbursement); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRunCalendarObject'; + $request = $this->createPayRunCalendarRequest($xero_tenant_id, $pay_run_calendar, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -4661,26 +4828,27 @@ function ($exception) { } /** - * Create request for operation 'createReimbursement' + * Create request for operation 'createPayRunCalendar' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Reimbursement $reimbursement (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRunCalendar $pay_run_calendar (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createReimbursementRequest($xero_tenant_id, $reimbursement) + protected function createPayRunCalendarRequest($xero_tenant_id, $pay_run_calendar, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling createReimbursement' + 'Missing the required parameter $xero_tenant_id when calling createPayRunCalendar' ); } - // verify the required parameter 'reimbursement' is set - if ($reimbursement === null || (is_array($reimbursement) && count($reimbursement) === 0)) { + // verify the required parameter 'pay_run_calendar' is set + if ($pay_run_calendar === null || (is_array($pay_run_calendar) && count($pay_run_calendar) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $reimbursement when calling createReimbursement' + 'Missing the required parameter $pay_run_calendar when calling createPayRunCalendar' ); } - $resourcePath = '/Reimbursements'; + $resourcePath = '/PayRunCalendars'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4690,10 +4858,14 @@ protected function createReimbursementRequest($xero_tenant_id, $reimbursement) if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollNzObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; - if (isset($reimbursement)) { - $_tempBody = $reimbursement; + if (isset($pay_run_calendar)) { + $_tempBody = $pay_run_calendar; } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -4754,31 +4926,33 @@ protected function createReimbursementRequest($xero_tenant_id, $reimbursement) } /** - * Operation createSuperannuation - * Creates a new superannuation + * Operation createReimbursement + * Creates a new reimbursement * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Benefit $benefit benefit (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Reimbursement $reimbursement reimbursement (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SuperannuationObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\ReimbursementObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function createSuperannuation($xero_tenant_id, $benefit) + public function createReimbursement($xero_tenant_id, $reimbursement, $idempotency_key = null) { - list($response) = $this->createSuperannuationWithHttpInfo($xero_tenant_id, $benefit); + list($response) = $this->createReimbursementWithHttpInfo($xero_tenant_id, $reimbursement, $idempotency_key); return $response; } /** - * Operation createSuperannuationWithHttpInfo - * Creates a new superannuation + * Operation createReimbursementWithHttpInfo + * Creates a new reimbursement * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Benefit $benefit (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Reimbursement $reimbursement (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\SuperannuationObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\ReimbursementObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createSuperannuationWithHttpInfo($xero_tenant_id, $benefit) + public function createReimbursementWithHttpInfo($xero_tenant_id, $reimbursement, $idempotency_key = null) { - $request = $this->createSuperannuationRequest($xero_tenant_id, $benefit); + $request = $this->createReimbursementRequest($xero_tenant_id, $reimbursement, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -4807,13 +4981,13 @@ public function createSuperannuationWithHttpInfo($xero_tenant_id, $benefit) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SuperannuationObject' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\ReimbursementObject' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SuperannuationObject', []), + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\ReimbursementObject', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -4829,7 +5003,7 @@ public function createSuperannuationWithHttpInfo($xero_tenant_id, $benefit) $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SuperannuationObject'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\ReimbursementObject'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -4846,7 +5020,7 @@ public function createSuperannuationWithHttpInfo($xero_tenant_id, $benefit) case 200: $data = PayrollNzObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SuperannuationObject', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\ReimbursementObject', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -4864,16 +5038,17 @@ public function createSuperannuationWithHttpInfo($xero_tenant_id, $benefit) } } /** - * Operation createSuperannuationAsync - * Creates a new superannuation + * Operation createReimbursementAsync + * Creates a new reimbursement * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Benefit $benefit (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Reimbursement $reimbursement (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createSuperannuationAsync($xero_tenant_id, $benefit) + public function createReimbursementAsync($xero_tenant_id, $reimbursement, $idempotency_key = null) { - return $this->createSuperannuationAsyncWithHttpInfo($xero_tenant_id, $benefit) + return $this->createReimbursementAsyncWithHttpInfo($xero_tenant_id, $reimbursement, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -4881,16 +5056,17 @@ function ($response) { ); } /** - * Operation createSuperannuationAsyncWithHttpInfo - * Creates a new superannuation + * Operation createReimbursementAsyncWithHttpInfo + * Creates a new reimbursement * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Benefit $benefit (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Reimbursement $reimbursement (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createSuperannuationAsyncWithHttpInfo($xero_tenant_id, $benefit) + public function createReimbursementAsyncWithHttpInfo($xero_tenant_id, $reimbursement, $idempotency_key = null) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SuperannuationObject'; - $request = $this->createSuperannuationRequest($xero_tenant_id, $benefit); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\ReimbursementObject'; + $request = $this->createReimbursementRequest($xero_tenant_id, $reimbursement, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -4925,26 +5101,27 @@ function ($exception) { } /** - * Create request for operation 'createSuperannuation' + * Create request for operation 'createReimbursement' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Benefit $benefit (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Reimbursement $reimbursement (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createSuperannuationRequest($xero_tenant_id, $benefit) + protected function createReimbursementRequest($xero_tenant_id, $reimbursement, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling createSuperannuation' + 'Missing the required parameter $xero_tenant_id when calling createReimbursement' ); } - // verify the required parameter 'benefit' is set - if ($benefit === null || (is_array($benefit) && count($benefit) === 0)) { + // verify the required parameter 'reimbursement' is set + if ($reimbursement === null || (is_array($reimbursement) && count($reimbursement) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $benefit when calling createSuperannuation' + 'Missing the required parameter $reimbursement when calling createReimbursement' ); } - $resourcePath = '/Superannuations'; + $resourcePath = '/Reimbursements'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4954,10 +5131,14 @@ protected function createSuperannuationRequest($xero_tenant_id, $benefit) if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollNzObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; - if (isset($benefit)) { - $_tempBody = $benefit; + if (isset($reimbursement)) { + $_tempBody = $reimbursement; } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -5018,31 +5199,33 @@ protected function createSuperannuationRequest($xero_tenant_id, $benefit) } /** - * Operation createTimesheet - * Creates a new timesheet + * Operation createSuperannuation + * Creates a new superannuation * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Timesheet $timesheet timesheet (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Benefit $benefit benefit (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SuperannuationObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function createTimesheet($xero_tenant_id, $timesheet) + public function createSuperannuation($xero_tenant_id, $benefit, $idempotency_key = null) { - list($response) = $this->createTimesheetWithHttpInfo($xero_tenant_id, $timesheet); + list($response) = $this->createSuperannuationWithHttpInfo($xero_tenant_id, $benefit, $idempotency_key); return $response; } /** - * Operation createTimesheetWithHttpInfo - * Creates a new timesheet + * Operation createSuperannuationWithHttpInfo + * Creates a new superannuation * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Timesheet $timesheet (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Benefit $benefit (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\TimesheetObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\SuperannuationObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createTimesheetWithHttpInfo($xero_tenant_id, $timesheet) + public function createSuperannuationWithHttpInfo($xero_tenant_id, $benefit, $idempotency_key = null) { - $request = $this->createTimesheetRequest($xero_tenant_id, $timesheet); + $request = $this->createSuperannuationRequest($xero_tenant_id, $benefit, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -5071,13 +5254,13 @@ public function createTimesheetWithHttpInfo($xero_tenant_id, $timesheet) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetObject' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SuperannuationObject' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetObject', []), + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SuperannuationObject', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -5093,7 +5276,7 @@ public function createTimesheetWithHttpInfo($xero_tenant_id, $timesheet) $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetObject'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SuperannuationObject'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -5110,7 +5293,7 @@ public function createTimesheetWithHttpInfo($xero_tenant_id, $timesheet) case 200: $data = PayrollNzObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetObject', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SuperannuationObject', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -5128,16 +5311,17 @@ public function createTimesheetWithHttpInfo($xero_tenant_id, $timesheet) } } /** - * Operation createTimesheetAsync - * Creates a new timesheet + * Operation createSuperannuationAsync + * Creates a new superannuation * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Timesheet $timesheet (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Benefit $benefit (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createTimesheetAsync($xero_tenant_id, $timesheet) + public function createSuperannuationAsync($xero_tenant_id, $benefit, $idempotency_key = null) { - return $this->createTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet) + return $this->createSuperannuationAsyncWithHttpInfo($xero_tenant_id, $benefit, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -5145,16 +5329,17 @@ function ($response) { ); } /** - * Operation createTimesheetAsyncWithHttpInfo - * Creates a new timesheet + * Operation createSuperannuationAsyncWithHttpInfo + * Creates a new superannuation * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Timesheet $timesheet (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Benefit $benefit (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet) + public function createSuperannuationAsyncWithHttpInfo($xero_tenant_id, $benefit, $idempotency_key = null) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetObject'; - $request = $this->createTimesheetRequest($xero_tenant_id, $timesheet); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SuperannuationObject'; + $request = $this->createSuperannuationRequest($xero_tenant_id, $benefit, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -5189,26 +5374,27 @@ function ($exception) { } /** - * Create request for operation 'createTimesheet' + * Create request for operation 'createSuperannuation' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Timesheet $timesheet (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Benefit $benefit (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createTimesheetRequest($xero_tenant_id, $timesheet) + protected function createSuperannuationRequest($xero_tenant_id, $benefit, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling createTimesheet' + 'Missing the required parameter $xero_tenant_id when calling createSuperannuation' ); } - // verify the required parameter 'timesheet' is set - if ($timesheet === null || (is_array($timesheet) && count($timesheet) === 0)) { + // verify the required parameter 'benefit' is set + if ($benefit === null || (is_array($benefit) && count($benefit) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $timesheet when calling createTimesheet' + 'Missing the required parameter $benefit when calling createSuperannuation' ); } - $resourcePath = '/Timesheets'; + $resourcePath = '/Superannuations'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5218,10 +5404,14 @@ protected function createTimesheetRequest($xero_tenant_id, $timesheet) if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollNzObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; - if (isset($timesheet)) { - $_tempBody = $timesheet; + if (isset($benefit)) { + $_tempBody = $benefit; } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -5282,33 +5472,33 @@ protected function createTimesheetRequest($xero_tenant_id, $timesheet) } /** - * Operation createTimesheetLine - * Create a new timesheet line for a specific time sheet + * Operation createTimesheet + * Creates a new timesheet * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $timesheet_id Identifier for the timesheet (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine $timesheet_line timesheet_line (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Timesheet $timesheet timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLineObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function createTimesheetLine($xero_tenant_id, $timesheet_id, $timesheet_line) + public function createTimesheet($xero_tenant_id, $timesheet, $idempotency_key = null) { - list($response) = $this->createTimesheetLineWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line); + list($response) = $this->createTimesheetWithHttpInfo($xero_tenant_id, $timesheet, $idempotency_key); return $response; } /** - * Operation createTimesheetLineWithHttpInfo - * Create a new timesheet line for a specific time sheet + * Operation createTimesheetWithHttpInfo + * Creates a new timesheet * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $timesheet_id Identifier for the timesheet (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine $timesheet_line (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Timesheet $timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLineObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\TimesheetObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createTimesheetLineWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line) + public function createTimesheetWithHttpInfo($xero_tenant_id, $timesheet, $idempotency_key = null) { - $request = $this->createTimesheetLineRequest($xero_tenant_id, $timesheet_id, $timesheet_line); + $request = $this->createTimesheetRequest($xero_tenant_id, $timesheet, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -5337,13 +5527,13 @@ public function createTimesheetLineWithHttpInfo($xero_tenant_id, $timesheet_id, $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLineObject' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetObject' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLineObject', []), + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetObject', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -5359,7 +5549,7 @@ public function createTimesheetLineWithHttpInfo($xero_tenant_id, $timesheet_id, $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLineObject'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetObject'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -5376,7 +5566,7 @@ public function createTimesheetLineWithHttpInfo($xero_tenant_id, $timesheet_id, case 200: $data = PayrollNzObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLineObject', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetObject', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -5394,17 +5584,17 @@ public function createTimesheetLineWithHttpInfo($xero_tenant_id, $timesheet_id, } } /** - * Operation createTimesheetLineAsync - * Create a new timesheet line for a specific time sheet + * Operation createTimesheetAsync + * Creates a new timesheet * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $timesheet_id Identifier for the timesheet (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine $timesheet_line (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Timesheet $timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createTimesheetLineAsync($xero_tenant_id, $timesheet_id, $timesheet_line) + public function createTimesheetAsync($xero_tenant_id, $timesheet, $idempotency_key = null) { - return $this->createTimesheetLineAsyncWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line) + return $this->createTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -5412,17 +5602,17 @@ function ($response) { ); } /** - * Operation createTimesheetLineAsyncWithHttpInfo - * Create a new timesheet line for a specific time sheet + * Operation createTimesheetAsyncWithHttpInfo + * Creates a new timesheet * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $timesheet_id Identifier for the timesheet (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine $timesheet_line (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Timesheet $timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createTimesheetLineAsyncWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line) + public function createTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet, $idempotency_key = null) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLineObject'; - $request = $this->createTimesheetLineRequest($xero_tenant_id, $timesheet_id, $timesheet_line); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetObject'; + $request = $this->createTimesheetRequest($xero_tenant_id, $timesheet, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -5457,33 +5647,27 @@ function ($exception) { } /** - * Create request for operation 'createTimesheetLine' + * Create request for operation 'createTimesheet' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $timesheet_id Identifier for the timesheet (required) - * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine $timesheet_line (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Timesheet $timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createTimesheetLineRequest($xero_tenant_id, $timesheet_id, $timesheet_line) + protected function createTimesheetRequest($xero_tenant_id, $timesheet, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling createTimesheetLine' - ); - } - // verify the required parameter 'timesheet_id' is set - if ($timesheet_id === null || (is_array($timesheet_id) && count($timesheet_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $timesheet_id when calling createTimesheetLine' + 'Missing the required parameter $xero_tenant_id when calling createTimesheet' ); } - // verify the required parameter 'timesheet_line' is set - if ($timesheet_line === null || (is_array($timesheet_line) && count($timesheet_line) === 0)) { + // verify the required parameter 'timesheet' is set + if ($timesheet === null || (is_array($timesheet) && count($timesheet) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $timesheet_line when calling createTimesheetLine' + 'Missing the required parameter $timesheet when calling createTimesheet' ); } - $resourcePath = '/Timesheets/{TimesheetID}/Lines'; + $resourcePath = '/Timesheets'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5493,18 +5677,14 @@ protected function createTimesheetLineRequest($xero_tenant_id, $timesheet_id, $t if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); } - // path params - if ($timesheet_id !== null) { - $resourcePath = str_replace( - '{' . 'TimesheetID' . '}', - PayrollNzObjectSerializer::toPathValue($timesheet_id), - $resourcePath - ); + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollNzObjectSerializer::toHeaderValue($idempotency_key); } // body params $_tempBody = null; - if (isset($timesheet_line)) { - $_tempBody = $timesheet_line; + if (isset($timesheet)) { + $_tempBody = $timesheet; } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -5565,33 +5745,35 @@ protected function createTimesheetLineRequest($xero_tenant_id, $timesheet_id, $t } /** - * Operation deleteEmployeeEarningsTemplate - * Deletes an employee's earnings template record + * Operation createTimesheetLine + * Create a new timesheet line for a specific time sheet * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $employee_id Employee id for single object (required) - * @param string $pay_template_earning_id Id for single pay template earnings object (required) + * @param string $timesheet_id Identifier for the timesheet (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine $timesheet_line timesheet_line (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplateObject + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLineObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function deleteEmployeeEarningsTemplate($xero_tenant_id, $employee_id, $pay_template_earning_id) + public function createTimesheetLine($xero_tenant_id, $timesheet_id, $timesheet_line, $idempotency_key = null) { - list($response) = $this->deleteEmployeeEarningsTemplateWithHttpInfo($xero_tenant_id, $employee_id, $pay_template_earning_id); + list($response) = $this->createTimesheetLineWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line, $idempotency_key); return $response; } /** - * Operation deleteEmployeeEarningsTemplateWithHttpInfo - * Deletes an employee's earnings template record + * Operation createTimesheetLineWithHttpInfo + * Create a new timesheet line for a specific time sheet * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $employee_id Employee id for single object (required) - * @param string $pay_template_earning_id Id for single pay template earnings object (required) + * @param string $timesheet_id Identifier for the timesheet (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine $timesheet_line (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplateObject, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLineObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function deleteEmployeeEarningsTemplateWithHttpInfo($xero_tenant_id, $employee_id, $pay_template_earning_id) + public function createTimesheetLineWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line, $idempotency_key = null) { - $request = $this->deleteEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $pay_template_earning_id); + $request = $this->createTimesheetLineRequest($xero_tenant_id, $timesheet_id, $timesheet_line, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -5620,18 +5802,29 @@ public function deleteEmployeeEarningsTemplateWithHttpInfo($xero_tenant_id, $emp $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplateObject' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLineObject' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplateObject', []), + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLineObject', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplateObject'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLineObject'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -5648,7 +5841,15 @@ public function deleteEmployeeEarningsTemplateWithHttpInfo($xero_tenant_id, $emp case 200: $data = PayrollNzObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplateObject', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLineObject', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = PayrollNzObjectSerializer::deserialize( + $e->getResponseBody(), + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -5658,17 +5859,18 @@ public function deleteEmployeeEarningsTemplateWithHttpInfo($xero_tenant_id, $emp } } /** - * Operation deleteEmployeeEarningsTemplateAsync - * Deletes an employee's earnings template record + * Operation createTimesheetLineAsync + * Create a new timesheet line for a specific time sheet * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $employee_id Employee id for single object (required) - * @param string $pay_template_earning_id Id for single pay template earnings object (required) + * @param string $timesheet_id Identifier for the timesheet (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine $timesheet_line (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function deleteEmployeeEarningsTemplateAsync($xero_tenant_id, $employee_id, $pay_template_earning_id) + public function createTimesheetLineAsync($xero_tenant_id, $timesheet_id, $timesheet_line, $idempotency_key = null) { - return $this->deleteEmployeeEarningsTemplateAsyncWithHttpInfo($xero_tenant_id, $employee_id, $pay_template_earning_id) + return $this->createTimesheetLineAsyncWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -5676,17 +5878,18 @@ function ($response) { ); } /** - * Operation deleteEmployeeEarningsTemplateAsyncWithHttpInfo - * Deletes an employee's earnings template record + * Operation createTimesheetLineAsyncWithHttpInfo + * Create a new timesheet line for a specific time sheet * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $employee_id Employee id for single object (required) - * @param string $pay_template_earning_id Id for single pay template earnings object (required) + * @param string $timesheet_id Identifier for the timesheet (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine $timesheet_line (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function deleteEmployeeEarningsTemplateAsyncWithHttpInfo($xero_tenant_id, $employee_id, $pay_template_earning_id) + public function createTimesheetLineAsyncWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line, $idempotency_key = null) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplateObject'; - $request = $this->deleteEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $pay_template_earning_id); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLineObject'; + $request = $this->createTimesheetLineRequest($xero_tenant_id, $timesheet_id, $timesheet_line, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -5721,33 +5924,34 @@ function ($exception) { } /** - * Create request for operation 'deleteEmployeeEarningsTemplate' + * Create request for operation 'createTimesheetLine' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $employee_id Employee id for single object (required) - * @param string $pay_template_earning_id Id for single pay template earnings object (required) + * @param string $timesheet_id Identifier for the timesheet (required) + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine $timesheet_line (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function deleteEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $pay_template_earning_id) + protected function createTimesheetLineRequest($xero_tenant_id, $timesheet_id, $timesheet_line, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling deleteEmployeeEarningsTemplate' + 'Missing the required parameter $xero_tenant_id when calling createTimesheetLine' ); } - // verify the required parameter 'employee_id' is set - if ($employee_id === null || (is_array($employee_id) && count($employee_id) === 0)) { + // verify the required parameter 'timesheet_id' is set + if ($timesheet_id === null || (is_array($timesheet_id) && count($timesheet_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $employee_id when calling deleteEmployeeEarningsTemplate' + 'Missing the required parameter $timesheet_id when calling createTimesheetLine' ); } - // verify the required parameter 'pay_template_earning_id' is set - if ($pay_template_earning_id === null || (is_array($pay_template_earning_id) && count($pay_template_earning_id) === 0)) { + // verify the required parameter 'timesheet_line' is set + if ($timesheet_line === null || (is_array($timesheet_line) && count($timesheet_line) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $pay_template_earning_id when calling deleteEmployeeEarningsTemplate' + 'Missing the required parameter $timesheet_line when calling createTimesheetLine' ); } - $resourcePath = '/Employees/{EmployeeID}/PayTemplates/earnings/{PayTemplateEarningID}'; + $resourcePath = '/Timesheets/{TimesheetID}/Lines'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5757,24 +5961,23 @@ protected function deleteEmployeeEarningsTemplateRequest($xero_tenant_id, $emplo if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); } - // path params - if ($employee_id !== null) { - $resourcePath = str_replace( - '{' . 'EmployeeID' . '}', - PayrollNzObjectSerializer::toPathValue($employee_id), - $resourcePath - ); + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollNzObjectSerializer::toHeaderValue($idempotency_key); } // path params - if ($pay_template_earning_id !== null) { + if ($timesheet_id !== null) { $resourcePath = str_replace( - '{' . 'PayTemplateEarningID' . '}', - PayrollNzObjectSerializer::toPathValue($pay_template_earning_id), + '{' . 'TimesheetID' . '}', + PayrollNzObjectSerializer::toPathValue($timesheet_id), $resourcePath ); } // body params $_tempBody = null; + if (isset($timesheet_line)) { + $_tempBody = $timesheet_line; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] @@ -5782,7 +5985,7 @@ protected function deleteEmployeeEarningsTemplateRequest($xero_tenant_id, $emplo } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['application/json'] ); } // for model (json/xml) @@ -5826,7 +6029,7 @@ protected function deleteEmployeeEarningsTemplateRequest($xero_tenant_id, $emplo ); $query = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Query::build($queryParams); return new Request( - 'DELETE', + 'POST', $this->config->getHostPayrollNz() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -5834,33 +6037,33 @@ protected function deleteEmployeeEarningsTemplateRequest($xero_tenant_id, $emplo } /** - * Operation deleteEmployeeLeave - * Deletes a leave record for a specific employee + * Operation deleteEmployeeEarningsTemplate + * Deletes an employee's earnings template record * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) - * @param string $leave_id Leave id for single object (required) + * @param string $pay_template_earning_id Id for single pay template earnings object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveObject + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplateObject */ - public function deleteEmployeeLeave($xero_tenant_id, $employee_id, $leave_id) + public function deleteEmployeeEarningsTemplate($xero_tenant_id, $employee_id, $pay_template_earning_id) { - list($response) = $this->deleteEmployeeLeaveWithHttpInfo($xero_tenant_id, $employee_id, $leave_id); + list($response) = $this->deleteEmployeeEarningsTemplateWithHttpInfo($xero_tenant_id, $employee_id, $pay_template_earning_id); return $response; } /** - * Operation deleteEmployeeLeaveWithHttpInfo - * Deletes a leave record for a specific employee + * Operation deleteEmployeeEarningsTemplateWithHttpInfo + * Deletes an employee's earnings template record * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) - * @param string $leave_id Leave id for single object (required) + * @param string $pay_template_earning_id Id for single pay template earnings object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveObject, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplateObject, HTTP status code, HTTP response headers (array of strings) */ - public function deleteEmployeeLeaveWithHttpInfo($xero_tenant_id, $employee_id, $leave_id) + public function deleteEmployeeEarningsTemplateWithHttpInfo($xero_tenant_id, $employee_id, $pay_template_earning_id) { - $request = $this->deleteEmployeeLeaveRequest($xero_tenant_id, $employee_id, $leave_id); + $request = $this->deleteEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $pay_template_earning_id); try { $options = $this->createHttpClientOption(); try { @@ -5889,18 +6092,18 @@ public function deleteEmployeeLeaveWithHttpInfo($xero_tenant_id, $employee_id, $ $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveObject' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplateObject' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveObject', []), + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplateObject', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveObject'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplateObject'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -5917,7 +6120,7 @@ public function deleteEmployeeLeaveWithHttpInfo($xero_tenant_id, $employee_id, $ case 200: $data = PayrollNzObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveObject', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplateObject', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -5927,17 +6130,17 @@ public function deleteEmployeeLeaveWithHttpInfo($xero_tenant_id, $employee_id, $ } } /** - * Operation deleteEmployeeLeaveAsync - * Deletes a leave record for a specific employee + * Operation deleteEmployeeEarningsTemplateAsync + * Deletes an employee's earnings template record * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) - * @param string $leave_id Leave id for single object (required) + * @param string $pay_template_earning_id Id for single pay template earnings object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function deleteEmployeeLeaveAsync($xero_tenant_id, $employee_id, $leave_id) + public function deleteEmployeeEarningsTemplateAsync($xero_tenant_id, $employee_id, $pay_template_earning_id) { - return $this->deleteEmployeeLeaveAsyncWithHttpInfo($xero_tenant_id, $employee_id, $leave_id) + return $this->deleteEmployeeEarningsTemplateAsyncWithHttpInfo($xero_tenant_id, $employee_id, $pay_template_earning_id) ->then( function ($response) { return $response[0]; @@ -5945,17 +6148,17 @@ function ($response) { ); } /** - * Operation deleteEmployeeLeaveAsyncWithHttpInfo - * Deletes a leave record for a specific employee + * Operation deleteEmployeeEarningsTemplateAsyncWithHttpInfo + * Deletes an employee's earnings template record * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) - * @param string $leave_id Leave id for single object (required) + * @param string $pay_template_earning_id Id for single pay template earnings object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function deleteEmployeeLeaveAsyncWithHttpInfo($xero_tenant_id, $employee_id, $leave_id) + public function deleteEmployeeEarningsTemplateAsyncWithHttpInfo($xero_tenant_id, $employee_id, $pay_template_earning_id) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveObject'; - $request = $this->deleteEmployeeLeaveRequest($xero_tenant_id, $employee_id, $leave_id); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplateObject'; + $request = $this->deleteEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $pay_template_earning_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -5990,33 +6193,33 @@ function ($exception) { } /** - * Create request for operation 'deleteEmployeeLeave' + * Create request for operation 'deleteEmployeeEarningsTemplate' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) - * @param string $leave_id Leave id for single object (required) + * @param string $pay_template_earning_id Id for single pay template earnings object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function deleteEmployeeLeaveRequest($xero_tenant_id, $employee_id, $leave_id) + protected function deleteEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $pay_template_earning_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling deleteEmployeeLeave' + 'Missing the required parameter $xero_tenant_id when calling deleteEmployeeEarningsTemplate' ); } // verify the required parameter 'employee_id' is set if ($employee_id === null || (is_array($employee_id) && count($employee_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $employee_id when calling deleteEmployeeLeave' + 'Missing the required parameter $employee_id when calling deleteEmployeeEarningsTemplate' ); } - // verify the required parameter 'leave_id' is set - if ($leave_id === null || (is_array($leave_id) && count($leave_id) === 0)) { + // verify the required parameter 'pay_template_earning_id' is set + if ($pay_template_earning_id === null || (is_array($pay_template_earning_id) && count($pay_template_earning_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $leave_id when calling deleteEmployeeLeave' + 'Missing the required parameter $pay_template_earning_id when calling deleteEmployeeEarningsTemplate' ); } - $resourcePath = '/Employees/{EmployeeID}/Leave/{LeaveID}'; + $resourcePath = '/Employees/{EmployeeID}/PayTemplates/Earnings/{PayTemplateEarningID}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6035,10 +6238,10 @@ protected function deleteEmployeeLeaveRequest($xero_tenant_id, $employee_id, $le ); } // path params - if ($leave_id !== null) { + if ($pay_template_earning_id !== null) { $resourcePath = str_replace( - '{' . 'LeaveID' . '}', - PayrollNzObjectSerializer::toPathValue($leave_id), + '{' . 'PayTemplateEarningID' . '}', + PayrollNzObjectSerializer::toPathValue($pay_template_earning_id), $resourcePath ); } @@ -6103,33 +6306,33 @@ protected function deleteEmployeeLeaveRequest($xero_tenant_id, $employee_id, $le } /** - * Operation deleteEmployeeSalaryAndWage - * Deletes an employee's salary and wages record + * Operation deleteEmployeeLeave + * Deletes a leave record for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) - * @param string $salary_and_wages_id Id for single salary and wages object (required) + * @param string $leave_id Leave id for single object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWageObject + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveObject */ - public function deleteEmployeeSalaryAndWage($xero_tenant_id, $employee_id, $salary_and_wages_id) + public function deleteEmployeeLeave($xero_tenant_id, $employee_id, $leave_id) { - list($response) = $this->deleteEmployeeSalaryAndWageWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wages_id); + list($response) = $this->deleteEmployeeLeaveWithHttpInfo($xero_tenant_id, $employee_id, $leave_id); return $response; } /** - * Operation deleteEmployeeSalaryAndWageWithHttpInfo - * Deletes an employee's salary and wages record + * Operation deleteEmployeeLeaveWithHttpInfo + * Deletes a leave record for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) - * @param string $salary_and_wages_id Id for single salary and wages object (required) + * @param string $leave_id Leave id for single object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWageObject, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveObject, HTTP status code, HTTP response headers (array of strings) */ - public function deleteEmployeeSalaryAndWageWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wages_id) + public function deleteEmployeeLeaveWithHttpInfo($xero_tenant_id, $employee_id, $leave_id) { - $request = $this->deleteEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id, $salary_and_wages_id); + $request = $this->deleteEmployeeLeaveRequest($xero_tenant_id, $employee_id, $leave_id); try { $options = $this->createHttpClientOption(); try { @@ -6158,18 +6361,18 @@ public function deleteEmployeeSalaryAndWageWithHttpInfo($xero_tenant_id, $employ $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWageObject' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveObject' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWageObject', []), + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveObject', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWageObject'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveObject'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -6186,7 +6389,7 @@ public function deleteEmployeeSalaryAndWageWithHttpInfo($xero_tenant_id, $employ case 200: $data = PayrollNzObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWageObject', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveObject', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -6196,17 +6399,17 @@ public function deleteEmployeeSalaryAndWageWithHttpInfo($xero_tenant_id, $employ } } /** - * Operation deleteEmployeeSalaryAndWageAsync - * Deletes an employee's salary and wages record + * Operation deleteEmployeeLeaveAsync + * Deletes a leave record for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) - * @param string $salary_and_wages_id Id for single salary and wages object (required) + * @param string $leave_id Leave id for single object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function deleteEmployeeSalaryAndWageAsync($xero_tenant_id, $employee_id, $salary_and_wages_id) + public function deleteEmployeeLeaveAsync($xero_tenant_id, $employee_id, $leave_id) { - return $this->deleteEmployeeSalaryAndWageAsyncWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wages_id) + return $this->deleteEmployeeLeaveAsyncWithHttpInfo($xero_tenant_id, $employee_id, $leave_id) ->then( function ($response) { return $response[0]; @@ -6214,17 +6417,17 @@ function ($response) { ); } /** - * Operation deleteEmployeeSalaryAndWageAsyncWithHttpInfo - * Deletes an employee's salary and wages record + * Operation deleteEmployeeLeaveAsyncWithHttpInfo + * Deletes a leave record for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) - * @param string $salary_and_wages_id Id for single salary and wages object (required) + * @param string $leave_id Leave id for single object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function deleteEmployeeSalaryAndWageAsyncWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wages_id) + public function deleteEmployeeLeaveAsyncWithHttpInfo($xero_tenant_id, $employee_id, $leave_id) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWageObject'; - $request = $this->deleteEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id, $salary_and_wages_id); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveObject'; + $request = $this->deleteEmployeeLeaveRequest($xero_tenant_id, $employee_id, $leave_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -6259,33 +6462,33 @@ function ($exception) { } /** - * Create request for operation 'deleteEmployeeSalaryAndWage' + * Create request for operation 'deleteEmployeeLeave' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) - * @param string $salary_and_wages_id Id for single salary and wages object (required) + * @param string $leave_id Leave id for single object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function deleteEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id, $salary_and_wages_id) + protected function deleteEmployeeLeaveRequest($xero_tenant_id, $employee_id, $leave_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling deleteEmployeeSalaryAndWage' + 'Missing the required parameter $xero_tenant_id when calling deleteEmployeeLeave' ); } // verify the required parameter 'employee_id' is set if ($employee_id === null || (is_array($employee_id) && count($employee_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $employee_id when calling deleteEmployeeSalaryAndWage' + 'Missing the required parameter $employee_id when calling deleteEmployeeLeave' ); } - // verify the required parameter 'salary_and_wages_id' is set - if ($salary_and_wages_id === null || (is_array($salary_and_wages_id) && count($salary_and_wages_id) === 0)) { + // verify the required parameter 'leave_id' is set + if ($leave_id === null || (is_array($leave_id) && count($leave_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $salary_and_wages_id when calling deleteEmployeeSalaryAndWage' + 'Missing the required parameter $leave_id when calling deleteEmployeeLeave' ); } - $resourcePath = '/Employees/{EmployeeID}/SalaryAndWages/{SalaryAndWagesID}'; + $resourcePath = '/Employees/{EmployeeID}/Leave/{LeaveID}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6304,10 +6507,10 @@ protected function deleteEmployeeSalaryAndWageRequest($xero_tenant_id, $employee ); } // path params - if ($salary_and_wages_id !== null) { + if ($leave_id !== null) { $resourcePath = str_replace( - '{' . 'SalaryAndWagesID' . '}', - PayrollNzObjectSerializer::toPathValue($salary_and_wages_id), + '{' . 'LeaveID' . '}', + PayrollNzObjectSerializer::toPathValue($leave_id), $resourcePath ); } @@ -6372,31 +6575,33 @@ protected function deleteEmployeeSalaryAndWageRequest($xero_tenant_id, $employee } /** - * Operation deleteTimesheet - * Deletes a timesheet + * Operation deleteEmployeeSalaryAndWage + * Deletes an employee's salary and wages record * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $timesheet_id Identifier for the timesheet (required) + * @param string $employee_id Employee id for single object (required) + * @param string $salary_and_wages_id Id for single salary and wages object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWageObject */ - public function deleteTimesheet($xero_tenant_id, $timesheet_id) + public function deleteEmployeeSalaryAndWage($xero_tenant_id, $employee_id, $salary_and_wages_id) { - list($response) = $this->deleteTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id); + list($response) = $this->deleteEmployeeSalaryAndWageWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wages_id); return $response; } /** - * Operation deleteTimesheetWithHttpInfo - * Deletes a timesheet + * Operation deleteEmployeeSalaryAndWageWithHttpInfo + * Deletes an employee's salary and wages record * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $timesheet_id Identifier for the timesheet (required) + * @param string $employee_id Employee id for single object (required) + * @param string $salary_and_wages_id Id for single salary and wages object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWageObject, HTTP status code, HTTP response headers (array of strings) */ - public function deleteTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id) + public function deleteEmployeeSalaryAndWageWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wages_id) { - $request = $this->deleteTimesheetRequest($xero_tenant_id, $timesheet_id); + $request = $this->deleteEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id, $salary_and_wages_id); try { $options = $this->createHttpClientOption(); try { @@ -6425,29 +6630,18 @@ public function deleteTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - } - return [ - PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWageObject' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem', []), + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWageObject', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWageObject'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -6464,15 +6658,7 @@ public function deleteTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id) case 200: $data = PayrollNzObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = PayrollNzObjectSerializer::deserialize( - $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWageObject', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -6482,16 +6668,17 @@ public function deleteTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id) } } /** - * Operation deleteTimesheetAsync - * Deletes a timesheet + * Operation deleteEmployeeSalaryAndWageAsync + * Deletes an employee's salary and wages record * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $timesheet_id Identifier for the timesheet (required) + * @param string $employee_id Employee id for single object (required) + * @param string $salary_and_wages_id Id for single salary and wages object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function deleteTimesheetAsync($xero_tenant_id, $timesheet_id) + public function deleteEmployeeSalaryAndWageAsync($xero_tenant_id, $employee_id, $salary_and_wages_id) { - return $this->deleteTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet_id) + return $this->deleteEmployeeSalaryAndWageAsyncWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wages_id) ->then( function ($response) { return $response[0]; @@ -6499,16 +6686,17 @@ function ($response) { ); } /** - * Operation deleteTimesheetAsyncWithHttpInfo - * Deletes a timesheet + * Operation deleteEmployeeSalaryAndWageAsyncWithHttpInfo + * Deletes an employee's salary and wages record * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $timesheet_id Identifier for the timesheet (required) + * @param string $employee_id Employee id for single object (required) + * @param string $salary_and_wages_id Id for single salary and wages object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function deleteTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet_id) + public function deleteEmployeeSalaryAndWageAsyncWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wages_id) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine'; - $request = $this->deleteTimesheetRequest($xero_tenant_id, $timesheet_id); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWageObject'; + $request = $this->deleteEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id, $salary_and_wages_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -6543,26 +6731,33 @@ function ($exception) { } /** - * Create request for operation 'deleteTimesheet' + * Create request for operation 'deleteEmployeeSalaryAndWage' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $timesheet_id Identifier for the timesheet (required) + * @param string $employee_id Employee id for single object (required) + * @param string $salary_and_wages_id Id for single salary and wages object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function deleteTimesheetRequest($xero_tenant_id, $timesheet_id) + protected function deleteEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id, $salary_and_wages_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling deleteTimesheet' + 'Missing the required parameter $xero_tenant_id when calling deleteEmployeeSalaryAndWage' ); } - // verify the required parameter 'timesheet_id' is set - if ($timesheet_id === null || (is_array($timesheet_id) && count($timesheet_id) === 0)) { + // verify the required parameter 'employee_id' is set + if ($employee_id === null || (is_array($employee_id) && count($employee_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $timesheet_id when calling deleteTimesheet' + 'Missing the required parameter $employee_id when calling deleteEmployeeSalaryAndWage' ); } - $resourcePath = '/Timesheets/{TimesheetID}'; + // verify the required parameter 'salary_and_wages_id' is set + if ($salary_and_wages_id === null || (is_array($salary_and_wages_id) && count($salary_and_wages_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $salary_and_wages_id when calling deleteEmployeeSalaryAndWage' + ); + } + $resourcePath = '/Employees/{EmployeeID}/SalaryAndWages/{SalaryAndWagesID}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6573,10 +6768,18 @@ protected function deleteTimesheetRequest($xero_tenant_id, $timesheet_id) $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); } // path params - if ($timesheet_id !== null) { + if ($employee_id !== null) { $resourcePath = str_replace( - '{' . 'TimesheetID' . '}', - PayrollNzObjectSerializer::toPathValue($timesheet_id), + '{' . 'EmployeeID' . '}', + PayrollNzObjectSerializer::toPathValue($employee_id), + $resourcePath + ); + } + // path params + if ($salary_and_wages_id !== null) { + $resourcePath = str_replace( + '{' . 'SalaryAndWagesID' . '}', + PayrollNzObjectSerializer::toPathValue($salary_and_wages_id), $resourcePath ); } @@ -6641,33 +6844,33 @@ protected function deleteTimesheetRequest($xero_tenant_id, $timesheet_id) } /** - * Operation deleteTimesheetLine - * Deletes a timesheet line for a specific timesheet + * Operation deleteEmployeeWorkingPattern + * deletes employee's working patterns * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $timesheet_id Identifier for the timesheet (required) - * @param string $timesheet_line_id Identifier for the timesheet line (required) + * @param string $employee_id Employee id for single object (required) + * @param string $employee_working_pattern_id Employee working pattern id for single object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function deleteTimesheetLine($xero_tenant_id, $timesheet_id, $timesheet_line_id) + public function deleteEmployeeWorkingPattern($xero_tenant_id, $employee_id, $employee_working_pattern_id) { - list($response) = $this->deleteTimesheetLineWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line_id); + list($response) = $this->deleteEmployeeWorkingPatternWithHttpInfo($xero_tenant_id, $employee_id, $employee_working_pattern_id); return $response; } /** - * Operation deleteTimesheetLineWithHttpInfo - * Deletes a timesheet line for a specific timesheet + * Operation deleteEmployeeWorkingPatternWithHttpInfo + * deletes employee's working patterns * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $timesheet_id Identifier for the timesheet (required) - * @param string $timesheet_line_id Identifier for the timesheet line (required) + * @param string $employee_id Employee id for single object (required) + * @param string $employee_working_pattern_id Employee working pattern id for single object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function deleteTimesheetLineWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line_id) + public function deleteEmployeeWorkingPatternWithHttpInfo($xero_tenant_id, $employee_id, $employee_working_pattern_id) { - $request = $this->deleteTimesheetLineRequest($xero_tenant_id, $timesheet_id, $timesheet_line_id); + $request = $this->deleteEmployeeWorkingPatternRequest($xero_tenant_id, $employee_id, $employee_working_pattern_id); try { $options = $this->createHttpClientOption(); try { @@ -6696,13 +6899,13 @@ public function deleteTimesheetLineWithHttpInfo($xero_tenant_id, $timesheet_id, $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveObject' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine', []), + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveObject', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -6718,7 +6921,7 @@ public function deleteTimesheetLineWithHttpInfo($xero_tenant_id, $timesheet_id, $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveObject'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -6735,7 +6938,7 @@ public function deleteTimesheetLineWithHttpInfo($xero_tenant_id, $timesheet_id, case 200: $data = PayrollNzObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveObject', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -6753,17 +6956,17 @@ public function deleteTimesheetLineWithHttpInfo($xero_tenant_id, $timesheet_id, } } /** - * Operation deleteTimesheetLineAsync - * Deletes a timesheet line for a specific timesheet + * Operation deleteEmployeeWorkingPatternAsync + * deletes employee's working patterns * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $timesheet_id Identifier for the timesheet (required) - * @param string $timesheet_line_id Identifier for the timesheet line (required) + * @param string $employee_id Employee id for single object (required) + * @param string $employee_working_pattern_id Employee working pattern id for single object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function deleteTimesheetLineAsync($xero_tenant_id, $timesheet_id, $timesheet_line_id) + public function deleteEmployeeWorkingPatternAsync($xero_tenant_id, $employee_id, $employee_working_pattern_id) { - return $this->deleteTimesheetLineAsyncWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line_id) + return $this->deleteEmployeeWorkingPatternAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_working_pattern_id) ->then( function ($response) { return $response[0]; @@ -6771,17 +6974,17 @@ function ($response) { ); } /** - * Operation deleteTimesheetLineAsyncWithHttpInfo - * Deletes a timesheet line for a specific timesheet + * Operation deleteEmployeeWorkingPatternAsyncWithHttpInfo + * deletes employee's working patterns * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $timesheet_id Identifier for the timesheet (required) - * @param string $timesheet_line_id Identifier for the timesheet line (required) + * @param string $employee_id Employee id for single object (required) + * @param string $employee_working_pattern_id Employee working pattern id for single object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function deleteTimesheetLineAsyncWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line_id) + public function deleteEmployeeWorkingPatternAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_working_pattern_id) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine'; - $request = $this->deleteTimesheetLineRequest($xero_tenant_id, $timesheet_id, $timesheet_line_id); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveObject'; + $request = $this->deleteEmployeeWorkingPatternRequest($xero_tenant_id, $employee_id, $employee_working_pattern_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -6816,33 +7019,33 @@ function ($exception) { } /** - * Create request for operation 'deleteTimesheetLine' + * Create request for operation 'deleteEmployeeWorkingPattern' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $timesheet_id Identifier for the timesheet (required) - * @param string $timesheet_line_id Identifier for the timesheet line (required) + * @param string $employee_id Employee id for single object (required) + * @param string $employee_working_pattern_id Employee working pattern id for single object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function deleteTimesheetLineRequest($xero_tenant_id, $timesheet_id, $timesheet_line_id) + protected function deleteEmployeeWorkingPatternRequest($xero_tenant_id, $employee_id, $employee_working_pattern_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling deleteTimesheetLine' + 'Missing the required parameter $xero_tenant_id when calling deleteEmployeeWorkingPattern' ); } - // verify the required parameter 'timesheet_id' is set - if ($timesheet_id === null || (is_array($timesheet_id) && count($timesheet_id) === 0)) { + // verify the required parameter 'employee_id' is set + if ($employee_id === null || (is_array($employee_id) && count($employee_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $timesheet_id when calling deleteTimesheetLine' + 'Missing the required parameter $employee_id when calling deleteEmployeeWorkingPattern' ); } - // verify the required parameter 'timesheet_line_id' is set - if ($timesheet_line_id === null || (is_array($timesheet_line_id) && count($timesheet_line_id) === 0)) { + // verify the required parameter 'employee_working_pattern_id' is set + if ($employee_working_pattern_id === null || (is_array($employee_working_pattern_id) && count($employee_working_pattern_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $timesheet_line_id when calling deleteTimesheetLine' + 'Missing the required parameter $employee_working_pattern_id when calling deleteEmployeeWorkingPattern' ); } - $resourcePath = '/Timesheets/{TimesheetID}/Lines/{TimesheetLineID}'; + $resourcePath = '/Employees/{EmployeeID}/Working-Patterns/{EmployeeWorkingPatternID}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6853,18 +7056,18 @@ protected function deleteTimesheetLineRequest($xero_tenant_id, $timesheet_id, $t $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); } // path params - if ($timesheet_id !== null) { + if ($employee_id !== null) { $resourcePath = str_replace( - '{' . 'TimesheetID' . '}', - PayrollNzObjectSerializer::toPathValue($timesheet_id), + '{' . 'EmployeeID' . '}', + PayrollNzObjectSerializer::toPathValue($employee_id), $resourcePath ); } // path params - if ($timesheet_line_id !== null) { + if ($employee_working_pattern_id !== null) { $resourcePath = str_replace( - '{' . 'TimesheetLineID' . '}', - PayrollNzObjectSerializer::toPathValue($timesheet_line_id), + '{' . 'EmployeeWorkingPatternID' . '}', + PayrollNzObjectSerializer::toPathValue($employee_working_pattern_id), $resourcePath ); } @@ -6929,31 +7132,31 @@ protected function deleteTimesheetLineRequest($xero_tenant_id, $timesheet_id, $t } /** - * Operation getDeduction - * Retrieves a single deduction by using a unique deduction ID + * Operation deleteTimesheet + * Deletes a timesheet * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $deduction_id Identifier for the deduction (required) + * @param string $timesheet_id Identifier for the timesheet (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\DeductionObject + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function getDeduction($xero_tenant_id, $deduction_id) + public function deleteTimesheet($xero_tenant_id, $timesheet_id) { - list($response) = $this->getDeductionWithHttpInfo($xero_tenant_id, $deduction_id); + list($response) = $this->deleteTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id); return $response; } /** - * Operation getDeductionWithHttpInfo - * Retrieves a single deduction by using a unique deduction ID + * Operation deleteTimesheetWithHttpInfo + * Deletes a timesheet * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $deduction_id Identifier for the deduction (required) + * @param string $timesheet_id Identifier for the timesheet (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\DeductionObject, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function getDeductionWithHttpInfo($xero_tenant_id, $deduction_id) + public function deleteTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id) { - $request = $this->getDeductionRequest($xero_tenant_id, $deduction_id); + $request = $this->deleteTimesheetRequest($xero_tenant_id, $timesheet_id); try { $options = $this->createHttpClientOption(); try { @@ -6982,18 +7185,29 @@ public function getDeductionWithHttpInfo($xero_tenant_id, $deduction_id) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\DeductionObject' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\DeductionObject', []), + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\DeductionObject'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -7010,7 +7224,15 @@ public function getDeductionWithHttpInfo($xero_tenant_id, $deduction_id) case 200: $data = PayrollNzObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\DeductionObject', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = PayrollNzObjectSerializer::deserialize( + $e->getResponseBody(), + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -7020,16 +7242,16 @@ public function getDeductionWithHttpInfo($xero_tenant_id, $deduction_id) } } /** - * Operation getDeductionAsync - * Retrieves a single deduction by using a unique deduction ID + * Operation deleteTimesheetAsync + * Deletes a timesheet * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $deduction_id Identifier for the deduction (required) + * @param string $timesheet_id Identifier for the timesheet (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getDeductionAsync($xero_tenant_id, $deduction_id) + public function deleteTimesheetAsync($xero_tenant_id, $timesheet_id) { - return $this->getDeductionAsyncWithHttpInfo($xero_tenant_id, $deduction_id) + return $this->deleteTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet_id) ->then( function ($response) { return $response[0]; @@ -7037,16 +7259,16 @@ function ($response) { ); } /** - * Operation getDeductionAsyncWithHttpInfo - * Retrieves a single deduction by using a unique deduction ID + * Operation deleteTimesheetAsyncWithHttpInfo + * Deletes a timesheet * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $deduction_id Identifier for the deduction (required) + * @param string $timesheet_id Identifier for the timesheet (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getDeductionAsyncWithHttpInfo($xero_tenant_id, $deduction_id) + public function deleteTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet_id) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\DeductionObject'; - $request = $this->getDeductionRequest($xero_tenant_id, $deduction_id); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine'; + $request = $this->deleteTimesheetRequest($xero_tenant_id, $timesheet_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -7081,26 +7303,26 @@ function ($exception) { } /** - * Create request for operation 'getDeduction' + * Create request for operation 'deleteTimesheet' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $deduction_id Identifier for the deduction (required) + * @param string $timesheet_id Identifier for the timesheet (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getDeductionRequest($xero_tenant_id, $deduction_id) + protected function deleteTimesheetRequest($xero_tenant_id, $timesheet_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getDeduction' + 'Missing the required parameter $xero_tenant_id when calling deleteTimesheet' ); } - // verify the required parameter 'deduction_id' is set - if ($deduction_id === null || (is_array($deduction_id) && count($deduction_id) === 0)) { + // verify the required parameter 'timesheet_id' is set + if ($timesheet_id === null || (is_array($timesheet_id) && count($timesheet_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $deduction_id when calling getDeduction' + 'Missing the required parameter $timesheet_id when calling deleteTimesheet' ); } - $resourcePath = '/Deductions/{deductionId}'; + $resourcePath = '/Timesheets/{TimesheetID}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -7111,10 +7333,10 @@ protected function getDeductionRequest($xero_tenant_id, $deduction_id) $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); } // path params - if ($deduction_id !== null) { + if ($timesheet_id !== null) { $resourcePath = str_replace( - '{' . 'deductionId' . '}', - PayrollNzObjectSerializer::toPathValue($deduction_id), + '{' . 'TimesheetID' . '}', + PayrollNzObjectSerializer::toPathValue($timesheet_id), $resourcePath ); } @@ -7171,7 +7393,7 @@ protected function getDeductionRequest($xero_tenant_id, $deduction_id) ); $query = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Query::build($queryParams); return new Request( - 'GET', + 'DELETE', $this->config->getHostPayrollNz() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -7179,31 +7401,33 @@ protected function getDeductionRequest($xero_tenant_id, $deduction_id) } /** - * Operation getDeductions - * Retrieves deductions for a specific employee + * Operation deleteTimesheetLine + * Deletes a timesheet line for a specific timesheet * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param int $page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. (optional) + * @param string $timesheet_id Identifier for the timesheet (required) + * @param string $timesheet_line_id Identifier for the timesheet line (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Deductions + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function getDeductions($xero_tenant_id, $page = null) + public function deleteTimesheetLine($xero_tenant_id, $timesheet_id, $timesheet_line_id) { - list($response) = $this->getDeductionsWithHttpInfo($xero_tenant_id, $page); + list($response) = $this->deleteTimesheetLineWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line_id); return $response; } /** - * Operation getDeductionsWithHttpInfo - * Retrieves deductions for a specific employee + * Operation deleteTimesheetLineWithHttpInfo + * Deletes a timesheet line for a specific timesheet * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param int $page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. (optional) + * @param string $timesheet_id Identifier for the timesheet (required) + * @param string $timesheet_line_id Identifier for the timesheet line (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\Deductions, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function getDeductionsWithHttpInfo($xero_tenant_id, $page = null) + public function deleteTimesheetLineWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line_id) { - $request = $this->getDeductionsRequest($xero_tenant_id, $page); + $request = $this->deleteTimesheetLineRequest($xero_tenant_id, $timesheet_id, $timesheet_line_id); try { $options = $this->createHttpClientOption(); try { @@ -7232,18 +7456,1044 @@ public function getDeductionsWithHttpInfo($xero_tenant_id, $page = null) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Deductions' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + PayrollNzObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = PayrollNzObjectSerializer::deserialize( + $e->getResponseBody(), + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = PayrollNzObjectSerializer::deserialize( + $e->getResponseBody(), + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + /** + * Operation deleteTimesheetLineAsync + * Deletes a timesheet line for a specific timesheet + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $timesheet_id Identifier for the timesheet (required) + * @param string $timesheet_line_id Identifier for the timesheet line (required) + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface + */ + public function deleteTimesheetLineAsync($xero_tenant_id, $timesheet_id, $timesheet_line_id) + { + return $this->deleteTimesheetLineAsyncWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + /** + * Operation deleteTimesheetLineAsyncWithHttpInfo + * Deletes a timesheet line for a specific timesheet + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $timesheet_id Identifier for the timesheet (required) + * @param string $timesheet_line_id Identifier for the timesheet line (required) + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ + public function deleteTimesheetLineAsyncWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line_id) + { + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine'; + $request = $this->deleteTimesheetLineRequest($xero_tenant_id, $timesheet_id, $timesheet_line_id); + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + PayrollNzObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'deleteTimesheetLine' + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $timesheet_id Identifier for the timesheet (required) + * @param string $timesheet_line_id Identifier for the timesheet line (required) + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ + protected function deleteTimesheetLineRequest($xero_tenant_id, $timesheet_id, $timesheet_line_id) + { + // verify the required parameter 'xero_tenant_id' is set + if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $xero_tenant_id when calling deleteTimesheetLine' + ); + } + // verify the required parameter 'timesheet_id' is set + if ($timesheet_id === null || (is_array($timesheet_id) && count($timesheet_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $timesheet_id when calling deleteTimesheetLine' + ); + } + // verify the required parameter 'timesheet_line_id' is set + if ($timesheet_line_id === null || (is_array($timesheet_line_id) && count($timesheet_line_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $timesheet_line_id when calling deleteTimesheetLine' + ); + } + $resourcePath = '/Timesheets/{TimesheetID}/Lines/{TimesheetLineID}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + // header params + if ($xero_tenant_id !== null) { + $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); + } + // path params + if ($timesheet_id !== null) { + $resourcePath = str_replace( + '{' . 'TimesheetID' . '}', + PayrollNzObjectSerializer::toPathValue($timesheet_id), + $resourcePath + ); + } + // path params + if ($timesheet_line_id !== null) { + $resourcePath = str_replace( + '{' . 'TimesheetLineID' . '}', + PayrollNzObjectSerializer::toPathValue($timesheet_line_id), + $resourcePath + ); + } + // body params + $_tempBody = null; + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\json_encode(PayrollNzObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = [ + [ + 'Content-type' => 'multipart/form-data', + ] + ]; + + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\json_encode($formParams); + } else { + // for HTTP post (form) + $httpBody = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Query::build($formParams); + } + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + $query = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'DELETE', + $this->config->getHostPayrollNz() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDeduction + * Retrieves a single deduction by using a unique deduction ID + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $deduction_id Identifier for the deduction (required) + * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\DeductionObject + */ + public function getDeduction($xero_tenant_id, $deduction_id) + { + list($response) = $this->getDeductionWithHttpInfo($xero_tenant_id, $deduction_id); + return $response; + } + /** + * Operation getDeductionWithHttpInfo + * Retrieves a single deduction by using a unique deduction ID + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $deduction_id Identifier for the deduction (required) + * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\DeductionObject, HTTP status code, HTTP response headers (array of strings) + */ + public function getDeductionWithHttpInfo($xero_tenant_id, $deduction_id) + { + $request = $this->getDeductionRequest($xero_tenant_id, $deduction_id); + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + $statusCode = $response->getStatusCode(); + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\DeductionObject' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\DeductionObject', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\DeductionObject'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + PayrollNzObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = PayrollNzObjectSerializer::deserialize( + $e->getResponseBody(), + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\DeductionObject', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + /** + * Operation getDeductionAsync + * Retrieves a single deduction by using a unique deduction ID + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $deduction_id Identifier for the deduction (required) + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface + */ + public function getDeductionAsync($xero_tenant_id, $deduction_id) + { + return $this->getDeductionAsyncWithHttpInfo($xero_tenant_id, $deduction_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + /** + * Operation getDeductionAsyncWithHttpInfo + * Retrieves a single deduction by using a unique deduction ID + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $deduction_id Identifier for the deduction (required) + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ + public function getDeductionAsyncWithHttpInfo($xero_tenant_id, $deduction_id) + { + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\DeductionObject'; + $request = $this->getDeductionRequest($xero_tenant_id, $deduction_id); + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + PayrollNzObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDeduction' + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $deduction_id Identifier for the deduction (required) + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ + protected function getDeductionRequest($xero_tenant_id, $deduction_id) + { + // verify the required parameter 'xero_tenant_id' is set + if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $xero_tenant_id when calling getDeduction' + ); + } + // verify the required parameter 'deduction_id' is set + if ($deduction_id === null || (is_array($deduction_id) && count($deduction_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $deduction_id when calling getDeduction' + ); + } + $resourcePath = '/Deductions/{deductionId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + // header params + if ($xero_tenant_id !== null) { + $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); + } + // path params + if ($deduction_id !== null) { + $resourcePath = str_replace( + '{' . 'deductionId' . '}', + PayrollNzObjectSerializer::toPathValue($deduction_id), + $resourcePath + ); + } + // body params + $_tempBody = null; + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\json_encode(PayrollNzObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = [ + [ + 'Content-type' => 'multipart/form-data', + ] + ]; + + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\json_encode($formParams); + } else { + // for HTTP post (form) + $httpBody = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Query::build($formParams); + } + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + $query = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHostPayrollNz() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getDeductions + * Retrieves deductions for a specific employee + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param int $page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. (optional) + * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Deductions + */ + public function getDeductions($xero_tenant_id, $page = null) + { + list($response) = $this->getDeductionsWithHttpInfo($xero_tenant_id, $page); + return $response; + } + /** + * Operation getDeductionsWithHttpInfo + * Retrieves deductions for a specific employee + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param int $page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. (optional) + * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\Deductions, HTTP status code, HTTP response headers (array of strings) + */ + public function getDeductionsWithHttpInfo($xero_tenant_id, $page = null) + { + $request = $this->getDeductionsRequest($xero_tenant_id, $page); + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + $statusCode = $response->getStatusCode(); + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Deductions' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Deductions', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Deductions'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + PayrollNzObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = PayrollNzObjectSerializer::deserialize( + $e->getResponseBody(), + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Deductions', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + /** + * Operation getDeductionsAsync + * Retrieves deductions for a specific employee + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param int $page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. (optional) + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface + */ + public function getDeductionsAsync($xero_tenant_id, $page = null) + { + return $this->getDeductionsAsyncWithHttpInfo($xero_tenant_id, $page) + ->then( + function ($response) { + return $response[0]; + } + ); + } + /** + * Operation getDeductionsAsyncWithHttpInfo + * Retrieves deductions for a specific employee + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param int $page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. (optional) + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ + public function getDeductionsAsyncWithHttpInfo($xero_tenant_id, $page = null) + { + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Deductions'; + $request = $this->getDeductionsRequest($xero_tenant_id, $page); + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + PayrollNzObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getDeductions' + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param int $page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. (optional) + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ + protected function getDeductionsRequest($xero_tenant_id, $page = null) + { + // verify the required parameter 'xero_tenant_id' is set + if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $xero_tenant_id when calling getDeductions' + ); + } + $resourcePath = '/Deductions'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + // query params + if ($page !== null) { + $queryParams['page'] = PayrollNzObjectSerializer::toQueryValue($page); + } + // header params + if ($xero_tenant_id !== null) { + $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); + } + // body params + $_tempBody = null; + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\json_encode(PayrollNzObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = [ + [ + 'Content-type' => 'multipart/form-data', + ] + ]; + + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\json_encode($formParams); + } else { + // for HTTP post (form) + $httpBody = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Query::build($formParams); + } + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + $query = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHostPayrollNz() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getEarningsRate + * Retrieves a specific earnings rates by using a unique earnings rate id + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $earnings_rate_id Identifier for the earnings rate (required) + * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsRateObject + */ + public function getEarningsRate($xero_tenant_id, $earnings_rate_id) + { + list($response) = $this->getEarningsRateWithHttpInfo($xero_tenant_id, $earnings_rate_id); + return $response; + } + /** + * Operation getEarningsRateWithHttpInfo + * Retrieves a specific earnings rates by using a unique earnings rate id + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $earnings_rate_id Identifier for the earnings rate (required) + * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EarningsRateObject, HTTP status code, HTTP response headers (array of strings) + */ + public function getEarningsRateWithHttpInfo($xero_tenant_id, $earnings_rate_id) + { + $request = $this->getEarningsRateRequest($xero_tenant_id, $earnings_rate_id); + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + $statusCode = $response->getStatusCode(); + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsRateObject' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsRateObject', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsRateObject'; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + PayrollNzObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = PayrollNzObjectSerializer::deserialize( + $e->getResponseBody(), + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsRateObject', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + /** + * Operation getEarningsRateAsync + * Retrieves a specific earnings rates by using a unique earnings rate id + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $earnings_rate_id Identifier for the earnings rate (required) + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface + */ + public function getEarningsRateAsync($xero_tenant_id, $earnings_rate_id) + { + return $this->getEarningsRateAsyncWithHttpInfo($xero_tenant_id, $earnings_rate_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + /** + * Operation getEarningsRateAsyncWithHttpInfo + * Retrieves a specific earnings rates by using a unique earnings rate id + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $earnings_rate_id Identifier for the earnings rate (required) + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ + public function getEarningsRateAsyncWithHttpInfo($xero_tenant_id, $earnings_rate_id) + { + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsRateObject'; + $request = $this->getEarningsRateRequest($xero_tenant_id, $earnings_rate_id); + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + PayrollNzObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getEarningsRate' + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param string $earnings_rate_id Identifier for the earnings rate (required) + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ + protected function getEarningsRateRequest($xero_tenant_id, $earnings_rate_id) + { + // verify the required parameter 'xero_tenant_id' is set + if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $xero_tenant_id when calling getEarningsRate' + ); + } + // verify the required parameter 'earnings_rate_id' is set + if ($earnings_rate_id === null || (is_array($earnings_rate_id) && count($earnings_rate_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $earnings_rate_id when calling getEarningsRate' + ); + } + $resourcePath = '/EarningsRates/{EarningsRateID}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + // header params + if ($xero_tenant_id !== null) { + $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); + } + // path params + if ($earnings_rate_id !== null) { + $resourcePath = str_replace( + '{' . 'EarningsRateID' . '}', + PayrollNzObjectSerializer::toPathValue($earnings_rate_id), + $resourcePath + ); + } + // body params + $_tempBody = null; + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\json_encode(PayrollNzObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = [ + [ + 'Content-type' => 'multipart/form-data', + ] + ]; + + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\json_encode($formParams); + } else { + // for HTTP post (form) + $httpBody = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Query::build($formParams); + } + } + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + $query = \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + 'GET', + $this->config->getHostPayrollNz() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getEarningsRates + * Retrieves earnings rates + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param int $page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. (optional) + * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsRates + */ + public function getEarningsRates($xero_tenant_id, $page = null) + { + list($response) = $this->getEarningsRatesWithHttpInfo($xero_tenant_id, $page); + return $response; + } + /** + * Operation getEarningsRatesWithHttpInfo + * Retrieves earnings rates + * @param string $xero_tenant_id Xero identifier for Tenant (required) + * @param int $page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. (optional) + * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EarningsRates, HTTP status code, HTTP response headers (array of strings) + */ + public function getEarningsRatesWithHttpInfo($xero_tenant_id, $page = null) + { + $request = $this->getEarningsRatesRequest($xero_tenant_id, $page); + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + $statusCode = $response->getStatusCode(); + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + $responseBody = $response->getBody(); + switch($statusCode) { + case 200: + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsRates' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Deductions', []), + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsRates', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Deductions'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsRates'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -7260,7 +8510,7 @@ public function getDeductionsWithHttpInfo($xero_tenant_id, $page = null) case 200: $data = PayrollNzObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Deductions', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsRates', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -7270,16 +8520,16 @@ public function getDeductionsWithHttpInfo($xero_tenant_id, $page = null) } } /** - * Operation getDeductionsAsync - * Retrieves deductions for a specific employee + * Operation getEarningsRatesAsync + * Retrieves earnings rates * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param int $page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getDeductionsAsync($xero_tenant_id, $page = null) + public function getEarningsRatesAsync($xero_tenant_id, $page = null) { - return $this->getDeductionsAsyncWithHttpInfo($xero_tenant_id, $page) + return $this->getEarningsRatesAsyncWithHttpInfo($xero_tenant_id, $page) ->then( function ($response) { return $response[0]; @@ -7287,16 +8537,16 @@ function ($response) { ); } /** - * Operation getDeductionsAsyncWithHttpInfo - * Retrieves deductions for a specific employee + * Operation getEarningsRatesAsyncWithHttpInfo + * Retrieves earnings rates * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param int $page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getDeductionsAsyncWithHttpInfo($xero_tenant_id, $page = null) + public function getEarningsRatesAsyncWithHttpInfo($xero_tenant_id, $page = null) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Deductions'; - $request = $this->getDeductionsRequest($xero_tenant_id, $page); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsRates'; + $request = $this->getEarningsRatesRequest($xero_tenant_id, $page); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -7331,20 +8581,20 @@ function ($exception) { } /** - * Create request for operation 'getDeductions' + * Create request for operation 'getEarningsRates' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param int $page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getDeductionsRequest($xero_tenant_id, $page = null) + protected function getEarningsRatesRequest($xero_tenant_id, $page = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getDeductions' + 'Missing the required parameter $xero_tenant_id when calling getEarningsRates' ); } - $resourcePath = '/Deductions'; + $resourcePath = '/EarningsRates'; $formParams = []; $queryParams = []; $headerParams = []; @@ -7419,31 +8669,31 @@ protected function getDeductionsRequest($xero_tenant_id, $page = null) } /** - * Operation getEarningsRate - * Retrieves a specific earnings rates by using a unique earnings rate id + * Operation getEmployee + * Retrieves an employees using a unique employee ID * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $earnings_rate_id Identifier for the earnings rate (required) + * @param string $employee_id Employee id for single object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsRateObject + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeObject */ - public function getEarningsRate($xero_tenant_id, $earnings_rate_id) + public function getEmployee($xero_tenant_id, $employee_id) { - list($response) = $this->getEarningsRateWithHttpInfo($xero_tenant_id, $earnings_rate_id); + list($response) = $this->getEmployeeWithHttpInfo($xero_tenant_id, $employee_id); return $response; } /** - * Operation getEarningsRateWithHttpInfo - * Retrieves a specific earnings rates by using a unique earnings rate id + * Operation getEmployeeWithHttpInfo + * Retrieves an employees using a unique employee ID * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $earnings_rate_id Identifier for the earnings rate (required) + * @param string $employee_id Employee id for single object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EarningsRateObject, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EmployeeObject, HTTP status code, HTTP response headers (array of strings) */ - public function getEarningsRateWithHttpInfo($xero_tenant_id, $earnings_rate_id) + public function getEmployeeWithHttpInfo($xero_tenant_id, $employee_id) { - $request = $this->getEarningsRateRequest($xero_tenant_id, $earnings_rate_id); + $request = $this->getEmployeeRequest($xero_tenant_id, $employee_id); try { $options = $this->createHttpClientOption(); try { @@ -7472,18 +8722,18 @@ public function getEarningsRateWithHttpInfo($xero_tenant_id, $earnings_rate_id) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsRateObject' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeObject' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsRateObject', []), + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeObject', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsRateObject'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeObject'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -7500,7 +8750,7 @@ public function getEarningsRateWithHttpInfo($xero_tenant_id, $earnings_rate_id) case 200: $data = PayrollNzObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsRateObject', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeObject', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -7510,16 +8760,16 @@ public function getEarningsRateWithHttpInfo($xero_tenant_id, $earnings_rate_id) } } /** - * Operation getEarningsRateAsync - * Retrieves a specific earnings rates by using a unique earnings rate id + * Operation getEmployeeAsync + * Retrieves an employees using a unique employee ID * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $earnings_rate_id Identifier for the earnings rate (required) + * @param string $employee_id Employee id for single object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getEarningsRateAsync($xero_tenant_id, $earnings_rate_id) + public function getEmployeeAsync($xero_tenant_id, $employee_id) { - return $this->getEarningsRateAsyncWithHttpInfo($xero_tenant_id, $earnings_rate_id) + return $this->getEmployeeAsyncWithHttpInfo($xero_tenant_id, $employee_id) ->then( function ($response) { return $response[0]; @@ -7527,16 +8777,16 @@ function ($response) { ); } /** - * Operation getEarningsRateAsyncWithHttpInfo - * Retrieves a specific earnings rates by using a unique earnings rate id + * Operation getEmployeeAsyncWithHttpInfo + * Retrieves an employees using a unique employee ID * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $earnings_rate_id Identifier for the earnings rate (required) + * @param string $employee_id Employee id for single object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getEarningsRateAsyncWithHttpInfo($xero_tenant_id, $earnings_rate_id) + public function getEmployeeAsyncWithHttpInfo($xero_tenant_id, $employee_id) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsRateObject'; - $request = $this->getEarningsRateRequest($xero_tenant_id, $earnings_rate_id); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeObject'; + $request = $this->getEmployeeRequest($xero_tenant_id, $employee_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -7571,26 +8821,26 @@ function ($exception) { } /** - * Create request for operation 'getEarningsRate' + * Create request for operation 'getEmployee' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param string $earnings_rate_id Identifier for the earnings rate (required) + * @param string $employee_id Employee id for single object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getEarningsRateRequest($xero_tenant_id, $earnings_rate_id) + protected function getEmployeeRequest($xero_tenant_id, $employee_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getEarningsRate' + 'Missing the required parameter $xero_tenant_id when calling getEmployee' ); } - // verify the required parameter 'earnings_rate_id' is set - if ($earnings_rate_id === null || (is_array($earnings_rate_id) && count($earnings_rate_id) === 0)) { + // verify the required parameter 'employee_id' is set + if ($employee_id === null || (is_array($employee_id) && count($employee_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $earnings_rate_id when calling getEarningsRate' + 'Missing the required parameter $employee_id when calling getEmployee' ); } - $resourcePath = '/EarningsRates/{EarningsRateID}'; + $resourcePath = '/Employees/{EmployeeID}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -7601,10 +8851,10 @@ protected function getEarningsRateRequest($xero_tenant_id, $earnings_rate_id) $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); } // path params - if ($earnings_rate_id !== null) { + if ($employee_id !== null) { $resourcePath = str_replace( - '{' . 'EarningsRateID' . '}', - PayrollNzObjectSerializer::toPathValue($earnings_rate_id), + '{' . 'EmployeeID' . '}', + PayrollNzObjectSerializer::toPathValue($employee_id), $resourcePath ); } @@ -7669,31 +8919,31 @@ protected function getEarningsRateRequest($xero_tenant_id, $earnings_rate_id) } /** - * Operation getEarningsRates - * Retrieves earnings rates + * Operation getEmployeeLeaveBalances + * Retrieves leave balances for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param int $page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. (optional) + * @param string $employee_id Employee id for single object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsRates + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveBalances */ - public function getEarningsRates($xero_tenant_id, $page = null) + public function getEmployeeLeaveBalances($xero_tenant_id, $employee_id) { - list($response) = $this->getEarningsRatesWithHttpInfo($xero_tenant_id, $page); + list($response) = $this->getEmployeeLeaveBalancesWithHttpInfo($xero_tenant_id, $employee_id); return $response; } /** - * Operation getEarningsRatesWithHttpInfo - * Retrieves earnings rates + * Operation getEmployeeLeaveBalancesWithHttpInfo + * Retrieves leave balances for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param int $page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. (optional) + * @param string $employee_id Employee id for single object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EarningsRates, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveBalances, HTTP status code, HTTP response headers (array of strings) */ - public function getEarningsRatesWithHttpInfo($xero_tenant_id, $page = null) + public function getEmployeeLeaveBalancesWithHttpInfo($xero_tenant_id, $employee_id) { - $request = $this->getEarningsRatesRequest($xero_tenant_id, $page); + $request = $this->getEmployeeLeaveBalancesRequest($xero_tenant_id, $employee_id); try { $options = $this->createHttpClientOption(); try { @@ -7722,18 +8972,18 @@ public function getEarningsRatesWithHttpInfo($xero_tenant_id, $page = null) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsRates' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveBalances' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsRates', []), + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveBalances', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsRates'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveBalances'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -7750,7 +9000,7 @@ public function getEarningsRatesWithHttpInfo($xero_tenant_id, $page = null) case 200: $data = PayrollNzObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsRates', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveBalances', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -7760,16 +9010,16 @@ public function getEarningsRatesWithHttpInfo($xero_tenant_id, $page = null) } } /** - * Operation getEarningsRatesAsync - * Retrieves earnings rates + * Operation getEmployeeLeaveBalancesAsync + * Retrieves leave balances for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param int $page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. (optional) + * @param string $employee_id Employee id for single object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getEarningsRatesAsync($xero_tenant_id, $page = null) + public function getEmployeeLeaveBalancesAsync($xero_tenant_id, $employee_id) { - return $this->getEarningsRatesAsyncWithHttpInfo($xero_tenant_id, $page) + return $this->getEmployeeLeaveBalancesAsyncWithHttpInfo($xero_tenant_id, $employee_id) ->then( function ($response) { return $response[0]; @@ -7777,16 +9027,16 @@ function ($response) { ); } /** - * Operation getEarningsRatesAsyncWithHttpInfo - * Retrieves earnings rates + * Operation getEmployeeLeaveBalancesAsyncWithHttpInfo + * Retrieves leave balances for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param int $page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. (optional) + * @param string $employee_id Employee id for single object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getEarningsRatesAsyncWithHttpInfo($xero_tenant_id, $page = null) + public function getEmployeeLeaveBalancesAsyncWithHttpInfo($xero_tenant_id, $employee_id) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsRates'; - $request = $this->getEarningsRatesRequest($xero_tenant_id, $page); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveBalances'; + $request = $this->getEmployeeLeaveBalancesRequest($xero_tenant_id, $employee_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -7821,33 +9071,43 @@ function ($exception) { } /** - * Create request for operation 'getEarningsRates' + * Create request for operation 'getEmployeeLeaveBalances' * @param string $xero_tenant_id Xero identifier for Tenant (required) - * @param int $page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. (optional) + * @param string $employee_id Employee id for single object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getEarningsRatesRequest($xero_tenant_id, $page = null) + protected function getEmployeeLeaveBalancesRequest($xero_tenant_id, $employee_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getEarningsRates' + 'Missing the required parameter $xero_tenant_id when calling getEmployeeLeaveBalances' ); } - $resourcePath = '/EarningsRates'; + // verify the required parameter 'employee_id' is set + if ($employee_id === null || (is_array($employee_id) && count($employee_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $employee_id when calling getEmployeeLeaveBalances' + ); + } + $resourcePath = '/Employees/{EmployeeID}/LeaveBalances'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if ($page !== null) { - $queryParams['page'] = PayrollNzObjectSerializer::toQueryValue($page); - } // header params if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); } + // path params + if ($employee_id !== null) { + $resourcePath = str_replace( + '{' . 'EmployeeID' . '}', + PayrollNzObjectSerializer::toPathValue($employee_id), + $resourcePath + ); + } // body params $_tempBody = null; if ($multipart) { @@ -7909,31 +9169,35 @@ protected function getEarningsRatesRequest($xero_tenant_id, $page = null) } /** - * Operation getEmployee - * Retrieves an employees using a unique employee ID + * Operation getEmployeeLeavePeriods + * Retrieves leave periods for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) + * @param \DateTime $start_date Filter by start date (optional) + * @param \DateTime $end_date Filter by end date (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeObject + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\LeavePeriods|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function getEmployee($xero_tenant_id, $employee_id) + public function getEmployeeLeavePeriods($xero_tenant_id, $employee_id, $start_date = null, $end_date = null) { - list($response) = $this->getEmployeeWithHttpInfo($xero_tenant_id, $employee_id); + list($response) = $this->getEmployeeLeavePeriodsWithHttpInfo($xero_tenant_id, $employee_id, $start_date, $end_date); return $response; } /** - * Operation getEmployeeWithHttpInfo - * Retrieves an employees using a unique employee ID + * Operation getEmployeeLeavePeriodsWithHttpInfo + * Retrieves leave periods for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) + * @param \DateTime $start_date Filter by start date (optional) + * @param \DateTime $end_date Filter by end date (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EmployeeObject, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\LeavePeriods|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function getEmployeeWithHttpInfo($xero_tenant_id, $employee_id) + public function getEmployeeLeavePeriodsWithHttpInfo($xero_tenant_id, $employee_id, $start_date = null, $end_date = null) { - $request = $this->getEmployeeRequest($xero_tenant_id, $employee_id); + $request = $this->getEmployeeLeavePeriodsRequest($xero_tenant_id, $employee_id, $start_date, $end_date); try { $options = $this->createHttpClientOption(); try { @@ -7962,18 +9226,29 @@ public function getEmployeeWithHttpInfo($xero_tenant_id, $employee_id) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeObject' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\LeavePeriods' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeObject', []), + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\LeavePeriods', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeObject'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\LeavePeriods'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -7990,7 +9265,15 @@ public function getEmployeeWithHttpInfo($xero_tenant_id, $employee_id) case 200: $data = PayrollNzObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeObject', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\LeavePeriods', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = PayrollNzObjectSerializer::deserialize( + $e->getResponseBody(), + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -8000,16 +9283,18 @@ public function getEmployeeWithHttpInfo($xero_tenant_id, $employee_id) } } /** - * Operation getEmployeeAsync - * Retrieves an employees using a unique employee ID + * Operation getEmployeeLeavePeriodsAsync + * Retrieves leave periods for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) + * @param \DateTime $start_date Filter by start date (optional) + * @param \DateTime $end_date Filter by end date (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getEmployeeAsync($xero_tenant_id, $employee_id) + public function getEmployeeLeavePeriodsAsync($xero_tenant_id, $employee_id, $start_date = null, $end_date = null) { - return $this->getEmployeeAsyncWithHttpInfo($xero_tenant_id, $employee_id) + return $this->getEmployeeLeavePeriodsAsyncWithHttpInfo($xero_tenant_id, $employee_id, $start_date, $end_date) ->then( function ($response) { return $response[0]; @@ -8017,16 +9302,18 @@ function ($response) { ); } /** - * Operation getEmployeeAsyncWithHttpInfo - * Retrieves an employees using a unique employee ID + * Operation getEmployeeLeavePeriodsAsyncWithHttpInfo + * Retrieves leave periods for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) + * @param \DateTime $start_date Filter by start date (optional) + * @param \DateTime $end_date Filter by end date (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getEmployeeAsyncWithHttpInfo($xero_tenant_id, $employee_id) + public function getEmployeeLeavePeriodsAsyncWithHttpInfo($xero_tenant_id, $employee_id, $start_date = null, $end_date = null) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeObject'; - $request = $this->getEmployeeRequest($xero_tenant_id, $employee_id); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\LeavePeriods'; + $request = $this->getEmployeeLeavePeriodsRequest($xero_tenant_id, $employee_id, $start_date, $end_date); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -8061,31 +9348,41 @@ function ($exception) { } /** - * Create request for operation 'getEmployee' + * Create request for operation 'getEmployeeLeavePeriods' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) + * @param \DateTime $start_date Filter by start date (optional) + * @param \DateTime $end_date Filter by end date (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getEmployeeRequest($xero_tenant_id, $employee_id) + protected function getEmployeeLeavePeriodsRequest($xero_tenant_id, $employee_id, $start_date = null, $end_date = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getEmployee' + 'Missing the required parameter $xero_tenant_id when calling getEmployeeLeavePeriods' ); } // verify the required parameter 'employee_id' is set if ($employee_id === null || (is_array($employee_id) && count($employee_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $employee_id when calling getEmployee' + 'Missing the required parameter $employee_id when calling getEmployeeLeavePeriods' ); } - $resourcePath = '/Employees/{EmployeeID}'; + $resourcePath = '/Employees/{EmployeeID}/LeavePeriods'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if ($start_date !== null) { + $queryParams['startDate'] = PayrollNzObjectSerializer::toQueryValue($start_date); + } + // query params + if ($end_date !== null) { + $queryParams['endDate'] = PayrollNzObjectSerializer::toQueryValue($end_date); + } // header params if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); @@ -8159,31 +9456,31 @@ protected function getEmployeeRequest($xero_tenant_id, $employee_id) } /** - * Operation getEmployeeLeaveBalances - * Retrieves leave balances for a specific employee + * Operation getEmployeeLeaveTypes + * Retrieves leave types for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveBalances + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveTypes|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function getEmployeeLeaveBalances($xero_tenant_id, $employee_id) + public function getEmployeeLeaveTypes($xero_tenant_id, $employee_id) { - list($response) = $this->getEmployeeLeaveBalancesWithHttpInfo($xero_tenant_id, $employee_id); + list($response) = $this->getEmployeeLeaveTypesWithHttpInfo($xero_tenant_id, $employee_id); return $response; } /** - * Operation getEmployeeLeaveBalancesWithHttpInfo - * Retrieves leave balances for a specific employee + * Operation getEmployeeLeaveTypesWithHttpInfo + * Retrieves leave types for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveBalances, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveTypes|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function getEmployeeLeaveBalancesWithHttpInfo($xero_tenant_id, $employee_id) + public function getEmployeeLeaveTypesWithHttpInfo($xero_tenant_id, $employee_id) { - $request = $this->getEmployeeLeaveBalancesRequest($xero_tenant_id, $employee_id); + $request = $this->getEmployeeLeaveTypesRequest($xero_tenant_id, $employee_id); try { $options = $this->createHttpClientOption(); try { @@ -8212,18 +9509,29 @@ public function getEmployeeLeaveBalancesWithHttpInfo($xero_tenant_id, $employee_ $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveBalances' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveTypes' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveBalances', []), + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveTypes', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveBalances'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveTypes'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -8240,7 +9548,15 @@ public function getEmployeeLeaveBalancesWithHttpInfo($xero_tenant_id, $employee_ case 200: $data = PayrollNzObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveBalances', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveTypes', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = PayrollNzObjectSerializer::deserialize( + $e->getResponseBody(), + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -8250,16 +9566,16 @@ public function getEmployeeLeaveBalancesWithHttpInfo($xero_tenant_id, $employee_ } } /** - * Operation getEmployeeLeaveBalancesAsync - * Retrieves leave balances for a specific employee + * Operation getEmployeeLeaveTypesAsync + * Retrieves leave types for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getEmployeeLeaveBalancesAsync($xero_tenant_id, $employee_id) + public function getEmployeeLeaveTypesAsync($xero_tenant_id, $employee_id) { - return $this->getEmployeeLeaveBalancesAsyncWithHttpInfo($xero_tenant_id, $employee_id) + return $this->getEmployeeLeaveTypesAsyncWithHttpInfo($xero_tenant_id, $employee_id) ->then( function ($response) { return $response[0]; @@ -8267,16 +9583,16 @@ function ($response) { ); } /** - * Operation getEmployeeLeaveBalancesAsyncWithHttpInfo - * Retrieves leave balances for a specific employee + * Operation getEmployeeLeaveTypesAsyncWithHttpInfo + * Retrieves leave types for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getEmployeeLeaveBalancesAsyncWithHttpInfo($xero_tenant_id, $employee_id) + public function getEmployeeLeaveTypesAsyncWithHttpInfo($xero_tenant_id, $employee_id) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveBalances'; - $request = $this->getEmployeeLeaveBalancesRequest($xero_tenant_id, $employee_id); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveTypes'; + $request = $this->getEmployeeLeaveTypesRequest($xero_tenant_id, $employee_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -8311,26 +9627,26 @@ function ($exception) { } /** - * Create request for operation 'getEmployeeLeaveBalances' + * Create request for operation 'getEmployeeLeaveTypes' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getEmployeeLeaveBalancesRequest($xero_tenant_id, $employee_id) + protected function getEmployeeLeaveTypesRequest($xero_tenant_id, $employee_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getEmployeeLeaveBalances' + 'Missing the required parameter $xero_tenant_id when calling getEmployeeLeaveTypes' ); } // verify the required parameter 'employee_id' is set if ($employee_id === null || (is_array($employee_id) && count($employee_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $employee_id when calling getEmployeeLeaveBalances' + 'Missing the required parameter $employee_id when calling getEmployeeLeaveTypes' ); } - $resourcePath = '/Employees/{EmployeeID}/LeaveBalances'; + $resourcePath = '/Employees/{EmployeeID}/LeaveTypes'; $formParams = []; $queryParams = []; $headerParams = []; @@ -8409,35 +9725,31 @@ protected function getEmployeeLeaveBalancesRequest($xero_tenant_id, $employee_id } /** - * Operation getEmployeeLeavePeriods - * Retrieves leave periods for a specific employee + * Operation getEmployeeLeaves + * Retrieves leave records for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) - * @param \DateTime $start_date Filter by start date (optional) - * @param \DateTime $end_date Filter by end date (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\LeavePeriods|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaves */ - public function getEmployeeLeavePeriods($xero_tenant_id, $employee_id, $start_date = null, $end_date = null) + public function getEmployeeLeaves($xero_tenant_id, $employee_id) { - list($response) = $this->getEmployeeLeavePeriodsWithHttpInfo($xero_tenant_id, $employee_id, $start_date, $end_date); + list($response) = $this->getEmployeeLeavesWithHttpInfo($xero_tenant_id, $employee_id); return $response; } /** - * Operation getEmployeeLeavePeriodsWithHttpInfo - * Retrieves leave periods for a specific employee + * Operation getEmployeeLeavesWithHttpInfo + * Retrieves leave records for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) - * @param \DateTime $start_date Filter by start date (optional) - * @param \DateTime $end_date Filter by end date (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\LeavePeriods|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaves, HTTP status code, HTTP response headers (array of strings) */ - public function getEmployeeLeavePeriodsWithHttpInfo($xero_tenant_id, $employee_id, $start_date = null, $end_date = null) + public function getEmployeeLeavesWithHttpInfo($xero_tenant_id, $employee_id) { - $request = $this->getEmployeeLeavePeriodsRequest($xero_tenant_id, $employee_id, $start_date, $end_date); + $request = $this->getEmployeeLeavesRequest($xero_tenant_id, $employee_id); try { $options = $this->createHttpClientOption(); try { @@ -8466,29 +9778,18 @@ public function getEmployeeLeavePeriodsWithHttpInfo($xero_tenant_id, $employee_i $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\LeavePeriods' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - } - return [ - PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\LeavePeriods', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaves' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem', []), + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaves', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\LeavePeriods'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaves'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -8505,15 +9806,7 @@ public function getEmployeeLeavePeriodsWithHttpInfo($xero_tenant_id, $employee_i case 200: $data = PayrollNzObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\LeavePeriods', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = PayrollNzObjectSerializer::deserialize( - $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaves', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -8523,18 +9816,16 @@ public function getEmployeeLeavePeriodsWithHttpInfo($xero_tenant_id, $employee_i } } /** - * Operation getEmployeeLeavePeriodsAsync - * Retrieves leave periods for a specific employee + * Operation getEmployeeLeavesAsync + * Retrieves leave records for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) - * @param \DateTime $start_date Filter by start date (optional) - * @param \DateTime $end_date Filter by end date (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getEmployeeLeavePeriodsAsync($xero_tenant_id, $employee_id, $start_date = null, $end_date = null) + public function getEmployeeLeavesAsync($xero_tenant_id, $employee_id) { - return $this->getEmployeeLeavePeriodsAsyncWithHttpInfo($xero_tenant_id, $employee_id, $start_date, $end_date) + return $this->getEmployeeLeavesAsyncWithHttpInfo($xero_tenant_id, $employee_id) ->then( function ($response) { return $response[0]; @@ -8542,18 +9833,16 @@ function ($response) { ); } /** - * Operation getEmployeeLeavePeriodsAsyncWithHttpInfo - * Retrieves leave periods for a specific employee + * Operation getEmployeeLeavesAsyncWithHttpInfo + * Retrieves leave records for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) - * @param \DateTime $start_date Filter by start date (optional) - * @param \DateTime $end_date Filter by end date (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getEmployeeLeavePeriodsAsyncWithHttpInfo($xero_tenant_id, $employee_id, $start_date = null, $end_date = null) + public function getEmployeeLeavesAsyncWithHttpInfo($xero_tenant_id, $employee_id) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\LeavePeriods'; - $request = $this->getEmployeeLeavePeriodsRequest($xero_tenant_id, $employee_id, $start_date, $end_date); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaves'; + $request = $this->getEmployeeLeavesRequest($xero_tenant_id, $employee_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -8588,41 +9877,31 @@ function ($exception) { } /** - * Create request for operation 'getEmployeeLeavePeriods' + * Create request for operation 'getEmployeeLeaves' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) - * @param \DateTime $start_date Filter by start date (optional) - * @param \DateTime $end_date Filter by end date (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getEmployeeLeavePeriodsRequest($xero_tenant_id, $employee_id, $start_date = null, $end_date = null) + protected function getEmployeeLeavesRequest($xero_tenant_id, $employee_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getEmployeeLeavePeriods' + 'Missing the required parameter $xero_tenant_id when calling getEmployeeLeaves' ); } // verify the required parameter 'employee_id' is set if ($employee_id === null || (is_array($employee_id) && count($employee_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $employee_id when calling getEmployeeLeavePeriods' + 'Missing the required parameter $employee_id when calling getEmployeeLeaves' ); } - $resourcePath = '/Employees/{EmployeeID}/LeavePeriods'; + $resourcePath = '/Employees/{EmployeeID}/Leave'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if ($start_date !== null) { - $queryParams['startDate'] = PayrollNzObjectSerializer::toQueryValue($start_date); - } - // query params - if ($end_date !== null) { - $queryParams['endDate'] = PayrollNzObjectSerializer::toQueryValue($end_date); - } // header params if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); @@ -8696,31 +9975,31 @@ protected function getEmployeeLeavePeriodsRequest($xero_tenant_id, $employee_id, } /** - * Operation getEmployeeLeaveTypes - * Retrieves leave types for a specific employee + * Operation getEmployeeOpeningBalances + * Retrieves the opening balance for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveTypes|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeOpeningBalancesObject */ - public function getEmployeeLeaveTypes($xero_tenant_id, $employee_id) + public function getEmployeeOpeningBalances($xero_tenant_id, $employee_id) { - list($response) = $this->getEmployeeLeaveTypesWithHttpInfo($xero_tenant_id, $employee_id); + list($response) = $this->getEmployeeOpeningBalancesWithHttpInfo($xero_tenant_id, $employee_id); return $response; } /** - * Operation getEmployeeLeaveTypesWithHttpInfo - * Retrieves leave types for a specific employee + * Operation getEmployeeOpeningBalancesWithHttpInfo + * Retrieves the opening balance for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveTypes|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EmployeeOpeningBalancesObject, HTTP status code, HTTP response headers (array of strings) */ - public function getEmployeeLeaveTypesWithHttpInfo($xero_tenant_id, $employee_id) + public function getEmployeeOpeningBalancesWithHttpInfo($xero_tenant_id, $employee_id) { - $request = $this->getEmployeeLeaveTypesRequest($xero_tenant_id, $employee_id); + $request = $this->getEmployeeOpeningBalancesRequest($xero_tenant_id, $employee_id); try { $options = $this->createHttpClientOption(); try { @@ -8749,29 +10028,18 @@ public function getEmployeeLeaveTypesWithHttpInfo($xero_tenant_id, $employee_id) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveTypes' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - } - return [ - PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveTypes', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeOpeningBalancesObject' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem', []), + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeOpeningBalancesObject', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveTypes'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeOpeningBalancesObject'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -8788,15 +10056,7 @@ public function getEmployeeLeaveTypesWithHttpInfo($xero_tenant_id, $employee_id) case 200: $data = PayrollNzObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveTypes', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = PayrollNzObjectSerializer::deserialize( - $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeOpeningBalancesObject', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -8806,16 +10066,16 @@ public function getEmployeeLeaveTypesWithHttpInfo($xero_tenant_id, $employee_id) } } /** - * Operation getEmployeeLeaveTypesAsync - * Retrieves leave types for a specific employee + * Operation getEmployeeOpeningBalancesAsync + * Retrieves the opening balance for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getEmployeeLeaveTypesAsync($xero_tenant_id, $employee_id) + public function getEmployeeOpeningBalancesAsync($xero_tenant_id, $employee_id) { - return $this->getEmployeeLeaveTypesAsyncWithHttpInfo($xero_tenant_id, $employee_id) + return $this->getEmployeeOpeningBalancesAsyncWithHttpInfo($xero_tenant_id, $employee_id) ->then( function ($response) { return $response[0]; @@ -8823,16 +10083,16 @@ function ($response) { ); } /** - * Operation getEmployeeLeaveTypesAsyncWithHttpInfo - * Retrieves leave types for a specific employee + * Operation getEmployeeOpeningBalancesAsyncWithHttpInfo + * Retrieves the opening balance for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getEmployeeLeaveTypesAsyncWithHttpInfo($xero_tenant_id, $employee_id) + public function getEmployeeOpeningBalancesAsyncWithHttpInfo($xero_tenant_id, $employee_id) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveTypes'; - $request = $this->getEmployeeLeaveTypesRequest($xero_tenant_id, $employee_id); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeOpeningBalancesObject'; + $request = $this->getEmployeeOpeningBalancesRequest($xero_tenant_id, $employee_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -8867,26 +10127,26 @@ function ($exception) { } /** - * Create request for operation 'getEmployeeLeaveTypes' + * Create request for operation 'getEmployeeOpeningBalances' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getEmployeeLeaveTypesRequest($xero_tenant_id, $employee_id) + protected function getEmployeeOpeningBalancesRequest($xero_tenant_id, $employee_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getEmployeeLeaveTypes' + 'Missing the required parameter $xero_tenant_id when calling getEmployeeOpeningBalances' ); } // verify the required parameter 'employee_id' is set if ($employee_id === null || (is_array($employee_id) && count($employee_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $employee_id when calling getEmployeeLeaveTypes' + 'Missing the required parameter $employee_id when calling getEmployeeOpeningBalances' ); } - $resourcePath = '/Employees/{EmployeeID}/LeaveTypes'; + $resourcePath = '/Employees/{EmployeeID}/OpeningBalances'; $formParams = []; $queryParams = []; $headerParams = []; @@ -8965,31 +10225,31 @@ protected function getEmployeeLeaveTypesRequest($xero_tenant_id, $employee_id) } /** - * Operation getEmployeeLeaves - * Retrieves leave records for a specific employee + * Operation getEmployeePayTemplates + * Retrieves pay templates for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaves + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeePayTemplates|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function getEmployeeLeaves($xero_tenant_id, $employee_id) + public function getEmployeePayTemplates($xero_tenant_id, $employee_id) { - list($response) = $this->getEmployeeLeavesWithHttpInfo($xero_tenant_id, $employee_id); + list($response) = $this->getEmployeePayTemplatesWithHttpInfo($xero_tenant_id, $employee_id); return $response; } /** - * Operation getEmployeeLeavesWithHttpInfo - * Retrieves leave records for a specific employee + * Operation getEmployeePayTemplatesWithHttpInfo + * Retrieves pay templates for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaves, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EmployeePayTemplates|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function getEmployeeLeavesWithHttpInfo($xero_tenant_id, $employee_id) + public function getEmployeePayTemplatesWithHttpInfo($xero_tenant_id, $employee_id) { - $request = $this->getEmployeeLeavesRequest($xero_tenant_id, $employee_id); + $request = $this->getEmployeePayTemplatesRequest($xero_tenant_id, $employee_id); try { $options = $this->createHttpClientOption(); try { @@ -9018,18 +10278,29 @@ public function getEmployeeLeavesWithHttpInfo($xero_tenant_id, $employee_id) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaves' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeePayTemplates' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaves', []), + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeePayTemplates', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaves'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeePayTemplates'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -9046,7 +10317,15 @@ public function getEmployeeLeavesWithHttpInfo($xero_tenant_id, $employee_id) case 200: $data = PayrollNzObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaves', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeePayTemplates', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = PayrollNzObjectSerializer::deserialize( + $e->getResponseBody(), + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -9056,16 +10335,16 @@ public function getEmployeeLeavesWithHttpInfo($xero_tenant_id, $employee_id) } } /** - * Operation getEmployeeLeavesAsync - * Retrieves leave records for a specific employee + * Operation getEmployeePayTemplatesAsync + * Retrieves pay templates for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getEmployeeLeavesAsync($xero_tenant_id, $employee_id) + public function getEmployeePayTemplatesAsync($xero_tenant_id, $employee_id) { - return $this->getEmployeeLeavesAsyncWithHttpInfo($xero_tenant_id, $employee_id) + return $this->getEmployeePayTemplatesAsyncWithHttpInfo($xero_tenant_id, $employee_id) ->then( function ($response) { return $response[0]; @@ -9073,16 +10352,16 @@ function ($response) { ); } /** - * Operation getEmployeeLeavesAsyncWithHttpInfo - * Retrieves leave records for a specific employee + * Operation getEmployeePayTemplatesAsyncWithHttpInfo + * Retrieves pay templates for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getEmployeeLeavesAsyncWithHttpInfo($xero_tenant_id, $employee_id) + public function getEmployeePayTemplatesAsyncWithHttpInfo($xero_tenant_id, $employee_id) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaves'; - $request = $this->getEmployeeLeavesRequest($xero_tenant_id, $employee_id); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeePayTemplates'; + $request = $this->getEmployeePayTemplatesRequest($xero_tenant_id, $employee_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -9117,26 +10396,26 @@ function ($exception) { } /** - * Create request for operation 'getEmployeeLeaves' + * Create request for operation 'getEmployeePayTemplates' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getEmployeeLeavesRequest($xero_tenant_id, $employee_id) + protected function getEmployeePayTemplatesRequest($xero_tenant_id, $employee_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getEmployeeLeaves' + 'Missing the required parameter $xero_tenant_id when calling getEmployeePayTemplates' ); } // verify the required parameter 'employee_id' is set if ($employee_id === null || (is_array($employee_id) && count($employee_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $employee_id when calling getEmployeeLeaves' + 'Missing the required parameter $employee_id when calling getEmployeePayTemplates' ); } - $resourcePath = '/Employees/{EmployeeID}/Leave'; + $resourcePath = '/Employees/{EmployeeID}/PayTemplates'; $formParams = []; $queryParams = []; $headerParams = []; @@ -9215,31 +10494,31 @@ protected function getEmployeeLeavesRequest($xero_tenant_id, $employee_id) } /** - * Operation getEmployeeOpeningBalances - * Retrieves the opening balance for a specific employee + * Operation getEmployeePaymentMethod + * Retrieves available payment methods for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeOpeningBalancesObject + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PaymentMethodObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function getEmployeeOpeningBalances($xero_tenant_id, $employee_id) + public function getEmployeePaymentMethod($xero_tenant_id, $employee_id) { - list($response) = $this->getEmployeeOpeningBalancesWithHttpInfo($xero_tenant_id, $employee_id); + list($response) = $this->getEmployeePaymentMethodWithHttpInfo($xero_tenant_id, $employee_id); return $response; } /** - * Operation getEmployeeOpeningBalancesWithHttpInfo - * Retrieves the opening balance for a specific employee + * Operation getEmployeePaymentMethodWithHttpInfo + * Retrieves available payment methods for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EmployeeOpeningBalancesObject, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\PaymentMethodObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function getEmployeeOpeningBalancesWithHttpInfo($xero_tenant_id, $employee_id) + public function getEmployeePaymentMethodWithHttpInfo($xero_tenant_id, $employee_id) { - $request = $this->getEmployeeOpeningBalancesRequest($xero_tenant_id, $employee_id); + $request = $this->getEmployeePaymentMethodRequest($xero_tenant_id, $employee_id); try { $options = $this->createHttpClientOption(); try { @@ -9268,18 +10547,29 @@ public function getEmployeeOpeningBalancesWithHttpInfo($xero_tenant_id, $employe $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeOpeningBalancesObject' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PaymentMethodObject' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeOpeningBalancesObject', []), + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PaymentMethodObject', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem' === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + } + return [ + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeOpeningBalancesObject'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PaymentMethodObject'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -9296,7 +10586,15 @@ public function getEmployeeOpeningBalancesWithHttpInfo($xero_tenant_id, $employe case 200: $data = PayrollNzObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeOpeningBalancesObject', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PaymentMethodObject', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = PayrollNzObjectSerializer::deserialize( + $e->getResponseBody(), + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -9306,16 +10604,16 @@ public function getEmployeeOpeningBalancesWithHttpInfo($xero_tenant_id, $employe } } /** - * Operation getEmployeeOpeningBalancesAsync - * Retrieves the opening balance for a specific employee + * Operation getEmployeePaymentMethodAsync + * Retrieves available payment methods for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getEmployeeOpeningBalancesAsync($xero_tenant_id, $employee_id) + public function getEmployeePaymentMethodAsync($xero_tenant_id, $employee_id) { - return $this->getEmployeeOpeningBalancesAsyncWithHttpInfo($xero_tenant_id, $employee_id) + return $this->getEmployeePaymentMethodAsyncWithHttpInfo($xero_tenant_id, $employee_id) ->then( function ($response) { return $response[0]; @@ -9323,16 +10621,16 @@ function ($response) { ); } /** - * Operation getEmployeeOpeningBalancesAsyncWithHttpInfo - * Retrieves the opening balance for a specific employee + * Operation getEmployeePaymentMethodAsyncWithHttpInfo + * Retrieves available payment methods for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getEmployeeOpeningBalancesAsyncWithHttpInfo($xero_tenant_id, $employee_id) + public function getEmployeePaymentMethodAsyncWithHttpInfo($xero_tenant_id, $employee_id) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeOpeningBalancesObject'; - $request = $this->getEmployeeOpeningBalancesRequest($xero_tenant_id, $employee_id); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PaymentMethodObject'; + $request = $this->getEmployeePaymentMethodRequest($xero_tenant_id, $employee_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -9367,26 +10665,26 @@ function ($exception) { } /** - * Create request for operation 'getEmployeeOpeningBalances' + * Create request for operation 'getEmployeePaymentMethod' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getEmployeeOpeningBalancesRequest($xero_tenant_id, $employee_id) + protected function getEmployeePaymentMethodRequest($xero_tenant_id, $employee_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getEmployeeOpeningBalances' + 'Missing the required parameter $xero_tenant_id when calling getEmployeePaymentMethod' ); } // verify the required parameter 'employee_id' is set if ($employee_id === null || (is_array($employee_id) && count($employee_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $employee_id when calling getEmployeeOpeningBalances' + 'Missing the required parameter $employee_id when calling getEmployeePaymentMethod' ); } - $resourcePath = '/Employees/{EmployeeID}/openingBalances'; + $resourcePath = '/Employees/{EmployeeID}/PaymentMethods'; $formParams = []; $queryParams = []; $headerParams = []; @@ -9465,31 +10763,33 @@ protected function getEmployeeOpeningBalancesRequest($xero_tenant_id, $employee_ } /** - * Operation getEmployeePayTemplates - * Retrieves pay templates for a specific employee + * Operation getEmployeeSalaryAndWage + * Retrieves an employee's salary and wages record by using a unique salary and wage ID * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) + * @param string $salary_and_wages_id Id for single pay template earnings object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeePayTemplates|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWages */ - public function getEmployeePayTemplates($xero_tenant_id, $employee_id) + public function getEmployeeSalaryAndWage($xero_tenant_id, $employee_id, $salary_and_wages_id) { - list($response) = $this->getEmployeePayTemplatesWithHttpInfo($xero_tenant_id, $employee_id); + list($response) = $this->getEmployeeSalaryAndWageWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wages_id); return $response; } /** - * Operation getEmployeePayTemplatesWithHttpInfo - * Retrieves pay templates for a specific employee + * Operation getEmployeeSalaryAndWageWithHttpInfo + * Retrieves an employee's salary and wages record by using a unique salary and wage ID * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) + * @param string $salary_and_wages_id Id for single pay template earnings object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EmployeePayTemplates|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWages, HTTP status code, HTTP response headers (array of strings) */ - public function getEmployeePayTemplatesWithHttpInfo($xero_tenant_id, $employee_id) + public function getEmployeeSalaryAndWageWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wages_id) { - $request = $this->getEmployeePayTemplatesRequest($xero_tenant_id, $employee_id); + $request = $this->getEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id, $salary_and_wages_id); try { $options = $this->createHttpClientOption(); try { @@ -9518,29 +10818,18 @@ public function getEmployeePayTemplatesWithHttpInfo($xero_tenant_id, $employee_i $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeePayTemplates' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - } - return [ - PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeePayTemplates', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWages' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem', []), + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWages', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeePayTemplates'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWages'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -9557,15 +10846,7 @@ public function getEmployeePayTemplatesWithHttpInfo($xero_tenant_id, $employee_i case 200: $data = PayrollNzObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeePayTemplates', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = PayrollNzObjectSerializer::deserialize( - $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWages', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -9575,16 +10856,17 @@ public function getEmployeePayTemplatesWithHttpInfo($xero_tenant_id, $employee_i } } /** - * Operation getEmployeePayTemplatesAsync - * Retrieves pay templates for a specific employee + * Operation getEmployeeSalaryAndWageAsync + * Retrieves an employee's salary and wages record by using a unique salary and wage ID * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) + * @param string $salary_and_wages_id Id for single pay template earnings object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getEmployeePayTemplatesAsync($xero_tenant_id, $employee_id) + public function getEmployeeSalaryAndWageAsync($xero_tenant_id, $employee_id, $salary_and_wages_id) { - return $this->getEmployeePayTemplatesAsyncWithHttpInfo($xero_tenant_id, $employee_id) + return $this->getEmployeeSalaryAndWageAsyncWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wages_id) ->then( function ($response) { return $response[0]; @@ -9592,16 +10874,17 @@ function ($response) { ); } /** - * Operation getEmployeePayTemplatesAsyncWithHttpInfo - * Retrieves pay templates for a specific employee + * Operation getEmployeeSalaryAndWageAsyncWithHttpInfo + * Retrieves an employee's salary and wages record by using a unique salary and wage ID * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) + * @param string $salary_and_wages_id Id for single pay template earnings object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getEmployeePayTemplatesAsyncWithHttpInfo($xero_tenant_id, $employee_id) + public function getEmployeeSalaryAndWageAsyncWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wages_id) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeePayTemplates'; - $request = $this->getEmployeePayTemplatesRequest($xero_tenant_id, $employee_id); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWages'; + $request = $this->getEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id, $salary_and_wages_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -9636,26 +10919,33 @@ function ($exception) { } /** - * Create request for operation 'getEmployeePayTemplates' + * Create request for operation 'getEmployeeSalaryAndWage' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) + * @param string $salary_and_wages_id Id for single pay template earnings object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getEmployeePayTemplatesRequest($xero_tenant_id, $employee_id) + protected function getEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id, $salary_and_wages_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getEmployeePayTemplates' + 'Missing the required parameter $xero_tenant_id when calling getEmployeeSalaryAndWage' ); } // verify the required parameter 'employee_id' is set if ($employee_id === null || (is_array($employee_id) && count($employee_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $employee_id when calling getEmployeePayTemplates' + 'Missing the required parameter $employee_id when calling getEmployeeSalaryAndWage' ); } - $resourcePath = '/Employees/{EmployeeID}/PayTemplates'; + // verify the required parameter 'salary_and_wages_id' is set + if ($salary_and_wages_id === null || (is_array($salary_and_wages_id) && count($salary_and_wages_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $salary_and_wages_id when calling getEmployeeSalaryAndWage' + ); + } + $resourcePath = '/Employees/{EmployeeID}/SalaryAndWages/{SalaryAndWagesID}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -9666,10 +10956,18 @@ protected function getEmployeePayTemplatesRequest($xero_tenant_id, $employee_id) $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); } // path params - if ($employee_id !== null) { + if ($employee_id !== null) { + $resourcePath = str_replace( + '{' . 'EmployeeID' . '}', + PayrollNzObjectSerializer::toPathValue($employee_id), + $resourcePath + ); + } + // path params + if ($salary_and_wages_id !== null) { $resourcePath = str_replace( - '{' . 'EmployeeID' . '}', - PayrollNzObjectSerializer::toPathValue($employee_id), + '{' . 'SalaryAndWagesID' . '}', + PayrollNzObjectSerializer::toPathValue($salary_and_wages_id), $resourcePath ); } @@ -9734,31 +11032,33 @@ protected function getEmployeePayTemplatesRequest($xero_tenant_id, $employee_id) } /** - * Operation getEmployeePaymentMethod - * Retrieves available payment methods for a specific employee + * Operation getEmployeeSalaryAndWages + * Retrieves an employee's salary and wages * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) + * @param int $page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PaymentMethodObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWages|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function getEmployeePaymentMethod($xero_tenant_id, $employee_id) + public function getEmployeeSalaryAndWages($xero_tenant_id, $employee_id, $page = null) { - list($response) = $this->getEmployeePaymentMethodWithHttpInfo($xero_tenant_id, $employee_id); + list($response) = $this->getEmployeeSalaryAndWagesWithHttpInfo($xero_tenant_id, $employee_id, $page); return $response; } /** - * Operation getEmployeePaymentMethodWithHttpInfo - * Retrieves available payment methods for a specific employee + * Operation getEmployeeSalaryAndWagesWithHttpInfo + * Retrieves an employee's salary and wages * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) + * @param int $page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\PaymentMethodObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWages|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function getEmployeePaymentMethodWithHttpInfo($xero_tenant_id, $employee_id) + public function getEmployeeSalaryAndWagesWithHttpInfo($xero_tenant_id, $employee_id, $page = null) { - $request = $this->getEmployeePaymentMethodRequest($xero_tenant_id, $employee_id); + $request = $this->getEmployeeSalaryAndWagesRequest($xero_tenant_id, $employee_id, $page); try { $options = $this->createHttpClientOption(); try { @@ -9787,13 +11087,13 @@ public function getEmployeePaymentMethodWithHttpInfo($xero_tenant_id, $employee_ $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PaymentMethodObject' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWages' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PaymentMethodObject', []), + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWages', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -9809,7 +11109,7 @@ public function getEmployeePaymentMethodWithHttpInfo($xero_tenant_id, $employee_ $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PaymentMethodObject'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWages'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -9826,7 +11126,7 @@ public function getEmployeePaymentMethodWithHttpInfo($xero_tenant_id, $employee_ case 200: $data = PayrollNzObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PaymentMethodObject', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWages', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -9844,16 +11144,17 @@ public function getEmployeePaymentMethodWithHttpInfo($xero_tenant_id, $employee_ } } /** - * Operation getEmployeePaymentMethodAsync - * Retrieves available payment methods for a specific employee + * Operation getEmployeeSalaryAndWagesAsync + * Retrieves an employee's salary and wages * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) + * @param int $page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getEmployeePaymentMethodAsync($xero_tenant_id, $employee_id) + public function getEmployeeSalaryAndWagesAsync($xero_tenant_id, $employee_id, $page = null) { - return $this->getEmployeePaymentMethodAsyncWithHttpInfo($xero_tenant_id, $employee_id) + return $this->getEmployeeSalaryAndWagesAsyncWithHttpInfo($xero_tenant_id, $employee_id, $page) ->then( function ($response) { return $response[0]; @@ -9861,16 +11162,17 @@ function ($response) { ); } /** - * Operation getEmployeePaymentMethodAsyncWithHttpInfo - * Retrieves available payment methods for a specific employee + * Operation getEmployeeSalaryAndWagesAsyncWithHttpInfo + * Retrieves an employee's salary and wages * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) + * @param int $page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getEmployeePaymentMethodAsyncWithHttpInfo($xero_tenant_id, $employee_id) + public function getEmployeeSalaryAndWagesAsyncWithHttpInfo($xero_tenant_id, $employee_id, $page = null) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PaymentMethodObject'; - $request = $this->getEmployeePaymentMethodRequest($xero_tenant_id, $employee_id); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWages'; + $request = $this->getEmployeeSalaryAndWagesRequest($xero_tenant_id, $employee_id, $page); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -9905,31 +11207,36 @@ function ($exception) { } /** - * Create request for operation 'getEmployeePaymentMethod' + * Create request for operation 'getEmployeeSalaryAndWages' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) + * @param int $page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getEmployeePaymentMethodRequest($xero_tenant_id, $employee_id) + protected function getEmployeeSalaryAndWagesRequest($xero_tenant_id, $employee_id, $page = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getEmployeePaymentMethod' + 'Missing the required parameter $xero_tenant_id when calling getEmployeeSalaryAndWages' ); } // verify the required parameter 'employee_id' is set if ($employee_id === null || (is_array($employee_id) && count($employee_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $employee_id when calling getEmployeePaymentMethod' + 'Missing the required parameter $employee_id when calling getEmployeeSalaryAndWages' ); } - $resourcePath = '/Employees/{EmployeeID}/PaymentMethods'; + $resourcePath = '/Employees/{EmployeeID}/SalaryAndWages'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if ($page !== null) { + $queryParams['page'] = PayrollNzObjectSerializer::toQueryValue($page); + } // header params if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); @@ -10003,33 +11310,31 @@ protected function getEmployeePaymentMethodRequest($xero_tenant_id, $employee_id } /** - * Operation getEmployeeSalaryAndWage - * Retrieves an employee's salary and wages record by using a unique salary and wage ID + * Operation getEmployeeTax + * Retrieves tax records for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) - * @param string $salary_and_wages_id Id for single pay template earnings object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWages + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeTaxObject */ - public function getEmployeeSalaryAndWage($xero_tenant_id, $employee_id, $salary_and_wages_id) + public function getEmployeeTax($xero_tenant_id, $employee_id) { - list($response) = $this->getEmployeeSalaryAndWageWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wages_id); + list($response) = $this->getEmployeeTaxWithHttpInfo($xero_tenant_id, $employee_id); return $response; } /** - * Operation getEmployeeSalaryAndWageWithHttpInfo - * Retrieves an employee's salary and wages record by using a unique salary and wage ID + * Operation getEmployeeTaxWithHttpInfo + * Retrieves tax records for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) - * @param string $salary_and_wages_id Id for single pay template earnings object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWages, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EmployeeTaxObject, HTTP status code, HTTP response headers (array of strings) */ - public function getEmployeeSalaryAndWageWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wages_id) + public function getEmployeeTaxWithHttpInfo($xero_tenant_id, $employee_id) { - $request = $this->getEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id, $salary_and_wages_id); + $request = $this->getEmployeeTaxRequest($xero_tenant_id, $employee_id); try { $options = $this->createHttpClientOption(); try { @@ -10058,18 +11363,18 @@ public function getEmployeeSalaryAndWageWithHttpInfo($xero_tenant_id, $employee_ $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWages' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeTaxObject' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWages', []), + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeTaxObject', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWages'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeTaxObject'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -10086,7 +11391,7 @@ public function getEmployeeSalaryAndWageWithHttpInfo($xero_tenant_id, $employee_ case 200: $data = PayrollNzObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWages', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeTaxObject', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -10096,17 +11401,16 @@ public function getEmployeeSalaryAndWageWithHttpInfo($xero_tenant_id, $employee_ } } /** - * Operation getEmployeeSalaryAndWageAsync - * Retrieves an employee's salary and wages record by using a unique salary and wage ID + * Operation getEmployeeTaxAsync + * Retrieves tax records for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) - * @param string $salary_and_wages_id Id for single pay template earnings object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getEmployeeSalaryAndWageAsync($xero_tenant_id, $employee_id, $salary_and_wages_id) + public function getEmployeeTaxAsync($xero_tenant_id, $employee_id) { - return $this->getEmployeeSalaryAndWageAsyncWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wages_id) + return $this->getEmployeeTaxAsyncWithHttpInfo($xero_tenant_id, $employee_id) ->then( function ($response) { return $response[0]; @@ -10114,17 +11418,16 @@ function ($response) { ); } /** - * Operation getEmployeeSalaryAndWageAsyncWithHttpInfo - * Retrieves an employee's salary and wages record by using a unique salary and wage ID + * Operation getEmployeeTaxAsyncWithHttpInfo + * Retrieves tax records for a specific employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) - * @param string $salary_and_wages_id Id for single pay template earnings object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getEmployeeSalaryAndWageAsyncWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wages_id) + public function getEmployeeTaxAsyncWithHttpInfo($xero_tenant_id, $employee_id) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWages'; - $request = $this->getEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id, $salary_and_wages_id); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeTaxObject'; + $request = $this->getEmployeeTaxRequest($xero_tenant_id, $employee_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -10159,33 +11462,26 @@ function ($exception) { } /** - * Create request for operation 'getEmployeeSalaryAndWage' + * Create request for operation 'getEmployeeTax' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) - * @param string $salary_and_wages_id Id for single pay template earnings object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id, $salary_and_wages_id) + protected function getEmployeeTaxRequest($xero_tenant_id, $employee_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getEmployeeSalaryAndWage' + 'Missing the required parameter $xero_tenant_id when calling getEmployeeTax' ); } // verify the required parameter 'employee_id' is set if ($employee_id === null || (is_array($employee_id) && count($employee_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $employee_id when calling getEmployeeSalaryAndWage' - ); - } - // verify the required parameter 'salary_and_wages_id' is set - if ($salary_and_wages_id === null || (is_array($salary_and_wages_id) && count($salary_and_wages_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $salary_and_wages_id when calling getEmployeeSalaryAndWage' + 'Missing the required parameter $employee_id when calling getEmployeeTax' ); } - $resourcePath = '/Employees/{EmployeeID}/SalaryAndWages/{SalaryAndWagesID}'; + $resourcePath = '/Employees/{EmployeeID}/Tax'; $formParams = []; $queryParams = []; $headerParams = []; @@ -10203,14 +11499,6 @@ protected function getEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id $resourcePath ); } - // path params - if ($salary_and_wages_id !== null) { - $resourcePath = str_replace( - '{' . 'SalaryAndWagesID' . '}', - PayrollNzObjectSerializer::toPathValue($salary_and_wages_id), - $resourcePath - ); - } // body params $_tempBody = null; if ($multipart) { @@ -10272,33 +11560,33 @@ protected function getEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id } /** - * Operation getEmployeeSalaryAndWages - * Retrieves an employee's salary and wages + * Operation getEmployeeWorkingPattern + * Retrieves employee's working patterns * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) - * @param int $page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. (optional) + * @param string $employee_working_pattern_id Employee working pattern id for single object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWages|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPatternWithWorkingWeeksObject */ - public function getEmployeeSalaryAndWages($xero_tenant_id, $employee_id, $page = null) + public function getEmployeeWorkingPattern($xero_tenant_id, $employee_id, $employee_working_pattern_id) { - list($response) = $this->getEmployeeSalaryAndWagesWithHttpInfo($xero_tenant_id, $employee_id, $page); + list($response) = $this->getEmployeeWorkingPatternWithHttpInfo($xero_tenant_id, $employee_id, $employee_working_pattern_id); return $response; } /** - * Operation getEmployeeSalaryAndWagesWithHttpInfo - * Retrieves an employee's salary and wages + * Operation getEmployeeWorkingPatternWithHttpInfo + * Retrieves employee's working patterns * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) - * @param int $page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. (optional) + * @param string $employee_working_pattern_id Employee working pattern id for single object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWages|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPatternWithWorkingWeeksObject, HTTP status code, HTTP response headers (array of strings) */ - public function getEmployeeSalaryAndWagesWithHttpInfo($xero_tenant_id, $employee_id, $page = null) + public function getEmployeeWorkingPatternWithHttpInfo($xero_tenant_id, $employee_id, $employee_working_pattern_id) { - $request = $this->getEmployeeSalaryAndWagesRequest($xero_tenant_id, $employee_id, $page); + $request = $this->getEmployeeWorkingPatternRequest($xero_tenant_id, $employee_id, $employee_working_pattern_id); try { $options = $this->createHttpClientOption(); try { @@ -10327,29 +11615,18 @@ public function getEmployeeSalaryAndWagesWithHttpInfo($xero_tenant_id, $employee $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWages' === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - } - return [ - PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWages', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPatternWithWorkingWeeksObject' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem', []), + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPatternWithWorkingWeeksObject', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWages'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPatternWithWorkingWeeksObject'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -10366,15 +11643,7 @@ public function getEmployeeSalaryAndWagesWithHttpInfo($xero_tenant_id, $employee case 200: $data = PayrollNzObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWages', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = PayrollNzObjectSerializer::deserialize( - $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPatternWithWorkingWeeksObject', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -10384,17 +11653,17 @@ public function getEmployeeSalaryAndWagesWithHttpInfo($xero_tenant_id, $employee } } /** - * Operation getEmployeeSalaryAndWagesAsync - * Retrieves an employee's salary and wages + * Operation getEmployeeWorkingPatternAsync + * Retrieves employee's working patterns * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) - * @param int $page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. (optional) + * @param string $employee_working_pattern_id Employee working pattern id for single object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getEmployeeSalaryAndWagesAsync($xero_tenant_id, $employee_id, $page = null) + public function getEmployeeWorkingPatternAsync($xero_tenant_id, $employee_id, $employee_working_pattern_id) { - return $this->getEmployeeSalaryAndWagesAsyncWithHttpInfo($xero_tenant_id, $employee_id, $page) + return $this->getEmployeeWorkingPatternAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_working_pattern_id) ->then( function ($response) { return $response[0]; @@ -10402,17 +11671,17 @@ function ($response) { ); } /** - * Operation getEmployeeSalaryAndWagesAsyncWithHttpInfo - * Retrieves an employee's salary and wages + * Operation getEmployeeWorkingPatternAsyncWithHttpInfo + * Retrieves employee's working patterns * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) - * @param int $page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. (optional) + * @param string $employee_working_pattern_id Employee working pattern id for single object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getEmployeeSalaryAndWagesAsyncWithHttpInfo($xero_tenant_id, $employee_id, $page = null) + public function getEmployeeWorkingPatternAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_working_pattern_id) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWages'; - $request = $this->getEmployeeSalaryAndWagesRequest($xero_tenant_id, $employee_id, $page); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPatternWithWorkingWeeksObject'; + $request = $this->getEmployeeWorkingPatternRequest($xero_tenant_id, $employee_id, $employee_working_pattern_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -10447,36 +11716,38 @@ function ($exception) { } /** - * Create request for operation 'getEmployeeSalaryAndWages' + * Create request for operation 'getEmployeeWorkingPattern' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) - * @param int $page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. (optional) + * @param string $employee_working_pattern_id Employee working pattern id for single object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getEmployeeSalaryAndWagesRequest($xero_tenant_id, $employee_id, $page = null) + protected function getEmployeeWorkingPatternRequest($xero_tenant_id, $employee_id, $employee_working_pattern_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getEmployeeSalaryAndWages' + 'Missing the required parameter $xero_tenant_id when calling getEmployeeWorkingPattern' ); } // verify the required parameter 'employee_id' is set if ($employee_id === null || (is_array($employee_id) && count($employee_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $employee_id when calling getEmployeeSalaryAndWages' + 'Missing the required parameter $employee_id when calling getEmployeeWorkingPattern' ); } - $resourcePath = '/Employees/{EmployeeID}/SalaryAndWages'; + // verify the required parameter 'employee_working_pattern_id' is set + if ($employee_working_pattern_id === null || (is_array($employee_working_pattern_id) && count($employee_working_pattern_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $employee_working_pattern_id when calling getEmployeeWorkingPattern' + ); + } + $resourcePath = '/Employees/{EmployeeID}/Working-Patterns/{EmployeeWorkingPatternID}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if ($page !== null) { - $queryParams['page'] = PayrollNzObjectSerializer::toQueryValue($page); - } // header params if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); @@ -10489,6 +11760,14 @@ protected function getEmployeeSalaryAndWagesRequest($xero_tenant_id, $employee_i $resourcePath ); } + // path params + if ($employee_working_pattern_id !== null) { + $resourcePath = str_replace( + '{' . 'EmployeeWorkingPatternID' . '}', + PayrollNzObjectSerializer::toPathValue($employee_working_pattern_id), + $resourcePath + ); + } // body params $_tempBody = null; if ($multipart) { @@ -10550,31 +11829,31 @@ protected function getEmployeeSalaryAndWagesRequest($xero_tenant_id, $employee_i } /** - * Operation getEmployeeTax - * Retrieves tax records for a specific employee + * Operation getEmployeeWorkingPatterns + * Retrieves employee's working patterns * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeTaxObject + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPatternsObject */ - public function getEmployeeTax($xero_tenant_id, $employee_id) + public function getEmployeeWorkingPatterns($xero_tenant_id, $employee_id) { - list($response) = $this->getEmployeeTaxWithHttpInfo($xero_tenant_id, $employee_id); + list($response) = $this->getEmployeeWorkingPatternsWithHttpInfo($xero_tenant_id, $employee_id); return $response; } /** - * Operation getEmployeeTaxWithHttpInfo - * Retrieves tax records for a specific employee + * Operation getEmployeeWorkingPatternsWithHttpInfo + * Retrieves employee's working patterns * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EmployeeTaxObject, HTTP status code, HTTP response headers (array of strings) + * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPatternsObject, HTTP status code, HTTP response headers (array of strings) */ - public function getEmployeeTaxWithHttpInfo($xero_tenant_id, $employee_id) + public function getEmployeeWorkingPatternsWithHttpInfo($xero_tenant_id, $employee_id) { - $request = $this->getEmployeeTaxRequest($xero_tenant_id, $employee_id); + $request = $this->getEmployeeWorkingPatternsRequest($xero_tenant_id, $employee_id); try { $options = $this->createHttpClientOption(); try { @@ -10603,18 +11882,18 @@ public function getEmployeeTaxWithHttpInfo($xero_tenant_id, $employee_id) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeTaxObject' === '\SplFileObject') { + if ('\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPatternsObject' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeTaxObject', []), + PayrollNzObjectSerializer::deserialize($content, '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPatternsObject', []), $response->getStatusCode(), $response->getHeaders() ]; } - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeTaxObject'; + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPatternsObject'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -10631,7 +11910,7 @@ public function getEmployeeTaxWithHttpInfo($xero_tenant_id, $employee_id) case 200: $data = PayrollNzObjectSerializer::deserialize( $e->getResponseBody(), - '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeTaxObject', + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPatternsObject', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -10641,16 +11920,16 @@ public function getEmployeeTaxWithHttpInfo($xero_tenant_id, $employee_id) } } /** - * Operation getEmployeeTaxAsync - * Retrieves tax records for a specific employee + * Operation getEmployeeWorkingPatternsAsync + * Retrieves employee's working patterns * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getEmployeeTaxAsync($xero_tenant_id, $employee_id) + public function getEmployeeWorkingPatternsAsync($xero_tenant_id, $employee_id) { - return $this->getEmployeeTaxAsyncWithHttpInfo($xero_tenant_id, $employee_id) + return $this->getEmployeeWorkingPatternsAsyncWithHttpInfo($xero_tenant_id, $employee_id) ->then( function ($response) { return $response[0]; @@ -10658,16 +11937,16 @@ function ($response) { ); } /** - * Operation getEmployeeTaxAsyncWithHttpInfo - * Retrieves tax records for a specific employee + * Operation getEmployeeWorkingPatternsAsyncWithHttpInfo + * Retrieves employee's working patterns * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function getEmployeeTaxAsyncWithHttpInfo($xero_tenant_id, $employee_id) + public function getEmployeeWorkingPatternsAsyncWithHttpInfo($xero_tenant_id, $employee_id) { - $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeTaxObject'; - $request = $this->getEmployeeTaxRequest($xero_tenant_id, $employee_id); + $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPatternsObject'; + $request = $this->getEmployeeWorkingPatternsRequest($xero_tenant_id, $employee_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -10702,26 +11981,26 @@ function ($exception) { } /** - * Create request for operation 'getEmployeeTax' + * Create request for operation 'getEmployeeWorkingPatterns' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function getEmployeeTaxRequest($xero_tenant_id, $employee_id) + protected function getEmployeeWorkingPatternsRequest($xero_tenant_id, $employee_id) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xero_tenant_id when calling getEmployeeTax' + 'Missing the required parameter $xero_tenant_id when calling getEmployeeWorkingPatterns' ); } // verify the required parameter 'employee_id' is set if ($employee_id === null || (is_array($employee_id) && count($employee_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $employee_id when calling getEmployeeTax' + 'Missing the required parameter $employee_id when calling getEmployeeWorkingPatterns' ); } - $resourcePath = '/Employees/{EmployeeID}/Tax'; + $resourcePath = '/Employees/{EmployeeID}/Working-Patterns'; $formParams = []; $queryParams = []; $headerParams = []; @@ -15532,13 +16811,14 @@ protected function getTrackingCategoriesRequest($xero_tenant_id) * Reverts a timesheet to draft * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $timesheet_id Identifier for the timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function revertTimesheet($xero_tenant_id, $timesheet_id) + public function revertTimesheet($xero_tenant_id, $timesheet_id, $idempotency_key = null) { - list($response) = $this->revertTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id); + list($response) = $this->revertTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id, $idempotency_key); return $response; } /** @@ -15546,13 +16826,14 @@ public function revertTimesheet($xero_tenant_id, $timesheet_id) * Reverts a timesheet to draft * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $timesheet_id Identifier for the timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\TimesheetObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function revertTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id) + public function revertTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id, $idempotency_key = null) { - $request = $this->revertTimesheetRequest($xero_tenant_id, $timesheet_id); + $request = $this->revertTimesheetRequest($xero_tenant_id, $timesheet_id, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -15642,12 +16923,13 @@ public function revertTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id) * Reverts a timesheet to draft * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $timesheet_id Identifier for the timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function revertTimesheetAsync($xero_tenant_id, $timesheet_id) + public function revertTimesheetAsync($xero_tenant_id, $timesheet_id, $idempotency_key = null) { - return $this->revertTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet_id) + return $this->revertTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet_id, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -15659,12 +16941,13 @@ function ($response) { * Reverts a timesheet to draft * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $timesheet_id Identifier for the timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function revertTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet_id) + public function revertTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet_id, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetObject'; - $request = $this->revertTimesheetRequest($xero_tenant_id, $timesheet_id); + $request = $this->revertTimesheetRequest($xero_tenant_id, $timesheet_id, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -15702,9 +16985,10 @@ function ($exception) { * Create request for operation 'revertTimesheet' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $timesheet_id Identifier for the timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function revertTimesheetRequest($xero_tenant_id, $timesheet_id) + protected function revertTimesheetRequest($xero_tenant_id, $timesheet_id, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -15728,6 +17012,10 @@ protected function revertTimesheetRequest($xero_tenant_id, $timesheet_id) if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollNzObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($timesheet_id !== null) { $resourcePath = str_replace( @@ -15802,13 +17090,14 @@ protected function revertTimesheetRequest($xero_tenant_id, $timesheet_id) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Employee $employee employee (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function updateEmployee($xero_tenant_id, $employee_id, $employee) + public function updateEmployee($xero_tenant_id, $employee_id, $employee, $idempotency_key = null) { - list($response) = $this->updateEmployeeWithHttpInfo($xero_tenant_id, $employee_id, $employee); + list($response) = $this->updateEmployeeWithHttpInfo($xero_tenant_id, $employee_id, $employee, $idempotency_key); return $response; } /** @@ -15817,13 +17106,14 @@ public function updateEmployee($xero_tenant_id, $employee_id, $employee) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Employee $employee (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EmployeeObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function updateEmployeeWithHttpInfo($xero_tenant_id, $employee_id, $employee) + public function updateEmployeeWithHttpInfo($xero_tenant_id, $employee_id, $employee, $idempotency_key = null) { - $request = $this->updateEmployeeRequest($xero_tenant_id, $employee_id, $employee); + $request = $this->updateEmployeeRequest($xero_tenant_id, $employee_id, $employee, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -15914,12 +17204,13 @@ public function updateEmployeeWithHttpInfo($xero_tenant_id, $employee_id, $emplo * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Employee $employee (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateEmployeeAsync($xero_tenant_id, $employee_id, $employee) + public function updateEmployeeAsync($xero_tenant_id, $employee_id, $employee, $idempotency_key = null) { - return $this->updateEmployeeAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee) + return $this->updateEmployeeAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -15932,12 +17223,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Employee $employee (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateEmployeeAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee) + public function updateEmployeeAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeObject'; - $request = $this->updateEmployeeRequest($xero_tenant_id, $employee_id, $employee); + $request = $this->updateEmployeeRequest($xero_tenant_id, $employee_id, $employee, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -15976,9 +17268,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Employee $employee (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateEmployeeRequest($xero_tenant_id, $employee_id, $employee) + protected function updateEmployeeRequest($xero_tenant_id, $employee_id, $employee, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -16008,6 +17301,10 @@ protected function updateEmployeeRequest($xero_tenant_id, $employee_id, $employe if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollNzObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($employee_id !== null) { $resourcePath = str_replace( @@ -16086,13 +17383,14 @@ protected function updateEmployeeRequest($xero_tenant_id, $employee_id, $employe * @param string $employee_id Employee id for single object (required) * @param string $pay_template_earning_id Id for single pay template earnings object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplate $earnings_template earnings_template (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplateObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function updateEmployeeEarningsTemplate($xero_tenant_id, $employee_id, $pay_template_earning_id, $earnings_template) + public function updateEmployeeEarningsTemplate($xero_tenant_id, $employee_id, $pay_template_earning_id, $earnings_template, $idempotency_key = null) { - list($response) = $this->updateEmployeeEarningsTemplateWithHttpInfo($xero_tenant_id, $employee_id, $pay_template_earning_id, $earnings_template); + list($response) = $this->updateEmployeeEarningsTemplateWithHttpInfo($xero_tenant_id, $employee_id, $pay_template_earning_id, $earnings_template, $idempotency_key); return $response; } /** @@ -16102,13 +17400,14 @@ public function updateEmployeeEarningsTemplate($xero_tenant_id, $employee_id, $p * @param string $employee_id Employee id for single object (required) * @param string $pay_template_earning_id Id for single pay template earnings object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplate $earnings_template (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplateObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function updateEmployeeEarningsTemplateWithHttpInfo($xero_tenant_id, $employee_id, $pay_template_earning_id, $earnings_template) + public function updateEmployeeEarningsTemplateWithHttpInfo($xero_tenant_id, $employee_id, $pay_template_earning_id, $earnings_template, $idempotency_key = null) { - $request = $this->updateEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $pay_template_earning_id, $earnings_template); + $request = $this->updateEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $pay_template_earning_id, $earnings_template, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -16200,12 +17499,13 @@ public function updateEmployeeEarningsTemplateWithHttpInfo($xero_tenant_id, $emp * @param string $employee_id Employee id for single object (required) * @param string $pay_template_earning_id Id for single pay template earnings object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplate $earnings_template (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateEmployeeEarningsTemplateAsync($xero_tenant_id, $employee_id, $pay_template_earning_id, $earnings_template) + public function updateEmployeeEarningsTemplateAsync($xero_tenant_id, $employee_id, $pay_template_earning_id, $earnings_template, $idempotency_key = null) { - return $this->updateEmployeeEarningsTemplateAsyncWithHttpInfo($xero_tenant_id, $employee_id, $pay_template_earning_id, $earnings_template) + return $this->updateEmployeeEarningsTemplateAsyncWithHttpInfo($xero_tenant_id, $employee_id, $pay_template_earning_id, $earnings_template, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -16219,12 +17519,13 @@ function ($response) { * @param string $employee_id Employee id for single object (required) * @param string $pay_template_earning_id Id for single pay template earnings object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplate $earnings_template (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateEmployeeEarningsTemplateAsyncWithHttpInfo($xero_tenant_id, $employee_id, $pay_template_earning_id, $earnings_template) + public function updateEmployeeEarningsTemplateAsyncWithHttpInfo($xero_tenant_id, $employee_id, $pay_template_earning_id, $earnings_template, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplateObject'; - $request = $this->updateEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $pay_template_earning_id, $earnings_template); + $request = $this->updateEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $pay_template_earning_id, $earnings_template, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -16264,9 +17565,10 @@ function ($exception) { * @param string $employee_id Employee id for single object (required) * @param string $pay_template_earning_id Id for single pay template earnings object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EarningsTemplate $earnings_template (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $pay_template_earning_id, $earnings_template) + protected function updateEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $pay_template_earning_id, $earnings_template, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -16292,7 +17594,7 @@ protected function updateEmployeeEarningsTemplateRequest($xero_tenant_id, $emplo 'Missing the required parameter $earnings_template when calling updateEmployeeEarningsTemplate' ); } - $resourcePath = '/Employees/{EmployeeID}/PayTemplates/earnings/{PayTemplateEarningID}'; + $resourcePath = '/Employees/{EmployeeID}/PayTemplates/Earnings/{PayTemplateEarningID}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -16302,6 +17604,10 @@ protected function updateEmployeeEarningsTemplateRequest($xero_tenant_id, $emplo if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollNzObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($employee_id !== null) { $resourcePath = str_replace( @@ -16388,13 +17694,14 @@ protected function updateEmployeeEarningsTemplateRequest($xero_tenant_id, $emplo * @param string $employee_id Employee id for single object (required) * @param string $leave_id Leave id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeave $employee_leave employee_leave (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function updateEmployeeLeave($xero_tenant_id, $employee_id, $leave_id, $employee_leave) + public function updateEmployeeLeave($xero_tenant_id, $employee_id, $leave_id, $employee_leave, $idempotency_key = null) { - list($response) = $this->updateEmployeeLeaveWithHttpInfo($xero_tenant_id, $employee_id, $leave_id, $employee_leave); + list($response) = $this->updateEmployeeLeaveWithHttpInfo($xero_tenant_id, $employee_id, $leave_id, $employee_leave, $idempotency_key); return $response; } /** @@ -16404,13 +17711,14 @@ public function updateEmployeeLeave($xero_tenant_id, $employee_id, $leave_id, $e * @param string $employee_id Employee id for single object (required) * @param string $leave_id Leave id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeave $employee_leave (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function updateEmployeeLeaveWithHttpInfo($xero_tenant_id, $employee_id, $leave_id, $employee_leave) + public function updateEmployeeLeaveWithHttpInfo($xero_tenant_id, $employee_id, $leave_id, $employee_leave, $idempotency_key = null) { - $request = $this->updateEmployeeLeaveRequest($xero_tenant_id, $employee_id, $leave_id, $employee_leave); + $request = $this->updateEmployeeLeaveRequest($xero_tenant_id, $employee_id, $leave_id, $employee_leave, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -16502,12 +17810,13 @@ public function updateEmployeeLeaveWithHttpInfo($xero_tenant_id, $employee_id, $ * @param string $employee_id Employee id for single object (required) * @param string $leave_id Leave id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeave $employee_leave (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateEmployeeLeaveAsync($xero_tenant_id, $employee_id, $leave_id, $employee_leave) + public function updateEmployeeLeaveAsync($xero_tenant_id, $employee_id, $leave_id, $employee_leave, $idempotency_key = null) { - return $this->updateEmployeeLeaveAsyncWithHttpInfo($xero_tenant_id, $employee_id, $leave_id, $employee_leave) + return $this->updateEmployeeLeaveAsyncWithHttpInfo($xero_tenant_id, $employee_id, $leave_id, $employee_leave, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -16521,12 +17830,13 @@ function ($response) { * @param string $employee_id Employee id for single object (required) * @param string $leave_id Leave id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeave $employee_leave (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateEmployeeLeaveAsyncWithHttpInfo($xero_tenant_id, $employee_id, $leave_id, $employee_leave) + public function updateEmployeeLeaveAsyncWithHttpInfo($xero_tenant_id, $employee_id, $leave_id, $employee_leave, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeaveObject'; - $request = $this->updateEmployeeLeaveRequest($xero_tenant_id, $employee_id, $leave_id, $employee_leave); + $request = $this->updateEmployeeLeaveRequest($xero_tenant_id, $employee_id, $leave_id, $employee_leave, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -16566,9 +17876,10 @@ function ($exception) { * @param string $employee_id Employee id for single object (required) * @param string $leave_id Leave id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeLeave $employee_leave (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateEmployeeLeaveRequest($xero_tenant_id, $employee_id, $leave_id, $employee_leave) + protected function updateEmployeeLeaveRequest($xero_tenant_id, $employee_id, $leave_id, $employee_leave, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -16604,6 +17915,10 @@ protected function updateEmployeeLeaveRequest($xero_tenant_id, $employee_id, $le if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollNzObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($employee_id !== null) { $resourcePath = str_replace( @@ -16690,13 +18005,14 @@ protected function updateEmployeeLeaveRequest($xero_tenant_id, $employee_id, $le * @param string $employee_id Employee id for single object (required) * @param string $salary_and_wages_id Id for single pay template earnings object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWage $salary_and_wage salary_and_wage (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWageObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function updateEmployeeSalaryAndWage($xero_tenant_id, $employee_id, $salary_and_wages_id, $salary_and_wage) + public function updateEmployeeSalaryAndWage($xero_tenant_id, $employee_id, $salary_and_wages_id, $salary_and_wage, $idempotency_key = null) { - list($response) = $this->updateEmployeeSalaryAndWageWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wages_id, $salary_and_wage); + list($response) = $this->updateEmployeeSalaryAndWageWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wages_id, $salary_and_wage, $idempotency_key); return $response; } /** @@ -16706,13 +18022,14 @@ public function updateEmployeeSalaryAndWage($xero_tenant_id, $employee_id, $sala * @param string $employee_id Employee id for single object (required) * @param string $salary_and_wages_id Id for single pay template earnings object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWage $salary_and_wage (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWageObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function updateEmployeeSalaryAndWageWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wages_id, $salary_and_wage) + public function updateEmployeeSalaryAndWageWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wages_id, $salary_and_wage, $idempotency_key = null) { - $request = $this->updateEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id, $salary_and_wages_id, $salary_and_wage); + $request = $this->updateEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id, $salary_and_wages_id, $salary_and_wage, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -16804,12 +18121,13 @@ public function updateEmployeeSalaryAndWageWithHttpInfo($xero_tenant_id, $employ * @param string $employee_id Employee id for single object (required) * @param string $salary_and_wages_id Id for single pay template earnings object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWage $salary_and_wage (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateEmployeeSalaryAndWageAsync($xero_tenant_id, $employee_id, $salary_and_wages_id, $salary_and_wage) + public function updateEmployeeSalaryAndWageAsync($xero_tenant_id, $employee_id, $salary_and_wages_id, $salary_and_wage, $idempotency_key = null) { - return $this->updateEmployeeSalaryAndWageAsyncWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wages_id, $salary_and_wage) + return $this->updateEmployeeSalaryAndWageAsyncWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wages_id, $salary_and_wage, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -16823,12 +18141,13 @@ function ($response) { * @param string $employee_id Employee id for single object (required) * @param string $salary_and_wages_id Id for single pay template earnings object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWage $salary_and_wage (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateEmployeeSalaryAndWageAsyncWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wages_id, $salary_and_wage) + public function updateEmployeeSalaryAndWageAsyncWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wages_id, $salary_and_wage, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWageObject'; - $request = $this->updateEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id, $salary_and_wages_id, $salary_and_wage); + $request = $this->updateEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id, $salary_and_wages_id, $salary_and_wage, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -16868,9 +18187,10 @@ function ($exception) { * @param string $employee_id Employee id for single object (required) * @param string $salary_and_wages_id Id for single pay template earnings object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\SalaryAndWage $salary_and_wage (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id, $salary_and_wages_id, $salary_and_wage) + protected function updateEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id, $salary_and_wages_id, $salary_and_wage, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -16906,6 +18226,10 @@ protected function updateEmployeeSalaryAndWageRequest($xero_tenant_id, $employee if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollNzObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($employee_id !== null) { $resourcePath = str_replace( @@ -16991,13 +18315,14 @@ protected function updateEmployeeSalaryAndWageRequest($xero_tenant_id, $employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeTax $employee_tax employee_tax (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeTaxObject */ - public function updateEmployeeTax($xero_tenant_id, $employee_id, $employee_tax) + public function updateEmployeeTax($xero_tenant_id, $employee_id, $employee_tax, $idempotency_key = null) { - list($response) = $this->updateEmployeeTaxWithHttpInfo($xero_tenant_id, $employee_id, $employee_tax); + list($response) = $this->updateEmployeeTaxWithHttpInfo($xero_tenant_id, $employee_id, $employee_tax, $idempotency_key); return $response; } /** @@ -17006,13 +18331,14 @@ public function updateEmployeeTax($xero_tenant_id, $employee_id, $employee_tax) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeTax $employee_tax (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\EmployeeTaxObject, HTTP status code, HTTP response headers (array of strings) */ - public function updateEmployeeTaxWithHttpInfo($xero_tenant_id, $employee_id, $employee_tax) + public function updateEmployeeTaxWithHttpInfo($xero_tenant_id, $employee_id, $employee_tax, $idempotency_key = null) { - $request = $this->updateEmployeeTaxRequest($xero_tenant_id, $employee_id, $employee_tax); + $request = $this->updateEmployeeTaxRequest($xero_tenant_id, $employee_id, $employee_tax, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -17084,12 +18410,13 @@ public function updateEmployeeTaxWithHttpInfo($xero_tenant_id, $employee_id, $em * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeTax $employee_tax (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateEmployeeTaxAsync($xero_tenant_id, $employee_id, $employee_tax) + public function updateEmployeeTaxAsync($xero_tenant_id, $employee_id, $employee_tax, $idempotency_key = null) { - return $this->updateEmployeeTaxAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_tax) + return $this->updateEmployeeTaxAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_tax, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -17102,12 +18429,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeTax $employee_tax (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateEmployeeTaxAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_tax) + public function updateEmployeeTaxAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_tax, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeTaxObject'; - $request = $this->updateEmployeeTaxRequest($xero_tenant_id, $employee_id, $employee_tax); + $request = $this->updateEmployeeTaxRequest($xero_tenant_id, $employee_id, $employee_tax, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -17146,9 +18474,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeTax $employee_tax (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateEmployeeTaxRequest($xero_tenant_id, $employee_id, $employee_tax) + protected function updateEmployeeTaxRequest($xero_tenant_id, $employee_id, $employee_tax, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -17178,6 +18507,10 @@ protected function updateEmployeeTaxRequest($xero_tenant_id, $employee_id, $empl if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollNzObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($employee_id !== null) { $resourcePath = str_replace( @@ -17255,13 +18588,14 @@ protected function updateEmployeeTaxRequest($xero_tenant_id, $employee_id, $empl * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $pay_run_id Identifier for the pay run (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRun $pay_run pay_run (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRunObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function updatePayRun($xero_tenant_id, $pay_run_id, $pay_run) + public function updatePayRun($xero_tenant_id, $pay_run_id, $pay_run, $idempotency_key = null) { - list($response) = $this->updatePayRunWithHttpInfo($xero_tenant_id, $pay_run_id, $pay_run); + list($response) = $this->updatePayRunWithHttpInfo($xero_tenant_id, $pay_run_id, $pay_run, $idempotency_key); return $response; } /** @@ -17270,13 +18604,14 @@ public function updatePayRun($xero_tenant_id, $pay_run_id, $pay_run) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $pay_run_id Identifier for the pay run (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRun $pay_run (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\PayRunObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function updatePayRunWithHttpInfo($xero_tenant_id, $pay_run_id, $pay_run) + public function updatePayRunWithHttpInfo($xero_tenant_id, $pay_run_id, $pay_run, $idempotency_key = null) { - $request = $this->updatePayRunRequest($xero_tenant_id, $pay_run_id, $pay_run); + $request = $this->updatePayRunRequest($xero_tenant_id, $pay_run_id, $pay_run, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -17367,12 +18702,13 @@ public function updatePayRunWithHttpInfo($xero_tenant_id, $pay_run_id, $pay_run) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $pay_run_id Identifier for the pay run (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRun $pay_run (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updatePayRunAsync($xero_tenant_id, $pay_run_id, $pay_run) + public function updatePayRunAsync($xero_tenant_id, $pay_run_id, $pay_run, $idempotency_key = null) { - return $this->updatePayRunAsyncWithHttpInfo($xero_tenant_id, $pay_run_id, $pay_run) + return $this->updatePayRunAsyncWithHttpInfo($xero_tenant_id, $pay_run_id, $pay_run, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -17385,12 +18721,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $pay_run_id Identifier for the pay run (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRun $pay_run (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updatePayRunAsyncWithHttpInfo($xero_tenant_id, $pay_run_id, $pay_run) + public function updatePayRunAsyncWithHttpInfo($xero_tenant_id, $pay_run_id, $pay_run, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRunObject'; - $request = $this->updatePayRunRequest($xero_tenant_id, $pay_run_id, $pay_run); + $request = $this->updatePayRunRequest($xero_tenant_id, $pay_run_id, $pay_run, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -17429,9 +18766,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $pay_run_id Identifier for the pay run (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PayRun $pay_run (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updatePayRunRequest($xero_tenant_id, $pay_run_id, $pay_run) + protected function updatePayRunRequest($xero_tenant_id, $pay_run_id, $pay_run, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -17461,6 +18799,10 @@ protected function updatePayRunRequest($xero_tenant_id, $pay_run_id, $pay_run) if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollNzObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($pay_run_id !== null) { $resourcePath = str_replace( @@ -17538,13 +18880,14 @@ protected function updatePayRunRequest($xero_tenant_id, $pay_run_id, $pay_run) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $pay_slip_id Identifier for the payslip (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PaySlip $pay_slip pay_slip (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PaySlipObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function updatePaySlipLineItems($xero_tenant_id, $pay_slip_id, $pay_slip) + public function updatePaySlipLineItems($xero_tenant_id, $pay_slip_id, $pay_slip, $idempotency_key = null) { - list($response) = $this->updatePaySlipLineItemsWithHttpInfo($xero_tenant_id, $pay_slip_id, $pay_slip); + list($response) = $this->updatePaySlipLineItemsWithHttpInfo($xero_tenant_id, $pay_slip_id, $pay_slip, $idempotency_key); return $response; } /** @@ -17553,13 +18896,14 @@ public function updatePaySlipLineItems($xero_tenant_id, $pay_slip_id, $pay_slip) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $pay_slip_id Identifier for the payslip (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PaySlip $pay_slip (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\PaySlipObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function updatePaySlipLineItemsWithHttpInfo($xero_tenant_id, $pay_slip_id, $pay_slip) + public function updatePaySlipLineItemsWithHttpInfo($xero_tenant_id, $pay_slip_id, $pay_slip, $idempotency_key = null) { - $request = $this->updatePaySlipLineItemsRequest($xero_tenant_id, $pay_slip_id, $pay_slip); + $request = $this->updatePaySlipLineItemsRequest($xero_tenant_id, $pay_slip_id, $pay_slip, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -17650,12 +18994,13 @@ public function updatePaySlipLineItemsWithHttpInfo($xero_tenant_id, $pay_slip_id * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $pay_slip_id Identifier for the payslip (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PaySlip $pay_slip (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updatePaySlipLineItemsAsync($xero_tenant_id, $pay_slip_id, $pay_slip) + public function updatePaySlipLineItemsAsync($xero_tenant_id, $pay_slip_id, $pay_slip, $idempotency_key = null) { - return $this->updatePaySlipLineItemsAsyncWithHttpInfo($xero_tenant_id, $pay_slip_id, $pay_slip) + return $this->updatePaySlipLineItemsAsyncWithHttpInfo($xero_tenant_id, $pay_slip_id, $pay_slip, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -17668,12 +19013,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $pay_slip_id Identifier for the payslip (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PaySlip $pay_slip (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updatePaySlipLineItemsAsyncWithHttpInfo($xero_tenant_id, $pay_slip_id, $pay_slip) + public function updatePaySlipLineItemsAsyncWithHttpInfo($xero_tenant_id, $pay_slip_id, $pay_slip, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PaySlipObject'; - $request = $this->updatePaySlipLineItemsRequest($xero_tenant_id, $pay_slip_id, $pay_slip); + $request = $this->updatePaySlipLineItemsRequest($xero_tenant_id, $pay_slip_id, $pay_slip, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -17712,9 +19058,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $pay_slip_id Identifier for the payslip (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\PaySlip $pay_slip (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updatePaySlipLineItemsRequest($xero_tenant_id, $pay_slip_id, $pay_slip) + protected function updatePaySlipLineItemsRequest($xero_tenant_id, $pay_slip_id, $pay_slip, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -17744,6 +19091,10 @@ protected function updatePaySlipLineItemsRequest($xero_tenant_id, $pay_slip_id, if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollNzObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($pay_slip_id !== null) { $resourcePath = str_replace( @@ -17822,13 +19173,14 @@ protected function updatePaySlipLineItemsRequest($xero_tenant_id, $pay_slip_id, * @param string $timesheet_id Identifier for the timesheet (required) * @param string $timesheet_line_id Identifier for the timesheet line (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine $timesheet_line timesheet_line (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLineObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem */ - public function updateTimesheetLine($xero_tenant_id, $timesheet_id, $timesheet_line_id, $timesheet_line) + public function updateTimesheetLine($xero_tenant_id, $timesheet_id, $timesheet_line_id, $timesheet_line, $idempotency_key = null) { - list($response) = $this->updateTimesheetLineWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line_id, $timesheet_line); + list($response) = $this->updateTimesheetLineWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line_id, $timesheet_line, $idempotency_key); return $response; } /** @@ -17838,13 +19190,14 @@ public function updateTimesheetLine($xero_tenant_id, $timesheet_id, $timesheet_l * @param string $timesheet_id Identifier for the timesheet (required) * @param string $timesheet_line_id Identifier for the timesheet line (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine $timesheet_line (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLineObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function updateTimesheetLineWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line_id, $timesheet_line) + public function updateTimesheetLineWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line_id, $timesheet_line, $idempotency_key = null) { - $request = $this->updateTimesheetLineRequest($xero_tenant_id, $timesheet_id, $timesheet_line_id, $timesheet_line); + $request = $this->updateTimesheetLineRequest($xero_tenant_id, $timesheet_id, $timesheet_line_id, $timesheet_line, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -17936,12 +19289,13 @@ public function updateTimesheetLineWithHttpInfo($xero_tenant_id, $timesheet_id, * @param string $timesheet_id Identifier for the timesheet (required) * @param string $timesheet_line_id Identifier for the timesheet line (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine $timesheet_line (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateTimesheetLineAsync($xero_tenant_id, $timesheet_id, $timesheet_line_id, $timesheet_line) + public function updateTimesheetLineAsync($xero_tenant_id, $timesheet_id, $timesheet_line_id, $timesheet_line, $idempotency_key = null) { - return $this->updateTimesheetLineAsyncWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line_id, $timesheet_line) + return $this->updateTimesheetLineAsyncWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line_id, $timesheet_line, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -17955,12 +19309,13 @@ function ($response) { * @param string $timesheet_id Identifier for the timesheet (required) * @param string $timesheet_line_id Identifier for the timesheet line (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine $timesheet_line (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateTimesheetLineAsyncWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line_id, $timesheet_line) + public function updateTimesheetLineAsyncWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line_id, $timesheet_line, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLineObject'; - $request = $this->updateTimesheetLineRequest($xero_tenant_id, $timesheet_id, $timesheet_line_id, $timesheet_line); + $request = $this->updateTimesheetLineRequest($xero_tenant_id, $timesheet_id, $timesheet_line_id, $timesheet_line, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -18000,9 +19355,10 @@ function ($exception) { * @param string $timesheet_id Identifier for the timesheet (required) * @param string $timesheet_line_id Identifier for the timesheet line (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\TimesheetLine $timesheet_line (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateTimesheetLineRequest($xero_tenant_id, $timesheet_id, $timesheet_line_id, $timesheet_line) + protected function updateTimesheetLineRequest($xero_tenant_id, $timesheet_id, $timesheet_line_id, $timesheet_line, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -18038,6 +19394,10 @@ protected function updateTimesheetLineRequest($xero_tenant_id, $timesheet_id, $t if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollNzObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollNzObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($timesheet_id !== null) { $resourcePath = str_replace( diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Api/PayrollUkApi.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Api/PayrollUkApi.php index d9794f5..289834d 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Api/PayrollUkApi.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Api/PayrollUkApi.php @@ -9,7 +9,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -18,7 +18,7 @@ * * This is the Xero Payroll API for orgs in the UK region. * - * OpenAPI spec version: 2.35.0 + * OpenAPI spec version: 6.2.0 * Contact: api@xero.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 5.4.0 @@ -94,13 +94,14 @@ public function getConfig() * Approves a specific timesheet * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $timesheet_id Identifier for the timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\TimesheetObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem */ - public function approveTimesheet($xero_tenant_id, $timesheet_id) + public function approveTimesheet($xero_tenant_id, $timesheet_id, $idempotency_key = null) { - list($response) = $this->approveTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id); + list($response) = $this->approveTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id, $idempotency_key); return $response; } /** @@ -108,13 +109,14 @@ public function approveTimesheet($xero_tenant_id, $timesheet_id) * Approves a specific timesheet * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $timesheet_id Identifier for the timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollUk\TimesheetObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function approveTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id) + public function approveTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id, $idempotency_key = null) { - $request = $this->approveTimesheetRequest($xero_tenant_id, $timesheet_id); + $request = $this->approveTimesheetRequest($xero_tenant_id, $timesheet_id, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -204,12 +206,13 @@ public function approveTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id) * Approves a specific timesheet * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $timesheet_id Identifier for the timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function approveTimesheetAsync($xero_tenant_id, $timesheet_id) + public function approveTimesheetAsync($xero_tenant_id, $timesheet_id, $idempotency_key = null) { - return $this->approveTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet_id) + return $this->approveTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet_id, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -221,12 +224,13 @@ function ($response) { * Approves a specific timesheet * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $timesheet_id Identifier for the timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function approveTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet_id) + public function approveTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet_id, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\TimesheetObject'; - $request = $this->approveTimesheetRequest($xero_tenant_id, $timesheet_id); + $request = $this->approveTimesheetRequest($xero_tenant_id, $timesheet_id, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -264,9 +268,10 @@ function ($exception) { * Create request for operation 'approveTimesheet' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $timesheet_id Identifier for the timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function approveTimesheetRequest($xero_tenant_id, $timesheet_id) + protected function approveTimesheetRequest($xero_tenant_id, $timesheet_id, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -290,6 +295,10 @@ protected function approveTimesheetRequest($xero_tenant_id, $timesheet_id) if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollUkObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollUkObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($timesheet_id !== null) { $resourcePath = str_replace( @@ -363,13 +372,14 @@ protected function approveTimesheetRequest($xero_tenant_id, $timesheet_id) * Creates a new employee benefit * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Benefit $benefit benefit (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\BenefitObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem */ - public function createBenefit($xero_tenant_id, $benefit) + public function createBenefit($xero_tenant_id, $benefit, $idempotency_key = null) { - list($response) = $this->createBenefitWithHttpInfo($xero_tenant_id, $benefit); + list($response) = $this->createBenefitWithHttpInfo($xero_tenant_id, $benefit, $idempotency_key); return $response; } /** @@ -377,13 +387,14 @@ public function createBenefit($xero_tenant_id, $benefit) * Creates a new employee benefit * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Benefit $benefit (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollUk\BenefitObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createBenefitWithHttpInfo($xero_tenant_id, $benefit) + public function createBenefitWithHttpInfo($xero_tenant_id, $benefit, $idempotency_key = null) { - $request = $this->createBenefitRequest($xero_tenant_id, $benefit); + $request = $this->createBenefitRequest($xero_tenant_id, $benefit, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -473,12 +484,13 @@ public function createBenefitWithHttpInfo($xero_tenant_id, $benefit) * Creates a new employee benefit * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Benefit $benefit (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createBenefitAsync($xero_tenant_id, $benefit) + public function createBenefitAsync($xero_tenant_id, $benefit, $idempotency_key = null) { - return $this->createBenefitAsyncWithHttpInfo($xero_tenant_id, $benefit) + return $this->createBenefitAsyncWithHttpInfo($xero_tenant_id, $benefit, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -490,12 +502,13 @@ function ($response) { * Creates a new employee benefit * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Benefit $benefit (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createBenefitAsyncWithHttpInfo($xero_tenant_id, $benefit) + public function createBenefitAsyncWithHttpInfo($xero_tenant_id, $benefit, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\BenefitObject'; - $request = $this->createBenefitRequest($xero_tenant_id, $benefit); + $request = $this->createBenefitRequest($xero_tenant_id, $benefit, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -533,9 +546,10 @@ function ($exception) { * Create request for operation 'createBenefit' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Benefit $benefit (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createBenefitRequest($xero_tenant_id, $benefit) + protected function createBenefitRequest($xero_tenant_id, $benefit, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -559,6 +573,10 @@ protected function createBenefitRequest($xero_tenant_id, $benefit) if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollUkObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollUkObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($benefit)) { @@ -627,13 +645,14 @@ protected function createBenefitRequest($xero_tenant_id, $benefit) * Creates a new deduction * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Deduction $deduction deduction (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\DeductionObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem */ - public function createDeduction($xero_tenant_id, $deduction) + public function createDeduction($xero_tenant_id, $deduction, $idempotency_key = null) { - list($response) = $this->createDeductionWithHttpInfo($xero_tenant_id, $deduction); + list($response) = $this->createDeductionWithHttpInfo($xero_tenant_id, $deduction, $idempotency_key); return $response; } /** @@ -641,13 +660,14 @@ public function createDeduction($xero_tenant_id, $deduction) * Creates a new deduction * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Deduction $deduction (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollUk\DeductionObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createDeductionWithHttpInfo($xero_tenant_id, $deduction) + public function createDeductionWithHttpInfo($xero_tenant_id, $deduction, $idempotency_key = null) { - $request = $this->createDeductionRequest($xero_tenant_id, $deduction); + $request = $this->createDeductionRequest($xero_tenant_id, $deduction, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -737,12 +757,13 @@ public function createDeductionWithHttpInfo($xero_tenant_id, $deduction) * Creates a new deduction * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Deduction $deduction (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createDeductionAsync($xero_tenant_id, $deduction) + public function createDeductionAsync($xero_tenant_id, $deduction, $idempotency_key = null) { - return $this->createDeductionAsyncWithHttpInfo($xero_tenant_id, $deduction) + return $this->createDeductionAsyncWithHttpInfo($xero_tenant_id, $deduction, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -754,12 +775,13 @@ function ($response) { * Creates a new deduction * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Deduction $deduction (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createDeductionAsyncWithHttpInfo($xero_tenant_id, $deduction) + public function createDeductionAsyncWithHttpInfo($xero_tenant_id, $deduction, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\DeductionObject'; - $request = $this->createDeductionRequest($xero_tenant_id, $deduction); + $request = $this->createDeductionRequest($xero_tenant_id, $deduction, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -797,9 +819,10 @@ function ($exception) { * Create request for operation 'createDeduction' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Deduction $deduction (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createDeductionRequest($xero_tenant_id, $deduction) + protected function createDeductionRequest($xero_tenant_id, $deduction, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -823,6 +846,10 @@ protected function createDeductionRequest($xero_tenant_id, $deduction) if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollUkObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollUkObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($deduction)) { @@ -891,13 +918,14 @@ protected function createDeductionRequest($xero_tenant_id, $deduction) * Creates a new earnings rate * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EarningsRate $earnings_rate earnings_rate (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EarningsRateObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem */ - public function createEarningsRate($xero_tenant_id, $earnings_rate) + public function createEarningsRate($xero_tenant_id, $earnings_rate, $idempotency_key = null) { - list($response) = $this->createEarningsRateWithHttpInfo($xero_tenant_id, $earnings_rate); + list($response) = $this->createEarningsRateWithHttpInfo($xero_tenant_id, $earnings_rate, $idempotency_key); return $response; } /** @@ -905,13 +933,14 @@ public function createEarningsRate($xero_tenant_id, $earnings_rate) * Creates a new earnings rate * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EarningsRate $earnings_rate (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollUk\EarningsRateObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createEarningsRateWithHttpInfo($xero_tenant_id, $earnings_rate) + public function createEarningsRateWithHttpInfo($xero_tenant_id, $earnings_rate, $idempotency_key = null) { - $request = $this->createEarningsRateRequest($xero_tenant_id, $earnings_rate); + $request = $this->createEarningsRateRequest($xero_tenant_id, $earnings_rate, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -1001,12 +1030,13 @@ public function createEarningsRateWithHttpInfo($xero_tenant_id, $earnings_rate) * Creates a new earnings rate * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EarningsRate $earnings_rate (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEarningsRateAsync($xero_tenant_id, $earnings_rate) + public function createEarningsRateAsync($xero_tenant_id, $earnings_rate, $idempotency_key = null) { - return $this->createEarningsRateAsyncWithHttpInfo($xero_tenant_id, $earnings_rate) + return $this->createEarningsRateAsyncWithHttpInfo($xero_tenant_id, $earnings_rate, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -1018,12 +1048,13 @@ function ($response) { * Creates a new earnings rate * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EarningsRate $earnings_rate (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEarningsRateAsyncWithHttpInfo($xero_tenant_id, $earnings_rate) + public function createEarningsRateAsyncWithHttpInfo($xero_tenant_id, $earnings_rate, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EarningsRateObject'; - $request = $this->createEarningsRateRequest($xero_tenant_id, $earnings_rate); + $request = $this->createEarningsRateRequest($xero_tenant_id, $earnings_rate, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -1061,9 +1092,10 @@ function ($exception) { * Create request for operation 'createEarningsRate' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EarningsRate $earnings_rate (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createEarningsRateRequest($xero_tenant_id, $earnings_rate) + protected function createEarningsRateRequest($xero_tenant_id, $earnings_rate, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -1087,6 +1119,10 @@ protected function createEarningsRateRequest($xero_tenant_id, $earnings_rate) if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollUkObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollUkObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($earnings_rate)) { @@ -1155,13 +1191,14 @@ protected function createEarningsRateRequest($xero_tenant_id, $earnings_rate) * Creates employees * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Employee $employee employee (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem */ - public function createEmployee($xero_tenant_id, $employee) + public function createEmployee($xero_tenant_id, $employee, $idempotency_key = null) { - list($response) = $this->createEmployeeWithHttpInfo($xero_tenant_id, $employee); + list($response) = $this->createEmployeeWithHttpInfo($xero_tenant_id, $employee, $idempotency_key); return $response; } /** @@ -1169,13 +1206,14 @@ public function createEmployee($xero_tenant_id, $employee) * Creates employees * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Employee $employee (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollUk\EmployeeObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createEmployeeWithHttpInfo($xero_tenant_id, $employee) + public function createEmployeeWithHttpInfo($xero_tenant_id, $employee, $idempotency_key = null) { - $request = $this->createEmployeeRequest($xero_tenant_id, $employee); + $request = $this->createEmployeeRequest($xero_tenant_id, $employee, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -1265,12 +1303,13 @@ public function createEmployeeWithHttpInfo($xero_tenant_id, $employee) * Creates employees * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Employee $employee (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeeAsync($xero_tenant_id, $employee) + public function createEmployeeAsync($xero_tenant_id, $employee, $idempotency_key = null) { - return $this->createEmployeeAsyncWithHttpInfo($xero_tenant_id, $employee) + return $this->createEmployeeAsyncWithHttpInfo($xero_tenant_id, $employee, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -1282,12 +1321,13 @@ function ($response) { * Creates employees * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Employee $employee (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeeAsyncWithHttpInfo($xero_tenant_id, $employee) + public function createEmployeeAsyncWithHttpInfo($xero_tenant_id, $employee, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeObject'; - $request = $this->createEmployeeRequest($xero_tenant_id, $employee); + $request = $this->createEmployeeRequest($xero_tenant_id, $employee, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -1325,9 +1365,10 @@ function ($exception) { * Create request for operation 'createEmployee' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Employee $employee (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createEmployeeRequest($xero_tenant_id, $employee) + protected function createEmployeeRequest($xero_tenant_id, $employee, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -1351,6 +1392,10 @@ protected function createEmployeeRequest($xero_tenant_id, $employee) if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollUkObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollUkObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($employee)) { @@ -1420,13 +1465,14 @@ protected function createEmployeeRequest($xero_tenant_id, $employee) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EarningsTemplate $earnings_template earnings_template (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EarningsTemplateObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem */ - public function createEmployeeEarningsTemplate($xero_tenant_id, $employee_id, $earnings_template) + public function createEmployeeEarningsTemplate($xero_tenant_id, $employee_id, $earnings_template, $idempotency_key = null) { - list($response) = $this->createEmployeeEarningsTemplateWithHttpInfo($xero_tenant_id, $employee_id, $earnings_template); + list($response) = $this->createEmployeeEarningsTemplateWithHttpInfo($xero_tenant_id, $employee_id, $earnings_template, $idempotency_key); return $response; } /** @@ -1435,13 +1481,14 @@ public function createEmployeeEarningsTemplate($xero_tenant_id, $employee_id, $e * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EarningsTemplate $earnings_template (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollUk\EarningsTemplateObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createEmployeeEarningsTemplateWithHttpInfo($xero_tenant_id, $employee_id, $earnings_template) + public function createEmployeeEarningsTemplateWithHttpInfo($xero_tenant_id, $employee_id, $earnings_template, $idempotency_key = null) { - $request = $this->createEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $earnings_template); + $request = $this->createEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $earnings_template, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -1532,12 +1579,13 @@ public function createEmployeeEarningsTemplateWithHttpInfo($xero_tenant_id, $emp * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EarningsTemplate $earnings_template (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeeEarningsTemplateAsync($xero_tenant_id, $employee_id, $earnings_template) + public function createEmployeeEarningsTemplateAsync($xero_tenant_id, $employee_id, $earnings_template, $idempotency_key = null) { - return $this->createEmployeeEarningsTemplateAsyncWithHttpInfo($xero_tenant_id, $employee_id, $earnings_template) + return $this->createEmployeeEarningsTemplateAsyncWithHttpInfo($xero_tenant_id, $employee_id, $earnings_template, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -1550,12 +1598,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EarningsTemplate $earnings_template (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeeEarningsTemplateAsyncWithHttpInfo($xero_tenant_id, $employee_id, $earnings_template) + public function createEmployeeEarningsTemplateAsyncWithHttpInfo($xero_tenant_id, $employee_id, $earnings_template, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EarningsTemplateObject'; - $request = $this->createEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $earnings_template); + $request = $this->createEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $earnings_template, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -1594,9 +1643,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EarningsTemplate $earnings_template (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $earnings_template) + protected function createEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $earnings_template, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -1626,6 +1676,10 @@ protected function createEmployeeEarningsTemplateRequest($xero_tenant_id, $emplo if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollUkObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollUkObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($employee_id !== null) { $resourcePath = str_replace( @@ -1703,13 +1757,14 @@ protected function createEmployeeEarningsTemplateRequest($xero_tenant_id, $emplo * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeLeave $employee_leave employee_leave (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeLeaveObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem */ - public function createEmployeeLeave($xero_tenant_id, $employee_id, $employee_leave) + public function createEmployeeLeave($xero_tenant_id, $employee_id, $employee_leave, $idempotency_key = null) { - list($response) = $this->createEmployeeLeaveWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave); + list($response) = $this->createEmployeeLeaveWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave, $idempotency_key); return $response; } /** @@ -1718,13 +1773,14 @@ public function createEmployeeLeave($xero_tenant_id, $employee_id, $employee_lea * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeLeave $employee_leave (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollUk\EmployeeLeaveObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createEmployeeLeaveWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave) + public function createEmployeeLeaveWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave, $idempotency_key = null) { - $request = $this->createEmployeeLeaveRequest($xero_tenant_id, $employee_id, $employee_leave); + $request = $this->createEmployeeLeaveRequest($xero_tenant_id, $employee_id, $employee_leave, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -1815,12 +1871,13 @@ public function createEmployeeLeaveWithHttpInfo($xero_tenant_id, $employee_id, $ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeLeave $employee_leave (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeeLeaveAsync($xero_tenant_id, $employee_id, $employee_leave) + public function createEmployeeLeaveAsync($xero_tenant_id, $employee_id, $employee_leave, $idempotency_key = null) { - return $this->createEmployeeLeaveAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave) + return $this->createEmployeeLeaveAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -1833,12 +1890,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeLeave $employee_leave (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeeLeaveAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave) + public function createEmployeeLeaveAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeLeaveObject'; - $request = $this->createEmployeeLeaveRequest($xero_tenant_id, $employee_id, $employee_leave); + $request = $this->createEmployeeLeaveRequest($xero_tenant_id, $employee_id, $employee_leave, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -1877,9 +1935,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeLeave $employee_leave (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createEmployeeLeaveRequest($xero_tenant_id, $employee_id, $employee_leave) + protected function createEmployeeLeaveRequest($xero_tenant_id, $employee_id, $employee_leave, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -1909,6 +1968,10 @@ protected function createEmployeeLeaveRequest($xero_tenant_id, $employee_id, $em if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollUkObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollUkObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($employee_id !== null) { $resourcePath = str_replace( @@ -1986,13 +2049,14 @@ protected function createEmployeeLeaveRequest($xero_tenant_id, $employee_id, $em * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeLeaveType $employee_leave_type employee_leave_type (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeLeaveTypeObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem */ - public function createEmployeeLeaveType($xero_tenant_id, $employee_id, $employee_leave_type) + public function createEmployeeLeaveType($xero_tenant_id, $employee_id, $employee_leave_type, $idempotency_key = null) { - list($response) = $this->createEmployeeLeaveTypeWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave_type); + list($response) = $this->createEmployeeLeaveTypeWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave_type, $idempotency_key); return $response; } /** @@ -2001,13 +2065,14 @@ public function createEmployeeLeaveType($xero_tenant_id, $employee_id, $employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeLeaveType $employee_leave_type (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollUk\EmployeeLeaveTypeObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createEmployeeLeaveTypeWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave_type) + public function createEmployeeLeaveTypeWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave_type, $idempotency_key = null) { - $request = $this->createEmployeeLeaveTypeRequest($xero_tenant_id, $employee_id, $employee_leave_type); + $request = $this->createEmployeeLeaveTypeRequest($xero_tenant_id, $employee_id, $employee_leave_type, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -2098,12 +2163,13 @@ public function createEmployeeLeaveTypeWithHttpInfo($xero_tenant_id, $employee_i * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeLeaveType $employee_leave_type (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeeLeaveTypeAsync($xero_tenant_id, $employee_id, $employee_leave_type) + public function createEmployeeLeaveTypeAsync($xero_tenant_id, $employee_id, $employee_leave_type, $idempotency_key = null) { - return $this->createEmployeeLeaveTypeAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave_type) + return $this->createEmployeeLeaveTypeAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave_type, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -2116,12 +2182,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeLeaveType $employee_leave_type (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeeLeaveTypeAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave_type) + public function createEmployeeLeaveTypeAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_leave_type, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeLeaveTypeObject'; - $request = $this->createEmployeeLeaveTypeRequest($xero_tenant_id, $employee_id, $employee_leave_type); + $request = $this->createEmployeeLeaveTypeRequest($xero_tenant_id, $employee_id, $employee_leave_type, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -2160,9 +2227,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeLeaveType $employee_leave_type (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createEmployeeLeaveTypeRequest($xero_tenant_id, $employee_id, $employee_leave_type) + protected function createEmployeeLeaveTypeRequest($xero_tenant_id, $employee_id, $employee_leave_type, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -2192,6 +2260,10 @@ protected function createEmployeeLeaveTypeRequest($xero_tenant_id, $employee_id, if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollUkObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollUkObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($employee_id !== null) { $resourcePath = str_replace( @@ -2269,13 +2341,14 @@ protected function createEmployeeLeaveTypeRequest($xero_tenant_id, $employee_id, * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeOpeningBalances $employee_opening_balances employee_opening_balances (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeOpeningBalancesObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem */ - public function createEmployeeOpeningBalances($xero_tenant_id, $employee_id, $employee_opening_balances) + public function createEmployeeOpeningBalances($xero_tenant_id, $employee_id, $employee_opening_balances, $idempotency_key = null) { - list($response) = $this->createEmployeeOpeningBalancesWithHttpInfo($xero_tenant_id, $employee_id, $employee_opening_balances); + list($response) = $this->createEmployeeOpeningBalancesWithHttpInfo($xero_tenant_id, $employee_id, $employee_opening_balances, $idempotency_key); return $response; } /** @@ -2284,13 +2357,14 @@ public function createEmployeeOpeningBalances($xero_tenant_id, $employee_id, $em * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeOpeningBalances $employee_opening_balances (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollUk\EmployeeOpeningBalancesObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createEmployeeOpeningBalancesWithHttpInfo($xero_tenant_id, $employee_id, $employee_opening_balances) + public function createEmployeeOpeningBalancesWithHttpInfo($xero_tenant_id, $employee_id, $employee_opening_balances, $idempotency_key = null) { - $request = $this->createEmployeeOpeningBalancesRequest($xero_tenant_id, $employee_id, $employee_opening_balances); + $request = $this->createEmployeeOpeningBalancesRequest($xero_tenant_id, $employee_id, $employee_opening_balances, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -2381,12 +2455,13 @@ public function createEmployeeOpeningBalancesWithHttpInfo($xero_tenant_id, $empl * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeOpeningBalances $employee_opening_balances (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeeOpeningBalancesAsync($xero_tenant_id, $employee_id, $employee_opening_balances) + public function createEmployeeOpeningBalancesAsync($xero_tenant_id, $employee_id, $employee_opening_balances, $idempotency_key = null) { - return $this->createEmployeeOpeningBalancesAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_opening_balances) + return $this->createEmployeeOpeningBalancesAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_opening_balances, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -2399,12 +2474,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeOpeningBalances $employee_opening_balances (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeeOpeningBalancesAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_opening_balances) + public function createEmployeeOpeningBalancesAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_opening_balances, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeOpeningBalancesObject'; - $request = $this->createEmployeeOpeningBalancesRequest($xero_tenant_id, $employee_id, $employee_opening_balances); + $request = $this->createEmployeeOpeningBalancesRequest($xero_tenant_id, $employee_id, $employee_opening_balances, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -2443,9 +2519,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeOpeningBalances $employee_opening_balances (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createEmployeeOpeningBalancesRequest($xero_tenant_id, $employee_id, $employee_opening_balances) + protected function createEmployeeOpeningBalancesRequest($xero_tenant_id, $employee_id, $employee_opening_balances, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -2475,6 +2552,10 @@ protected function createEmployeeOpeningBalancesRequest($xero_tenant_id, $employ if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollUkObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollUkObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($employee_id !== null) { $resourcePath = str_replace( @@ -2552,13 +2633,14 @@ protected function createEmployeeOpeningBalancesRequest($xero_tenant_id, $employ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\PaymentMethod $payment_method payment_method (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\PaymentMethodObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem */ - public function createEmployeePaymentMethod($xero_tenant_id, $employee_id, $payment_method) + public function createEmployeePaymentMethod($xero_tenant_id, $employee_id, $payment_method, $idempotency_key = null) { - list($response) = $this->createEmployeePaymentMethodWithHttpInfo($xero_tenant_id, $employee_id, $payment_method); + list($response) = $this->createEmployeePaymentMethodWithHttpInfo($xero_tenant_id, $employee_id, $payment_method, $idempotency_key); return $response; } /** @@ -2567,13 +2649,14 @@ public function createEmployeePaymentMethod($xero_tenant_id, $employee_id, $paym * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\PaymentMethod $payment_method (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollUk\PaymentMethodObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createEmployeePaymentMethodWithHttpInfo($xero_tenant_id, $employee_id, $payment_method) + public function createEmployeePaymentMethodWithHttpInfo($xero_tenant_id, $employee_id, $payment_method, $idempotency_key = null) { - $request = $this->createEmployeePaymentMethodRequest($xero_tenant_id, $employee_id, $payment_method); + $request = $this->createEmployeePaymentMethodRequest($xero_tenant_id, $employee_id, $payment_method, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -2664,12 +2747,13 @@ public function createEmployeePaymentMethodWithHttpInfo($xero_tenant_id, $employ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\PaymentMethod $payment_method (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeePaymentMethodAsync($xero_tenant_id, $employee_id, $payment_method) + public function createEmployeePaymentMethodAsync($xero_tenant_id, $employee_id, $payment_method, $idempotency_key = null) { - return $this->createEmployeePaymentMethodAsyncWithHttpInfo($xero_tenant_id, $employee_id, $payment_method) + return $this->createEmployeePaymentMethodAsyncWithHttpInfo($xero_tenant_id, $employee_id, $payment_method, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -2682,12 +2766,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\PaymentMethod $payment_method (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeePaymentMethodAsyncWithHttpInfo($xero_tenant_id, $employee_id, $payment_method) + public function createEmployeePaymentMethodAsyncWithHttpInfo($xero_tenant_id, $employee_id, $payment_method, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\PaymentMethodObject'; - $request = $this->createEmployeePaymentMethodRequest($xero_tenant_id, $employee_id, $payment_method); + $request = $this->createEmployeePaymentMethodRequest($xero_tenant_id, $employee_id, $payment_method, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -2726,9 +2811,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\PaymentMethod $payment_method (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createEmployeePaymentMethodRequest($xero_tenant_id, $employee_id, $payment_method) + protected function createEmployeePaymentMethodRequest($xero_tenant_id, $employee_id, $payment_method, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -2758,6 +2844,10 @@ protected function createEmployeePaymentMethodRequest($xero_tenant_id, $employee if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollUkObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollUkObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($employee_id !== null) { $resourcePath = str_replace( @@ -2835,13 +2925,14 @@ protected function createEmployeePaymentMethodRequest($xero_tenant_id, $employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\SalaryAndWage $salary_and_wage salary_and_wage (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\SalaryAndWageObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem */ - public function createEmployeeSalaryAndWage($xero_tenant_id, $employee_id, $salary_and_wage) + public function createEmployeeSalaryAndWage($xero_tenant_id, $employee_id, $salary_and_wage, $idempotency_key = null) { - list($response) = $this->createEmployeeSalaryAndWageWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wage); + list($response) = $this->createEmployeeSalaryAndWageWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wage, $idempotency_key); return $response; } /** @@ -2850,13 +2941,14 @@ public function createEmployeeSalaryAndWage($xero_tenant_id, $employee_id, $sala * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\SalaryAndWage $salary_and_wage (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollUk\SalaryAndWageObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createEmployeeSalaryAndWageWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wage) + public function createEmployeeSalaryAndWageWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wage, $idempotency_key = null) { - $request = $this->createEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id, $salary_and_wage); + $request = $this->createEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id, $salary_and_wage, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -2947,12 +3039,13 @@ public function createEmployeeSalaryAndWageWithHttpInfo($xero_tenant_id, $employ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\SalaryAndWage $salary_and_wage (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeeSalaryAndWageAsync($xero_tenant_id, $employee_id, $salary_and_wage) + public function createEmployeeSalaryAndWageAsync($xero_tenant_id, $employee_id, $salary_and_wage, $idempotency_key = null) { - return $this->createEmployeeSalaryAndWageAsyncWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wage) + return $this->createEmployeeSalaryAndWageAsyncWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wage, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -2965,12 +3058,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\SalaryAndWage $salary_and_wage (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeeSalaryAndWageAsyncWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wage) + public function createEmployeeSalaryAndWageAsyncWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wage, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\SalaryAndWageObject'; - $request = $this->createEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id, $salary_and_wage); + $request = $this->createEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id, $salary_and_wage, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -3009,9 +3103,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\SalaryAndWage $salary_and_wage (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id, $salary_and_wage) + protected function createEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id, $salary_and_wage, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -3041,6 +3136,10 @@ protected function createEmployeeSalaryAndWageRequest($xero_tenant_id, $employee if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollUkObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollUkObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($employee_id !== null) { $resourcePath = str_replace( @@ -3117,13 +3216,14 @@ protected function createEmployeeSalaryAndWageRequest($xero_tenant_id, $employee * Creates statutory sick leave records * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeStatutorySickLeave $employee_statutory_sick_leave employee_statutory_sick_leave (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeStatutorySickLeaveObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem */ - public function createEmployeeStatutorySickLeave($xero_tenant_id, $employee_statutory_sick_leave) + public function createEmployeeStatutorySickLeave($xero_tenant_id, $employee_statutory_sick_leave, $idempotency_key = null) { - list($response) = $this->createEmployeeStatutorySickLeaveWithHttpInfo($xero_tenant_id, $employee_statutory_sick_leave); + list($response) = $this->createEmployeeStatutorySickLeaveWithHttpInfo($xero_tenant_id, $employee_statutory_sick_leave, $idempotency_key); return $response; } /** @@ -3131,13 +3231,14 @@ public function createEmployeeStatutorySickLeave($xero_tenant_id, $employee_stat * Creates statutory sick leave records * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeStatutorySickLeave $employee_statutory_sick_leave (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollUk\EmployeeStatutorySickLeaveObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createEmployeeStatutorySickLeaveWithHttpInfo($xero_tenant_id, $employee_statutory_sick_leave) + public function createEmployeeStatutorySickLeaveWithHttpInfo($xero_tenant_id, $employee_statutory_sick_leave, $idempotency_key = null) { - $request = $this->createEmployeeStatutorySickLeaveRequest($xero_tenant_id, $employee_statutory_sick_leave); + $request = $this->createEmployeeStatutorySickLeaveRequest($xero_tenant_id, $employee_statutory_sick_leave, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -3227,12 +3328,13 @@ public function createEmployeeStatutorySickLeaveWithHttpInfo($xero_tenant_id, $e * Creates statutory sick leave records * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeStatutorySickLeave $employee_statutory_sick_leave (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeeStatutorySickLeaveAsync($xero_tenant_id, $employee_statutory_sick_leave) + public function createEmployeeStatutorySickLeaveAsync($xero_tenant_id, $employee_statutory_sick_leave, $idempotency_key = null) { - return $this->createEmployeeStatutorySickLeaveAsyncWithHttpInfo($xero_tenant_id, $employee_statutory_sick_leave) + return $this->createEmployeeStatutorySickLeaveAsyncWithHttpInfo($xero_tenant_id, $employee_statutory_sick_leave, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -3244,12 +3346,13 @@ function ($response) { * Creates statutory sick leave records * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeStatutorySickLeave $employee_statutory_sick_leave (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmployeeStatutorySickLeaveAsyncWithHttpInfo($xero_tenant_id, $employee_statutory_sick_leave) + public function createEmployeeStatutorySickLeaveAsyncWithHttpInfo($xero_tenant_id, $employee_statutory_sick_leave, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeStatutorySickLeaveObject'; - $request = $this->createEmployeeStatutorySickLeaveRequest($xero_tenant_id, $employee_statutory_sick_leave); + $request = $this->createEmployeeStatutorySickLeaveRequest($xero_tenant_id, $employee_statutory_sick_leave, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -3287,9 +3390,10 @@ function ($exception) { * Create request for operation 'createEmployeeStatutorySickLeave' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeStatutorySickLeave $employee_statutory_sick_leave (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createEmployeeStatutorySickLeaveRequest($xero_tenant_id, $employee_statutory_sick_leave) + protected function createEmployeeStatutorySickLeaveRequest($xero_tenant_id, $employee_statutory_sick_leave, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -3313,6 +3417,10 @@ protected function createEmployeeStatutorySickLeaveRequest($xero_tenant_id, $emp if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollUkObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollUkObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($employee_statutory_sick_leave)) { @@ -3382,13 +3490,14 @@ protected function createEmployeeStatutorySickLeaveRequest($xero_tenant_id, $emp * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Employment $employment employment (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmploymentObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem */ - public function createEmployment($xero_tenant_id, $employee_id, $employment) + public function createEmployment($xero_tenant_id, $employee_id, $employment, $idempotency_key = null) { - list($response) = $this->createEmploymentWithHttpInfo($xero_tenant_id, $employee_id, $employment); + list($response) = $this->createEmploymentWithHttpInfo($xero_tenant_id, $employee_id, $employment, $idempotency_key); return $response; } /** @@ -3397,13 +3506,14 @@ public function createEmployment($xero_tenant_id, $employee_id, $employment) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Employment $employment (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollUk\EmploymentObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createEmploymentWithHttpInfo($xero_tenant_id, $employee_id, $employment) + public function createEmploymentWithHttpInfo($xero_tenant_id, $employee_id, $employment, $idempotency_key = null) { - $request = $this->createEmploymentRequest($xero_tenant_id, $employee_id, $employment); + $request = $this->createEmploymentRequest($xero_tenant_id, $employee_id, $employment, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -3494,12 +3604,13 @@ public function createEmploymentWithHttpInfo($xero_tenant_id, $employee_id, $emp * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Employment $employment (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmploymentAsync($xero_tenant_id, $employee_id, $employment) + public function createEmploymentAsync($xero_tenant_id, $employee_id, $employment, $idempotency_key = null) { - return $this->createEmploymentAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employment) + return $this->createEmploymentAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employment, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -3512,12 +3623,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Employment $employment (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createEmploymentAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employment) + public function createEmploymentAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employment, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmploymentObject'; - $request = $this->createEmploymentRequest($xero_tenant_id, $employee_id, $employment); + $request = $this->createEmploymentRequest($xero_tenant_id, $employee_id, $employment, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -3556,9 +3668,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Employment $employment (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createEmploymentRequest($xero_tenant_id, $employee_id, $employment) + protected function createEmploymentRequest($xero_tenant_id, $employee_id, $employment, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -3588,6 +3701,10 @@ protected function createEmploymentRequest($xero_tenant_id, $employee_id, $emplo if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollUkObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollUkObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($employee_id !== null) { $resourcePath = str_replace( @@ -3664,13 +3781,14 @@ protected function createEmploymentRequest($xero_tenant_id, $employee_id, $emplo * Creates a new leave type * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\LeaveType $leave_type leave_type (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\LeaveTypeObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem */ - public function createLeaveType($xero_tenant_id, $leave_type) + public function createLeaveType($xero_tenant_id, $leave_type, $idempotency_key = null) { - list($response) = $this->createLeaveTypeWithHttpInfo($xero_tenant_id, $leave_type); + list($response) = $this->createLeaveTypeWithHttpInfo($xero_tenant_id, $leave_type, $idempotency_key); return $response; } /** @@ -3678,13 +3796,14 @@ public function createLeaveType($xero_tenant_id, $leave_type) * Creates a new leave type * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\LeaveType $leave_type (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollUk\LeaveTypeObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createLeaveTypeWithHttpInfo($xero_tenant_id, $leave_type) + public function createLeaveTypeWithHttpInfo($xero_tenant_id, $leave_type, $idempotency_key = null) { - $request = $this->createLeaveTypeRequest($xero_tenant_id, $leave_type); + $request = $this->createLeaveTypeRequest($xero_tenant_id, $leave_type, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -3774,12 +3893,13 @@ public function createLeaveTypeWithHttpInfo($xero_tenant_id, $leave_type) * Creates a new leave type * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\LeaveType $leave_type (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createLeaveTypeAsync($xero_tenant_id, $leave_type) + public function createLeaveTypeAsync($xero_tenant_id, $leave_type, $idempotency_key = null) { - return $this->createLeaveTypeAsyncWithHttpInfo($xero_tenant_id, $leave_type) + return $this->createLeaveTypeAsyncWithHttpInfo($xero_tenant_id, $leave_type, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -3791,12 +3911,13 @@ function ($response) { * Creates a new leave type * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\LeaveType $leave_type (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createLeaveTypeAsyncWithHttpInfo($xero_tenant_id, $leave_type) + public function createLeaveTypeAsyncWithHttpInfo($xero_tenant_id, $leave_type, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\LeaveTypeObject'; - $request = $this->createLeaveTypeRequest($xero_tenant_id, $leave_type); + $request = $this->createLeaveTypeRequest($xero_tenant_id, $leave_type, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -3834,9 +3955,10 @@ function ($exception) { * Create request for operation 'createLeaveType' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\LeaveType $leave_type (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createLeaveTypeRequest($xero_tenant_id, $leave_type) + protected function createLeaveTypeRequest($xero_tenant_id, $leave_type, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -3860,6 +3982,10 @@ protected function createLeaveTypeRequest($xero_tenant_id, $leave_type) if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollUkObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollUkObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($leave_type)) { @@ -3929,13 +4055,14 @@ protected function createLeaveTypeRequest($xero_tenant_id, $leave_type) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EarningsTemplate[] $earnings_template earnings_template (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeePayTemplates|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem */ - public function createMultipleEmployeeEarningsTemplate($xero_tenant_id, $employee_id, $earnings_template) + public function createMultipleEmployeeEarningsTemplate($xero_tenant_id, $employee_id, $earnings_template, $idempotency_key = null) { - list($response) = $this->createMultipleEmployeeEarningsTemplateWithHttpInfo($xero_tenant_id, $employee_id, $earnings_template); + list($response) = $this->createMultipleEmployeeEarningsTemplateWithHttpInfo($xero_tenant_id, $employee_id, $earnings_template, $idempotency_key); return $response; } /** @@ -3944,13 +4071,14 @@ public function createMultipleEmployeeEarningsTemplate($xero_tenant_id, $employe * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EarningsTemplate[] $earnings_template (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollUk\EmployeePayTemplates|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createMultipleEmployeeEarningsTemplateWithHttpInfo($xero_tenant_id, $employee_id, $earnings_template) + public function createMultipleEmployeeEarningsTemplateWithHttpInfo($xero_tenant_id, $employee_id, $earnings_template, $idempotency_key = null) { - $request = $this->createMultipleEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $earnings_template); + $request = $this->createMultipleEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $earnings_template, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -4041,12 +4169,13 @@ public function createMultipleEmployeeEarningsTemplateWithHttpInfo($xero_tenant_ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EarningsTemplate[] $earnings_template (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createMultipleEmployeeEarningsTemplateAsync($xero_tenant_id, $employee_id, $earnings_template) + public function createMultipleEmployeeEarningsTemplateAsync($xero_tenant_id, $employee_id, $earnings_template, $idempotency_key = null) { - return $this->createMultipleEmployeeEarningsTemplateAsyncWithHttpInfo($xero_tenant_id, $employee_id, $earnings_template) + return $this->createMultipleEmployeeEarningsTemplateAsyncWithHttpInfo($xero_tenant_id, $employee_id, $earnings_template, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -4059,12 +4188,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EarningsTemplate[] $earnings_template (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createMultipleEmployeeEarningsTemplateAsyncWithHttpInfo($xero_tenant_id, $employee_id, $earnings_template) + public function createMultipleEmployeeEarningsTemplateAsyncWithHttpInfo($xero_tenant_id, $employee_id, $earnings_template, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeePayTemplates'; - $request = $this->createMultipleEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $earnings_template); + $request = $this->createMultipleEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $earnings_template, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -4103,9 +4233,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EarningsTemplate[] $earnings_template (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createMultipleEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $earnings_template) + protected function createMultipleEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $earnings_template, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -4135,6 +4266,10 @@ protected function createMultipleEmployeeEarningsTemplateRequest($xero_tenant_id if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollUkObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollUkObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($employee_id !== null) { $resourcePath = str_replace( @@ -4211,13 +4346,14 @@ protected function createMultipleEmployeeEarningsTemplateRequest($xero_tenant_id * Creates a new payrun calendar * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\PayRunCalendar $pay_run_calendar pay_run_calendar (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\PayRunCalendarObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem */ - public function createPayRunCalendar($xero_tenant_id, $pay_run_calendar) + public function createPayRunCalendar($xero_tenant_id, $pay_run_calendar, $idempotency_key = null) { - list($response) = $this->createPayRunCalendarWithHttpInfo($xero_tenant_id, $pay_run_calendar); + list($response) = $this->createPayRunCalendarWithHttpInfo($xero_tenant_id, $pay_run_calendar, $idempotency_key); return $response; } /** @@ -4225,13 +4361,14 @@ public function createPayRunCalendar($xero_tenant_id, $pay_run_calendar) * Creates a new payrun calendar * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\PayRunCalendar $pay_run_calendar (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollUk\PayRunCalendarObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createPayRunCalendarWithHttpInfo($xero_tenant_id, $pay_run_calendar) + public function createPayRunCalendarWithHttpInfo($xero_tenant_id, $pay_run_calendar, $idempotency_key = null) { - $request = $this->createPayRunCalendarRequest($xero_tenant_id, $pay_run_calendar); + $request = $this->createPayRunCalendarRequest($xero_tenant_id, $pay_run_calendar, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -4321,12 +4458,13 @@ public function createPayRunCalendarWithHttpInfo($xero_tenant_id, $pay_run_calen * Creates a new payrun calendar * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\PayRunCalendar $pay_run_calendar (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createPayRunCalendarAsync($xero_tenant_id, $pay_run_calendar) + public function createPayRunCalendarAsync($xero_tenant_id, $pay_run_calendar, $idempotency_key = null) { - return $this->createPayRunCalendarAsyncWithHttpInfo($xero_tenant_id, $pay_run_calendar) + return $this->createPayRunCalendarAsyncWithHttpInfo($xero_tenant_id, $pay_run_calendar, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -4338,12 +4476,13 @@ function ($response) { * Creates a new payrun calendar * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\PayRunCalendar $pay_run_calendar (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createPayRunCalendarAsyncWithHttpInfo($xero_tenant_id, $pay_run_calendar) + public function createPayRunCalendarAsyncWithHttpInfo($xero_tenant_id, $pay_run_calendar, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\PayRunCalendarObject'; - $request = $this->createPayRunCalendarRequest($xero_tenant_id, $pay_run_calendar); + $request = $this->createPayRunCalendarRequest($xero_tenant_id, $pay_run_calendar, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -4381,9 +4520,10 @@ function ($exception) { * Create request for operation 'createPayRunCalendar' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\PayRunCalendar $pay_run_calendar (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createPayRunCalendarRequest($xero_tenant_id, $pay_run_calendar) + protected function createPayRunCalendarRequest($xero_tenant_id, $pay_run_calendar, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -4407,6 +4547,10 @@ protected function createPayRunCalendarRequest($xero_tenant_id, $pay_run_calenda if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollUkObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollUkObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($pay_run_calendar)) { @@ -4475,13 +4619,14 @@ protected function createPayRunCalendarRequest($xero_tenant_id, $pay_run_calenda * Creates a new reimbursement * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Reimbursement $reimbursement reimbursement (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\ReimbursementObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem */ - public function createReimbursement($xero_tenant_id, $reimbursement) + public function createReimbursement($xero_tenant_id, $reimbursement, $idempotency_key = null) { - list($response) = $this->createReimbursementWithHttpInfo($xero_tenant_id, $reimbursement); + list($response) = $this->createReimbursementWithHttpInfo($xero_tenant_id, $reimbursement, $idempotency_key); return $response; } /** @@ -4489,13 +4634,14 @@ public function createReimbursement($xero_tenant_id, $reimbursement) * Creates a new reimbursement * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Reimbursement $reimbursement (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollUk\ReimbursementObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createReimbursementWithHttpInfo($xero_tenant_id, $reimbursement) + public function createReimbursementWithHttpInfo($xero_tenant_id, $reimbursement, $idempotency_key = null) { - $request = $this->createReimbursementRequest($xero_tenant_id, $reimbursement); + $request = $this->createReimbursementRequest($xero_tenant_id, $reimbursement, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -4585,12 +4731,13 @@ public function createReimbursementWithHttpInfo($xero_tenant_id, $reimbursement) * Creates a new reimbursement * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Reimbursement $reimbursement (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createReimbursementAsync($xero_tenant_id, $reimbursement) + public function createReimbursementAsync($xero_tenant_id, $reimbursement, $idempotency_key = null) { - return $this->createReimbursementAsyncWithHttpInfo($xero_tenant_id, $reimbursement) + return $this->createReimbursementAsyncWithHttpInfo($xero_tenant_id, $reimbursement, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -4602,12 +4749,13 @@ function ($response) { * Creates a new reimbursement * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Reimbursement $reimbursement (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createReimbursementAsyncWithHttpInfo($xero_tenant_id, $reimbursement) + public function createReimbursementAsyncWithHttpInfo($xero_tenant_id, $reimbursement, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\ReimbursementObject'; - $request = $this->createReimbursementRequest($xero_tenant_id, $reimbursement); + $request = $this->createReimbursementRequest($xero_tenant_id, $reimbursement, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -4645,9 +4793,10 @@ function ($exception) { * Create request for operation 'createReimbursement' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Reimbursement $reimbursement (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createReimbursementRequest($xero_tenant_id, $reimbursement) + protected function createReimbursementRequest($xero_tenant_id, $reimbursement, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -4671,6 +4820,10 @@ protected function createReimbursementRequest($xero_tenant_id, $reimbursement) if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollUkObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollUkObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($reimbursement)) { @@ -4739,13 +4892,14 @@ protected function createReimbursementRequest($xero_tenant_id, $reimbursement) * Creates a new timesheet * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Timesheet $timesheet timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\TimesheetObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem */ - public function createTimesheet($xero_tenant_id, $timesheet) + public function createTimesheet($xero_tenant_id, $timesheet, $idempotency_key = null) { - list($response) = $this->createTimesheetWithHttpInfo($xero_tenant_id, $timesheet); + list($response) = $this->createTimesheetWithHttpInfo($xero_tenant_id, $timesheet, $idempotency_key); return $response; } /** @@ -4753,13 +4907,14 @@ public function createTimesheet($xero_tenant_id, $timesheet) * Creates a new timesheet * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Timesheet $timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollUk\TimesheetObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createTimesheetWithHttpInfo($xero_tenant_id, $timesheet) + public function createTimesheetWithHttpInfo($xero_tenant_id, $timesheet, $idempotency_key = null) { - $request = $this->createTimesheetRequest($xero_tenant_id, $timesheet); + $request = $this->createTimesheetRequest($xero_tenant_id, $timesheet, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -4849,12 +5004,13 @@ public function createTimesheetWithHttpInfo($xero_tenant_id, $timesheet) * Creates a new timesheet * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Timesheet $timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createTimesheetAsync($xero_tenant_id, $timesheet) + public function createTimesheetAsync($xero_tenant_id, $timesheet, $idempotency_key = null) { - return $this->createTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet) + return $this->createTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -4866,12 +5022,13 @@ function ($response) { * Creates a new timesheet * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Timesheet $timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet) + public function createTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\TimesheetObject'; - $request = $this->createTimesheetRequest($xero_tenant_id, $timesheet); + $request = $this->createTimesheetRequest($xero_tenant_id, $timesheet, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -4909,9 +5066,10 @@ function ($exception) { * Create request for operation 'createTimesheet' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Timesheet $timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createTimesheetRequest($xero_tenant_id, $timesheet) + protected function createTimesheetRequest($xero_tenant_id, $timesheet, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -4935,6 +5093,10 @@ protected function createTimesheetRequest($xero_tenant_id, $timesheet) if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollUkObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollUkObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($timesheet)) { @@ -5004,13 +5166,14 @@ protected function createTimesheetRequest($xero_tenant_id, $timesheet) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $timesheet_id Identifier for the timesheet (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\TimesheetLine $timesheet_line timesheet_line (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\TimesheetLineObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem */ - public function createTimesheetLine($xero_tenant_id, $timesheet_id, $timesheet_line) + public function createTimesheetLine($xero_tenant_id, $timesheet_id, $timesheet_line, $idempotency_key = null) { - list($response) = $this->createTimesheetLineWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line); + list($response) = $this->createTimesheetLineWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line, $idempotency_key); return $response; } /** @@ -5019,13 +5182,14 @@ public function createTimesheetLine($xero_tenant_id, $timesheet_id, $timesheet_l * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $timesheet_id Identifier for the timesheet (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\TimesheetLine $timesheet_line (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollUk\TimesheetLineObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function createTimesheetLineWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line) + public function createTimesheetLineWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line, $idempotency_key = null) { - $request = $this->createTimesheetLineRequest($xero_tenant_id, $timesheet_id, $timesheet_line); + $request = $this->createTimesheetLineRequest($xero_tenant_id, $timesheet_id, $timesheet_line, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -5116,12 +5280,13 @@ public function createTimesheetLineWithHttpInfo($xero_tenant_id, $timesheet_id, * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $timesheet_id Identifier for the timesheet (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\TimesheetLine $timesheet_line (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createTimesheetLineAsync($xero_tenant_id, $timesheet_id, $timesheet_line) + public function createTimesheetLineAsync($xero_tenant_id, $timesheet_id, $timesheet_line, $idempotency_key = null) { - return $this->createTimesheetLineAsyncWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line) + return $this->createTimesheetLineAsyncWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -5134,12 +5299,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $timesheet_id Identifier for the timesheet (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\TimesheetLine $timesheet_line (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createTimesheetLineAsyncWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line) + public function createTimesheetLineAsyncWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\TimesheetLineObject'; - $request = $this->createTimesheetLineRequest($xero_tenant_id, $timesheet_id, $timesheet_line); + $request = $this->createTimesheetLineRequest($xero_tenant_id, $timesheet_id, $timesheet_line, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -5178,9 +5344,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $timesheet_id Identifier for the timesheet (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\TimesheetLine $timesheet_line (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createTimesheetLineRequest($xero_tenant_id, $timesheet_id, $timesheet_line) + protected function createTimesheetLineRequest($xero_tenant_id, $timesheet_id, $timesheet_line, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -5210,6 +5377,10 @@ protected function createTimesheetLineRequest($xero_tenant_id, $timesheet_id, $t if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollUkObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollUkObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($timesheet_id !== null) { $resourcePath = str_replace( @@ -16207,13 +16378,14 @@ protected function getTrackingCategoriesRequest($xero_tenant_id) * Reverts a specific timesheet to draft * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $timesheet_id Identifier for the timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\TimesheetObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem */ - public function revertTimesheet($xero_tenant_id, $timesheet_id) + public function revertTimesheet($xero_tenant_id, $timesheet_id, $idempotency_key = null) { - list($response) = $this->revertTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id); + list($response) = $this->revertTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id, $idempotency_key); return $response; } /** @@ -16221,13 +16393,14 @@ public function revertTimesheet($xero_tenant_id, $timesheet_id) * Reverts a specific timesheet to draft * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $timesheet_id Identifier for the timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollUk\TimesheetObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function revertTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id) + public function revertTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id, $idempotency_key = null) { - $request = $this->revertTimesheetRequest($xero_tenant_id, $timesheet_id); + $request = $this->revertTimesheetRequest($xero_tenant_id, $timesheet_id, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -16317,12 +16490,13 @@ public function revertTimesheetWithHttpInfo($xero_tenant_id, $timesheet_id) * Reverts a specific timesheet to draft * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $timesheet_id Identifier for the timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function revertTimesheetAsync($xero_tenant_id, $timesheet_id) + public function revertTimesheetAsync($xero_tenant_id, $timesheet_id, $idempotency_key = null) { - return $this->revertTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet_id) + return $this->revertTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet_id, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -16334,12 +16508,13 @@ function ($response) { * Reverts a specific timesheet to draft * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $timesheet_id Identifier for the timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function revertTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet_id) + public function revertTimesheetAsyncWithHttpInfo($xero_tenant_id, $timesheet_id, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\TimesheetObject'; - $request = $this->revertTimesheetRequest($xero_tenant_id, $timesheet_id); + $request = $this->revertTimesheetRequest($xero_tenant_id, $timesheet_id, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -16377,9 +16552,10 @@ function ($exception) { * Create request for operation 'revertTimesheet' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $timesheet_id Identifier for the timesheet (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function revertTimesheetRequest($xero_tenant_id, $timesheet_id) + protected function revertTimesheetRequest($xero_tenant_id, $timesheet_id, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -16403,6 +16579,10 @@ protected function revertTimesheetRequest($xero_tenant_id, $timesheet_id) if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollUkObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollUkObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($timesheet_id !== null) { $resourcePath = str_replace( @@ -16477,13 +16657,14 @@ protected function revertTimesheetRequest($xero_tenant_id, $timesheet_id) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Employee $employee employee (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem */ - public function updateEmployee($xero_tenant_id, $employee_id, $employee) + public function updateEmployee($xero_tenant_id, $employee_id, $employee, $idempotency_key = null) { - list($response) = $this->updateEmployeeWithHttpInfo($xero_tenant_id, $employee_id, $employee); + list($response) = $this->updateEmployeeWithHttpInfo($xero_tenant_id, $employee_id, $employee, $idempotency_key); return $response; } /** @@ -16492,13 +16673,14 @@ public function updateEmployee($xero_tenant_id, $employee_id, $employee) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Employee $employee (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollUk\EmployeeObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function updateEmployeeWithHttpInfo($xero_tenant_id, $employee_id, $employee) + public function updateEmployeeWithHttpInfo($xero_tenant_id, $employee_id, $employee, $idempotency_key = null) { - $request = $this->updateEmployeeRequest($xero_tenant_id, $employee_id, $employee); + $request = $this->updateEmployeeRequest($xero_tenant_id, $employee_id, $employee, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -16589,12 +16771,13 @@ public function updateEmployeeWithHttpInfo($xero_tenant_id, $employee_id, $emplo * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Employee $employee (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateEmployeeAsync($xero_tenant_id, $employee_id, $employee) + public function updateEmployeeAsync($xero_tenant_id, $employee_id, $employee, $idempotency_key = null) { - return $this->updateEmployeeAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee) + return $this->updateEmployeeAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -16607,12 +16790,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Employee $employee (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateEmployeeAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee) + public function updateEmployeeAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeObject'; - $request = $this->updateEmployeeRequest($xero_tenant_id, $employee_id, $employee); + $request = $this->updateEmployeeRequest($xero_tenant_id, $employee_id, $employee, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -16651,9 +16835,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Employee $employee (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateEmployeeRequest($xero_tenant_id, $employee_id, $employee) + protected function updateEmployeeRequest($xero_tenant_id, $employee_id, $employee, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -16683,6 +16868,10 @@ protected function updateEmployeeRequest($xero_tenant_id, $employee_id, $employe if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollUkObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollUkObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($employee_id !== null) { $resourcePath = str_replace( @@ -16761,13 +16950,14 @@ protected function updateEmployeeRequest($xero_tenant_id, $employee_id, $employe * @param string $employee_id Employee id for single object (required) * @param string $pay_template_earning_id Id for single pay template earnings object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EarningsTemplate $earnings_template earnings_template (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EarningsTemplateObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem */ - public function updateEmployeeEarningsTemplate($xero_tenant_id, $employee_id, $pay_template_earning_id, $earnings_template) + public function updateEmployeeEarningsTemplate($xero_tenant_id, $employee_id, $pay_template_earning_id, $earnings_template, $idempotency_key = null) { - list($response) = $this->updateEmployeeEarningsTemplateWithHttpInfo($xero_tenant_id, $employee_id, $pay_template_earning_id, $earnings_template); + list($response) = $this->updateEmployeeEarningsTemplateWithHttpInfo($xero_tenant_id, $employee_id, $pay_template_earning_id, $earnings_template, $idempotency_key); return $response; } /** @@ -16777,13 +16967,14 @@ public function updateEmployeeEarningsTemplate($xero_tenant_id, $employee_id, $p * @param string $employee_id Employee id for single object (required) * @param string $pay_template_earning_id Id for single pay template earnings object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EarningsTemplate $earnings_template (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollUk\EarningsTemplateObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function updateEmployeeEarningsTemplateWithHttpInfo($xero_tenant_id, $employee_id, $pay_template_earning_id, $earnings_template) + public function updateEmployeeEarningsTemplateWithHttpInfo($xero_tenant_id, $employee_id, $pay_template_earning_id, $earnings_template, $idempotency_key = null) { - $request = $this->updateEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $pay_template_earning_id, $earnings_template); + $request = $this->updateEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $pay_template_earning_id, $earnings_template, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -16875,12 +17066,13 @@ public function updateEmployeeEarningsTemplateWithHttpInfo($xero_tenant_id, $emp * @param string $employee_id Employee id for single object (required) * @param string $pay_template_earning_id Id for single pay template earnings object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EarningsTemplate $earnings_template (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateEmployeeEarningsTemplateAsync($xero_tenant_id, $employee_id, $pay_template_earning_id, $earnings_template) + public function updateEmployeeEarningsTemplateAsync($xero_tenant_id, $employee_id, $pay_template_earning_id, $earnings_template, $idempotency_key = null) { - return $this->updateEmployeeEarningsTemplateAsyncWithHttpInfo($xero_tenant_id, $employee_id, $pay_template_earning_id, $earnings_template) + return $this->updateEmployeeEarningsTemplateAsyncWithHttpInfo($xero_tenant_id, $employee_id, $pay_template_earning_id, $earnings_template, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -16894,12 +17086,13 @@ function ($response) { * @param string $employee_id Employee id for single object (required) * @param string $pay_template_earning_id Id for single pay template earnings object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EarningsTemplate $earnings_template (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateEmployeeEarningsTemplateAsyncWithHttpInfo($xero_tenant_id, $employee_id, $pay_template_earning_id, $earnings_template) + public function updateEmployeeEarningsTemplateAsyncWithHttpInfo($xero_tenant_id, $employee_id, $pay_template_earning_id, $earnings_template, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EarningsTemplateObject'; - $request = $this->updateEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $pay_template_earning_id, $earnings_template); + $request = $this->updateEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $pay_template_earning_id, $earnings_template, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -16939,9 +17132,10 @@ function ($exception) { * @param string $employee_id Employee id for single object (required) * @param string $pay_template_earning_id Id for single pay template earnings object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EarningsTemplate $earnings_template (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $pay_template_earning_id, $earnings_template) + protected function updateEmployeeEarningsTemplateRequest($xero_tenant_id, $employee_id, $pay_template_earning_id, $earnings_template, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -16977,6 +17171,10 @@ protected function updateEmployeeEarningsTemplateRequest($xero_tenant_id, $emplo if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollUkObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollUkObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($employee_id !== null) { $resourcePath = str_replace( @@ -17063,13 +17261,14 @@ protected function updateEmployeeEarningsTemplateRequest($xero_tenant_id, $emplo * @param string $employee_id Employee id for single object (required) * @param string $leave_id Leave id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeLeave $employee_leave employee_leave (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeLeaveObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem */ - public function updateEmployeeLeave($xero_tenant_id, $employee_id, $leave_id, $employee_leave) + public function updateEmployeeLeave($xero_tenant_id, $employee_id, $leave_id, $employee_leave, $idempotency_key = null) { - list($response) = $this->updateEmployeeLeaveWithHttpInfo($xero_tenant_id, $employee_id, $leave_id, $employee_leave); + list($response) = $this->updateEmployeeLeaveWithHttpInfo($xero_tenant_id, $employee_id, $leave_id, $employee_leave, $idempotency_key); return $response; } /** @@ -17079,13 +17278,14 @@ public function updateEmployeeLeave($xero_tenant_id, $employee_id, $leave_id, $e * @param string $employee_id Employee id for single object (required) * @param string $leave_id Leave id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeLeave $employee_leave (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollUk\EmployeeLeaveObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function updateEmployeeLeaveWithHttpInfo($xero_tenant_id, $employee_id, $leave_id, $employee_leave) + public function updateEmployeeLeaveWithHttpInfo($xero_tenant_id, $employee_id, $leave_id, $employee_leave, $idempotency_key = null) { - $request = $this->updateEmployeeLeaveRequest($xero_tenant_id, $employee_id, $leave_id, $employee_leave); + $request = $this->updateEmployeeLeaveRequest($xero_tenant_id, $employee_id, $leave_id, $employee_leave, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -17177,12 +17377,13 @@ public function updateEmployeeLeaveWithHttpInfo($xero_tenant_id, $employee_id, $ * @param string $employee_id Employee id for single object (required) * @param string $leave_id Leave id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeLeave $employee_leave (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateEmployeeLeaveAsync($xero_tenant_id, $employee_id, $leave_id, $employee_leave) + public function updateEmployeeLeaveAsync($xero_tenant_id, $employee_id, $leave_id, $employee_leave, $idempotency_key = null) { - return $this->updateEmployeeLeaveAsyncWithHttpInfo($xero_tenant_id, $employee_id, $leave_id, $employee_leave) + return $this->updateEmployeeLeaveAsyncWithHttpInfo($xero_tenant_id, $employee_id, $leave_id, $employee_leave, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -17196,12 +17397,13 @@ function ($response) { * @param string $employee_id Employee id for single object (required) * @param string $leave_id Leave id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeLeave $employee_leave (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateEmployeeLeaveAsyncWithHttpInfo($xero_tenant_id, $employee_id, $leave_id, $employee_leave) + public function updateEmployeeLeaveAsyncWithHttpInfo($xero_tenant_id, $employee_id, $leave_id, $employee_leave, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeLeaveObject'; - $request = $this->updateEmployeeLeaveRequest($xero_tenant_id, $employee_id, $leave_id, $employee_leave); + $request = $this->updateEmployeeLeaveRequest($xero_tenant_id, $employee_id, $leave_id, $employee_leave, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -17241,9 +17443,10 @@ function ($exception) { * @param string $employee_id Employee id for single object (required) * @param string $leave_id Leave id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeLeave $employee_leave (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateEmployeeLeaveRequest($xero_tenant_id, $employee_id, $leave_id, $employee_leave) + protected function updateEmployeeLeaveRequest($xero_tenant_id, $employee_id, $leave_id, $employee_leave, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -17279,6 +17482,10 @@ protected function updateEmployeeLeaveRequest($xero_tenant_id, $employee_id, $le if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollUkObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollUkObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($employee_id !== null) { $resourcePath = str_replace( @@ -17364,13 +17571,14 @@ protected function updateEmployeeLeaveRequest($xero_tenant_id, $employee_id, $le * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeOpeningBalances $employee_opening_balances employee_opening_balances (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeOpeningBalancesObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem */ - public function updateEmployeeOpeningBalances($xero_tenant_id, $employee_id, $employee_opening_balances) + public function updateEmployeeOpeningBalances($xero_tenant_id, $employee_id, $employee_opening_balances, $idempotency_key = null) { - list($response) = $this->updateEmployeeOpeningBalancesWithHttpInfo($xero_tenant_id, $employee_id, $employee_opening_balances); + list($response) = $this->updateEmployeeOpeningBalancesWithHttpInfo($xero_tenant_id, $employee_id, $employee_opening_balances, $idempotency_key); return $response; } /** @@ -17379,13 +17587,14 @@ public function updateEmployeeOpeningBalances($xero_tenant_id, $employee_id, $em * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeOpeningBalances $employee_opening_balances (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollUk\EmployeeOpeningBalancesObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function updateEmployeeOpeningBalancesWithHttpInfo($xero_tenant_id, $employee_id, $employee_opening_balances) + public function updateEmployeeOpeningBalancesWithHttpInfo($xero_tenant_id, $employee_id, $employee_opening_balances, $idempotency_key = null) { - $request = $this->updateEmployeeOpeningBalancesRequest($xero_tenant_id, $employee_id, $employee_opening_balances); + $request = $this->updateEmployeeOpeningBalancesRequest($xero_tenant_id, $employee_id, $employee_opening_balances, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -17476,12 +17685,13 @@ public function updateEmployeeOpeningBalancesWithHttpInfo($xero_tenant_id, $empl * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeOpeningBalances $employee_opening_balances (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateEmployeeOpeningBalancesAsync($xero_tenant_id, $employee_id, $employee_opening_balances) + public function updateEmployeeOpeningBalancesAsync($xero_tenant_id, $employee_id, $employee_opening_balances, $idempotency_key = null) { - return $this->updateEmployeeOpeningBalancesAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_opening_balances) + return $this->updateEmployeeOpeningBalancesAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_opening_balances, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -17494,12 +17704,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeOpeningBalances $employee_opening_balances (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateEmployeeOpeningBalancesAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_opening_balances) + public function updateEmployeeOpeningBalancesAsyncWithHttpInfo($xero_tenant_id, $employee_id, $employee_opening_balances, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeOpeningBalancesObject'; - $request = $this->updateEmployeeOpeningBalancesRequest($xero_tenant_id, $employee_id, $employee_opening_balances); + $request = $this->updateEmployeeOpeningBalancesRequest($xero_tenant_id, $employee_id, $employee_opening_balances, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -17538,9 +17749,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $employee_id Employee id for single object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\EmployeeOpeningBalances $employee_opening_balances (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateEmployeeOpeningBalancesRequest($xero_tenant_id, $employee_id, $employee_opening_balances) + protected function updateEmployeeOpeningBalancesRequest($xero_tenant_id, $employee_id, $employee_opening_balances, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -17570,6 +17782,10 @@ protected function updateEmployeeOpeningBalancesRequest($xero_tenant_id, $employ if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollUkObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollUkObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($employee_id !== null) { $resourcePath = str_replace( @@ -17648,13 +17864,14 @@ protected function updateEmployeeOpeningBalancesRequest($xero_tenant_id, $employ * @param string $employee_id Employee id for single object (required) * @param string $salary_and_wages_id Id for single pay template earnings object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\SalaryAndWage $salary_and_wage salary_and_wage (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\SalaryAndWageObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem */ - public function updateEmployeeSalaryAndWage($xero_tenant_id, $employee_id, $salary_and_wages_id, $salary_and_wage) + public function updateEmployeeSalaryAndWage($xero_tenant_id, $employee_id, $salary_and_wages_id, $salary_and_wage, $idempotency_key = null) { - list($response) = $this->updateEmployeeSalaryAndWageWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wages_id, $salary_and_wage); + list($response) = $this->updateEmployeeSalaryAndWageWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wages_id, $salary_and_wage, $idempotency_key); return $response; } /** @@ -17664,13 +17881,14 @@ public function updateEmployeeSalaryAndWage($xero_tenant_id, $employee_id, $sala * @param string $employee_id Employee id for single object (required) * @param string $salary_and_wages_id Id for single pay template earnings object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\SalaryAndWage $salary_and_wage (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollUk\SalaryAndWageObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function updateEmployeeSalaryAndWageWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wages_id, $salary_and_wage) + public function updateEmployeeSalaryAndWageWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wages_id, $salary_and_wage, $idempotency_key = null) { - $request = $this->updateEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id, $salary_and_wages_id, $salary_and_wage); + $request = $this->updateEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id, $salary_and_wages_id, $salary_and_wage, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -17762,12 +17980,13 @@ public function updateEmployeeSalaryAndWageWithHttpInfo($xero_tenant_id, $employ * @param string $employee_id Employee id for single object (required) * @param string $salary_and_wages_id Id for single pay template earnings object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\SalaryAndWage $salary_and_wage (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateEmployeeSalaryAndWageAsync($xero_tenant_id, $employee_id, $salary_and_wages_id, $salary_and_wage) + public function updateEmployeeSalaryAndWageAsync($xero_tenant_id, $employee_id, $salary_and_wages_id, $salary_and_wage, $idempotency_key = null) { - return $this->updateEmployeeSalaryAndWageAsyncWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wages_id, $salary_and_wage) + return $this->updateEmployeeSalaryAndWageAsyncWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wages_id, $salary_and_wage, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -17781,12 +18000,13 @@ function ($response) { * @param string $employee_id Employee id for single object (required) * @param string $salary_and_wages_id Id for single pay template earnings object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\SalaryAndWage $salary_and_wage (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateEmployeeSalaryAndWageAsyncWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wages_id, $salary_and_wage) + public function updateEmployeeSalaryAndWageAsyncWithHttpInfo($xero_tenant_id, $employee_id, $salary_and_wages_id, $salary_and_wage, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\SalaryAndWageObject'; - $request = $this->updateEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id, $salary_and_wages_id, $salary_and_wage); + $request = $this->updateEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id, $salary_and_wages_id, $salary_and_wage, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -17826,9 +18046,10 @@ function ($exception) { * @param string $employee_id Employee id for single object (required) * @param string $salary_and_wages_id Id for single pay template earnings object (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\SalaryAndWage $salary_and_wage (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id, $salary_and_wages_id, $salary_and_wage) + protected function updateEmployeeSalaryAndWageRequest($xero_tenant_id, $employee_id, $salary_and_wages_id, $salary_and_wage, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -17864,6 +18085,10 @@ protected function updateEmployeeSalaryAndWageRequest($xero_tenant_id, $employee if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollUkObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollUkObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($employee_id !== null) { $resourcePath = str_replace( @@ -17949,13 +18174,14 @@ protected function updateEmployeeSalaryAndWageRequest($xero_tenant_id, $employee * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $pay_run_id Identifier for the pay run (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\PayRun $pay_run pay_run (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\PayRunObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem */ - public function updatePayRun($xero_tenant_id, $pay_run_id, $pay_run) + public function updatePayRun($xero_tenant_id, $pay_run_id, $pay_run, $idempotency_key = null) { - list($response) = $this->updatePayRunWithHttpInfo($xero_tenant_id, $pay_run_id, $pay_run); + list($response) = $this->updatePayRunWithHttpInfo($xero_tenant_id, $pay_run_id, $pay_run, $idempotency_key); return $response; } /** @@ -17964,13 +18190,14 @@ public function updatePayRun($xero_tenant_id, $pay_run_id, $pay_run) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $pay_run_id Identifier for the pay run (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\PayRun $pay_run (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollUk\PayRunObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function updatePayRunWithHttpInfo($xero_tenant_id, $pay_run_id, $pay_run) + public function updatePayRunWithHttpInfo($xero_tenant_id, $pay_run_id, $pay_run, $idempotency_key = null) { - $request = $this->updatePayRunRequest($xero_tenant_id, $pay_run_id, $pay_run); + $request = $this->updatePayRunRequest($xero_tenant_id, $pay_run_id, $pay_run, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -18061,12 +18288,13 @@ public function updatePayRunWithHttpInfo($xero_tenant_id, $pay_run_id, $pay_run) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $pay_run_id Identifier for the pay run (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\PayRun $pay_run (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updatePayRunAsync($xero_tenant_id, $pay_run_id, $pay_run) + public function updatePayRunAsync($xero_tenant_id, $pay_run_id, $pay_run, $idempotency_key = null) { - return $this->updatePayRunAsyncWithHttpInfo($xero_tenant_id, $pay_run_id, $pay_run) + return $this->updatePayRunAsyncWithHttpInfo($xero_tenant_id, $pay_run_id, $pay_run, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -18079,12 +18307,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $pay_run_id Identifier for the pay run (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\PayRun $pay_run (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updatePayRunAsyncWithHttpInfo($xero_tenant_id, $pay_run_id, $pay_run) + public function updatePayRunAsyncWithHttpInfo($xero_tenant_id, $pay_run_id, $pay_run, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\PayRunObject'; - $request = $this->updatePayRunRequest($xero_tenant_id, $pay_run_id, $pay_run); + $request = $this->updatePayRunRequest($xero_tenant_id, $pay_run_id, $pay_run, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -18123,9 +18352,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $pay_run_id Identifier for the pay run (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\PayRun $pay_run (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updatePayRunRequest($xero_tenant_id, $pay_run_id, $pay_run) + protected function updatePayRunRequest($xero_tenant_id, $pay_run_id, $pay_run, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -18155,6 +18385,10 @@ protected function updatePayRunRequest($xero_tenant_id, $pay_run_id, $pay_run) if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollUkObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollUkObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($pay_run_id !== null) { $resourcePath = str_replace( @@ -18233,13 +18467,14 @@ protected function updatePayRunRequest($xero_tenant_id, $pay_run_id, $pay_run) * @param string $timesheet_id Identifier for the timesheet (required) * @param string $timesheet_line_id Identifier for the timesheet line (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\TimesheetLine $timesheet_line timesheet_line (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\TimesheetLineObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem */ - public function updateTimesheetLine($xero_tenant_id, $timesheet_id, $timesheet_line_id, $timesheet_line) + public function updateTimesheetLine($xero_tenant_id, $timesheet_id, $timesheet_line_id, $timesheet_line, $idempotency_key = null) { - list($response) = $this->updateTimesheetLineWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line_id, $timesheet_line); + list($response) = $this->updateTimesheetLineWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line_id, $timesheet_line, $idempotency_key); return $response; } /** @@ -18249,13 +18484,14 @@ public function updateTimesheetLine($xero_tenant_id, $timesheet_id, $timesheet_l * @param string $timesheet_id Identifier for the timesheet (required) * @param string $timesheet_line_id Identifier for the timesheet line (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\TimesheetLine $timesheet_line (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\PayrollUk\TimesheetLineObject|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\Problem, HTTP status code, HTTP response headers (array of strings) */ - public function updateTimesheetLineWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line_id, $timesheet_line) + public function updateTimesheetLineWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line_id, $timesheet_line, $idempotency_key = null) { - $request = $this->updateTimesheetLineRequest($xero_tenant_id, $timesheet_id, $timesheet_line_id, $timesheet_line); + $request = $this->updateTimesheetLineRequest($xero_tenant_id, $timesheet_id, $timesheet_line_id, $timesheet_line, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -18347,12 +18583,13 @@ public function updateTimesheetLineWithHttpInfo($xero_tenant_id, $timesheet_id, * @param string $timesheet_id Identifier for the timesheet (required) * @param string $timesheet_line_id Identifier for the timesheet line (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\TimesheetLine $timesheet_line (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateTimesheetLineAsync($xero_tenant_id, $timesheet_id, $timesheet_line_id, $timesheet_line) + public function updateTimesheetLineAsync($xero_tenant_id, $timesheet_id, $timesheet_line_id, $timesheet_line, $idempotency_key = null) { - return $this->updateTimesheetLineAsyncWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line_id, $timesheet_line) + return $this->updateTimesheetLineAsyncWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line_id, $timesheet_line, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -18366,12 +18603,13 @@ function ($response) { * @param string $timesheet_id Identifier for the timesheet (required) * @param string $timesheet_line_id Identifier for the timesheet line (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\TimesheetLine $timesheet_line (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateTimesheetLineAsyncWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line_id, $timesheet_line) + public function updateTimesheetLineAsyncWithHttpInfo($xero_tenant_id, $timesheet_id, $timesheet_line_id, $timesheet_line, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\TimesheetLineObject'; - $request = $this->updateTimesheetLineRequest($xero_tenant_id, $timesheet_id, $timesheet_line_id, $timesheet_line); + $request = $this->updateTimesheetLineRequest($xero_tenant_id, $timesheet_id, $timesheet_line_id, $timesheet_line, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -18411,9 +18649,10 @@ function ($exception) { * @param string $timesheet_id Identifier for the timesheet (required) * @param string $timesheet_line_id Identifier for the timesheet line (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollUk\TimesheetLine $timesheet_line (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateTimesheetLineRequest($xero_tenant_id, $timesheet_id, $timesheet_line_id, $timesheet_line) + protected function updateTimesheetLineRequest($xero_tenant_id, $timesheet_id, $timesheet_line_id, $timesheet_line, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -18449,6 +18688,10 @@ protected function updateTimesheetLineRequest($xero_tenant_id, $timesheet_id, $t if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = PayrollUkObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = PayrollUkObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($timesheet_id !== null) { $resourcePath = str_replace( diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Api/ProjectApi.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Api/ProjectApi.php index 87e2638..afdcfd1 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Api/ProjectApi.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Api/ProjectApi.php @@ -9,7 +9,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -18,7 +18,7 @@ * * This is the Xero Projects API * - * OpenAPI spec version: 2.35.0 + * OpenAPI spec version: 6.2.0 * Contact: api@xero.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 5.4.0 @@ -94,13 +94,14 @@ public function getConfig() * Create one or more new projects * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\ProjectCreateOrUpdate $project_create_or_update Create a new project with ProjectCreateOrUpdate object (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\Project|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\Error */ - public function createProject($xero_tenant_id, $project_create_or_update) + public function createProject($xero_tenant_id, $project_create_or_update, $idempotency_key = null) { - list($response) = $this->createProjectWithHttpInfo($xero_tenant_id, $project_create_or_update); + list($response) = $this->createProjectWithHttpInfo($xero_tenant_id, $project_create_or_update, $idempotency_key); return $response; } /** @@ -108,13 +109,14 @@ public function createProject($xero_tenant_id, $project_create_or_update) * Create one or more new projects * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\ProjectCreateOrUpdate $project_create_or_update Create a new project with ProjectCreateOrUpdate object (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Project\Project|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createProjectWithHttpInfo($xero_tenant_id, $project_create_or_update) + public function createProjectWithHttpInfo($xero_tenant_id, $project_create_or_update, $idempotency_key = null) { - $request = $this->createProjectRequest($xero_tenant_id, $project_create_or_update); + $request = $this->createProjectRequest($xero_tenant_id, $project_create_or_update, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -204,12 +206,13 @@ public function createProjectWithHttpInfo($xero_tenant_id, $project_create_or_up * Create one or more new projects * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\ProjectCreateOrUpdate $project_create_or_update Create a new project with ProjectCreateOrUpdate object (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createProjectAsync($xero_tenant_id, $project_create_or_update) + public function createProjectAsync($xero_tenant_id, $project_create_or_update, $idempotency_key = null) { - return $this->createProjectAsyncWithHttpInfo($xero_tenant_id, $project_create_or_update) + return $this->createProjectAsyncWithHttpInfo($xero_tenant_id, $project_create_or_update, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -221,12 +224,13 @@ function ($response) { * Create one or more new projects * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\ProjectCreateOrUpdate $project_create_or_update Create a new project with ProjectCreateOrUpdate object (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createProjectAsyncWithHttpInfo($xero_tenant_id, $project_create_or_update) + public function createProjectAsyncWithHttpInfo($xero_tenant_id, $project_create_or_update, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\Project'; - $request = $this->createProjectRequest($xero_tenant_id, $project_create_or_update); + $request = $this->createProjectRequest($xero_tenant_id, $project_create_or_update, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -264,9 +268,10 @@ function ($exception) { * Create request for operation 'createProject' * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\ProjectCreateOrUpdate $project_create_or_update Create a new project with ProjectCreateOrUpdate object (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createProjectRequest($xero_tenant_id, $project_create_or_update) + protected function createProjectRequest($xero_tenant_id, $project_create_or_update, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -290,6 +295,10 @@ protected function createProjectRequest($xero_tenant_id, $project_create_or_upda if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = ProjectObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = ProjectObjectSerializer::toHeaderValue($idempotency_key); + } // body params $_tempBody = null; if (isset($project_create_or_update)) { @@ -359,13 +368,14 @@ protected function createProjectRequest($xero_tenant_id, $project_create_or_upda * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $project_id You can create a task on a specified projectId (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\TaskCreateOrUpdate $task_create_or_update The task object you are creating (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\Task|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\Error */ - public function createTask($xero_tenant_id, $project_id, $task_create_or_update) + public function createTask($xero_tenant_id, $project_id, $task_create_or_update, $idempotency_key = null) { - list($response) = $this->createTaskWithHttpInfo($xero_tenant_id, $project_id, $task_create_or_update); + list($response) = $this->createTaskWithHttpInfo($xero_tenant_id, $project_id, $task_create_or_update, $idempotency_key); return $response; } /** @@ -374,13 +384,14 @@ public function createTask($xero_tenant_id, $project_id, $task_create_or_update) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $project_id You can create a task on a specified projectId (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\TaskCreateOrUpdate $task_create_or_update The task object you are creating (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Project\Task|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createTaskWithHttpInfo($xero_tenant_id, $project_id, $task_create_or_update) + public function createTaskWithHttpInfo($xero_tenant_id, $project_id, $task_create_or_update, $idempotency_key = null) { - $request = $this->createTaskRequest($xero_tenant_id, $project_id, $task_create_or_update); + $request = $this->createTaskRequest($xero_tenant_id, $project_id, $task_create_or_update, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -471,12 +482,13 @@ public function createTaskWithHttpInfo($xero_tenant_id, $project_id, $task_creat * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $project_id You can create a task on a specified projectId (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\TaskCreateOrUpdate $task_create_or_update The task object you are creating (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createTaskAsync($xero_tenant_id, $project_id, $task_create_or_update) + public function createTaskAsync($xero_tenant_id, $project_id, $task_create_or_update, $idempotency_key = null) { - return $this->createTaskAsyncWithHttpInfo($xero_tenant_id, $project_id, $task_create_or_update) + return $this->createTaskAsyncWithHttpInfo($xero_tenant_id, $project_id, $task_create_or_update, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -489,12 +501,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $project_id You can create a task on a specified projectId (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\TaskCreateOrUpdate $task_create_or_update The task object you are creating (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createTaskAsyncWithHttpInfo($xero_tenant_id, $project_id, $task_create_or_update) + public function createTaskAsyncWithHttpInfo($xero_tenant_id, $project_id, $task_create_or_update, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\Task'; - $request = $this->createTaskRequest($xero_tenant_id, $project_id, $task_create_or_update); + $request = $this->createTaskRequest($xero_tenant_id, $project_id, $task_create_or_update, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -533,9 +546,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $project_id You can create a task on a specified projectId (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\TaskCreateOrUpdate $task_create_or_update The task object you are creating (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createTaskRequest($xero_tenant_id, $project_id, $task_create_or_update) + protected function createTaskRequest($xero_tenant_id, $project_id, $task_create_or_update, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -565,6 +579,10 @@ protected function createTaskRequest($xero_tenant_id, $project_id, $task_create_ if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = ProjectObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = ProjectObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($project_id !== null) { $resourcePath = str_replace( @@ -642,13 +660,14 @@ protected function createTaskRequest($xero_tenant_id, $project_id, $task_create_ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $project_id You can specify an individual project by appending the projectId to the endpoint (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\TimeEntryCreateOrUpdate $time_entry_create_or_update The time entry object you are creating (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\TimeEntry|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\Error */ - public function createTimeEntry($xero_tenant_id, $project_id, $time_entry_create_or_update) + public function createTimeEntry($xero_tenant_id, $project_id, $time_entry_create_or_update, $idempotency_key = null) { - list($response) = $this->createTimeEntryWithHttpInfo($xero_tenant_id, $project_id, $time_entry_create_or_update); + list($response) = $this->createTimeEntryWithHttpInfo($xero_tenant_id, $project_id, $time_entry_create_or_update, $idempotency_key); return $response; } /** @@ -657,13 +676,14 @@ public function createTimeEntry($xero_tenant_id, $project_id, $time_entry_create * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $project_id You can specify an individual project by appending the projectId to the endpoint (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\TimeEntryCreateOrUpdate $time_entry_create_or_update The time entry object you are creating (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \XeroAPI\XeroPHP\Models\Project\TimeEntry|\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\Error, HTTP status code, HTTP response headers (array of strings) */ - public function createTimeEntryWithHttpInfo($xero_tenant_id, $project_id, $time_entry_create_or_update) + public function createTimeEntryWithHttpInfo($xero_tenant_id, $project_id, $time_entry_create_or_update, $idempotency_key = null) { - $request = $this->createTimeEntryRequest($xero_tenant_id, $project_id, $time_entry_create_or_update); + $request = $this->createTimeEntryRequest($xero_tenant_id, $project_id, $time_entry_create_or_update, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -754,12 +774,13 @@ public function createTimeEntryWithHttpInfo($xero_tenant_id, $project_id, $time_ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $project_id You can specify an individual project by appending the projectId to the endpoint (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\TimeEntryCreateOrUpdate $time_entry_create_or_update The time entry object you are creating (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createTimeEntryAsync($xero_tenant_id, $project_id, $time_entry_create_or_update) + public function createTimeEntryAsync($xero_tenant_id, $project_id, $time_entry_create_or_update, $idempotency_key = null) { - return $this->createTimeEntryAsyncWithHttpInfo($xero_tenant_id, $project_id, $time_entry_create_or_update) + return $this->createTimeEntryAsyncWithHttpInfo($xero_tenant_id, $project_id, $time_entry_create_or_update, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -772,12 +793,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $project_id You can specify an individual project by appending the projectId to the endpoint (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\TimeEntryCreateOrUpdate $time_entry_create_or_update The time entry object you are creating (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function createTimeEntryAsyncWithHttpInfo($xero_tenant_id, $project_id, $time_entry_create_or_update) + public function createTimeEntryAsyncWithHttpInfo($xero_tenant_id, $project_id, $time_entry_create_or_update, $idempotency_key = null) { $returnType = '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\TimeEntry'; - $request = $this->createTimeEntryRequest($xero_tenant_id, $project_id, $time_entry_create_or_update); + $request = $this->createTimeEntryRequest($xero_tenant_id, $project_id, $time_entry_create_or_update, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -816,9 +838,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $project_id You can specify an individual project by appending the projectId to the endpoint (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\TimeEntryCreateOrUpdate $time_entry_create_or_update The time entry object you are creating (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function createTimeEntryRequest($xero_tenant_id, $project_id, $time_entry_create_or_update) + protected function createTimeEntryRequest($xero_tenant_id, $project_id, $time_entry_create_or_update, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -848,6 +871,10 @@ protected function createTimeEntryRequest($xero_tenant_id, $project_id, $time_en if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = ProjectObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = ProjectObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($project_id !== null) { $resourcePath = str_replace( @@ -3483,13 +3510,14 @@ protected function getTimeEntryRequest($xero_tenant_id, $project_id, $time_entry * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $project_id You can specify an individual project by appending the projectId to the endpoint (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\ProjectPatch $project_patch Update the status of an existing Project (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function patchProject($xero_tenant_id, $project_id, $project_patch) + public function patchProject($xero_tenant_id, $project_id, $project_patch, $idempotency_key = null) { - $this->patchProjectWithHttpInfo($xero_tenant_id, $project_id, $project_patch); + $this->patchProjectWithHttpInfo($xero_tenant_id, $project_id, $project_patch, $idempotency_key); } /** * Operation patchProjectWithHttpInfo @@ -3497,13 +3525,14 @@ public function patchProject($xero_tenant_id, $project_id, $project_patch) * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $project_id You can specify an individual project by appending the projectId to the endpoint (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\ProjectPatch $project_patch Update the status of an existing Project (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function patchProjectWithHttpInfo($xero_tenant_id, $project_id, $project_patch) + public function patchProjectWithHttpInfo($xero_tenant_id, $project_id, $project_patch, $idempotency_key = null) { - $request = $this->patchProjectRequest($xero_tenant_id, $project_id, $project_patch); + $request = $this->patchProjectRequest($xero_tenant_id, $project_id, $project_patch, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -3550,12 +3579,13 @@ public function patchProjectWithHttpInfo($xero_tenant_id, $project_id, $project_ * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $project_id You can specify an individual project by appending the projectId to the endpoint (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\ProjectPatch $project_patch Update the status of an existing Project (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function patchProjectAsync($xero_tenant_id, $project_id, $project_patch) + public function patchProjectAsync($xero_tenant_id, $project_id, $project_patch, $idempotency_key = null) { - return $this->patchProjectAsyncWithHttpInfo($xero_tenant_id, $project_id, $project_patch) + return $this->patchProjectAsyncWithHttpInfo($xero_tenant_id, $project_id, $project_patch, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -3568,12 +3598,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $project_id You can specify an individual project by appending the projectId to the endpoint (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\ProjectPatch $project_patch Update the status of an existing Project (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function patchProjectAsyncWithHttpInfo($xero_tenant_id, $project_id, $project_patch) + public function patchProjectAsyncWithHttpInfo($xero_tenant_id, $project_id, $project_patch, $idempotency_key = null) { $returnType = ''; - $request = $this->patchProjectRequest($xero_tenant_id, $project_id, $project_patch); + $request = $this->patchProjectRequest($xero_tenant_id, $project_id, $project_patch, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -3602,9 +3633,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $project_id You can specify an individual project by appending the projectId to the endpoint (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\ProjectPatch $project_patch Update the status of an existing Project (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function patchProjectRequest($xero_tenant_id, $project_id, $project_patch) + protected function patchProjectRequest($xero_tenant_id, $project_id, $project_patch, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -3634,6 +3666,10 @@ protected function patchProjectRequest($xero_tenant_id, $project_id, $project_pa if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = ProjectObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = ProjectObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($project_id !== null) { $resourcePath = str_replace( @@ -3711,13 +3747,14 @@ protected function patchProjectRequest($xero_tenant_id, $project_id, $project_pa * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $project_id You can specify an individual project by appending the projectId to the endpoint (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\ProjectCreateOrUpdate $project_create_or_update Request of type ProjectCreateOrUpdate (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function updateProject($xero_tenant_id, $project_id, $project_create_or_update) + public function updateProject($xero_tenant_id, $project_id, $project_create_or_update, $idempotency_key = null) { - $this->updateProjectWithHttpInfo($xero_tenant_id, $project_id, $project_create_or_update); + $this->updateProjectWithHttpInfo($xero_tenant_id, $project_id, $project_create_or_update, $idempotency_key); } /** * Operation updateProjectWithHttpInfo @@ -3725,13 +3762,14 @@ public function updateProject($xero_tenant_id, $project_id, $project_create_or_u * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $project_id You can specify an individual project by appending the projectId to the endpoint (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\ProjectCreateOrUpdate $project_create_or_update Request of type ProjectCreateOrUpdate (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function updateProjectWithHttpInfo($xero_tenant_id, $project_id, $project_create_or_update) + public function updateProjectWithHttpInfo($xero_tenant_id, $project_id, $project_create_or_update, $idempotency_key = null) { - $request = $this->updateProjectRequest($xero_tenant_id, $project_id, $project_create_or_update); + $request = $this->updateProjectRequest($xero_tenant_id, $project_id, $project_create_or_update, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -3778,12 +3816,13 @@ public function updateProjectWithHttpInfo($xero_tenant_id, $project_id, $project * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $project_id You can specify an individual project by appending the projectId to the endpoint (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\ProjectCreateOrUpdate $project_create_or_update Request of type ProjectCreateOrUpdate (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateProjectAsync($xero_tenant_id, $project_id, $project_create_or_update) + public function updateProjectAsync($xero_tenant_id, $project_id, $project_create_or_update, $idempotency_key = null) { - return $this->updateProjectAsyncWithHttpInfo($xero_tenant_id, $project_id, $project_create_or_update) + return $this->updateProjectAsyncWithHttpInfo($xero_tenant_id, $project_id, $project_create_or_update, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -3796,12 +3835,13 @@ function ($response) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $project_id You can specify an individual project by appending the projectId to the endpoint (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\ProjectCreateOrUpdate $project_create_or_update Request of type ProjectCreateOrUpdate (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateProjectAsyncWithHttpInfo($xero_tenant_id, $project_id, $project_create_or_update) + public function updateProjectAsyncWithHttpInfo($xero_tenant_id, $project_id, $project_create_or_update, $idempotency_key = null) { $returnType = ''; - $request = $this->updateProjectRequest($xero_tenant_id, $project_id, $project_create_or_update); + $request = $this->updateProjectRequest($xero_tenant_id, $project_id, $project_create_or_update, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -3830,9 +3870,10 @@ function ($exception) { * @param string $xero_tenant_id Xero identifier for Tenant (required) * @param string $project_id You can specify an individual project by appending the projectId to the endpoint (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\ProjectCreateOrUpdate $project_create_or_update Request of type ProjectCreateOrUpdate (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateProjectRequest($xero_tenant_id, $project_id, $project_create_or_update) + protected function updateProjectRequest($xero_tenant_id, $project_id, $project_create_or_update, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -3862,6 +3903,10 @@ protected function updateProjectRequest($xero_tenant_id, $project_id, $project_c if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = ProjectObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = ProjectObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($project_id !== null) { $resourcePath = str_replace( @@ -3940,13 +3985,14 @@ protected function updateProjectRequest($xero_tenant_id, $project_id, $project_c * @param string $project_id You can specify an individual project by appending the projectId to the endpoint (required) * @param string $task_id You can specify an individual task by appending the id to the endpoint (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\TaskCreateOrUpdate $task_create_or_update The task object you are updating (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function updateTask($xero_tenant_id, $project_id, $task_id, $task_create_or_update) + public function updateTask($xero_tenant_id, $project_id, $task_id, $task_create_or_update, $idempotency_key = null) { - $this->updateTaskWithHttpInfo($xero_tenant_id, $project_id, $task_id, $task_create_or_update); + $this->updateTaskWithHttpInfo($xero_tenant_id, $project_id, $task_id, $task_create_or_update, $idempotency_key); } /** * Operation updateTaskWithHttpInfo @@ -3955,13 +4001,14 @@ public function updateTask($xero_tenant_id, $project_id, $task_id, $task_create_ * @param string $project_id You can specify an individual project by appending the projectId to the endpoint (required) * @param string $task_id You can specify an individual task by appending the id to the endpoint (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\TaskCreateOrUpdate $task_create_or_update The task object you are updating (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function updateTaskWithHttpInfo($xero_tenant_id, $project_id, $task_id, $task_create_or_update) + public function updateTaskWithHttpInfo($xero_tenant_id, $project_id, $task_id, $task_create_or_update, $idempotency_key = null) { - $request = $this->updateTaskRequest($xero_tenant_id, $project_id, $task_id, $task_create_or_update); + $request = $this->updateTaskRequest($xero_tenant_id, $project_id, $task_id, $task_create_or_update, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -4009,12 +4056,13 @@ public function updateTaskWithHttpInfo($xero_tenant_id, $project_id, $task_id, $ * @param string $project_id You can specify an individual project by appending the projectId to the endpoint (required) * @param string $task_id You can specify an individual task by appending the id to the endpoint (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\TaskCreateOrUpdate $task_create_or_update The task object you are updating (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateTaskAsync($xero_tenant_id, $project_id, $task_id, $task_create_or_update) + public function updateTaskAsync($xero_tenant_id, $project_id, $task_id, $task_create_or_update, $idempotency_key = null) { - return $this->updateTaskAsyncWithHttpInfo($xero_tenant_id, $project_id, $task_id, $task_create_or_update) + return $this->updateTaskAsyncWithHttpInfo($xero_tenant_id, $project_id, $task_id, $task_create_or_update, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -4028,12 +4076,13 @@ function ($response) { * @param string $project_id You can specify an individual project by appending the projectId to the endpoint (required) * @param string $task_id You can specify an individual task by appending the id to the endpoint (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\TaskCreateOrUpdate $task_create_or_update The task object you are updating (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateTaskAsyncWithHttpInfo($xero_tenant_id, $project_id, $task_id, $task_create_or_update) + public function updateTaskAsyncWithHttpInfo($xero_tenant_id, $project_id, $task_id, $task_create_or_update, $idempotency_key = null) { $returnType = ''; - $request = $this->updateTaskRequest($xero_tenant_id, $project_id, $task_id, $task_create_or_update); + $request = $this->updateTaskRequest($xero_tenant_id, $project_id, $task_id, $task_create_or_update, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -4063,9 +4112,10 @@ function ($exception) { * @param string $project_id You can specify an individual project by appending the projectId to the endpoint (required) * @param string $task_id You can specify an individual task by appending the id to the endpoint (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\TaskCreateOrUpdate $task_create_or_update The task object you are updating (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateTaskRequest($xero_tenant_id, $project_id, $task_id, $task_create_or_update) + protected function updateTaskRequest($xero_tenant_id, $project_id, $task_id, $task_create_or_update, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -4101,6 +4151,10 @@ protected function updateTaskRequest($xero_tenant_id, $project_id, $task_id, $ta if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = ProjectObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = ProjectObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($project_id !== null) { $resourcePath = str_replace( @@ -4187,13 +4241,14 @@ protected function updateTaskRequest($xero_tenant_id, $project_id, $task_id, $ta * @param string $project_id You can specify an individual project by appending the projectId to the endpoint (required) * @param string $time_entry_id You can specify an individual time entry by appending the id to the endpoint (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\TimeEntryCreateOrUpdate $time_entry_create_or_update The time entry object you are updating (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function updateTimeEntry($xero_tenant_id, $project_id, $time_entry_id, $time_entry_create_or_update) + public function updateTimeEntry($xero_tenant_id, $project_id, $time_entry_id, $time_entry_create_or_update, $idempotency_key = null) { - $this->updateTimeEntryWithHttpInfo($xero_tenant_id, $project_id, $time_entry_id, $time_entry_create_or_update); + $this->updateTimeEntryWithHttpInfo($xero_tenant_id, $project_id, $time_entry_id, $time_entry_create_or_update, $idempotency_key); } /** * Operation updateTimeEntryWithHttpInfo @@ -4202,13 +4257,14 @@ public function updateTimeEntry($xero_tenant_id, $project_id, $time_entry_id, $t * @param string $project_id You can specify an individual project by appending the projectId to the endpoint (required) * @param string $time_entry_id You can specify an individual time entry by appending the id to the endpoint (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\TimeEntryCreateOrUpdate $time_entry_create_or_update The time entry object you are updating (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function updateTimeEntryWithHttpInfo($xero_tenant_id, $project_id, $time_entry_id, $time_entry_create_or_update) + public function updateTimeEntryWithHttpInfo($xero_tenant_id, $project_id, $time_entry_id, $time_entry_create_or_update, $idempotency_key = null) { - $request = $this->updateTimeEntryRequest($xero_tenant_id, $project_id, $time_entry_id, $time_entry_create_or_update); + $request = $this->updateTimeEntryRequest($xero_tenant_id, $project_id, $time_entry_id, $time_entry_create_or_update, $idempotency_key); try { $options = $this->createHttpClientOption(); try { @@ -4256,12 +4312,13 @@ public function updateTimeEntryWithHttpInfo($xero_tenant_id, $project_id, $time_ * @param string $project_id You can specify an individual project by appending the projectId to the endpoint (required) * @param string $time_entry_id You can specify an individual time entry by appending the id to the endpoint (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\TimeEntryCreateOrUpdate $time_entry_create_or_update The time entry object you are updating (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateTimeEntryAsync($xero_tenant_id, $project_id, $time_entry_id, $time_entry_create_or_update) + public function updateTimeEntryAsync($xero_tenant_id, $project_id, $time_entry_id, $time_entry_create_or_update, $idempotency_key = null) { - return $this->updateTimeEntryAsyncWithHttpInfo($xero_tenant_id, $project_id, $time_entry_id, $time_entry_create_or_update) + return $this->updateTimeEntryAsyncWithHttpInfo($xero_tenant_id, $project_id, $time_entry_id, $time_entry_create_or_update, $idempotency_key) ->then( function ($response) { return $response[0]; @@ -4275,12 +4332,13 @@ function ($response) { * @param string $project_id You can specify an individual project by appending the projectId to the endpoint (required) * @param string $time_entry_id You can specify an individual time entry by appending the id to the endpoint (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\TimeEntryCreateOrUpdate $time_entry_create_or_update The time entry object you are updating (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Promise\PromiseInterface */ - public function updateTimeEntryAsyncWithHttpInfo($xero_tenant_id, $project_id, $time_entry_id, $time_entry_create_or_update) + public function updateTimeEntryAsyncWithHttpInfo($xero_tenant_id, $project_id, $time_entry_id, $time_entry_create_or_update, $idempotency_key = null) { $returnType = ''; - $request = $this->updateTimeEntryRequest($xero_tenant_id, $project_id, $time_entry_id, $time_entry_create_or_update); + $request = $this->updateTimeEntryRequest($xero_tenant_id, $project_id, $time_entry_id, $time_entry_create_or_update, $idempotency_key); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -4310,9 +4368,10 @@ function ($exception) { * @param string $project_id You can specify an individual project by appending the projectId to the endpoint (required) * @param string $time_entry_id You can specify an individual time entry by appending the id to the endpoint (required) * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Project\TimeEntryCreateOrUpdate $time_entry_create_or_update The time entry object you are updating (required) + * @param string $idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max. (optional) * @throws \InvalidArgumentException * @return \Automattic\WooCommerce\Xero\Vendor\GuzzleHttp\Psr7\Request */ - protected function updateTimeEntryRequest($xero_tenant_id, $project_id, $time_entry_id, $time_entry_create_or_update) + protected function updateTimeEntryRequest($xero_tenant_id, $project_id, $time_entry_id, $time_entry_create_or_update, $idempotency_key = null) { // verify the required parameter 'xero_tenant_id' is set if ($xero_tenant_id === null || (is_array($xero_tenant_id) && count($xero_tenant_id) === 0)) { @@ -4348,6 +4407,10 @@ protected function updateTimeEntryRequest($xero_tenant_id, $project_id, $time_en if ($xero_tenant_id !== null) { $headerParams['Xero-Tenant-Id'] = ProjectObjectSerializer::toHeaderValue($xero_tenant_id); } + // header params + if ($idempotency_key !== null) { + $headerParams['Idempotency-Key'] = ProjectObjectSerializer::toHeaderValue($idempotency_key); + } // path params if ($project_id !== null) { $resourcePath = str_replace( diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/ApiException.php b/lib/packages/xeroapi/xero-php-oauth2/lib/ApiException.php index 772c20c..62810ad 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/ApiException.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/ApiException.php @@ -9,7 +9,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/AppStoreObjectSerializer.php b/lib/packages/xeroapi/xero-php-oauth2/lib/AppStoreObjectSerializer.php index c975028..b8892ac 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/AppStoreObjectSerializer.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/AppStoreObjectSerializer.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/AssetObjectSerializer.php b/lib/packages/xeroapi/xero-php-oauth2/lib/AssetObjectSerializer.php index 96679e7..422b0dc 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/AssetObjectSerializer.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/AssetObjectSerializer.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Configuration.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Configuration.php index cd09812..1161e13 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Configuration.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Configuration.php @@ -9,7 +9,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -161,7 +161,7 @@ class Configuration * * @var string */ - protected $userAgent = '[xero-php-oauth2 (2.20.0)]'; + protected $userAgent = '[xero-php-oauth2 (7.2.0)]'; /** * Debug switch (default set to false) @@ -700,8 +700,8 @@ public static function toDebugReport() $report = 'PHP SDK (XeroAPI\XeroPHP) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' OpenAPI Spec Version: 2.35.0' . PHP_EOL; - $report .= ' SDK Package Version: 2.20.0' . PHP_EOL; + $report .= ' OpenAPI Spec Version: 6.2.0' . PHP_EOL; + $report .= ' SDK Package Version: 7.2.0' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/FileObjectSerializer.php b/lib/packages/xeroapi/xero-php-oauth2/lib/FileObjectSerializer.php index 1e5a795..30907fe 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/FileObjectSerializer.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/FileObjectSerializer.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/FinanceObjectSerializer.php b/lib/packages/xeroapi/xero-php-oauth2/lib/FinanceObjectSerializer.php index 430d83b..4fcc0ad 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/FinanceObjectSerializer.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/FinanceObjectSerializer.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/HeaderSelector.php b/lib/packages/xeroapi/xero-php-oauth2/lib/HeaderSelector.php index 5b831ba..225a5a8 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/HeaderSelector.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/HeaderSelector.php @@ -9,7 +9,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/IdentityObjectSerializer.php b/lib/packages/xeroapi/xero-php-oauth2/lib/IdentityObjectSerializer.php index 00e4024..a8db9a7 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/IdentityObjectSerializer.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/IdentityObjectSerializer.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/JWTClaims.php b/lib/packages/xeroapi/xero-php-oauth2/lib/JWTClaims.php index 5238cdb..7574778 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/JWTClaims.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/JWTClaims.php @@ -2,7 +2,7 @@ /** * @license MIT * - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ namespace Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP; @@ -42,7 +42,7 @@ class JWTClaims private function verify($token) { $json = file_get_contents('https://identity.xero.com/.well-known/openid-configuration/jwks'); $jwks = json_decode($json, true); - $supportedAlgorithm = array('RS256'); + $supportedAlgorithm = (object) ['alg'=>['RS256','ES256']]; $verifiedJWT = JWT::decode($token, JWK::parseKeySet($jwks), $supportedAlgorithm); return $verifiedJWT; @@ -88,7 +88,7 @@ public function decodeIdToken($token) { $this->sid = $verifiedJWT->sid; $this->subvalue = $verifiedJWT->sub; $this->auth_time = $verifiedJWT->auth_time; - $this->preferred_username = $verifiedJWT->preferred_username; + $this->username = $verifiedJWT->preferred_username; $this->email = $verifiedJWT->email; $this->given_name = $verifiedJWT->given_name; $this->family_name = $verifiedJWT->family_name; diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Account.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Account.php index 48420e3..709a04c 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Account.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Account.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/AccountType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/AccountType.php index ef9ec0b..a524c6d 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/AccountType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/AccountType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -66,11 +66,7 @@ class AccountType const REVENUE = 'REVENUE'; const SALES = 'SALES'; const TERMLIAB = 'TERMLIAB'; - const PAYGLIABILITY = 'PAYGLIABILITY'; const PAYG = 'PAYG'; - const SUPERANNUATIONEXPENSE = 'SUPERANNUATIONEXPENSE'; - const SUPERANNUATIONLIABILITY = 'SUPERANNUATIONLIABILITY'; - const WAGESEXPENSE = 'WAGESEXPENSE'; /** * Gets allowable values of the enum @@ -96,11 +92,7 @@ public static function getAllowableEnumValues() self::REVENUE, self::SALES, self::TERMLIAB, - self::PAYGLIABILITY, self::PAYG, - self::SUPERANNUATIONEXPENSE, - self::SUPERANNUATIONLIABILITY, - self::WAGESEXPENSE, ]; } } diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Accounts.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Accounts.php index a2b0fe1..2666128 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Accounts.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Accounts.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->Accounts; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['Accounts'] = $sanitizedObject->Accounts; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/AccountsPayable.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/AccountsPayable.php index 63e0e55..c072433 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/AccountsPayable.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/AccountsPayable.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/AccountsReceivable.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/AccountsReceivable.php index 96ef4bb..5a27ded 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/AccountsReceivable.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/AccountsReceivable.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Action.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Action.php index 2abb6d2..d96b687 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Action.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Action.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Actions.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Actions.php index 15c1f09..59b1946 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Actions.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Actions.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->Actions; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['Actions'] = $sanitizedObject->Actions; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Address.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Address.php index b34b429..8882236 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Address.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Address.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/AddressForOrganisation.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/AddressForOrganisation.php index 25e3d1e..094d969 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/AddressForOrganisation.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/AddressForOrganisation.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Allocation.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Allocation.php index e1c09a6..7703c91 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Allocation.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Allocation.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -62,12 +62,14 @@ class Allocation implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ + 'allocation_id' => 'string', 'invoice' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Invoice', 'overpayment' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Overpayment', 'prepayment' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Prepayment', 'credit_note' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CreditNote', 'amount' => 'double', 'date' => 'string', + 'is_deleted' => 'bool', 'status_attribute_string' => 'string', 'validation_errors' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]' ]; @@ -78,12 +80,14 @@ class Allocation implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPIFormats = [ + 'allocation_id' => 'uuid', 'invoice' => null, 'overpayment' => null, 'prepayment' => null, 'credit_note' => null, 'amount' => 'double', 'date' => null, + 'is_deleted' => null, 'status_attribute_string' => null, 'validation_errors' => null ]; @@ -115,12 +119,14 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ + 'allocation_id' => 'AllocationID', 'invoice' => 'Invoice', 'overpayment' => 'Overpayment', 'prepayment' => 'Prepayment', 'credit_note' => 'CreditNote', 'amount' => 'Amount', 'date' => 'Date', + 'is_deleted' => 'IsDeleted', 'status_attribute_string' => 'StatusAttributeString', 'validation_errors' => 'ValidationErrors' ]; @@ -131,12 +137,14 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ + 'allocation_id' => 'setAllocationId', 'invoice' => 'setInvoice', 'overpayment' => 'setOverpayment', 'prepayment' => 'setPrepayment', 'credit_note' => 'setCreditNote', 'amount' => 'setAmount', 'date' => 'setDate', + 'is_deleted' => 'setIsDeleted', 'status_attribute_string' => 'setStatusAttributeString', 'validation_errors' => 'setValidationErrors' ]; @@ -147,12 +155,14 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ + 'allocation_id' => 'getAllocationId', 'invoice' => 'getInvoice', 'overpayment' => 'getOverpayment', 'prepayment' => 'getPrepayment', 'credit_note' => 'getCreditNote', 'amount' => 'getAmount', 'date' => 'getDate', + 'is_deleted' => 'getIsDeleted', 'status_attribute_string' => 'getStatusAttributeString', 'validation_errors' => 'getValidationErrors' ]; @@ -217,12 +227,14 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->container['allocation_id'] = isset($data['allocation_id']) ? $data['allocation_id'] : null; $this->container['invoice'] = isset($data['invoice']) ? $data['invoice'] : null; $this->container['overpayment'] = isset($data['overpayment']) ? $data['overpayment'] : null; $this->container['prepayment'] = isset($data['prepayment']) ? $data['prepayment'] : null; $this->container['credit_note'] = isset($data['credit_note']) ? $data['credit_note'] : null; $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; $this->container['date'] = isset($data['date']) ? $data['date'] : null; + $this->container['is_deleted'] = isset($data['is_deleted']) ? $data['is_deleted'] : null; $this->container['status_attribute_string'] = isset($data['status_attribute_string']) ? $data['status_attribute_string'] : null; $this->container['validation_errors'] = isset($data['validation_errors']) ? $data['validation_errors'] : null; } @@ -260,6 +272,33 @@ public function valid() } + /** + * Gets allocation_id + * + * @return string|null + */ + public function getAllocationId() + { + return $this->container['allocation_id']; + } + + /** + * Sets allocation_id + * + * @param string|null $allocation_id Xero generated unique identifier + * + * @return $this + */ + public function setAllocationId($allocation_id) + { + + $this->container['allocation_id'] = $allocation_id; + + return $this; + } + + + /** * Gets invoice * @@ -448,6 +487,32 @@ public function setDateAsDate($date) + /** + * Gets is_deleted + * + * @return bool|null + */ + public function getIsDeleted() + { + return $this->container['is_deleted']; + } + + /** + * Sets is_deleted + * + * @param bool|null $is_deleted A flag that returns true when the allocation is succesfully deleted + * + * @return $this + */ + public function setIsDeleted($is_deleted) + { + + $this->container['is_deleted'] = $is_deleted; + + return $this; + } + + /** * Gets status_attribute_string * diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Allocations.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Allocations.php index cc973c5..b454952 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Allocations.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Allocations.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->Allocations; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['Allocations'] = $sanitizedObject->Allocations; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Attachment.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Attachment.php index cdc8d8f..ede012a 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Attachment.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Attachment.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Attachments.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Attachments.php index e99e793..4e56fb0 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Attachments.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Attachments.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->Attachments; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['Attachments'] = $sanitizedObject->Attachments; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BalanceDetails.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BalanceDetails.php index 11897fa..40a16f8 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BalanceDetails.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BalanceDetails.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Balances.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Balances.php index 9c79b73..1527985 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Balances.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Balances.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BankTransaction.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BankTransaction.php index f8b16fb..8e7aa28 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BankTransaction.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BankTransaction.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BankTransactions.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BankTransactions.php index 1e89c38..79eb99e 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BankTransactions.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BankTransactions.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -62,6 +62,8 @@ class BankTransactions implements ModelInterface, ArrayAccess, \Countable, \Iter * @var string[] */ protected static $openAPITypes = [ + 'pagination' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Pagination', + 'warnings' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]', 'bank_transactions' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransaction[]' ]; @@ -71,6 +73,8 @@ class BankTransactions implements ModelInterface, ArrayAccess, \Countable, \Iter * @var string[] */ protected static $openAPIFormats = [ + 'pagination' => null, + 'warnings' => null, 'bank_transactions' => null ]; @@ -101,6 +105,8 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ + 'pagination' => 'pagination', + 'warnings' => 'Warnings', 'bank_transactions' => 'BankTransactions' ]; @@ -110,6 +116,8 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ + 'pagination' => 'setPagination', + 'warnings' => 'setWarnings', 'bank_transactions' => 'setBankTransactions' ]; @@ -119,6 +127,8 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ + 'pagination' => 'getPagination', + 'warnings' => 'getWarnings', 'bank_transactions' => 'getBankTransactions' ]; @@ -182,6 +192,8 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->container['pagination'] = isset($data['pagination']) ? $data['pagination'] : null; + $this->container['warnings'] = isset($data['warnings']) ? $data['warnings'] : null; $this->container['bank_transactions'] = isset($data['bank_transactions']) ? $data['bank_transactions'] : null; } @@ -209,6 +221,60 @@ public function valid() } + /** + * Gets pagination + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Pagination|null + */ + public function getPagination() + { + return $this->container['pagination']; + } + + /** + * Sets pagination + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Pagination|null $pagination pagination + * + * @return $this + */ + public function setPagination($pagination) + { + + $this->container['pagination'] = $pagination; + + return $this; + } + + + + /** + * Gets warnings + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]|null + */ + public function getWarnings() + { + return $this->container['warnings']; + } + + /** + * Sets warnings + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]|null $warnings Displays array of warning messages from the API + * + * @return $this + */ + public function setWarnings($warnings) + { + + $this->container['warnings'] = $warnings; + + return $this; + } + + + /** * Gets bank_transactions * @@ -307,7 +373,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->BankTransactions; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['BankTransactions'] = $sanitizedObject->BankTransactions; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BankTransfer.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BankTransfer.php index 99a9e03..2f5c0c8 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BankTransfer.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BankTransfer.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BankTransfers.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BankTransfers.php index 7ec893d..244f0f4 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BankTransfers.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BankTransfers.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->BankTransfers; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['BankTransfers'] = $sanitizedObject->BankTransfers; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BatchPayment.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BatchPayment.php index 26b63da..9656804 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BatchPayment.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BatchPayment.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BatchPaymentDelete.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BatchPaymentDelete.php index c2a725f..bdbbdde 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BatchPaymentDelete.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BatchPaymentDelete.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BatchPaymentDeleteByUrlParam.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BatchPaymentDeleteByUrlParam.php index 56020f1..2b1df39 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BatchPaymentDeleteByUrlParam.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BatchPaymentDeleteByUrlParam.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BatchPaymentDetails.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BatchPaymentDetails.php index 8a0f5ee..dbd03e6 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BatchPaymentDetails.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BatchPaymentDetails.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BatchPayments.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BatchPayments.php index b72ba54..53ab900 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BatchPayments.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BatchPayments.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->BatchPayments; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['BatchPayments'] = $sanitizedObject->BatchPayments; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Bill.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Bill.php index 58f6854..21e676c 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Bill.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Bill.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BrandingTheme.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BrandingTheme.php index 84f7d46..9cd6c94 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BrandingTheme.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BrandingTheme.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BrandingThemes.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BrandingThemes.php index 0873230..384a5b4 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BrandingThemes.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BrandingThemes.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->BrandingThemes; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['BrandingThemes'] = $sanitizedObject->BrandingThemes; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Budget.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Budget.php index 2db5b1e..bf61ea5 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Budget.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Budget.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BudgetBalance.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BudgetBalance.php index 9b173a4..d52226f 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BudgetBalance.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BudgetBalance.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BudgetLine.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BudgetLine.php index d244805..29896a8 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BudgetLine.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BudgetLine.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BudgetLines.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BudgetLines.php index ec2e3e0..51d2fe1 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BudgetLines.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/BudgetLines.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Budgets.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Budgets.php index 340547e..a658305 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Budgets.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Budgets.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->Budgets; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['Budgets'] = $sanitizedObject->Budgets; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/CISOrgSetting.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/CISOrgSetting.php index ff23853..58522eb 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/CISOrgSetting.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/CISOrgSetting.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/CISOrgSettings.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/CISOrgSettings.php index 362bbdc..0b6c494 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/CISOrgSettings.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/CISOrgSettings.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->CISOrgSettings; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['CISOrgSettings'] = $sanitizedObject->CISOrgSettings; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/CISSetting.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/CISSetting.php index 72aa0bc..d6699a5 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/CISSetting.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/CISSetting.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/CISSettings.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/CISSettings.php index 2f792ec..b5c0533 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/CISSettings.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/CISSettings.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->CISSettings; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['CISSettings'] = $sanitizedObject->CISSettings; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Contact.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Contact.php index 16a28c6..d235f28 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Contact.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Contact.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -72,7 +72,6 @@ class Contact implements ModelInterface, ArrayAccess 'last_name' => 'string', 'company_number' => 'string', 'email_address' => 'string', - 'skype_user_name' => 'string', 'contact_persons' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ContactPerson[]', 'bank_account_details' => 'string', 'tax_number' => 'string', @@ -123,7 +122,6 @@ class Contact implements ModelInterface, ArrayAccess 'last_name' => null, 'company_number' => null, 'email_address' => null, - 'skype_user_name' => null, 'contact_persons' => null, 'bank_account_details' => null, 'tax_number' => null, @@ -195,7 +193,6 @@ public static function openAPIFormats() 'last_name' => 'LastName', 'company_number' => 'CompanyNumber', 'email_address' => 'EmailAddress', - 'skype_user_name' => 'SkypeUserName', 'contact_persons' => 'ContactPersons', 'bank_account_details' => 'BankAccountDetails', 'tax_number' => 'TaxNumber', @@ -246,7 +243,6 @@ public static function openAPIFormats() 'last_name' => 'setLastName', 'company_number' => 'setCompanyNumber', 'email_address' => 'setEmailAddress', - 'skype_user_name' => 'setSkypeUserName', 'contact_persons' => 'setContactPersons', 'bank_account_details' => 'setBankAccountDetails', 'tax_number' => 'setTaxNumber', @@ -297,7 +293,6 @@ public static function openAPIFormats() 'last_name' => 'getLastName', 'company_number' => 'getCompanyNumber', 'email_address' => 'getEmailAddress', - 'skype_user_name' => 'getSkypeUserName', 'contact_persons' => 'getContactPersons', 'bank_account_details' => 'getBankAccountDetails', 'tax_number' => 'getTaxNumber', @@ -453,7 +448,6 @@ public function __construct(array $data = null) $this->container['last_name'] = isset($data['last_name']) ? $data['last_name'] : null; $this->container['company_number'] = isset($data['company_number']) ? $data['company_number'] : null; $this->container['email_address'] = isset($data['email_address']) ? $data['email_address'] : null; - $this->container['skype_user_name'] = isset($data['skype_user_name']) ? $data['skype_user_name'] : null; $this->container['contact_persons'] = isset($data['contact_persons']) ? $data['contact_persons'] : null; $this->container['bank_account_details'] = isset($data['bank_account_details']) ? $data['bank_account_details'] : null; $this->container['tax_number'] = isset($data['tax_number']) ? $data['tax_number'] : null; @@ -875,33 +869,6 @@ public function setEmailAddress($email_address) - /** - * Gets skype_user_name - * - * @return string|null - */ - public function getSkypeUserName() - { - return $this->container['skype_user_name']; - } - - /** - * Sets skype_user_name - * - * @param string|null $skype_user_name Skype user name of contact - * - * @return $this - */ - public function setSkypeUserName($skype_user_name) - { - - $this->container['skype_user_name'] = $skype_user_name; - - return $this; - } - - - /** * Gets contact_persons * diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ContactGroup.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ContactGroup.php index 2202f71..7330905 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ContactGroup.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ContactGroup.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ContactGroups.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ContactGroups.php index c0820cf..723669c 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ContactGroups.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ContactGroups.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->ContactGroups; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['ContactGroups'] = $sanitizedObject->ContactGroups; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ContactPerson.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ContactPerson.php index 92dfc9e..4228c9e 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ContactPerson.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ContactPerson.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Contacts.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Contacts.php index 56b5216..d782455 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Contacts.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Contacts.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -62,6 +62,8 @@ class Contacts implements ModelInterface, ArrayAccess, \Countable, \IteratorAggr * @var string[] */ protected static $openAPITypes = [ + 'pagination' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Pagination', + 'warnings' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]', 'contacts' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contact[]' ]; @@ -71,6 +73,8 @@ class Contacts implements ModelInterface, ArrayAccess, \Countable, \IteratorAggr * @var string[] */ protected static $openAPIFormats = [ + 'pagination' => null, + 'warnings' => null, 'contacts' => null ]; @@ -101,6 +105,8 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ + 'pagination' => 'pagination', + 'warnings' => 'Warnings', 'contacts' => 'Contacts' ]; @@ -110,6 +116,8 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ + 'pagination' => 'setPagination', + 'warnings' => 'setWarnings', 'contacts' => 'setContacts' ]; @@ -119,6 +127,8 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ + 'pagination' => 'getPagination', + 'warnings' => 'getWarnings', 'contacts' => 'getContacts' ]; @@ -182,6 +192,8 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->container['pagination'] = isset($data['pagination']) ? $data['pagination'] : null; + $this->container['warnings'] = isset($data['warnings']) ? $data['warnings'] : null; $this->container['contacts'] = isset($data['contacts']) ? $data['contacts'] : null; } @@ -209,6 +221,60 @@ public function valid() } + /** + * Gets pagination + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Pagination|null + */ + public function getPagination() + { + return $this->container['pagination']; + } + + /** + * Sets pagination + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Pagination|null $pagination pagination + * + * @return $this + */ + public function setPagination($pagination) + { + + $this->container['pagination'] = $pagination; + + return $this; + } + + + + /** + * Gets warnings + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]|null + */ + public function getWarnings() + { + return $this->container['warnings']; + } + + /** + * Sets warnings + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]|null $warnings Displays array of warning messages from the API + * + * @return $this + */ + public function setWarnings($warnings) + { + + $this->container['warnings'] = $warnings; + + return $this; + } + + + /** * Gets contacts * @@ -307,7 +373,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->Contacts; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['Contacts'] = $sanitizedObject->Contacts; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ConversionBalances.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ConversionBalances.php index cbfcb24..86cd339 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ConversionBalances.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ConversionBalances.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ConversionDate.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ConversionDate.php index fb3e9cb..ce2d52e 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ConversionDate.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ConversionDate.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/CountryCode.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/CountryCode.php index 68bb608..cc51853 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/CountryCode.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/CountryCode.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/CreditNote.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/CreditNote.php index 7380244..ef3f310 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/CreditNote.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/CreditNote.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -1037,7 +1037,7 @@ public function getSentToContact() /** * Sets sent_to_contact * - * @param bool|null $sent_to_contact boolean to indicate if a credit note has been sent to a contact via the Xero app (currently read only) + * @param bool|null $sent_to_contact Boolean to set whether the credit note in the Xero app should be marked as “sent”. This can be set only on credit notes that have been approved * * @return $this */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/CreditNotes.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/CreditNotes.php index a51224a..f3e4f07 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/CreditNotes.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/CreditNotes.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -62,6 +62,8 @@ class CreditNotes implements ModelInterface, ArrayAccess, \Countable, \IteratorA * @var string[] */ protected static $openAPITypes = [ + 'pagination' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Pagination', + 'warnings' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]', 'credit_notes' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CreditNote[]' ]; @@ -71,6 +73,8 @@ class CreditNotes implements ModelInterface, ArrayAccess, \Countable, \IteratorA * @var string[] */ protected static $openAPIFormats = [ + 'pagination' => null, + 'warnings' => null, 'credit_notes' => null ]; @@ -101,6 +105,8 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ + 'pagination' => 'pagination', + 'warnings' => 'Warnings', 'credit_notes' => 'CreditNotes' ]; @@ -110,6 +116,8 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ + 'pagination' => 'setPagination', + 'warnings' => 'setWarnings', 'credit_notes' => 'setCreditNotes' ]; @@ -119,6 +127,8 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ + 'pagination' => 'getPagination', + 'warnings' => 'getWarnings', 'credit_notes' => 'getCreditNotes' ]; @@ -182,6 +192,8 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->container['pagination'] = isset($data['pagination']) ? $data['pagination'] : null; + $this->container['warnings'] = isset($data['warnings']) ? $data['warnings'] : null; $this->container['credit_notes'] = isset($data['credit_notes']) ? $data['credit_notes'] : null; } @@ -209,6 +221,60 @@ public function valid() } + /** + * Gets pagination + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Pagination|null + */ + public function getPagination() + { + return $this->container['pagination']; + } + + /** + * Sets pagination + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Pagination|null $pagination pagination + * + * @return $this + */ + public function setPagination($pagination) + { + + $this->container['pagination'] = $pagination; + + return $this; + } + + + + /** + * Gets warnings + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]|null + */ + public function getWarnings() + { + return $this->container['warnings']; + } + + /** + * Sets warnings + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]|null $warnings Displays array of warning messages from the API + * + * @return $this + */ + public function setWarnings($warnings) + { + + $this->container['warnings'] = $warnings; + + return $this; + } + + + /** * Gets credit_notes * @@ -307,7 +373,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->CreditNotes; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['CreditNotes'] = $sanitizedObject->CreditNotes; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Currencies.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Currencies.php index 725e730..66e65f5 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Currencies.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Currencies.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->Currencies; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['Currencies'] = $sanitizedObject->Currencies; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Currency.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Currency.php index 3f4cd30..36bc228 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Currency.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Currency.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/CurrencyCode.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/CurrencyCode.php index 66267dd..18e1158 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/CurrencyCode.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/CurrencyCode.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -78,6 +78,7 @@ class CurrencyCode const CAD = 'CAD'; const CDF = 'CDF'; const CHF = 'CHF'; + const CLF = 'CLF'; const CLP = 'CLP'; const CNY = 'CNY'; const COP = 'COP'; @@ -90,6 +91,7 @@ class CurrencyCode const DKK = 'DKK'; const DOP = 'DOP'; const DZD = 'DZD'; + const EEK = 'EEK'; const EGP = 'EGP'; const ERN = 'ERN'; const ETB = 'ETB'; @@ -98,7 +100,6 @@ class CurrencyCode const FKP = 'FKP'; const GBP = 'GBP'; const GEL = 'GEL'; - const GGP = 'GGP'; const GHS = 'GHS'; const GIP = 'GIP'; const GMD = 'GMD'; @@ -112,12 +113,10 @@ class CurrencyCode const HUF = 'HUF'; const IDR = 'IDR'; const ILS = 'ILS'; - const IMP = 'IMP'; const INR = 'INR'; const IQD = 'IQD'; const IRR = 'IRR'; const ISK = 'ISK'; - const JEP = 'JEP'; const JMD = 'JMD'; const JOD = 'JOD'; const JPY = 'JPY'; @@ -136,6 +135,7 @@ class CurrencyCode const LRD = 'LRD'; const LSL = 'LSL'; const LTL = 'LTL'; + const LVL = 'LVL'; const LYD = 'LYD'; const MAD = 'MAD'; const MDL = 'MDL'; @@ -144,11 +144,13 @@ class CurrencyCode const MMK = 'MMK'; const MNT = 'MNT'; const MOP = 'MOP'; + const MRO = 'MRO'; const MRU = 'MRU'; const MUR = 'MUR'; const MVR = 'MVR'; const MWK = 'MWK'; const MXN = 'MXN'; + const MXV = 'MXV'; const MYR = 'MYR'; const MZN = 'MZN'; const NAD = 'NAD'; @@ -177,11 +179,13 @@ class CurrencyCode const SEK = 'SEK'; const SGD = 'SGD'; const SHP = 'SHP'; + const SKK = 'SKK'; + const SLE = 'SLE'; const SLL = 'SLL'; const SOS = 'SOS'; - const SPL = 'SPL'; const SRD = 'SRD'; - const STN = 'STN'; + const STN = 'STD'; + const STD = 'STN'; const SVC = 'SVC'; const SYP = 'SYP'; const SZL = 'SZL'; @@ -192,7 +196,6 @@ class CurrencyCode const TOP = 'TOP'; const TRY_LIRA = 'TRY'; const TTD = 'TTD'; - const TVD = 'TVD'; const TWD = 'TWD'; const TZS = 'TZS'; const UAH = 'UAH'; @@ -201,12 +204,12 @@ class CurrencyCode const UYU = 'UYU'; const UZS = 'UZS'; const VEF = 'VEF'; + const VES = 'VES'; const VND = 'VND'; const VUV = 'VUV'; const WST = 'WST'; const XAF = 'XAF'; const XCD = 'XCD'; - const XDR = 'XDR'; const XOF = 'XOF'; const XPF = 'XPF'; const YER = 'YER'; @@ -214,7 +217,6 @@ class CurrencyCode const ZMW = 'ZMW'; const ZMK = 'ZMK'; const ZWD = 'ZWD'; - const EMPTY_CURRENCY = ''; /** * Gets allowable values of the enum @@ -252,6 +254,7 @@ public static function getAllowableEnumValues() self::CAD, self::CDF, self::CHF, + self::CLF, self::CLP, self::CNY, self::COP, @@ -264,6 +267,7 @@ public static function getAllowableEnumValues() self::DKK, self::DOP, self::DZD, + self::EEK, self::EGP, self::ERN, self::ETB, @@ -272,7 +276,6 @@ public static function getAllowableEnumValues() self::FKP, self::GBP, self::GEL, - self::GGP, self::GHS, self::GIP, self::GMD, @@ -286,12 +289,10 @@ public static function getAllowableEnumValues() self::HUF, self::IDR, self::ILS, - self::IMP, self::INR, self::IQD, self::IRR, self::ISK, - self::JEP, self::JMD, self::JOD, self::JPY, @@ -310,6 +311,7 @@ public static function getAllowableEnumValues() self::LRD, self::LSL, self::LTL, + self::LVL, self::LYD, self::MAD, self::MDL, @@ -318,11 +320,13 @@ public static function getAllowableEnumValues() self::MMK, self::MNT, self::MOP, + self::MRO, self::MRU, self::MUR, self::MVR, self::MWK, self::MXN, + self::MXV, self::MYR, self::MZN, self::NAD, @@ -351,11 +355,13 @@ public static function getAllowableEnumValues() self::SEK, self::SGD, self::SHP, + self::SKK, + self::SLE, self::SLL, self::SOS, - self::SPL, self::SRD, self::STN, + self::STD, self::SVC, self::SYP, self::SZL, @@ -366,7 +372,6 @@ public static function getAllowableEnumValues() self::TOP, self::TRY_LIRA, self::TTD, - self::TVD, self::TWD, self::TZS, self::UAH, @@ -375,12 +380,12 @@ public static function getAllowableEnumValues() self::UYU, self::UZS, self::VEF, + self::VES, self::VND, self::VUV, self::WST, self::XAF, self::XCD, - self::XDR, self::XOF, self::XPF, self::YER, @@ -388,7 +393,6 @@ public static function getAllowableEnumValues() self::ZMW, self::ZMK, self::ZWD, - self::EMPTY_CURRENCY, ]; } } diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Element.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Element.php index 0d84f4e..ee33b9c 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Element.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Element.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Employee.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Employee.php index 2930506..6856682 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Employee.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Employee.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Employees.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Employees.php index 31bf61a..4d2b180 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Employees.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Employees.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->Employees; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['Employees'] = $sanitizedObject->Employees; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Error.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Error.php index 4795731..5d46b98 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Error.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Error.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ExpenseClaim.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ExpenseClaim.php index 0c382e1..cb1ef20 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ExpenseClaim.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ExpenseClaim.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ExpenseClaims.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ExpenseClaims.php index 8c1012b..eec15f6 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ExpenseClaims.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ExpenseClaims.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->ExpenseClaims; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['ExpenseClaims'] = $sanitizedObject->ExpenseClaims; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ExternalLink.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ExternalLink.php index 4113441..76c68bd 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ExternalLink.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ExternalLink.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetBankTransactionsResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetBankTransactionsResponse.php new file mode 100644 index 0000000..ca46836 --- /dev/null +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetBankTransactionsResponse.php @@ -0,0 +1,483 @@ + 'string', + 'status' => 'string', + 'provider_name' => 'string', + 'date_time_utc' => 'string', + 'page_info' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PageInfo', + 'bank_transactions' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransaction[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => null, + 'status' => null, + 'provider_name' => null, + 'date_time_utc' => null, + 'page_info' => null, + 'bank_transactions' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'Id', + 'status' => 'Status', + 'provider_name' => 'ProviderName', + 'date_time_utc' => 'DateTimeUTC', + 'page_info' => 'PageInfo', + 'bank_transactions' => 'BankTransactions' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'status' => 'setStatus', + 'provider_name' => 'setProviderName', + 'date_time_utc' => 'setDateTimeUtc', + 'page_info' => 'setPageInfo', + 'bank_transactions' => 'setBankTransactions' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'status' => 'getStatus', + 'provider_name' => 'getProviderName', + 'date_time_utc' => 'getDateTimeUtc', + 'page_info' => 'getPageInfo', + 'bank_transactions' => 'getBankTransactions' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->container['provider_name'] = isset($data['provider_name']) ? $data['provider_name'] : null; + $this->container['date_time_utc'] = isset($data['date_time_utc']) ? $data['date_time_utc'] : null; + $this->container['page_info'] = isset($data['page_info']) ? $data['page_info'] : null; + $this->container['bank_transactions'] = isset($data['bank_transactions']) ? $data['bank_transactions'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['bank_transactions']) && (count($this->container['bank_transactions']) < 1)) { + $invalidProperties[] = "invalid value for 'bank_transactions', number of items must be greater than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return $this + */ + public function setId($id) + { + + $this->container['id'] = $id; + + return $this; + } + + + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status status + * + * @return $this + */ + public function setStatus($status) + { + + $this->container['status'] = $status; + + return $this; + } + + + + /** + * Gets provider_name + * + * @return string|null + */ + public function getProviderName() + { + return $this->container['provider_name']; + } + + /** + * Sets provider_name + * + * @param string|null $provider_name provider_name + * + * @return $this + */ + public function setProviderName($provider_name) + { + + $this->container['provider_name'] = $provider_name; + + return $this; + } + + + + /** + * Gets date_time_utc + * + * @return string|null + */ + public function getDateTimeUtc() + { + return $this->container['date_time_utc']; + } + + /** + * Sets date_time_utc + * + * @param string|null $date_time_utc date_time_utc + * + * @return $this + */ + public function setDateTimeUtc($date_time_utc) + { + + $this->container['date_time_utc'] = $date_time_utc; + + return $this; + } + + + + /** + * Gets page_info + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PageInfo|null + */ + public function getPageInfo() + { + return $this->container['page_info']; + } + + /** + * Sets page_info + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PageInfo|null $page_info page_info + * + * @return $this + */ + public function setPageInfo($page_info) + { + + $this->container['page_info'] = $page_info; + + return $this; + } + + + + /** + * Gets bank_transactions + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransaction[]|null + */ + public function getBankTransactions() + { + return $this->container['bank_transactions']; + } + + /** + * Sets bank_transactions + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\BankTransaction[]|null $bank_transactions bank_transactions + * + * @return $this + */ + public function setBankTransactions($bank_transactions) + { + + + if (!is_null($bank_transactions) && (count($bank_transactions) < 1)) { + throw new \InvalidArgumentException('invalid length for $bank_transactions when calling GetBankTransactionsResponse., number of items must be greater than or equal to 1.'); + } + + $this->container['bank_transactions'] = $bank_transactions; + + return $this; + } + + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + AccountingObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} + + diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetContactsResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetContactsResponse.php new file mode 100644 index 0000000..5439a62 --- /dev/null +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetContactsResponse.php @@ -0,0 +1,483 @@ + 'string', + 'status' => 'string', + 'provider_name' => 'string', + 'date_time_utc' => 'string', + 'page_info' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PageInfo', + 'contacts' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contact[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => null, + 'status' => null, + 'provider_name' => null, + 'date_time_utc' => null, + 'page_info' => null, + 'contacts' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'Id', + 'status' => 'Status', + 'provider_name' => 'ProviderName', + 'date_time_utc' => 'DateTimeUTC', + 'page_info' => 'PageInfo', + 'contacts' => 'Contacts' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'status' => 'setStatus', + 'provider_name' => 'setProviderName', + 'date_time_utc' => 'setDateTimeUtc', + 'page_info' => 'setPageInfo', + 'contacts' => 'setContacts' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'status' => 'getStatus', + 'provider_name' => 'getProviderName', + 'date_time_utc' => 'getDateTimeUtc', + 'page_info' => 'getPageInfo', + 'contacts' => 'getContacts' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->container['provider_name'] = isset($data['provider_name']) ? $data['provider_name'] : null; + $this->container['date_time_utc'] = isset($data['date_time_utc']) ? $data['date_time_utc'] : null; + $this->container['page_info'] = isset($data['page_info']) ? $data['page_info'] : null; + $this->container['contacts'] = isset($data['contacts']) ? $data['contacts'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['contacts']) && (count($this->container['contacts']) < 1)) { + $invalidProperties[] = "invalid value for 'contacts', number of items must be greater than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return $this + */ + public function setId($id) + { + + $this->container['id'] = $id; + + return $this; + } + + + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status status + * + * @return $this + */ + public function setStatus($status) + { + + $this->container['status'] = $status; + + return $this; + } + + + + /** + * Gets provider_name + * + * @return string|null + */ + public function getProviderName() + { + return $this->container['provider_name']; + } + + /** + * Sets provider_name + * + * @param string|null $provider_name provider_name + * + * @return $this + */ + public function setProviderName($provider_name) + { + + $this->container['provider_name'] = $provider_name; + + return $this; + } + + + + /** + * Gets date_time_utc + * + * @return string|null + */ + public function getDateTimeUtc() + { + return $this->container['date_time_utc']; + } + + /** + * Sets date_time_utc + * + * @param string|null $date_time_utc date_time_utc + * + * @return $this + */ + public function setDateTimeUtc($date_time_utc) + { + + $this->container['date_time_utc'] = $date_time_utc; + + return $this; + } + + + + /** + * Gets page_info + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PageInfo|null + */ + public function getPageInfo() + { + return $this->container['page_info']; + } + + /** + * Sets page_info + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PageInfo|null $page_info page_info + * + * @return $this + */ + public function setPageInfo($page_info) + { + + $this->container['page_info'] = $page_info; + + return $this; + } + + + + /** + * Gets contacts + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contact[]|null + */ + public function getContacts() + { + return $this->container['contacts']; + } + + /** + * Sets contacts + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Contact[]|null $contacts contacts + * + * @return $this + */ + public function setContacts($contacts) + { + + + if (!is_null($contacts) && (count($contacts) < 1)) { + throw new \InvalidArgumentException('invalid length for $contacts when calling GetContactsResponse., number of items must be greater than or equal to 1.'); + } + + $this->container['contacts'] = $contacts; + + return $this; + } + + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + AccountingObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} + + diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetCreditNotesResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetCreditNotesResponse.php new file mode 100644 index 0000000..62441c4 --- /dev/null +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetCreditNotesResponse.php @@ -0,0 +1,483 @@ + 'string', + 'status' => 'string', + 'provider_name' => 'string', + 'date_time_utc' => 'string', + 'page_info' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PageInfo', + 'credit_notes' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CreditNote[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => null, + 'status' => null, + 'provider_name' => null, + 'date_time_utc' => null, + 'page_info' => null, + 'credit_notes' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'Id', + 'status' => 'Status', + 'provider_name' => 'ProviderName', + 'date_time_utc' => 'DateTimeUTC', + 'page_info' => 'PageInfo', + 'credit_notes' => 'CreditNotes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'status' => 'setStatus', + 'provider_name' => 'setProviderName', + 'date_time_utc' => 'setDateTimeUtc', + 'page_info' => 'setPageInfo', + 'credit_notes' => 'setCreditNotes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'status' => 'getStatus', + 'provider_name' => 'getProviderName', + 'date_time_utc' => 'getDateTimeUtc', + 'page_info' => 'getPageInfo', + 'credit_notes' => 'getCreditNotes' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->container['provider_name'] = isset($data['provider_name']) ? $data['provider_name'] : null; + $this->container['date_time_utc'] = isset($data['date_time_utc']) ? $data['date_time_utc'] : null; + $this->container['page_info'] = isset($data['page_info']) ? $data['page_info'] : null; + $this->container['credit_notes'] = isset($data['credit_notes']) ? $data['credit_notes'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['credit_notes']) && (count($this->container['credit_notes']) < 1)) { + $invalidProperties[] = "invalid value for 'credit_notes', number of items must be greater than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return $this + */ + public function setId($id) + { + + $this->container['id'] = $id; + + return $this; + } + + + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status status + * + * @return $this + */ + public function setStatus($status) + { + + $this->container['status'] = $status; + + return $this; + } + + + + /** + * Gets provider_name + * + * @return string|null + */ + public function getProviderName() + { + return $this->container['provider_name']; + } + + /** + * Sets provider_name + * + * @param string|null $provider_name provider_name + * + * @return $this + */ + public function setProviderName($provider_name) + { + + $this->container['provider_name'] = $provider_name; + + return $this; + } + + + + /** + * Gets date_time_utc + * + * @return string|null + */ + public function getDateTimeUtc() + { + return $this->container['date_time_utc']; + } + + /** + * Sets date_time_utc + * + * @param string|null $date_time_utc date_time_utc + * + * @return $this + */ + public function setDateTimeUtc($date_time_utc) + { + + $this->container['date_time_utc'] = $date_time_utc; + + return $this; + } + + + + /** + * Gets page_info + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PageInfo|null + */ + public function getPageInfo() + { + return $this->container['page_info']; + } + + /** + * Sets page_info + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PageInfo|null $page_info page_info + * + * @return $this + */ + public function setPageInfo($page_info) + { + + $this->container['page_info'] = $page_info; + + return $this; + } + + + + /** + * Gets credit_notes + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CreditNote[]|null + */ + public function getCreditNotes() + { + return $this->container['credit_notes']; + } + + /** + * Sets credit_notes + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\CreditNote[]|null $credit_notes credit_notes + * + * @return $this + */ + public function setCreditNotes($credit_notes) + { + + + if (!is_null($credit_notes) && (count($credit_notes) < 1)) { + throw new \InvalidArgumentException('invalid length for $credit_notes when calling GetCreditNotesResponse., number of items must be greater than or equal to 1.'); + } + + $this->container['credit_notes'] = $credit_notes; + + return $this; + } + + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + AccountingObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} + + diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetInvoicesResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetInvoicesResponse.php new file mode 100644 index 0000000..44a61a4 --- /dev/null +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetInvoicesResponse.php @@ -0,0 +1,483 @@ + 'string', + 'status' => 'string', + 'provider_name' => 'string', + 'date_time_utc' => 'string', + 'page_info' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PageInfo', + 'invoices' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Invoice[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => null, + 'status' => null, + 'provider_name' => null, + 'date_time_utc' => null, + 'page_info' => null, + 'invoices' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'Id', + 'status' => 'Status', + 'provider_name' => 'ProviderName', + 'date_time_utc' => 'DateTimeUTC', + 'page_info' => 'PageInfo', + 'invoices' => 'Invoices' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'status' => 'setStatus', + 'provider_name' => 'setProviderName', + 'date_time_utc' => 'setDateTimeUtc', + 'page_info' => 'setPageInfo', + 'invoices' => 'setInvoices' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'status' => 'getStatus', + 'provider_name' => 'getProviderName', + 'date_time_utc' => 'getDateTimeUtc', + 'page_info' => 'getPageInfo', + 'invoices' => 'getInvoices' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->container['provider_name'] = isset($data['provider_name']) ? $data['provider_name'] : null; + $this->container['date_time_utc'] = isset($data['date_time_utc']) ? $data['date_time_utc'] : null; + $this->container['page_info'] = isset($data['page_info']) ? $data['page_info'] : null; + $this->container['invoices'] = isset($data['invoices']) ? $data['invoices'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['invoices']) && (count($this->container['invoices']) < 1)) { + $invalidProperties[] = "invalid value for 'invoices', number of items must be greater than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return $this + */ + public function setId($id) + { + + $this->container['id'] = $id; + + return $this; + } + + + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status status + * + * @return $this + */ + public function setStatus($status) + { + + $this->container['status'] = $status; + + return $this; + } + + + + /** + * Gets provider_name + * + * @return string|null + */ + public function getProviderName() + { + return $this->container['provider_name']; + } + + /** + * Sets provider_name + * + * @param string|null $provider_name provider_name + * + * @return $this + */ + public function setProviderName($provider_name) + { + + $this->container['provider_name'] = $provider_name; + + return $this; + } + + + + /** + * Gets date_time_utc + * + * @return string|null + */ + public function getDateTimeUtc() + { + return $this->container['date_time_utc']; + } + + /** + * Sets date_time_utc + * + * @param string|null $date_time_utc date_time_utc + * + * @return $this + */ + public function setDateTimeUtc($date_time_utc) + { + + $this->container['date_time_utc'] = $date_time_utc; + + return $this; + } + + + + /** + * Gets page_info + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PageInfo|null + */ + public function getPageInfo() + { + return $this->container['page_info']; + } + + /** + * Sets page_info + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PageInfo|null $page_info page_info + * + * @return $this + */ + public function setPageInfo($page_info) + { + + $this->container['page_info'] = $page_info; + + return $this; + } + + + + /** + * Gets invoices + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Invoice[]|null + */ + public function getInvoices() + { + return $this->container['invoices']; + } + + /** + * Sets invoices + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Invoice[]|null $invoices invoices + * + * @return $this + */ + public function setInvoices($invoices) + { + + + if (!is_null($invoices) && (count($invoices) < 1)) { + throw new \InvalidArgumentException('invalid length for $invoices when calling GetInvoicesResponse., number of items must be greater than or equal to 1.'); + } + + $this->container['invoices'] = $invoices; + + return $this; + } + + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + AccountingObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} + + diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetManualJournalsResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetManualJournalsResponse.php new file mode 100644 index 0000000..5b0edcb --- /dev/null +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetManualJournalsResponse.php @@ -0,0 +1,483 @@ + 'string', + 'status' => 'string', + 'provider_name' => 'string', + 'date_time_utc' => 'string', + 'page_info' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PageInfo', + 'manual_journals' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ManualJournal[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => null, + 'status' => null, + 'provider_name' => null, + 'date_time_utc' => null, + 'page_info' => null, + 'manual_journals' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'Id', + 'status' => 'Status', + 'provider_name' => 'ProviderName', + 'date_time_utc' => 'DateTimeUTC', + 'page_info' => 'PageInfo', + 'manual_journals' => 'ManualJournals' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'status' => 'setStatus', + 'provider_name' => 'setProviderName', + 'date_time_utc' => 'setDateTimeUtc', + 'page_info' => 'setPageInfo', + 'manual_journals' => 'setManualJournals' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'status' => 'getStatus', + 'provider_name' => 'getProviderName', + 'date_time_utc' => 'getDateTimeUtc', + 'page_info' => 'getPageInfo', + 'manual_journals' => 'getManualJournals' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->container['provider_name'] = isset($data['provider_name']) ? $data['provider_name'] : null; + $this->container['date_time_utc'] = isset($data['date_time_utc']) ? $data['date_time_utc'] : null; + $this->container['page_info'] = isset($data['page_info']) ? $data['page_info'] : null; + $this->container['manual_journals'] = isset($data['manual_journals']) ? $data['manual_journals'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['manual_journals']) && (count($this->container['manual_journals']) < 1)) { + $invalidProperties[] = "invalid value for 'manual_journals', number of items must be greater than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return $this + */ + public function setId($id) + { + + $this->container['id'] = $id; + + return $this; + } + + + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status status + * + * @return $this + */ + public function setStatus($status) + { + + $this->container['status'] = $status; + + return $this; + } + + + + /** + * Gets provider_name + * + * @return string|null + */ + public function getProviderName() + { + return $this->container['provider_name']; + } + + /** + * Sets provider_name + * + * @param string|null $provider_name provider_name + * + * @return $this + */ + public function setProviderName($provider_name) + { + + $this->container['provider_name'] = $provider_name; + + return $this; + } + + + + /** + * Gets date_time_utc + * + * @return string|null + */ + public function getDateTimeUtc() + { + return $this->container['date_time_utc']; + } + + /** + * Sets date_time_utc + * + * @param string|null $date_time_utc date_time_utc + * + * @return $this + */ + public function setDateTimeUtc($date_time_utc) + { + + $this->container['date_time_utc'] = $date_time_utc; + + return $this; + } + + + + /** + * Gets page_info + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PageInfo|null + */ + public function getPageInfo() + { + return $this->container['page_info']; + } + + /** + * Sets page_info + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PageInfo|null $page_info page_info + * + * @return $this + */ + public function setPageInfo($page_info) + { + + $this->container['page_info'] = $page_info; + + return $this; + } + + + + /** + * Gets manual_journals + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ManualJournal[]|null + */ + public function getManualJournals() + { + return $this->container['manual_journals']; + } + + /** + * Sets manual_journals + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ManualJournal[]|null $manual_journals manual_journals + * + * @return $this + */ + public function setManualJournals($manual_journals) + { + + + if (!is_null($manual_journals) && (count($manual_journals) < 1)) { + throw new \InvalidArgumentException('invalid length for $manual_journals when calling GetManualJournalsResponse., number of items must be greater than or equal to 1.'); + } + + $this->container['manual_journals'] = $manual_journals; + + return $this; + } + + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + AccountingObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} + + diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetOverpaymentsResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetOverpaymentsResponse.php new file mode 100644 index 0000000..0bdb7df --- /dev/null +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetOverpaymentsResponse.php @@ -0,0 +1,483 @@ + 'string', + 'status' => 'string', + 'provider_name' => 'string', + 'date_time_utc' => 'string', + 'page_info' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PageInfo', + 'overpayments' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Overpayment[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => null, + 'status' => null, + 'provider_name' => null, + 'date_time_utc' => null, + 'page_info' => null, + 'overpayments' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'Id', + 'status' => 'Status', + 'provider_name' => 'ProviderName', + 'date_time_utc' => 'DateTimeUTC', + 'page_info' => 'PageInfo', + 'overpayments' => 'Overpayments' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'status' => 'setStatus', + 'provider_name' => 'setProviderName', + 'date_time_utc' => 'setDateTimeUtc', + 'page_info' => 'setPageInfo', + 'overpayments' => 'setOverpayments' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'status' => 'getStatus', + 'provider_name' => 'getProviderName', + 'date_time_utc' => 'getDateTimeUtc', + 'page_info' => 'getPageInfo', + 'overpayments' => 'getOverpayments' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->container['provider_name'] = isset($data['provider_name']) ? $data['provider_name'] : null; + $this->container['date_time_utc'] = isset($data['date_time_utc']) ? $data['date_time_utc'] : null; + $this->container['page_info'] = isset($data['page_info']) ? $data['page_info'] : null; + $this->container['overpayments'] = isset($data['overpayments']) ? $data['overpayments'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['overpayments']) && (count($this->container['overpayments']) < 1)) { + $invalidProperties[] = "invalid value for 'overpayments', number of items must be greater than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return $this + */ + public function setId($id) + { + + $this->container['id'] = $id; + + return $this; + } + + + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status status + * + * @return $this + */ + public function setStatus($status) + { + + $this->container['status'] = $status; + + return $this; + } + + + + /** + * Gets provider_name + * + * @return string|null + */ + public function getProviderName() + { + return $this->container['provider_name']; + } + + /** + * Sets provider_name + * + * @param string|null $provider_name provider_name + * + * @return $this + */ + public function setProviderName($provider_name) + { + + $this->container['provider_name'] = $provider_name; + + return $this; + } + + + + /** + * Gets date_time_utc + * + * @return string|null + */ + public function getDateTimeUtc() + { + return $this->container['date_time_utc']; + } + + /** + * Sets date_time_utc + * + * @param string|null $date_time_utc date_time_utc + * + * @return $this + */ + public function setDateTimeUtc($date_time_utc) + { + + $this->container['date_time_utc'] = $date_time_utc; + + return $this; + } + + + + /** + * Gets page_info + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PageInfo|null + */ + public function getPageInfo() + { + return $this->container['page_info']; + } + + /** + * Sets page_info + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PageInfo|null $page_info page_info + * + * @return $this + */ + public function setPageInfo($page_info) + { + + $this->container['page_info'] = $page_info; + + return $this; + } + + + + /** + * Gets overpayments + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Overpayment[]|null + */ + public function getOverpayments() + { + return $this->container['overpayments']; + } + + /** + * Sets overpayments + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Overpayment[]|null $overpayments overpayments + * + * @return $this + */ + public function setOverpayments($overpayments) + { + + + if (!is_null($overpayments) && (count($overpayments) < 1)) { + throw new \InvalidArgumentException('invalid length for $overpayments when calling GetOverpaymentsResponse., number of items must be greater than or equal to 1.'); + } + + $this->container['overpayments'] = $overpayments; + + return $this; + } + + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + AccountingObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} + + diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetPaymentsResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetPaymentsResponse.php new file mode 100644 index 0000000..0ec41d7 --- /dev/null +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetPaymentsResponse.php @@ -0,0 +1,483 @@ + 'string', + 'status' => 'string', + 'provider_name' => 'string', + 'date_time_utc' => 'string', + 'page_info' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PageInfo', + 'payments' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Payment[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => null, + 'status' => null, + 'provider_name' => null, + 'date_time_utc' => null, + 'page_info' => null, + 'payments' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'Id', + 'status' => 'Status', + 'provider_name' => 'ProviderName', + 'date_time_utc' => 'DateTimeUTC', + 'page_info' => 'PageInfo', + 'payments' => 'Payments' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'status' => 'setStatus', + 'provider_name' => 'setProviderName', + 'date_time_utc' => 'setDateTimeUtc', + 'page_info' => 'setPageInfo', + 'payments' => 'setPayments' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'status' => 'getStatus', + 'provider_name' => 'getProviderName', + 'date_time_utc' => 'getDateTimeUtc', + 'page_info' => 'getPageInfo', + 'payments' => 'getPayments' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->container['provider_name'] = isset($data['provider_name']) ? $data['provider_name'] : null; + $this->container['date_time_utc'] = isset($data['date_time_utc']) ? $data['date_time_utc'] : null; + $this->container['page_info'] = isset($data['page_info']) ? $data['page_info'] : null; + $this->container['payments'] = isset($data['payments']) ? $data['payments'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['payments']) && (count($this->container['payments']) < 1)) { + $invalidProperties[] = "invalid value for 'payments', number of items must be greater than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return $this + */ + public function setId($id) + { + + $this->container['id'] = $id; + + return $this; + } + + + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status status + * + * @return $this + */ + public function setStatus($status) + { + + $this->container['status'] = $status; + + return $this; + } + + + + /** + * Gets provider_name + * + * @return string|null + */ + public function getProviderName() + { + return $this->container['provider_name']; + } + + /** + * Sets provider_name + * + * @param string|null $provider_name provider_name + * + * @return $this + */ + public function setProviderName($provider_name) + { + + $this->container['provider_name'] = $provider_name; + + return $this; + } + + + + /** + * Gets date_time_utc + * + * @return string|null + */ + public function getDateTimeUtc() + { + return $this->container['date_time_utc']; + } + + /** + * Sets date_time_utc + * + * @param string|null $date_time_utc date_time_utc + * + * @return $this + */ + public function setDateTimeUtc($date_time_utc) + { + + $this->container['date_time_utc'] = $date_time_utc; + + return $this; + } + + + + /** + * Gets page_info + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PageInfo|null + */ + public function getPageInfo() + { + return $this->container['page_info']; + } + + /** + * Sets page_info + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PageInfo|null $page_info page_info + * + * @return $this + */ + public function setPageInfo($page_info) + { + + $this->container['page_info'] = $page_info; + + return $this; + } + + + + /** + * Gets payments + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Payment[]|null + */ + public function getPayments() + { + return $this->container['payments']; + } + + /** + * Sets payments + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Payment[]|null $payments payments + * + * @return $this + */ + public function setPayments($payments) + { + + + if (!is_null($payments) && (count($payments) < 1)) { + throw new \InvalidArgumentException('invalid length for $payments when calling GetPaymentsResponse., number of items must be greater than or equal to 1.'); + } + + $this->container['payments'] = $payments; + + return $this; + } + + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + AccountingObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} + + diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetPrepaymentsResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetPrepaymentsResponse.php new file mode 100644 index 0000000..4d76682 --- /dev/null +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetPrepaymentsResponse.php @@ -0,0 +1,483 @@ + 'string', + 'status' => 'string', + 'provider_name' => 'string', + 'date_time_utc' => 'string', + 'page_info' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PageInfo', + 'prepayments' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Prepayment[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => null, + 'status' => null, + 'provider_name' => null, + 'date_time_utc' => null, + 'page_info' => null, + 'prepayments' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'Id', + 'status' => 'Status', + 'provider_name' => 'ProviderName', + 'date_time_utc' => 'DateTimeUTC', + 'page_info' => 'PageInfo', + 'prepayments' => 'Prepayments' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'status' => 'setStatus', + 'provider_name' => 'setProviderName', + 'date_time_utc' => 'setDateTimeUtc', + 'page_info' => 'setPageInfo', + 'prepayments' => 'setPrepayments' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'status' => 'getStatus', + 'provider_name' => 'getProviderName', + 'date_time_utc' => 'getDateTimeUtc', + 'page_info' => 'getPageInfo', + 'prepayments' => 'getPrepayments' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->container['provider_name'] = isset($data['provider_name']) ? $data['provider_name'] : null; + $this->container['date_time_utc'] = isset($data['date_time_utc']) ? $data['date_time_utc'] : null; + $this->container['page_info'] = isset($data['page_info']) ? $data['page_info'] : null; + $this->container['prepayments'] = isset($data['prepayments']) ? $data['prepayments'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['prepayments']) && (count($this->container['prepayments']) < 1)) { + $invalidProperties[] = "invalid value for 'prepayments', number of items must be greater than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return $this + */ + public function setId($id) + { + + $this->container['id'] = $id; + + return $this; + } + + + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status status + * + * @return $this + */ + public function setStatus($status) + { + + $this->container['status'] = $status; + + return $this; + } + + + + /** + * Gets provider_name + * + * @return string|null + */ + public function getProviderName() + { + return $this->container['provider_name']; + } + + /** + * Sets provider_name + * + * @param string|null $provider_name provider_name + * + * @return $this + */ + public function setProviderName($provider_name) + { + + $this->container['provider_name'] = $provider_name; + + return $this; + } + + + + /** + * Gets date_time_utc + * + * @return string|null + */ + public function getDateTimeUtc() + { + return $this->container['date_time_utc']; + } + + /** + * Sets date_time_utc + * + * @param string|null $date_time_utc date_time_utc + * + * @return $this + */ + public function setDateTimeUtc($date_time_utc) + { + + $this->container['date_time_utc'] = $date_time_utc; + + return $this; + } + + + + /** + * Gets page_info + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PageInfo|null + */ + public function getPageInfo() + { + return $this->container['page_info']; + } + + /** + * Sets page_info + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PageInfo|null $page_info page_info + * + * @return $this + */ + public function setPageInfo($page_info) + { + + $this->container['page_info'] = $page_info; + + return $this; + } + + + + /** + * Gets prepayments + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Prepayment[]|null + */ + public function getPrepayments() + { + return $this->container['prepayments']; + } + + /** + * Sets prepayments + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Prepayment[]|null $prepayments prepayments + * + * @return $this + */ + public function setPrepayments($prepayments) + { + + + if (!is_null($prepayments) && (count($prepayments) < 1)) { + throw new \InvalidArgumentException('invalid length for $prepayments when calling GetPrepaymentsResponse., number of items must be greater than or equal to 1.'); + } + + $this->container['prepayments'] = $prepayments; + + return $this; + } + + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + AccountingObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} + + diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetPurchaseOrdersResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetPurchaseOrdersResponse.php new file mode 100644 index 0000000..9a9db2d --- /dev/null +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/GetPurchaseOrdersResponse.php @@ -0,0 +1,483 @@ + 'string', + 'status' => 'string', + 'provider_name' => 'string', + 'date_time_utc' => 'string', + 'page_info' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PageInfo', + 'purchase_orders' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PurchaseOrder[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'id' => null, + 'status' => null, + 'provider_name' => null, + 'date_time_utc' => null, + 'page_info' => null, + 'purchase_orders' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'Id', + 'status' => 'Status', + 'provider_name' => 'ProviderName', + 'date_time_utc' => 'DateTimeUTC', + 'page_info' => 'PageInfo', + 'purchase_orders' => 'PurchaseOrders' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'status' => 'setStatus', + 'provider_name' => 'setProviderName', + 'date_time_utc' => 'setDateTimeUtc', + 'page_info' => 'setPageInfo', + 'purchase_orders' => 'setPurchaseOrders' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'status' => 'getStatus', + 'provider_name' => 'getProviderName', + 'date_time_utc' => 'getDateTimeUtc', + 'page_info' => 'getPageInfo', + 'purchase_orders' => 'getPurchaseOrders' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->container['provider_name'] = isset($data['provider_name']) ? $data['provider_name'] : null; + $this->container['date_time_utc'] = isset($data['date_time_utc']) ? $data['date_time_utc'] : null; + $this->container['page_info'] = isset($data['page_info']) ? $data['page_info'] : null; + $this->container['purchase_orders'] = isset($data['purchase_orders']) ? $data['purchase_orders'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['purchase_orders']) && (count($this->container['purchase_orders']) < 1)) { + $invalidProperties[] = "invalid value for 'purchase_orders', number of items must be greater than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return $this + */ + public function setId($id) + { + + $this->container['id'] = $id; + + return $this; + } + + + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status status + * + * @return $this + */ + public function setStatus($status) + { + + $this->container['status'] = $status; + + return $this; + } + + + + /** + * Gets provider_name + * + * @return string|null + */ + public function getProviderName() + { + return $this->container['provider_name']; + } + + /** + * Sets provider_name + * + * @param string|null $provider_name provider_name + * + * @return $this + */ + public function setProviderName($provider_name) + { + + $this->container['provider_name'] = $provider_name; + + return $this; + } + + + + /** + * Gets date_time_utc + * + * @return string|null + */ + public function getDateTimeUtc() + { + return $this->container['date_time_utc']; + } + + /** + * Sets date_time_utc + * + * @param string|null $date_time_utc date_time_utc + * + * @return $this + */ + public function setDateTimeUtc($date_time_utc) + { + + $this->container['date_time_utc'] = $date_time_utc; + + return $this; + } + + + + /** + * Gets page_info + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PageInfo|null + */ + public function getPageInfo() + { + return $this->container['page_info']; + } + + /** + * Sets page_info + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PageInfo|null $page_info page_info + * + * @return $this + */ + public function setPageInfo($page_info) + { + + $this->container['page_info'] = $page_info; + + return $this; + } + + + + /** + * Gets purchase_orders + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PurchaseOrder[]|null + */ + public function getPurchaseOrders() + { + return $this->container['purchase_orders']; + } + + /** + * Sets purchase_orders + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PurchaseOrder[]|null $purchase_orders purchase_orders + * + * @return $this + */ + public function setPurchaseOrders($purchase_orders) + { + + + if (!is_null($purchase_orders) && (count($purchase_orders) < 1)) { + throw new \InvalidArgumentException('invalid length for $purchase_orders when calling GetPurchaseOrdersResponse., number of items must be greater than or equal to 1.'); + } + + $this->container['purchase_orders'] = $purchase_orders; + + return $this; + } + + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + AccountingObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} + + diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/HistoryRecord.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/HistoryRecord.php index a1251b1..d446dd9 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/HistoryRecord.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/HistoryRecord.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/HistoryRecords.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/HistoryRecords.php index dcdd504..510ef6a 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/HistoryRecords.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/HistoryRecords.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->HistoryRecords; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['HistoryRecords'] = $sanitizedObject->HistoryRecords; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ImportSummary.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ImportSummary.php index 76f2038..44d3f4b 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ImportSummary.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ImportSummary.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ImportSummaryAccounts.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ImportSummaryAccounts.php index feee0d4..9c6cd70 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ImportSummaryAccounts.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ImportSummaryAccounts.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ImportSummaryObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ImportSummaryObject.php index 339df6b..cdf7fe3 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ImportSummaryObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ImportSummaryObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ImportSummaryOrganisation.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ImportSummaryOrganisation.php index 95a653e..a1eaf84 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ImportSummaryOrganisation.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ImportSummaryOrganisation.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Invoice.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Invoice.php index ce6f991..8c316aa 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Invoice.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Invoice.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/InvoiceReminder.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/InvoiceReminder.php index 4b6ff53..aeaccd3 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/InvoiceReminder.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/InvoiceReminder.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/InvoiceReminders.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/InvoiceReminders.php index 2154685..5406be9 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/InvoiceReminders.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/InvoiceReminders.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->InvoiceReminders; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['InvoiceReminders'] = $sanitizedObject->InvoiceReminders; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Invoices.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Invoices.php index 6390695..491a579 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Invoices.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Invoices.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -62,6 +62,8 @@ class Invoices implements ModelInterface, ArrayAccess, \Countable, \IteratorAggr * @var string[] */ protected static $openAPITypes = [ + 'pagination' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Pagination', + 'warnings' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]', 'invoices' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Invoice[]' ]; @@ -71,6 +73,8 @@ class Invoices implements ModelInterface, ArrayAccess, \Countable, \IteratorAggr * @var string[] */ protected static $openAPIFormats = [ + 'pagination' => null, + 'warnings' => null, 'invoices' => null ]; @@ -101,6 +105,8 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ + 'pagination' => 'pagination', + 'warnings' => 'Warnings', 'invoices' => 'Invoices' ]; @@ -110,6 +116,8 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ + 'pagination' => 'setPagination', + 'warnings' => 'setWarnings', 'invoices' => 'setInvoices' ]; @@ -119,6 +127,8 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ + 'pagination' => 'getPagination', + 'warnings' => 'getWarnings', 'invoices' => 'getInvoices' ]; @@ -182,6 +192,8 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->container['pagination'] = isset($data['pagination']) ? $data['pagination'] : null; + $this->container['warnings'] = isset($data['warnings']) ? $data['warnings'] : null; $this->container['invoices'] = isset($data['invoices']) ? $data['invoices'] : null; } @@ -209,6 +221,60 @@ public function valid() } + /** + * Gets pagination + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Pagination|null + */ + public function getPagination() + { + return $this->container['pagination']; + } + + /** + * Sets pagination + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Pagination|null $pagination pagination + * + * @return $this + */ + public function setPagination($pagination) + { + + $this->container['pagination'] = $pagination; + + return $this; + } + + + + /** + * Gets warnings + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]|null + */ + public function getWarnings() + { + return $this->container['warnings']; + } + + /** + * Sets warnings + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]|null $warnings Displays array of warning messages from the API + * + * @return $this + */ + public function setWarnings($warnings) + { + + $this->container['warnings'] = $warnings; + + return $this; + } + + + /** * Gets invoices * @@ -307,7 +373,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->Invoices; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['Invoices'] = $sanitizedObject->Invoices; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Item.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Item.php index a231173..9c52837 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Item.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Item.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Items.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Items.php index 46eca56..76fdc26 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Items.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Items.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->Items; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['Items'] = $sanitizedObject->Items; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Journal.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Journal.php index 13f5607..65163d7 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Journal.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Journal.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/JournalLine.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/JournalLine.php index ca5eb05..bc8485b 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/JournalLine.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/JournalLine.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Journals.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Journals.php index 66cd169..70b8f43 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Journals.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Journals.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -62,6 +62,7 @@ class Journals implements ModelInterface, ArrayAccess, \Countable, \IteratorAggr * @var string[] */ protected static $openAPITypes = [ + 'warnings' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]', 'journals' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Journal[]' ]; @@ -71,6 +72,7 @@ class Journals implements ModelInterface, ArrayAccess, \Countable, \IteratorAggr * @var string[] */ protected static $openAPIFormats = [ + 'warnings' => null, 'journals' => null ]; @@ -101,6 +103,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ + 'warnings' => 'Warnings', 'journals' => 'Journals' ]; @@ -110,6 +113,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ + 'warnings' => 'setWarnings', 'journals' => 'setJournals' ]; @@ -119,6 +123,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ + 'warnings' => 'getWarnings', 'journals' => 'getJournals' ]; @@ -182,6 +187,7 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->container['warnings'] = isset($data['warnings']) ? $data['warnings'] : null; $this->container['journals'] = isset($data['journals']) ? $data['journals'] : null; } @@ -209,6 +215,33 @@ public function valid() } + /** + * Gets warnings + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]|null + */ + public function getWarnings() + { + return $this->container['warnings']; + } + + /** + * Sets warnings + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]|null $warnings Displays array of warning messages from the API + * + * @return $this + */ + public function setWarnings($warnings) + { + + $this->container['warnings'] = $warnings; + + return $this; + } + + + /** * Gets journals * @@ -307,7 +340,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->Journals; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['Journals'] = $sanitizedObject->Journals; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/LineAmountTypes.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/LineAmountTypes.php index 5d7527e..7580210 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/LineAmountTypes.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/LineAmountTypes.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/LineItem.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/LineItem.php index de96392..5fdb6cf 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/LineItem.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/LineItem.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/LineItemItem.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/LineItemItem.php index 438d155..5b16dff 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/LineItemItem.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/LineItemItem.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/LineItemTracking.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/LineItemTracking.php index dfecb52..5ea7f1c 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/LineItemTracking.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/LineItemTracking.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/LinkedTransaction.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/LinkedTransaction.php index b273260..06acae3 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/LinkedTransaction.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/LinkedTransaction.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/LinkedTransactions.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/LinkedTransactions.php index 97037bb..282a03a 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/LinkedTransactions.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/LinkedTransactions.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->LinkedTransactions; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['LinkedTransactions'] = $sanitizedObject->LinkedTransactions; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ManualJournal.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ManualJournal.php index 238216f..ab759dc 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ManualJournal.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ManualJournal.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ManualJournalLine.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ManualJournalLine.php index 347b1c9..fe5b509 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ManualJournalLine.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ManualJournalLine.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ManualJournals.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ManualJournals.php index ec83966..c77de91 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ManualJournals.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ManualJournals.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -62,6 +62,8 @@ class ManualJournals implements ModelInterface, ArrayAccess, \Countable, \Iterat * @var string[] */ protected static $openAPITypes = [ + 'pagination' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Pagination', + 'warnings' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]', 'manual_journals' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ManualJournal[]' ]; @@ -71,6 +73,8 @@ class ManualJournals implements ModelInterface, ArrayAccess, \Countable, \Iterat * @var string[] */ protected static $openAPIFormats = [ + 'pagination' => null, + 'warnings' => null, 'manual_journals' => null ]; @@ -101,6 +105,8 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ + 'pagination' => 'pagination', + 'warnings' => 'Warnings', 'manual_journals' => 'ManualJournals' ]; @@ -110,6 +116,8 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ + 'pagination' => 'setPagination', + 'warnings' => 'setWarnings', 'manual_journals' => 'setManualJournals' ]; @@ -119,6 +127,8 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ + 'pagination' => 'getPagination', + 'warnings' => 'getWarnings', 'manual_journals' => 'getManualJournals' ]; @@ -182,6 +192,8 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->container['pagination'] = isset($data['pagination']) ? $data['pagination'] : null; + $this->container['warnings'] = isset($data['warnings']) ? $data['warnings'] : null; $this->container['manual_journals'] = isset($data['manual_journals']) ? $data['manual_journals'] : null; } @@ -209,6 +221,60 @@ public function valid() } + /** + * Gets pagination + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Pagination|null + */ + public function getPagination() + { + return $this->container['pagination']; + } + + /** + * Sets pagination + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Pagination|null $pagination pagination + * + * @return $this + */ + public function setPagination($pagination) + { + + $this->container['pagination'] = $pagination; + + return $this; + } + + + + /** + * Gets warnings + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]|null + */ + public function getWarnings() + { + return $this->container['warnings']; + } + + /** + * Sets warnings + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]|null $warnings Displays array of warning messages from the API + * + * @return $this + */ + public function setWarnings($warnings) + { + + $this->container['warnings'] = $warnings; + + return $this; + } + + + /** * Gets manual_journals * @@ -307,7 +373,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->ManualJournals; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['ManualJournals'] = $sanitizedObject->ManualJournals; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ModelInterface.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ModelInterface.php index 4086c4e..c494a1a 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ModelInterface.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ModelInterface.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/OnlineInvoice.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/OnlineInvoice.php index 4b31060..86c3daf 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/OnlineInvoice.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/OnlineInvoice.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/OnlineInvoices.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/OnlineInvoices.php index 42b489a..0b7bcd1 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/OnlineInvoices.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/OnlineInvoices.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->OnlineInvoices; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['OnlineInvoices'] = $sanitizedObject->OnlineInvoices; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Organisation.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Organisation.php index e12028c..dd29653 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Organisation.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Organisation.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -395,6 +395,13 @@ public function getModelName() const MODEL_CLASS_NON_GST_CASHBOOK = 'NON_GST_CASHBOOK'; const MODEL_CLASS_ULTIMATE = 'ULTIMATE'; const MODEL_CLASS_LITE = 'LITE'; + const MODEL_CLASS_ULTIMATE_10 = 'ULTIMATE_10'; + const MODEL_CLASS_ULTIMATE_20 = 'ULTIMATE_20'; + const MODEL_CLASS_ULTIMATE_50 = 'ULTIMATE_50'; + const MODEL_CLASS_ULTIMATE_100 = 'ULTIMATE_100'; + const MODEL_CLASS_IGNITE = 'IGNITE'; + const MODEL_CLASS_GROW = 'GROW'; + const MODEL_CLASS_COMPREHENSIVE = 'COMPREHENSIVE'; const EDITION_BUSINESS = 'BUSINESS'; const EDITION_PARTNER = 'PARTNER'; @@ -535,6 +542,13 @@ public function getClassAllowableValues() self::MODEL_CLASS_NON_GST_CASHBOOK, self::MODEL_CLASS_ULTIMATE, self::MODEL_CLASS_LITE, + self::MODEL_CLASS_ULTIMATE_10, + self::MODEL_CLASS_ULTIMATE_20, + self::MODEL_CLASS_ULTIMATE_50, + self::MODEL_CLASS_ULTIMATE_100, + self::MODEL_CLASS_IGNITE, + self::MODEL_CLASS_GROW, + self::MODEL_CLASS_COMPREHENSIVE, ]; } diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Organisations.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Organisations.php index 4f77690..ed01cb3 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Organisations.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Organisations.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->Organisations; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['Organisations'] = $sanitizedObject->Organisations; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Overpayment.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Overpayment.php index 6e42e90..e2a71b9 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Overpayment.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Overpayment.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Overpayments.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Overpayments.php index 376fc58..5cb916c 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Overpayments.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Overpayments.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -62,6 +62,8 @@ class Overpayments implements ModelInterface, ArrayAccess, \Countable, \Iterator * @var string[] */ protected static $openAPITypes = [ + 'pagination' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Pagination', + 'warnings' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]', 'overpayments' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Overpayment[]' ]; @@ -71,6 +73,8 @@ class Overpayments implements ModelInterface, ArrayAccess, \Countable, \Iterator * @var string[] */ protected static $openAPIFormats = [ + 'pagination' => null, + 'warnings' => null, 'overpayments' => null ]; @@ -101,6 +105,8 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ + 'pagination' => 'pagination', + 'warnings' => 'Warnings', 'overpayments' => 'Overpayments' ]; @@ -110,6 +116,8 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ + 'pagination' => 'setPagination', + 'warnings' => 'setWarnings', 'overpayments' => 'setOverpayments' ]; @@ -119,6 +127,8 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ + 'pagination' => 'getPagination', + 'warnings' => 'getWarnings', 'overpayments' => 'getOverpayments' ]; @@ -182,6 +192,8 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->container['pagination'] = isset($data['pagination']) ? $data['pagination'] : null; + $this->container['warnings'] = isset($data['warnings']) ? $data['warnings'] : null; $this->container['overpayments'] = isset($data['overpayments']) ? $data['overpayments'] : null; } @@ -209,6 +221,60 @@ public function valid() } + /** + * Gets pagination + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Pagination|null + */ + public function getPagination() + { + return $this->container['pagination']; + } + + /** + * Sets pagination + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Pagination|null $pagination pagination + * + * @return $this + */ + public function setPagination($pagination) + { + + $this->container['pagination'] = $pagination; + + return $this; + } + + + + /** + * Gets warnings + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]|null + */ + public function getWarnings() + { + return $this->container['warnings']; + } + + /** + * Sets warnings + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]|null $warnings Displays array of warning messages from the API + * + * @return $this + */ + public function setWarnings($warnings) + { + + $this->container['warnings'] = $warnings; + + return $this; + } + + + /** * Gets overpayments * @@ -307,7 +373,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->Overpayments; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['Overpayments'] = $sanitizedObject->Overpayments; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/PageInfo.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/PageInfo.php new file mode 100644 index 0000000..eea71a5 --- /dev/null +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/PageInfo.php @@ -0,0 +1,409 @@ + 'int', + 'page_size' => 'int', + 'total_pages' => 'int', + 'total_rows' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'page' => null, + 'page_size' => null, + 'total_pages' => null, + 'total_rows' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'page' => 'Page', + 'page_size' => 'PageSize', + 'total_pages' => 'TotalPages', + 'total_rows' => 'TotalRows' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'page' => 'setPage', + 'page_size' => 'setPageSize', + 'total_pages' => 'setTotalPages', + 'total_rows' => 'setTotalRows' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'page' => 'getPage', + 'page_size' => 'getPageSize', + 'total_pages' => 'getTotalPages', + 'total_rows' => 'getTotalRows' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['page'] = isset($data['page']) ? $data['page'] : null; + $this->container['page_size'] = isset($data['page_size']) ? $data['page_size'] : null; + $this->container['total_pages'] = isset($data['total_pages']) ? $data['total_pages'] : null; + $this->container['total_rows'] = isset($data['total_rows']) ? $data['total_rows'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets page + * + * @return int|null + */ + public function getPage() + { + return $this->container['page']; + } + + /** + * Sets page + * + * @param int|null $page page + * + * @return $this + */ + public function setPage($page) + { + + $this->container['page'] = $page; + + return $this; + } + + + + /** + * Gets page_size + * + * @return int|null + */ + public function getPageSize() + { + return $this->container['page_size']; + } + + /** + * Sets page_size + * + * @param int|null $page_size page_size + * + * @return $this + */ + public function setPageSize($page_size) + { + + $this->container['page_size'] = $page_size; + + return $this; + } + + + + /** + * Gets total_pages + * + * @return int|null + */ + public function getTotalPages() + { + return $this->container['total_pages']; + } + + /** + * Sets total_pages + * + * @param int|null $total_pages total_pages + * + * @return $this + */ + public function setTotalPages($total_pages) + { + + $this->container['total_pages'] = $total_pages; + + return $this; + } + + + + /** + * Gets total_rows + * + * @return int|null + */ + public function getTotalRows() + { + return $this->container['total_rows']; + } + + /** + * Sets total_rows + * + * @param int|null $total_rows total_rows + * + * @return $this + */ + public function setTotalRows($total_rows) + { + + $this->container['total_rows'] = $total_rows; + + return $this; + } + + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + AccountingObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} + + diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Pagination.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Pagination.php new file mode 100644 index 0000000..e02dac0 --- /dev/null +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Pagination.php @@ -0,0 +1,408 @@ + 'int', + 'page_size' => 'int', + 'page_count' => 'int', + 'item_count' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'page' => null, + 'page_size' => null, + 'page_count' => null, + 'item_count' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'page' => 'page', + 'page_size' => 'pageSize', + 'page_count' => 'pageCount', + 'item_count' => 'itemCount' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'page' => 'setPage', + 'page_size' => 'setPageSize', + 'page_count' => 'setPageCount', + 'item_count' => 'setItemCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'page' => 'getPage', + 'page_size' => 'getPageSize', + 'page_count' => 'getPageCount', + 'item_count' => 'getItemCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['page'] = isset($data['page']) ? $data['page'] : null; + $this->container['page_size'] = isset($data['page_size']) ? $data['page_size'] : null; + $this->container['page_count'] = isset($data['page_count']) ? $data['page_count'] : null; + $this->container['item_count'] = isset($data['item_count']) ? $data['item_count'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets page + * + * @return int|null + */ + public function getPage() + { + return $this->container['page']; + } + + /** + * Sets page + * + * @param int|null $page page + * + * @return $this + */ + public function setPage($page) + { + + $this->container['page'] = $page; + + return $this; + } + + + + /** + * Gets page_size + * + * @return int|null + */ + public function getPageSize() + { + return $this->container['page_size']; + } + + /** + * Sets page_size + * + * @param int|null $page_size page_size + * + * @return $this + */ + public function setPageSize($page_size) + { + + $this->container['page_size'] = $page_size; + + return $this; + } + + + + /** + * Gets page_count + * + * @return int|null + */ + public function getPageCount() + { + return $this->container['page_count']; + } + + /** + * Sets page_count + * + * @param int|null $page_count page_count + * + * @return $this + */ + public function setPageCount($page_count) + { + + $this->container['page_count'] = $page_count; + + return $this; + } + + + + /** + * Gets item_count + * + * @return int|null + */ + public function getItemCount() + { + return $this->container['item_count']; + } + + /** + * Sets item_count + * + * @param int|null $item_count item_count + * + * @return $this + */ + public function setItemCount($item_count) + { + + $this->container['item_count'] = $item_count; + + return $this; + } + + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + AccountingObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} + + diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Payment.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Payment.php index 0482911..312e3e4 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Payment.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Payment.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -88,7 +88,8 @@ class Payment implements ModelInterface, ArrayAccess 'has_account' => 'bool', 'has_validation_errors' => 'bool', 'status_attribute_string' => 'string', - 'validation_errors' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]' + 'validation_errors' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]', + 'warnings' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]' ]; /** @@ -123,7 +124,8 @@ class Payment implements ModelInterface, ArrayAccess 'has_account' => null, 'has_validation_errors' => null, 'status_attribute_string' => null, - 'validation_errors' => null + 'validation_errors' => null, + 'warnings' => null ]; /** @@ -179,7 +181,8 @@ public static function openAPIFormats() 'has_account' => 'HasAccount', 'has_validation_errors' => 'HasValidationErrors', 'status_attribute_string' => 'StatusAttributeString', - 'validation_errors' => 'ValidationErrors' + 'validation_errors' => 'ValidationErrors', + 'warnings' => 'Warnings' ]; /** @@ -214,7 +217,8 @@ public static function openAPIFormats() 'has_account' => 'setHasAccount', 'has_validation_errors' => 'setHasValidationErrors', 'status_attribute_string' => 'setStatusAttributeString', - 'validation_errors' => 'setValidationErrors' + 'validation_errors' => 'setValidationErrors', + 'warnings' => 'setWarnings' ]; /** @@ -249,7 +253,8 @@ public static function openAPIFormats() 'has_account' => 'getHasAccount', 'has_validation_errors' => 'getHasValidationErrors', 'status_attribute_string' => 'getStatusAttributeString', - 'validation_errors' => 'getValidationErrors' + 'validation_errors' => 'getValidationErrors', + 'warnings' => 'getWarnings' ]; /** @@ -381,6 +386,7 @@ public function __construct(array $data = null) $this->container['has_validation_errors'] = isset($data['has_validation_errors']) ? $data['has_validation_errors'] : false; $this->container['status_attribute_string'] = isset($data['status_attribute_string']) ? $data['status_attribute_string'] : null; $this->container['validation_errors'] = isset($data['validation_errors']) ? $data['validation_errors'] : null; + $this->container['warnings'] = isset($data['warnings']) ? $data['warnings'] : null; } /** @@ -1201,6 +1207,33 @@ public function setValidationErrors($validation_errors) } + + /** + * Gets warnings + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]|null + */ + public function getWarnings() + { + return $this->container['warnings']; + } + + /** + * Sets warnings + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]|null $warnings Displays array of warning messages from the API + * + * @return $this + */ + public function setWarnings($warnings) + { + + $this->container['warnings'] = $warnings; + + return $this; + } + + /** * Returns true if offset exists. False otherwise. * diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/PaymentDelete.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/PaymentDelete.php index 92ab494..11a78c1 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/PaymentDelete.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/PaymentDelete.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/PaymentService.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/PaymentService.php index 3939b23..a437c1d 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/PaymentService.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/PaymentService.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/PaymentServices.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/PaymentServices.php index 1790a4c..edabfa2 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/PaymentServices.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/PaymentServices.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->PaymentServices; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['PaymentServices'] = $sanitizedObject->PaymentServices; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/PaymentTerm.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/PaymentTerm.php index 62ff22e..a0bda69 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/PaymentTerm.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/PaymentTerm.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/PaymentTermType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/PaymentTermType.php index 214a378..175d4bb 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/PaymentTermType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/PaymentTermType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Payments.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Payments.php index d206f2c..fce67a9 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Payments.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Payments.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -62,6 +62,8 @@ class Payments implements ModelInterface, ArrayAccess, \Countable, \IteratorAggr * @var string[] */ protected static $openAPITypes = [ + 'pagination' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Pagination', + 'warnings' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]', 'payments' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Payment[]' ]; @@ -71,6 +73,8 @@ class Payments implements ModelInterface, ArrayAccess, \Countable, \IteratorAggr * @var string[] */ protected static $openAPIFormats = [ + 'pagination' => null, + 'warnings' => null, 'payments' => null ]; @@ -101,6 +105,8 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ + 'pagination' => 'pagination', + 'warnings' => 'Warnings', 'payments' => 'Payments' ]; @@ -110,6 +116,8 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ + 'pagination' => 'setPagination', + 'warnings' => 'setWarnings', 'payments' => 'setPayments' ]; @@ -119,6 +127,8 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ + 'pagination' => 'getPagination', + 'warnings' => 'getWarnings', 'payments' => 'getPayments' ]; @@ -182,6 +192,8 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->container['pagination'] = isset($data['pagination']) ? $data['pagination'] : null; + $this->container['warnings'] = isset($data['warnings']) ? $data['warnings'] : null; $this->container['payments'] = isset($data['payments']) ? $data['payments'] : null; } @@ -209,6 +221,60 @@ public function valid() } + /** + * Gets pagination + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Pagination|null + */ + public function getPagination() + { + return $this->container['pagination']; + } + + /** + * Sets pagination + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Pagination|null $pagination pagination + * + * @return $this + */ + public function setPagination($pagination) + { + + $this->container['pagination'] = $pagination; + + return $this; + } + + + + /** + * Gets warnings + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]|null + */ + public function getWarnings() + { + return $this->container['warnings']; + } + + /** + * Sets warnings + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]|null $warnings Displays array of warning messages from the API + * + * @return $this + */ + public function setWarnings($warnings) + { + + $this->container['warnings'] = $warnings; + + return $this; + } + + + /** * Gets payments * @@ -307,7 +373,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->Payments; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['Payments'] = $sanitizedObject->Payments; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Phone.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Phone.php index b58e686..be7854f 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Phone.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Phone.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Prepayment.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Prepayment.php index aff3f87..c472ce8 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Prepayment.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Prepayment.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Prepayments.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Prepayments.php index fd89282..00b849a 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Prepayments.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Prepayments.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -62,6 +62,8 @@ class Prepayments implements ModelInterface, ArrayAccess, \Countable, \IteratorA * @var string[] */ protected static $openAPITypes = [ + 'pagination' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Pagination', + 'warnings' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]', 'prepayments' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Prepayment[]' ]; @@ -71,6 +73,8 @@ class Prepayments implements ModelInterface, ArrayAccess, \Countable, \IteratorA * @var string[] */ protected static $openAPIFormats = [ + 'pagination' => null, + 'warnings' => null, 'prepayments' => null ]; @@ -101,6 +105,8 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ + 'pagination' => 'pagination', + 'warnings' => 'Warnings', 'prepayments' => 'Prepayments' ]; @@ -110,6 +116,8 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ + 'pagination' => 'setPagination', + 'warnings' => 'setWarnings', 'prepayments' => 'setPrepayments' ]; @@ -119,6 +127,8 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ + 'pagination' => 'getPagination', + 'warnings' => 'getWarnings', 'prepayments' => 'getPrepayments' ]; @@ -182,6 +192,8 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->container['pagination'] = isset($data['pagination']) ? $data['pagination'] : null; + $this->container['warnings'] = isset($data['warnings']) ? $data['warnings'] : null; $this->container['prepayments'] = isset($data['prepayments']) ? $data['prepayments'] : null; } @@ -209,6 +221,60 @@ public function valid() } + /** + * Gets pagination + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Pagination|null + */ + public function getPagination() + { + return $this->container['pagination']; + } + + /** + * Sets pagination + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Pagination|null $pagination pagination + * + * @return $this + */ + public function setPagination($pagination) + { + + $this->container['pagination'] = $pagination; + + return $this; + } + + + + /** + * Gets warnings + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]|null + */ + public function getWarnings() + { + return $this->container['warnings']; + } + + /** + * Sets warnings + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]|null $warnings Displays array of warning messages from the API + * + * @return $this + */ + public function setWarnings($warnings) + { + + $this->container['warnings'] = $warnings; + + return $this; + } + + + /** * Gets prepayments * @@ -307,7 +373,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->Prepayments; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['Prepayments'] = $sanitizedObject->Prepayments; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Purchase.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Purchase.php index 01ca548..f097a47 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Purchase.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Purchase.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/PurchaseOrder.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/PurchaseOrder.php index 2424b52..ea9a367 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/PurchaseOrder.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/PurchaseOrder.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/PurchaseOrders.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/PurchaseOrders.php index 55ca996..a8ab2f3 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/PurchaseOrders.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/PurchaseOrders.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -62,6 +62,8 @@ class PurchaseOrders implements ModelInterface, ArrayAccess, \Countable, \Iterat * @var string[] */ protected static $openAPITypes = [ + 'pagination' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Pagination', + 'warnings' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]', 'purchase_orders' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\PurchaseOrder[]' ]; @@ -71,6 +73,8 @@ class PurchaseOrders implements ModelInterface, ArrayAccess, \Countable, \Iterat * @var string[] */ protected static $openAPIFormats = [ + 'pagination' => null, + 'warnings' => null, 'purchase_orders' => null ]; @@ -101,6 +105,8 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ + 'pagination' => 'pagination', + 'warnings' => 'Warnings', 'purchase_orders' => 'PurchaseOrders' ]; @@ -110,6 +116,8 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ + 'pagination' => 'setPagination', + 'warnings' => 'setWarnings', 'purchase_orders' => 'setPurchaseOrders' ]; @@ -119,6 +127,8 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ + 'pagination' => 'getPagination', + 'warnings' => 'getWarnings', 'purchase_orders' => 'getPurchaseOrders' ]; @@ -182,6 +192,8 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->container['pagination'] = isset($data['pagination']) ? $data['pagination'] : null; + $this->container['warnings'] = isset($data['warnings']) ? $data['warnings'] : null; $this->container['purchase_orders'] = isset($data['purchase_orders']) ? $data['purchase_orders'] : null; } @@ -209,6 +221,60 @@ public function valid() } + /** + * Gets pagination + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Pagination|null + */ + public function getPagination() + { + return $this->container['pagination']; + } + + /** + * Sets pagination + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\Pagination|null $pagination pagination + * + * @return $this + */ + public function setPagination($pagination) + { + + $this->container['pagination'] = $pagination; + + return $this; + } + + + + /** + * Gets warnings + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]|null + */ + public function getWarnings() + { + return $this->container['warnings']; + } + + /** + * Sets warnings + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]|null $warnings Displays array of warning messages from the API + * + * @return $this + */ + public function setWarnings($warnings) + { + + $this->container['warnings'] = $warnings; + + return $this; + } + + + /** * Gets purchase_orders * @@ -307,7 +373,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->PurchaseOrders; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['PurchaseOrders'] = $sanitizedObject->PurchaseOrders; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Quote.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Quote.php index 5953d90..316734b 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Quote.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Quote.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/QuoteLineAmountTypes.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/QuoteLineAmountTypes.php index c8110b6..e2b256e 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/QuoteLineAmountTypes.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/QuoteLineAmountTypes.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/QuoteStatusCodes.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/QuoteStatusCodes.php index a534aee..21c9dcc 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/QuoteStatusCodes.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/QuoteStatusCodes.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Quotes.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Quotes.php index 688c685..fd04030 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Quotes.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Quotes.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->Quotes; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['Quotes'] = $sanitizedObject->Quotes; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Receipt.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Receipt.php index d0d43f6..f7b59a0 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Receipt.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Receipt.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Receipts.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Receipts.php index 963cbf0..8d0c375 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Receipts.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Receipts.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->Receipts; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['Receipts'] = $sanitizedObject->Receipts; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/RepeatingInvoice.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/RepeatingInvoice.php index 8ca01ab..38bfe92 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/RepeatingInvoice.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/RepeatingInvoice.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/RepeatingInvoices.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/RepeatingInvoices.php index fd6ae73..b8cbcea 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/RepeatingInvoices.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/RepeatingInvoices.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->RepeatingInvoices; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['RepeatingInvoices'] = $sanitizedObject->RepeatingInvoices; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Report.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Report.php index c4e9569..ba90d92 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Report.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Report.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ReportAttribute.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ReportAttribute.php index d736ce4..3cfa28d 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ReportAttribute.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ReportAttribute.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ReportCell.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ReportCell.php index 880f301..304cfe2 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ReportCell.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ReportCell.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ReportFields.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ReportFields.php index f57ed8c..9763ace 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ReportFields.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ReportFields.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ReportRow.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ReportRow.php index 6047e07..800a037 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ReportRow.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ReportRow.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ReportRows.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ReportRows.php index b6b5a21..261ac3c 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ReportRows.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ReportRows.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ReportWithRow.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ReportWithRow.php index 3cbc886..fc0c006 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ReportWithRow.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ReportWithRow.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ReportWithRows.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ReportWithRows.php index 97baba0..d4ab7d1 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ReportWithRows.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ReportWithRows.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Reports.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Reports.php index 73efd45..df8da54 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Reports.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Reports.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->Reports; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['Reports'] = $sanitizedObject->Reports; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/RequestEmpty.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/RequestEmpty.php index 8e6d013..ec96232 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/RequestEmpty.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/RequestEmpty.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/RowType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/RowType.php index d94e48f..e2d7ff2 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/RowType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/RowType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/SalesTrackingCategory.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/SalesTrackingCategory.php index 5086893..6a7ace5 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/SalesTrackingCategory.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/SalesTrackingCategory.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Schedule.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Schedule.php index b5b69b4..b11dc51 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Schedule.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Schedule.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Setup.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Setup.php index 2b0b920..c6dfae8 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Setup.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Setup.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/SetupBalanceDetails.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/SetupBalanceDetails.php index 330f0d7..9706647 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/SetupBalanceDetails.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/SetupBalanceDetails.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/SetupConversionBalances.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/SetupConversionBalances.php index 51815d4..1b1d9a1 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/SetupConversionBalances.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/SetupConversionBalances.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/SetupConversionDate.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/SetupConversionDate.php index 6136072..9f5477e 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/SetupConversionDate.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/SetupConversionDate.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TaxComponent.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TaxComponent.php index b160a50..2acdd01 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TaxComponent.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TaxComponent.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TaxRate.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TaxRate.php index d5b84c7..c4d2d2b 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TaxRate.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TaxRate.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -300,10 +300,10 @@ public function getModelName() const REPORT_TAX_TYPE_IGDSINPUT3 = 'IGDSINPUT3'; const REPORT_TAX_TYPE_SROVR = 'SROVR'; const REPORT_TAX_TYPE_TOURISTREFUND = 'TOURISTREFUND'; - const REPORT_TAX_TYPE_TXRCN33_INPUT = 'TXRCN33INPUT'; - const REPORT_TAX_TYPE_TXRCREINPUT = 'TXRCREINPUT'; - const REPORT_TAX_TYPE_TXRCESSINPUT = 'TXRCESSINPUT'; - const REPORT_TAX_TYPE_TXRCTSINPUT = 'TXRCTSINPUT'; + const REPORT_TAX_TYPE_TXRCN33 = 'TXRCN33'; + const REPORT_TAX_TYPE_TXRCRE = 'TXRCRE'; + const REPORT_TAX_TYPE_TXRCESS = 'TXRCESS'; + const REPORT_TAX_TYPE_TXRCTS = 'TXRCTS'; const REPORT_TAX_TYPE_CAPEXINPUT = 'CAPEXINPUT'; const REPORT_TAX_TYPE_UNDEFINED = 'UNDEFINED'; const REPORT_TAX_TYPE_CAPEXOUTPUT = 'CAPEXOUTPUT'; @@ -314,6 +314,13 @@ public function getModelName() const REPORT_TAX_TYPE_SROVRRS = 'SROVRRS'; const REPORT_TAX_TYPE_SROVRLVG = 'SROVRLVG'; const REPORT_TAX_TYPE_SRLVG = 'SRLVG'; + const REPORT_TAX_TYPE_IM = 'IM'; + const REPORT_TAX_TYPE_IMESS = 'IMESS'; + const REPORT_TAX_TYPE_IMN33 = 'IMN33'; + const REPORT_TAX_TYPE_IMRE = 'IMRE'; + const REPORT_TAX_TYPE_BADDEBTRECOVERY = 'BADDEBTRECOVERY'; + const REPORT_TAX_TYPE_USSALESTAX = 'USSALESTAX'; + const REPORT_TAX_TYPE_BLINPUT3 = 'BLINPUT3'; @@ -418,10 +425,10 @@ public function getReportTaxTypeAllowableValues() self::REPORT_TAX_TYPE_IGDSINPUT3, self::REPORT_TAX_TYPE_SROVR, self::REPORT_TAX_TYPE_TOURISTREFUND, - self::REPORT_TAX_TYPE_TXRCN33_INPUT, - self::REPORT_TAX_TYPE_TXRCREINPUT, - self::REPORT_TAX_TYPE_TXRCESSINPUT, - self::REPORT_TAX_TYPE_TXRCTSINPUT, + self::REPORT_TAX_TYPE_TXRCN33, + self::REPORT_TAX_TYPE_TXRCRE, + self::REPORT_TAX_TYPE_TXRCESS, + self::REPORT_TAX_TYPE_TXRCTS, self::REPORT_TAX_TYPE_CAPEXINPUT, self::REPORT_TAX_TYPE_UNDEFINED, self::REPORT_TAX_TYPE_CAPEXOUTPUT, @@ -432,6 +439,13 @@ public function getReportTaxTypeAllowableValues() self::REPORT_TAX_TYPE_SROVRRS, self::REPORT_TAX_TYPE_SROVRLVG, self::REPORT_TAX_TYPE_SRLVG, + self::REPORT_TAX_TYPE_IM, + self::REPORT_TAX_TYPE_IMESS, + self::REPORT_TAX_TYPE_IMN33, + self::REPORT_TAX_TYPE_IMRE, + self::REPORT_TAX_TYPE_BADDEBTRECOVERY, + self::REPORT_TAX_TYPE_USSALESTAX, + self::REPORT_TAX_TYPE_BLINPUT3, ]; } diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TaxRates.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TaxRates.php index d55928e..bb2b437 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TaxRates.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TaxRates.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->TaxRates; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['TaxRates'] = $sanitizedObject->TaxRates; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TaxType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TaxType.php index aef6889..fc1148e 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TaxType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TaxType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -112,10 +112,10 @@ class TaxType const IGDSINPUT3 = 'IGDSINPUT3'; const SROVR = 'SROVR'; const TOURISTREFUND = 'TOURISTREFUND'; - const TXRCN33_INPUT = 'TXRCN33INPUT'; - const TXRCREINPUT = 'TXRCREINPUT'; - const TXRCESSINPUT = 'TXRCESSINPUT'; - const TXRCTSINPUT = 'TXRCTSINPUT'; + const TXRCN33 = 'TXRCN33'; + const TXRCRE = 'TXRCRE'; + const TXRCESS = 'TXRCESS'; + const TXRCTS = 'TXRCTS'; const OUTPUTY23 = 'OUTPUTY23'; const DSOUTPUTY23 = 'DSOUTPUTY23'; const INPUTY23 = 'INPUTY23'; @@ -131,6 +131,47 @@ class TaxType const SROVRRSY23 = 'SROVRRSY23'; const SROVRLVGY23 = 'SROVRLVGY23'; const SRLVGY23 = 'SRLVGY23'; + const TXRCN33_Y23 = 'TXRCN33Y23'; + const TXRCREY23 = 'TXRCREY23'; + const TXRCESSY23 = 'TXRCESSY23'; + const TXRCTSY23 = 'TXRCTSY23'; + const IM = 'IM'; + const IMY23 = 'IMY23'; + const IMESS = 'IMESS'; + const IMESSY23 = 'IMESSY23'; + const IMN33 = 'IMN33'; + const IMN33_Y23 = 'IMN33Y23'; + const IMRE = 'IMRE'; + const IMREY23 = 'IMREY23'; + const BADDEBTRECOVERY = 'BADDEBTRECOVERY'; + const BADDEBTRECOVERYY23 = 'BADDEBTRECOVERYY23'; + const OUTPUTY24 = 'OUTPUTY24'; + const DSOUTPUTY24 = 'DSOUTPUTY24'; + const INPUTY24 = 'INPUTY24'; + const IGDSINPUT2_Y24 = 'IGDSINPUT2Y24'; + const TXPETINPUTY24 = 'TXPETINPUTY24'; + const TXESSINPUTY24 = 'TXESSINPUTY24'; + const TXN33_INPUTY24 = 'TXN33INPUTY24'; + const TXREINPUTY24 = 'TXREINPUTY24'; + const TXCAY24 = 'TXCAY24'; + const BADDEBTRELIEFY24 = 'BADDEBTRELIEFY24'; + const IGDSINPUT3_Y24 = 'IGDSINPUT3Y24'; + const SROVRRSY24 = 'SROVRRSY24'; + const SROVRLVGY24 = 'SROVRLVGY24'; + const SRLVGY24 = 'SRLVGY24'; + const TXRCTSY24 = 'TXRCTSY24'; + const TXRCESSY24 = 'TXRCESSY24'; + const TXRCN33_Y24 = 'TXRCN33Y24'; + const TXRCREY24 = 'TXRCREY24'; + const IMY24 = 'IMY24'; + const IMESSY24 = 'IMESSY24'; + const IMN33_Y24 = 'IMN33Y24'; + const IMREY24 = 'IMREY24'; + const BADDEBTRECOVERYY24 = 'BADDEBTRECOVERYY24'; + const OSOUTPUT2 = 'OSOUTPUT2'; + const BLINPUT3 = 'BLINPUT3'; + const BLINPUT3_Y23 = 'BLINPUT3Y23'; + const BLINPUT3_Y24 = 'BLINPUT3Y24'; /** * Gets allowable values of the enum @@ -202,10 +243,10 @@ public static function getAllowableEnumValues() self::IGDSINPUT3, self::SROVR, self::TOURISTREFUND, - self::TXRCN33_INPUT, - self::TXRCREINPUT, - self::TXRCESSINPUT, - self::TXRCTSINPUT, + self::TXRCN33, + self::TXRCRE, + self::TXRCESS, + self::TXRCTS, self::OUTPUTY23, self::DSOUTPUTY23, self::INPUTY23, @@ -221,6 +262,47 @@ public static function getAllowableEnumValues() self::SROVRRSY23, self::SROVRLVGY23, self::SRLVGY23, + self::TXRCN33_Y23, + self::TXRCREY23, + self::TXRCESSY23, + self::TXRCTSY23, + self::IM, + self::IMY23, + self::IMESS, + self::IMESSY23, + self::IMN33, + self::IMN33_Y23, + self::IMRE, + self::IMREY23, + self::BADDEBTRECOVERY, + self::BADDEBTRECOVERYY23, + self::OUTPUTY24, + self::DSOUTPUTY24, + self::INPUTY24, + self::IGDSINPUT2_Y24, + self::TXPETINPUTY24, + self::TXESSINPUTY24, + self::TXN33_INPUTY24, + self::TXREINPUTY24, + self::TXCAY24, + self::BADDEBTRELIEFY24, + self::IGDSINPUT3_Y24, + self::SROVRRSY24, + self::SROVRLVGY24, + self::SRLVGY24, + self::TXRCTSY24, + self::TXRCESSY24, + self::TXRCN33_Y24, + self::TXRCREY24, + self::IMY24, + self::IMESSY24, + self::IMN33_Y24, + self::IMREY24, + self::BADDEBTRECOVERYY24, + self::OSOUTPUT2, + self::BLINPUT3, + self::BLINPUT3_Y23, + self::BLINPUT3_Y24, ]; } } diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TenNinetyNineContact.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TenNinetyNineContact.php index 50883b3..5f83a22 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TenNinetyNineContact.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TenNinetyNineContact.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -83,7 +83,10 @@ class TenNinetyNineContact implements ModelInterface, ArrayAccess 'email' => 'string', 'street_address' => 'string', 'tax_id' => 'string', - 'contact_id' => 'string' + 'contact_id' => 'string', + 'legal_name' => 'string', + 'business_name' => 'string', + 'federal_tax_classification' => 'string' ]; /** @@ -113,7 +116,10 @@ class TenNinetyNineContact implements ModelInterface, ArrayAccess 'email' => null, 'street_address' => null, 'tax_id' => null, - 'contact_id' => 'uuid' + 'contact_id' => 'uuid', + 'legal_name' => null, + 'business_name' => null, + 'federal_tax_classification' => null ]; /** @@ -164,7 +170,10 @@ public static function openAPIFormats() 'email' => 'Email', 'street_address' => 'StreetAddress', 'tax_id' => 'TaxID', - 'contact_id' => 'ContactId' + 'contact_id' => 'ContactId', + 'legal_name' => 'LegalName', + 'business_name' => 'BusinessName', + 'federal_tax_classification' => 'FederalTaxClassification' ]; /** @@ -194,7 +203,10 @@ public static function openAPIFormats() 'email' => 'setEmail', 'street_address' => 'setStreetAddress', 'tax_id' => 'setTaxId', - 'contact_id' => 'setContactId' + 'contact_id' => 'setContactId', + 'legal_name' => 'setLegalName', + 'business_name' => 'setBusinessName', + 'federal_tax_classification' => 'setFederalTaxClassification' ]; /** @@ -224,7 +236,10 @@ public static function openAPIFormats() 'email' => 'getEmail', 'street_address' => 'getStreetAddress', 'tax_id' => 'getTaxId', - 'contact_id' => 'getContactId' + 'contact_id' => 'getContactId', + 'legal_name' => 'getLegalName', + 'business_name' => 'getBusinessName', + 'federal_tax_classification' => 'getFederalTaxClassification' ]; /** @@ -268,9 +283,34 @@ public function getModelName() return self::$openAPIModelName; } + const FEDERAL_TAX_CLASSIFICATION_SOLE_PROPRIETOR = 'SOLE_PROPRIETOR'; + const FEDERAL_TAX_CLASSIFICATION_PARTNERSHIP = 'PARTNERSHIP'; + const FEDERAL_TAX_CLASSIFICATION_TRUST_OR_ESTATE = 'TRUST_OR_ESTATE'; + const FEDERAL_TAX_CLASSIFICATION_NONPROFIT = 'NONPROFIT'; + const FEDERAL_TAX_CLASSIFICATION_C_CORP = 'C_CORP'; + const FEDERAL_TAX_CLASSIFICATION_S_CORP = 'S_CORP'; + const FEDERAL_TAX_CLASSIFICATION_OTHER = 'OTHER'; + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFederalTaxClassificationAllowableValues() + { + return [ + self::FEDERAL_TAX_CLASSIFICATION_SOLE_PROPRIETOR, + self::FEDERAL_TAX_CLASSIFICATION_PARTNERSHIP, + self::FEDERAL_TAX_CLASSIFICATION_TRUST_OR_ESTATE, + self::FEDERAL_TAX_CLASSIFICATION_NONPROFIT, + self::FEDERAL_TAX_CLASSIFICATION_C_CORP, + self::FEDERAL_TAX_CLASSIFICATION_S_CORP, + self::FEDERAL_TAX_CLASSIFICATION_OTHER, + ]; + } + /** * Associative array for storing property values @@ -309,6 +349,9 @@ public function __construct(array $data = null) $this->container['street_address'] = isset($data['street_address']) ? $data['street_address'] : null; $this->container['tax_id'] = isset($data['tax_id']) ? $data['tax_id'] : null; $this->container['contact_id'] = isset($data['contact_id']) ? $data['contact_id'] : null; + $this->container['legal_name'] = isset($data['legal_name']) ? $data['legal_name'] : null; + $this->container['business_name'] = isset($data['business_name']) ? $data['business_name'] : null; + $this->container['federal_tax_classification'] = isset($data['federal_tax_classification']) ? $data['federal_tax_classification'] : null; } /** @@ -320,6 +363,14 @@ public function listInvalidProperties() { $invalidProperties = []; + $allowedValues = $this->getFederalTaxClassificationAllowableValues(); + if (!is_null($this->container['federal_tax_classification']) && !in_array($this->container['federal_tax_classification'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'federal_tax_classification', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + return $invalidProperties; } @@ -928,6 +979,96 @@ public function setContactId($contact_id) } + + /** + * Gets legal_name + * + * @return string|null + */ + public function getLegalName() + { + return $this->container['legal_name']; + } + + /** + * Sets legal_name + * + * @param string|null $legal_name Contact legal name + * + * @return $this + */ + public function setLegalName($legal_name) + { + + $this->container['legal_name'] = $legal_name; + + return $this; + } + + + + /** + * Gets business_name + * + * @return string|null + */ + public function getBusinessName() + { + return $this->container['business_name']; + } + + /** + * Sets business_name + * + * @param string|null $business_name Contact business name + * + * @return $this + */ + public function setBusinessName($business_name) + { + + $this->container['business_name'] = $business_name; + + return $this; + } + + + + /** + * Gets federal_tax_classification + * + * @return string|null + */ + public function getFederalTaxClassification() + { + return $this->container['federal_tax_classification']; + } + + /** + * Sets federal_tax_classification + * + * @param string|null $federal_tax_classification Contact federal tax classification + * + * @return $this + */ + public function setFederalTaxClassification($federal_tax_classification) + { + $allowedValues = $this->getFederalTaxClassificationAllowableValues(); + if (!is_null($federal_tax_classification) && !in_array($federal_tax_classification, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'federal_tax_classification', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + + $this->container['federal_tax_classification'] = $federal_tax_classification; + + return $this; + } + + /** * Returns true if offset exists. False otherwise. * diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TenNinteyNineContact.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TenNinteyNineContact.php index 1fd88b5..368c3e4 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TenNinteyNineContact.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TenNinteyNineContact.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TimeZone.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TimeZone.php index 419f46d..3df2f73 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TimeZone.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TimeZone.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TrackingCategories.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TrackingCategories.php index 8bf1a38..cc74381 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TrackingCategories.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TrackingCategories.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->TrackingCategories; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['TrackingCategories'] = $sanitizedObject->TrackingCategories; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TrackingCategory.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TrackingCategory.php index 91df973..2905127 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TrackingCategory.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TrackingCategory.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TrackingOption.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TrackingOption.php index 72a6d9d..606c12b 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TrackingOption.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TrackingOption.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TrackingOptions.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TrackingOptions.php index 0627141..305d4d5 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TrackingOptions.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/TrackingOptions.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->TrackingOptions; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['TrackingOptions'] = $sanitizedObject->TrackingOptions; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/User.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/User.php index 719493d..57b4d3b 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/User.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/User.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Users.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Users.php index 92c9629..d6980e1 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Users.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/Users.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return AccountingObjectSerializer::sanitizeForSerialization($this)->Users; + $sanitizedObject = AccountingObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['Users'] = $sanitizedObject->Users; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ValidationError.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ValidationError.php index b782d4b..36f1ad3 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ValidationError.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Accounting/ValidationError.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/CreateUsageRecord.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/CreateUsageRecord.php index 554951f..b4e2bf5 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/CreateUsageRecord.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/CreateUsageRecord.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/ModelInterface.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/ModelInterface.php index d1165fa..efa2ac0 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/ModelInterface.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/ModelInterface.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/Plan.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/Plan.php index 7ed481a..3f7c138 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/Plan.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/Plan.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/Price.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/Price.php index a888e45..5d6aa36 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/Price.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/Price.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/ProblemDetails.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/ProblemDetails.php index 08a4a05..95f4cdc 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/ProblemDetails.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/ProblemDetails.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/Product.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/Product.php index 529deb9..cd22164 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/Product.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/Product.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/Subscription.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/Subscription.php index 72fdbf1..7a8718c 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/Subscription.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/Subscription.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/SubscriptionItem.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/SubscriptionItem.php index 1004970..73b048e 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/SubscriptionItem.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/SubscriptionItem.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/UpdateUsageRecord.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/UpdateUsageRecord.php index ee47f5a..fea3475 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/UpdateUsageRecord.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/UpdateUsageRecord.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/UsageRecord.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/UsageRecord.php index 897ace3..d6f016f 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/UsageRecord.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/UsageRecord.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/UsageRecordsList.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/UsageRecordsList.php index 2d0189e..c1461fa 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/UsageRecordsList.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/AppStore/UsageRecordsList.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/Asset.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/Asset.php index 87e6583..54730ca 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/Asset.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/Asset.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/AssetStatus.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/AssetStatus.php index 6e51e49..f63237b 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/AssetStatus.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/AssetStatus.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/AssetStatusQueryParam.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/AssetStatusQueryParam.php index aabad9f..ffe2bec 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/AssetStatusQueryParam.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/AssetStatusQueryParam.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/AssetType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/AssetType.php index e2a48c5..9a76b37 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/AssetType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/AssetType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/Assets.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/Assets.php index d964a37..1c605f9 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/Assets.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/Assets.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/BookDepreciationDetail.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/BookDepreciationDetail.php index 25b3cf4..6812668 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/BookDepreciationDetail.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/BookDepreciationDetail.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/BookDepreciationSetting.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/BookDepreciationSetting.php index 2374c4b..a5f9e80 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/BookDepreciationSetting.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/BookDepreciationSetting.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/Error.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/Error.php index f8d82d5..874a1b8 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/Error.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/Error.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/FieldValidationErrorsElement.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/FieldValidationErrorsElement.php index 982aebb..6899a04 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/FieldValidationErrorsElement.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/FieldValidationErrorsElement.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/ModelInterface.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/ModelInterface.php index a4b63dd..772739b 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/ModelInterface.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/ModelInterface.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/Pagination.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/Pagination.php index 66ecf91..8b79845 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/Pagination.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/Pagination.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/ResourceValidationErrorsElement.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/ResourceValidationErrorsElement.php index 460c4b1..7ff12d1 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/ResourceValidationErrorsElement.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/ResourceValidationErrorsElement.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/Setting.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/Setting.php index 03d2533..3f9616c 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/Setting.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Asset/Setting.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/Association.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/Association.php index 97b7b8c..fa404b8 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/Association.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/Association.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -62,6 +62,9 @@ class Association implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ + 'send_with_object' => 'bool', + 'name' => 'string', + 'size' => 'int', 'file_id' => 'string', 'object_id' => 'string', 'object_group' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\File\ObjectGroup', @@ -74,6 +77,9 @@ class Association implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPIFormats = [ + 'send_with_object' => null, + 'name' => null, + 'size' => null, 'file_id' => 'uuid', 'object_id' => 'uuid', 'object_group' => null, @@ -107,6 +113,9 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ + 'send_with_object' => 'SendWithObject', + 'name' => 'Name', + 'size' => 'Size', 'file_id' => 'FileId', 'object_id' => 'ObjectId', 'object_group' => 'ObjectGroup', @@ -119,6 +128,9 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ + 'send_with_object' => 'setSendWithObject', + 'name' => 'setName', + 'size' => 'setSize', 'file_id' => 'setFileId', 'object_id' => 'setObjectId', 'object_group' => 'setObjectGroup', @@ -131,6 +143,9 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ + 'send_with_object' => 'getSendWithObject', + 'name' => 'getName', + 'size' => 'getSize', 'file_id' => 'getFileId', 'object_id' => 'getObjectId', 'object_group' => 'getObjectGroup', @@ -197,6 +212,9 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->container['send_with_object'] = isset($data['send_with_object']) ? $data['send_with_object'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['size'] = isset($data['size']) ? $data['size'] : null; $this->container['file_id'] = isset($data['file_id']) ? $data['file_id'] : null; $this->container['object_id'] = isset($data['object_id']) ? $data['object_id'] : null; $this->container['object_group'] = isset($data['object_group']) ? $data['object_group'] : null; @@ -227,6 +245,87 @@ public function valid() } + /** + * Gets send_with_object + * + * @return bool|null + */ + public function getSendWithObject() + { + return $this->container['send_with_object']; + } + + /** + * Sets send_with_object + * + * @param bool|null $send_with_object Boolean flag to determines whether the file is sent with the document it is attached to on client facing communications. Note- The SendWithObject element is only returned when using /Associations/{ObjectId} endpoint. + * + * @return $this + */ + public function setSendWithObject($send_with_object) + { + + $this->container['send_with_object'] = $send_with_object; + + return $this; + } + + + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The name of the associated file. Note- The Name element is only returned when using /Associations/{ObjectId} endpoint. + * + * @return $this + */ + public function setName($name) + { + + $this->container['name'] = $name; + + return $this; + } + + + + /** + * Gets size + * + * @return int|null + */ + public function getSize() + { + return $this->container['size']; + } + + /** + * Sets size + * + * @param int|null $size The size of the associated file in bytes. Note- The Size element is only returned when using /Associations/{ObjectId} endpoint. + * + * @return $this + */ + public function setSize($size) + { + + $this->container['size'] = $size; + + return $this; + } + + + /** * Gets file_id * diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/FileObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/FileObject.php index cf322f6..af481f6 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/FileObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/FileObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/FileResponse204.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/FileResponse204.php index 3457325..8ccbb65 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/FileResponse204.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/FileResponse204.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/Files.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/Files.php index 9bad7f8..eccad44 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/Files.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/Files.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/Folder.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/Folder.php index 762ab05..c465f17 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/Folder.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/Folder.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/Folders.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/Folders.php index 6df163d..8dd0cb8 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/Folders.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/Folders.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/InlineObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/InlineObject.php index 198a04e..7fda618 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/InlineObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/InlineObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/ModelInterface.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/ModelInterface.php index 04e34a7..e5de078 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/ModelInterface.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/ModelInterface.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/ObjectGroup.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/ObjectGroup.php index a3bd05b..ac4da59 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/ObjectGroup.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/ObjectGroup.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/ObjectType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/ObjectType.php index ac4e835..da2eef6 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/ObjectType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/ObjectType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/UploadObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/UploadObject.php index 8d6d05c..faa02d1 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/UploadObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/UploadObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/User.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/User.php index 6aa1c99..9f0d61c 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/User.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/File/User.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/AccountUsage.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/AccountUsage.php index ff0dc3b..97cb9a2 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/AccountUsage.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/AccountUsage.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/AccountUsageResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/AccountUsageResponse.php index bb69e05..a276b67 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/AccountUsageResponse.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/AccountUsageResponse.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/BalanceSheetAccountDetail.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/BalanceSheetAccountDetail.php index 2377841..b208203 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/BalanceSheetAccountDetail.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/BalanceSheetAccountDetail.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/BalanceSheetAccountGroup.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/BalanceSheetAccountGroup.php index f229de4..8d2cd9c 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/BalanceSheetAccountGroup.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/BalanceSheetAccountGroup.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/BalanceSheetAccountType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/BalanceSheetAccountType.php index a46654a..1d8e787 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/BalanceSheetAccountType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/BalanceSheetAccountType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/BalanceSheetResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/BalanceSheetResponse.php index ac495d1..3f76675 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/BalanceSheetResponse.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/BalanceSheetResponse.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/BankStatementAccountingResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/BankStatementAccountingResponse.php index 0f1078f..87f950a 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/BankStatementAccountingResponse.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/BankStatementAccountingResponse.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/BankStatementResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/BankStatementResponse.php index 953a734..710cf5f 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/BankStatementResponse.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/BankStatementResponse.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/BankTransactionResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/BankTransactionResponse.php index 73a099f..b336078 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/BankTransactionResponse.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/BankTransactionResponse.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/CashAccountResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/CashAccountResponse.php index 2173ce3..1095555 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/CashAccountResponse.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/CashAccountResponse.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/CashBalance.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/CashBalance.php index 8682310..df18754 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/CashBalance.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/CashBalance.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/CashValidationResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/CashValidationResponse.php index f5fd2d3..a88de3d 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/CashValidationResponse.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/CashValidationResponse.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/CashflowAccount.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/CashflowAccount.php index f7fda9b..548c7b2 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/CashflowAccount.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/CashflowAccount.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/CashflowActivity.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/CashflowActivity.php index 23f9e39..c7d4a1a 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/CashflowActivity.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/CashflowActivity.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/CashflowResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/CashflowResponse.php index b4f75e5..280ef2b 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/CashflowResponse.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/CashflowResponse.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/CashflowType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/CashflowType.php index 65e35b6..100b73e 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/CashflowType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/CashflowType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ContactDetail.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ContactDetail.php index 93f79c2..1664410 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ContactDetail.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ContactDetail.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ContactResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ContactResponse.php index 0fc69fc..5c29599 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ContactResponse.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ContactResponse.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ContactTotalDetail.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ContactTotalDetail.php index f81a43a..74dd86e 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ContactTotalDetail.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ContactTotalDetail.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ContactTotalOther.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ContactTotalOther.php index 3f10802..aead4a7 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ContactTotalOther.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ContactTotalOther.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/CreditNoteResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/CreditNoteResponse.php index 2fef6f1..865e19e 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/CreditNoteResponse.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/CreditNoteResponse.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/CurrentStatementResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/CurrentStatementResponse.php index 36ff039..94045f5 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/CurrentStatementResponse.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/CurrentStatementResponse.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/DataSourceResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/DataSourceResponse.php index 3392309..57a331d 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/DataSourceResponse.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/DataSourceResponse.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -306,7 +306,7 @@ public function getDirectBankFeed() /** * Sets direct_bank_feed * - * @param double|null $direct_bank_feed Sum of the amounts of all statement lines where the source of the data was a direct bank feed in to Xero. This gives an indication on the certainty of correctness of the data. + * @param double|null $direct_bank_feed Sum of the amounts of all statement lines where the source of the data was a direct bank feed in to Xero via an API integration. This could be from a bank or aggregator. This gives an indication on the certainty of correctness of the data. * * @return $this */ @@ -333,7 +333,7 @@ public function getIndirectBankFeed() /** * Sets indirect_bank_feed * - * @param double|null $indirect_bank_feed Sum of the amounts of all statement lines where the source of the data was a indirect bank feed to Xero (usually via Yodlee). This gives an indication on the certainty of correctness of the data. + * @param double|null $indirect_bank_feed No longer in use. * * @return $this */ @@ -360,7 +360,7 @@ public function getFileUpload() /** * Sets file_upload * - * @param double|null $file_upload Sum of the amounts of all statement lines where the source of the data was a CSV file upload in to Xero. This gives an indication on the certainty of correctness of the data. + * @param double|null $file_upload Sum of the amounts of all statement lines where the source of the data was a file manually uploaded in to Xero. This gives an indication on the certainty of correctness of the data. * * @return $this */ @@ -387,7 +387,7 @@ public function getManual() /** * Sets manual * - * @param double|null $manual Sum of the amounts of all statement lines where the source of the data was manually keyed in to Xero. This gives an indication on the certainty of correctness of the data. + * @param double|null $manual Sum of the amounts of all statement lines where the source of the data was manually input in to Xero. This gives an indication on the certainty of correctness of the data. * * @return $this */ @@ -414,7 +414,7 @@ public function getDirectBankFeedPos() /** * Sets direct_bank_feed_pos * - * @param double|null $direct_bank_feed_pos Sum of the amounts of all statement lines where the source of the data was a direct bank feed in to Xero. This gives an indication on the certainty of correctness of the data. Only positive transactions are included. + * @param double|null $direct_bank_feed_pos Sum of the amounts of all statement lines where the source of the data was a direct bank feed in to Xero via an API integration. This could be from a bank or aggregator. This gives an indication on the certainty of correctness of the data. Only positive transactions are included. * * @return $this */ @@ -441,7 +441,7 @@ public function getIndirectBankFeedPos() /** * Sets indirect_bank_feed_pos * - * @param double|null $indirect_bank_feed_pos Sum of the amounts of all statement lines where the source of the data was a indirect bank feed to Xero (usually via Yodlee). This gives an indication on the certainty of correctness of the data. Only positive transactions are included. + * @param double|null $indirect_bank_feed_pos No longer in use. * * @return $this */ @@ -468,7 +468,7 @@ public function getFileUploadPos() /** * Sets file_upload_pos * - * @param double|null $file_upload_pos Sum of the amounts of all statement lines where the source of the data was a CSV file upload in to Xero. This gives an indication on the certainty of correctness of the data. Only positive transactions are included. + * @param double|null $file_upload_pos Sum of the amounts of all statement lines where the source of the data was a file manually uploaded in to Xero. This gives an indication on the certainty of correctness of the data. Only positive transactions are included. * * @return $this */ @@ -495,7 +495,7 @@ public function getManualPos() /** * Sets manual_pos * - * @param double|null $manual_pos Sum of the amounts of all statement lines where the source of the data was manually keyed in to Xero. This gives an indication on the certainty of correctness of the data. Only positive transactions are included. + * @param double|null $manual_pos Sum of the amounts of all statement lines where the source of the data was manually input in to Xero. This gives an indication on the certainty of correctness of the data. Only positive transactions are included. * * @return $this */ @@ -522,7 +522,7 @@ public function getDirectBankFeedNeg() /** * Sets direct_bank_feed_neg * - * @param double|null $direct_bank_feed_neg Sum of the amounts of all statement lines where the source of the data was a direct bank feed in to Xero. This gives an indication on the certainty of correctness of the data. Only negative transactions are included. + * @param double|null $direct_bank_feed_neg Sum of the amounts of all statement lines where the source of the data was a direct bank feed in to Xero via an API integration. This could be from a bank or aggregator. This gives an indication on the certainty of correctness of the data. Only negative transactions are included. * * @return $this */ @@ -549,7 +549,7 @@ public function getIndirectBankFeedNeg() /** * Sets indirect_bank_feed_neg * - * @param double|null $indirect_bank_feed_neg Sum of the amounts of all statement lines where the source of the data was a indirect bank feed to Xero (usually via Yodlee). This gives an indication on the certainty of correctness of the data. Only negative transactions are included. + * @param double|null $indirect_bank_feed_neg No longer in use. * * @return $this */ @@ -576,7 +576,7 @@ public function getFileUploadNeg() /** * Sets file_upload_neg * - * @param double|null $file_upload_neg Sum of the amounts of all statement lines where the source of the data was a CSV file upload in to Xero. This gives an indication on the certainty of correctness of the data. Only negative transactions are included. + * @param double|null $file_upload_neg Sum of the amounts of all statement lines where the source of the data was a file manually uploaded in to Xero. This gives an indication on the certainty of correctness of the data. Only negative transactions are included. * * @return $this */ @@ -603,7 +603,7 @@ public function getManualNeg() /** * Sets manual_neg * - * @param double|null $manual_neg Sum of the amounts of all statement lines where the source of the data was manually keyed in to Xero. This gives an indication on the certainty of correctness of the data. Only negative transactions are included. + * @param double|null $manual_neg Sum of the amounts of all statement lines where the source of the data was manually input in to Xero. This gives an indication on the certainty of correctness of the data. Only negative transactions are included. * * @return $this */ @@ -630,7 +630,7 @@ public function getOtherPos() /** * Sets other_pos * - * @param double|null $other_pos Sum of the amounts of all statement lines where the source of the data was any other category. This gives an indication on the certainty of correctness of the data. Only positive transactions are included. + * @param double|null $other_pos Sum of the amounts of all statement lines where the source of the data was unknown. This gives an indication on the certainty of correctness of the data. Only positive transactions are included. * * @return $this */ @@ -657,7 +657,7 @@ public function getOtherNeg() /** * Sets other_neg * - * @param double|null $other_neg Sum of the amounts of all statement lines where the source of the data was any other category. This gives an indication on the certainty of correctness of the data. Only negative transactions are included. + * @param double|null $other_neg Sum of the amounts of all statement lines where the source of the data was unknown. This gives an indication on the certainty of correctness of the data. Only negative transactions are included. * * @return $this */ @@ -684,7 +684,7 @@ public function getOther() /** * Sets other * - * @param double|null $other Sum of the amounts of all statement lines where the source of the data was any other category. This gives an indication on the certainty of correctness of the data. + * @param double|null $other Sum of the amounts of all statement lines where the source of the data was unknown. This gives an indication on the certainty of correctness of the data. * * @return $this */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/HistoryRecordResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/HistoryRecordResponse.php index 12fb643..23f1478 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/HistoryRecordResponse.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/HistoryRecordResponse.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/IncomeByContactResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/IncomeByContactResponse.php index 62f328b..948d6a8 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/IncomeByContactResponse.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/IncomeByContactResponse.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/InvoiceResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/InvoiceResponse.php index c60056a..d7038bc 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/InvoiceResponse.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/InvoiceResponse.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/LineItemResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/LineItemResponse.php index 6b8d2bf..67d0465 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/LineItemResponse.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/LineItemResponse.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/LockHistoryModel.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/LockHistoryModel.php index 4196e22..05a8b22 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/LockHistoryModel.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/LockHistoryModel.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/LockHistoryResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/LockHistoryResponse.php index 01eb996..18b282d 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/LockHistoryResponse.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/LockHistoryResponse.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ManualJournalTotal.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ManualJournalTotal.php index 76de0a2..db738ca 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ManualJournalTotal.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ManualJournalTotal.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ModelInterface.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ModelInterface.php index c8904a0..7c6d6b6 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ModelInterface.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ModelInterface.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/OverpaymentResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/OverpaymentResponse.php index 7eabc44..bc9e623 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/OverpaymentResponse.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/OverpaymentResponse.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/PaymentResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/PaymentResponse.php index fcaf6b4..11c3d3f 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/PaymentResponse.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/PaymentResponse.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/PnlAccount.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/PnlAccount.php index ff9c958..46c6d27 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/PnlAccount.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/PnlAccount.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/PnlAccountClass.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/PnlAccountClass.php index a49f583..313fe09 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/PnlAccountClass.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/PnlAccountClass.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/PnlAccountType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/PnlAccountType.php index 83ed548..6e505af 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/PnlAccountType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/PnlAccountType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/PracticeResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/PracticeResponse.php index 6cc7da2..5d13d39 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/PracticeResponse.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/PracticeResponse.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/PrepaymentResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/PrepaymentResponse.php index 6ae8ea8..ab0eab1 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/PrepaymentResponse.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/PrepaymentResponse.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/Problem.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/Problem.php index 07917ce..706f3c4 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/Problem.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/Problem.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ProblemType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ProblemType.php index 69cde91..a4c7b9d 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ProblemType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ProblemType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -58,6 +58,7 @@ class ProblemType const REQUEST_TIMEOUT = 'request-timeout'; const SERVICE_UNAVAILABLE = 'service-unavailable'; const UNAUTHORIZED = 'unauthorized'; + const RATE_LIMIT_ERROR = 'rate-limit-error'; /** * Gets allowable values of the enum @@ -76,6 +77,7 @@ public static function getAllowableEnumValues() self::REQUEST_TIMEOUT, self::SERVICE_UNAVAILABLE, self::UNAUTHORIZED, + self::RATE_LIMIT_ERROR, ]; } } diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ProfitAndLossResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ProfitAndLossResponse.php index 0c39339..14cd3d2 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ProfitAndLossResponse.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ProfitAndLossResponse.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ReportHistoryModel.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ReportHistoryModel.php index f86d7bf..0c2a8d7 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ReportHistoryModel.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ReportHistoryModel.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ReportHistoryResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ReportHistoryResponse.php index df40b0c..134b1aa 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ReportHistoryResponse.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/ReportHistoryResponse.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/StatementBalanceResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/StatementBalanceResponse.php index 8f7934b..c376356 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/StatementBalanceResponse.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/StatementBalanceResponse.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/StatementLineResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/StatementLineResponse.php index 995897c..5741e4f 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/StatementLineResponse.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/StatementLineResponse.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/StatementLinesResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/StatementLinesResponse.php index a691ea9..c500784 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/StatementLinesResponse.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/StatementLinesResponse.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/StatementResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/StatementResponse.php index 692c7f8..fc80721 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/StatementResponse.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/StatementResponse.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -384,7 +384,7 @@ public function getImportSource() /** * Sets import_source * - * @param string|null $import_source Indicates the source of the statement data. Either imported from 1) direct bank feed OR 2) manual customer entry or upload. Manual import sources are STMTIMPORTSRC/MANUAL, STMTIMPORTSRC/CSV, STMTIMPORTSRC/OFX, Ofx or STMTIMPORTSRC/QIF. All other import sources are direct and, depending on the direct solution, may contain the name of the financial institution. + * @param string|null $import_source Identifies where the statement data in Xero was sourced, 1) direct bank feed, automatically loaded from the bank (eg STMTIMPORTSRC/CBAFEED); 2) indirect bank feed, automatically loaded from a 3rd party provider (eg STMTIMPORTSRC/YODLEE); 3) manually uploaded bank feed (eg STMTIMPORTSRC/CSV) or 4) manually entered statement data (STMTIMPORTSRC/MANUAL). * * @return $this */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/TotalDetail.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/TotalDetail.php index 1ca2083..6a847f8 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/TotalDetail.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/TotalDetail.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/TotalOther.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/TotalOther.php index 7562422..c3a8472 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/TotalOther.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/TotalOther.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/TrialBalanceAccount.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/TrialBalanceAccount.php index a1794b4..4f2d6e4 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/TrialBalanceAccount.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/TrialBalanceAccount.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/TrialBalanceEntry.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/TrialBalanceEntry.php index 7da10d6..3afc915 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/TrialBalanceEntry.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/TrialBalanceEntry.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/TrialBalanceMovement.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/TrialBalanceMovement.php index 8758b43..a38d7d7 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/TrialBalanceMovement.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/TrialBalanceMovement.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/TrialBalanceResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/TrialBalanceResponse.php index 04a9613..90b140a 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/TrialBalanceResponse.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/TrialBalanceResponse.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/UserActivitiesResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/UserActivitiesResponse.php index 6877d24..be444dd 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/UserActivitiesResponse.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/UserActivitiesResponse.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/UserResponse.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/UserResponse.php index 2d7e02a..1d4d746 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/UserResponse.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Finance/UserResponse.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Identity/AccessToken.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Identity/AccessToken.php index 081404f..e3423ae 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Identity/AccessToken.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Identity/AccessToken.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Identity/Connection.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Identity/Connection.php index c6dfd31..02f8e68 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Identity/Connection.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Identity/Connection.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Identity/ModelInterface.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Identity/ModelInterface.php index 8542865..daae426 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Identity/ModelInterface.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Identity/ModelInterface.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Identity/RefreshToken.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Identity/RefreshToken.php index e596280..0e118a6 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Identity/RefreshToken.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Identity/RefreshToken.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/APIException.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/APIException.php index 3070e20..698310e 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/APIException.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/APIException.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/Account.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/Account.php index 6367865..ae44b37 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/Account.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/Account.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/AccountType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/AccountType.php index 68a3093..26b6921 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/AccountType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/AccountType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/AllowanceCategory.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/AllowanceCategory.php index 6cd1165..92a346d 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/AllowanceCategory.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/AllowanceCategory.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/AllowanceType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/AllowanceType.php index e0916a5..24ab8cf 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/AllowanceType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/AllowanceType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -54,7 +54,6 @@ class AllowanceType const MEALS = 'MEALS'; const TRAVEL = 'TRAVEL'; const OTHER = 'OTHER'; - const JOBKEEPER = 'JOBKEEPER'; const TOOLS = 'TOOLS'; const TASKS = 'TASKS'; const QUALIFICATIONS = 'QUALIFICATIONS'; @@ -72,7 +71,6 @@ public static function getAllowableEnumValues() self::MEALS, self::TRAVEL, self::OTHER, - self::JOBKEEPER, self::TOOLS, self::TASKS, self::QUALIFICATIONS, diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/BankAccount.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/BankAccount.php index 3b38b77..11ce0c7 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/BankAccount.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/BankAccount.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/CalendarType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/CalendarType.php index 25e1169..a76fbc1 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/CalendarType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/CalendarType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/CountryOfResidence.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/CountryOfResidence.php index d81af2d..95835b7 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/CountryOfResidence.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/CountryOfResidence.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -39,7 +39,7 @@ * CountryOfResidence Class Doc Comment * * @category Class - * @description Country of residence as a valid ISO 3166-1 alpha-2 country code e.g. \"AU\", \"NZ\", \"CA\" or an empty string (\"\") to unset a previously set value. Only applicable, and mandatory if income type is WORKINGHOLIDAYMAKER. + * @description Country of residence as a valid ISO 3166-1 alpha-2 country code e.g. \"AU\", \"NZ\", \"CA\". Only applicable, and mandatory if income type is WORKINGHOLIDAYMAKER. * @package XeroAPI\XeroPHP * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -299,7 +299,6 @@ class CountryOfResidence const CW = 'CW'; const SX = 'SX'; const SS = 'SS'; - const EMPTY = ''; /** * Gets allowable values of the enum @@ -558,7 +557,6 @@ public static function getAllowableEnumValues() self::CW, self::SX, self::SS, - self::EMPTY, ]; } } diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/DeductionLine.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/DeductionLine.php index d1bef15..723f1c8 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/DeductionLine.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/DeductionLine.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/DeductionType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/DeductionType.php index c42f9bb..7b32083 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/DeductionType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/DeductionType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/DeductionTypeCalculationType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/DeductionTypeCalculationType.php index 9a1c3d8..47935e4 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/DeductionTypeCalculationType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/DeductionTypeCalculationType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/EarningsLine.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/EarningsLine.php index 7443114..6b8dd2f 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/EarningsLine.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/EarningsLine.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/EarningsRate.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/EarningsRate.php index e86db3b..04fdbce 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/EarningsRate.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/EarningsRate.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/EarningsRateCalculationType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/EarningsRateCalculationType.php index 615e4b2..c9d8d20 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/EarningsRateCalculationType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/EarningsRateCalculationType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/EarningsType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/EarningsType.php index 3e92b34..9ecea53 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/EarningsType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/EarningsType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/Employee.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/Employee.php index 4caa49c..a6716f3 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/Employee.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/Employee.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/EmployeeStatus.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/EmployeeStatus.php index de52951..fc35ed4 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/EmployeeStatus.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/EmployeeStatus.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/Employees.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/Employees.php index f381b00..a1d4ba8 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/Employees.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/Employees.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return PayrollAuObjectSerializer::sanitizeForSerialization($this)->Employees; + $sanitizedObject = PayrollAuObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['Employees'] = $sanitizedObject->Employees; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/EmploymentBasis.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/EmploymentBasis.php index 947102a..6452ee8 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/EmploymentBasis.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/EmploymentBasis.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/EmploymentTerminationPaymentType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/EmploymentTerminationPaymentType.php index 268b474..9a086b3 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/EmploymentTerminationPaymentType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/EmploymentTerminationPaymentType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/EmploymentType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/EmploymentType.php index bb08e3d..f624cc6 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/EmploymentType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/EmploymentType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/EntitlementFinalPayPayoutType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/EntitlementFinalPayPayoutType.php index 471580d..90fa22e 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/EntitlementFinalPayPayoutType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/EntitlementFinalPayPayoutType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/HomeAddress.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/HomeAddress.php index 25501e3..8ccdb6a 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/HomeAddress.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/HomeAddress.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/IncomeType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/IncomeType.php index 53fd118..40d72c2 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/IncomeType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/IncomeType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveAccrualLine.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveAccrualLine.php index 284c93d..3fdc667 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveAccrualLine.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveAccrualLine.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveApplication.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveApplication.php index b37c3c3..733ba6e 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveApplication.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveApplication.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -69,6 +69,7 @@ class LeaveApplication implements ModelInterface, ArrayAccess 'start_date' => 'string', 'end_date' => 'string', 'description' => 'string', + 'pay_out_type' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayOutType', 'leave_periods' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\LeavePeriod[]', 'updated_date_utc' => 'string', 'validation_errors' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\ValidationError[]' @@ -87,6 +88,7 @@ class LeaveApplication implements ModelInterface, ArrayAccess 'start_date' => null, 'end_date' => null, 'description' => null, + 'pay_out_type' => null, 'leave_periods' => null, 'updated_date_utc' => null, 'validation_errors' => null @@ -126,6 +128,7 @@ public static function openAPIFormats() 'start_date' => 'StartDate', 'end_date' => 'EndDate', 'description' => 'Description', + 'pay_out_type' => 'PayOutType', 'leave_periods' => 'LeavePeriods', 'updated_date_utc' => 'UpdatedDateUTC', 'validation_errors' => 'ValidationErrors' @@ -144,6 +147,7 @@ public static function openAPIFormats() 'start_date' => 'setStartDate', 'end_date' => 'setEndDate', 'description' => 'setDescription', + 'pay_out_type' => 'setPayOutType', 'leave_periods' => 'setLeavePeriods', 'updated_date_utc' => 'setUpdatedDateUtc', 'validation_errors' => 'setValidationErrors' @@ -162,6 +166,7 @@ public static function openAPIFormats() 'start_date' => 'getStartDate', 'end_date' => 'getEndDate', 'description' => 'getDescription', + 'pay_out_type' => 'getPayOutType', 'leave_periods' => 'getLeavePeriods', 'updated_date_utc' => 'getUpdatedDateUtc', 'validation_errors' => 'getValidationErrors' @@ -234,6 +239,7 @@ public function __construct(array $data = null) $this->container['start_date'] = isset($data['start_date']) ? $data['start_date'] : null; $this->container['end_date'] = isset($data['end_date']) ? $data['end_date'] : null; $this->container['description'] = isset($data['description']) ? $data['description'] : null; + $this->container['pay_out_type'] = isset($data['pay_out_type']) ? $data['pay_out_type'] : null; $this->container['leave_periods'] = isset($data['leave_periods']) ? $data['leave_periods'] : null; $this->container['updated_date_utc'] = isset($data['updated_date_utc']) ? $data['updated_date_utc'] : null; $this->container['validation_errors'] = isset($data['validation_errors']) ? $data['validation_errors'] : null; @@ -504,6 +510,33 @@ public function setDescription($description) + /** + * Gets pay_out_type + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayOutType|null + */ + public function getPayOutType() + { + return $this->container['pay_out_type']; + } + + /** + * Sets pay_out_type + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayOutType|null $pay_out_type pay_out_type + * + * @return $this + */ + public function setPayOutType($pay_out_type) + { + + $this->container['pay_out_type'] = $pay_out_type; + + return $this; + } + + + /** * Gets leave_periods * diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveApplications.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveApplications.php index d0a9707..ee39aa2 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveApplications.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveApplications.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return PayrollAuObjectSerializer::sanitizeForSerialization($this)->LeaveApplications; + $sanitizedObject = PayrollAuObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['LeaveApplications'] = $sanitizedObject->LeaveApplications; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveBalance.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveBalance.php index 4c91958..f237f8d 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveBalance.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveBalance.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveCategoryCode.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveCategoryCode.php index ef52362..38316ac 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveCategoryCode.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveCategoryCode.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveEarningsLine.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveEarningsLine.php index 1a73861..eb290f7 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveEarningsLine.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveEarningsLine.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -64,7 +64,8 @@ class LeaveEarningsLine implements ModelInterface, ArrayAccess protected static $openAPITypes = [ 'earnings_rate_id' => 'string', 'rate_per_unit' => 'double', - 'number_of_units' => 'double' + 'number_of_units' => 'double', + 'pay_out_type' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayOutType' ]; /** @@ -75,7 +76,8 @@ class LeaveEarningsLine implements ModelInterface, ArrayAccess protected static $openAPIFormats = [ 'earnings_rate_id' => 'uuid', 'rate_per_unit' => 'double', - 'number_of_units' => 'double' + 'number_of_units' => 'double', + 'pay_out_type' => null ]; /** @@ -107,7 +109,8 @@ public static function openAPIFormats() protected static $attributeMap = [ 'earnings_rate_id' => 'EarningsRateID', 'rate_per_unit' => 'RatePerUnit', - 'number_of_units' => 'NumberOfUnits' + 'number_of_units' => 'NumberOfUnits', + 'pay_out_type' => 'PayOutType' ]; /** @@ -118,7 +121,8 @@ public static function openAPIFormats() protected static $setters = [ 'earnings_rate_id' => 'setEarningsRateId', 'rate_per_unit' => 'setRatePerUnit', - 'number_of_units' => 'setNumberOfUnits' + 'number_of_units' => 'setNumberOfUnits', + 'pay_out_type' => 'setPayOutType' ]; /** @@ -129,7 +133,8 @@ public static function openAPIFormats() protected static $getters = [ 'earnings_rate_id' => 'getEarningsRateId', 'rate_per_unit' => 'getRatePerUnit', - 'number_of_units' => 'getNumberOfUnits' + 'number_of_units' => 'getNumberOfUnits', + 'pay_out_type' => 'getPayOutType' ]; /** @@ -195,6 +200,7 @@ public function __construct(array $data = null) $this->container['earnings_rate_id'] = isset($data['earnings_rate_id']) ? $data['earnings_rate_id'] : null; $this->container['rate_per_unit'] = isset($data['rate_per_unit']) ? $data['rate_per_unit'] : null; $this->container['number_of_units'] = isset($data['number_of_units']) ? $data['number_of_units'] : null; + $this->container['pay_out_type'] = isset($data['pay_out_type']) ? $data['pay_out_type'] : null; } /** @@ -301,6 +307,33 @@ public function setNumberOfUnits($number_of_units) } + + /** + * Gets pay_out_type + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayOutType|null + */ + public function getPayOutType() + { + return $this->container['pay_out_type']; + } + + /** + * Sets pay_out_type + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PayOutType|null $pay_out_type pay_out_type + * + * @return $this + */ + public function setPayOutType($pay_out_type) + { + + $this->container['pay_out_type'] = $pay_out_type; + + return $this; + } + + /** * Returns true if offset exists. False otherwise. * diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveLine.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveLine.php index 9ecadfa..2d19a24 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveLine.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveLine.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveLineCalculationType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveLineCalculationType.php index 366dfd0..db29f50 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveLineCalculationType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveLineCalculationType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -53,7 +53,6 @@ class LeaveLineCalculationType const FIXEDAMOUNTEACHPERIOD = 'FIXEDAMOUNTEACHPERIOD'; const ENTERRATEINPAYTEMPLATE = 'ENTERRATEINPAYTEMPLATE'; const BASEDONORDINARYEARNINGS = 'BASEDONORDINARYEARNINGS'; - const EMPTY = ''; /** * Gets allowable values of the enum @@ -66,7 +65,6 @@ public static function getAllowableEnumValues() self::FIXEDAMOUNTEACHPERIOD, self::ENTERRATEINPAYTEMPLATE, self::BASEDONORDINARYEARNINGS, - self::EMPTY, ]; } } diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveLines.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveLines.php index d983924..1bfcf95 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveLines.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveLines.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -308,7 +308,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return PayrollAuObjectSerializer::sanitizeForSerialization($this)->LeaveLines; + $sanitizedObject = PayrollAuObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['LeaveLines'] = $sanitizedObject->LeaveLines; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeavePeriod.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeavePeriod.php index a49d3ff..266f7b9 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeavePeriod.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeavePeriod.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeavePeriodStatus.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeavePeriodStatus.php index 76a99c9..df452fe 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeavePeriodStatus.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeavePeriodStatus.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -50,6 +50,8 @@ class LeavePeriodStatus */ const SCHEDULED = 'SCHEDULED'; const PROCESSED = 'PROCESSED'; + const REQUESTED = 'REQUESTED'; + const REJECTED = 'REJECTED'; /** * Gets allowable values of the enum @@ -60,6 +62,8 @@ public static function getAllowableEnumValues() return [ self::SCHEDULED, self::PROCESSED, + self::REQUESTED, + self::REJECTED, ]; } } diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveType.php index a6cde60..4f61ae1 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveTypeContributionType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveTypeContributionType.php index a2df489..63b22a9 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveTypeContributionType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveTypeContributionType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/ManualTaxType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/ManualTaxType.php index 88d0bef..cb88d8f 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/ManualTaxType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/ManualTaxType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/ModelInterface.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/ModelInterface.php index c03aec6..53b5ab9 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/ModelInterface.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/ModelInterface.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/OpeningBalances.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/OpeningBalances.php index dbdb7ee..46b7d61 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/OpeningBalances.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/OpeningBalances.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -68,7 +68,8 @@ class OpeningBalances implements ModelInterface, ArrayAccess 'deduction_lines' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\DeductionLine[]', 'super_lines' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\SuperLine[]', 'reimbursement_lines' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\ReimbursementLine[]', - 'leave_lines' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\LeaveLine[]' + 'leave_lines' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\LeaveLine[]', + 'paid_leave_earnings_lines' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PaidLeaveEarningsLine[]' ]; /** @@ -83,7 +84,8 @@ class OpeningBalances implements ModelInterface, ArrayAccess 'deduction_lines' => null, 'super_lines' => null, 'reimbursement_lines' => null, - 'leave_lines' => null + 'leave_lines' => null, + 'paid_leave_earnings_lines' => null ]; /** @@ -119,7 +121,8 @@ public static function openAPIFormats() 'deduction_lines' => 'DeductionLines', 'super_lines' => 'SuperLines', 'reimbursement_lines' => 'ReimbursementLines', - 'leave_lines' => 'LeaveLines' + 'leave_lines' => 'LeaveLines', + 'paid_leave_earnings_lines' => 'PaidLeaveEarningsLines' ]; /** @@ -134,7 +137,8 @@ public static function openAPIFormats() 'deduction_lines' => 'setDeductionLines', 'super_lines' => 'setSuperLines', 'reimbursement_lines' => 'setReimbursementLines', - 'leave_lines' => 'setLeaveLines' + 'leave_lines' => 'setLeaveLines', + 'paid_leave_earnings_lines' => 'setPaidLeaveEarningsLines' ]; /** @@ -149,7 +153,8 @@ public static function openAPIFormats() 'deduction_lines' => 'getDeductionLines', 'super_lines' => 'getSuperLines', 'reimbursement_lines' => 'getReimbursementLines', - 'leave_lines' => 'getLeaveLines' + 'leave_lines' => 'getLeaveLines', + 'paid_leave_earnings_lines' => 'getPaidLeaveEarningsLines' ]; /** @@ -219,6 +224,7 @@ public function __construct(array $data = null) $this->container['super_lines'] = isset($data['super_lines']) ? $data['super_lines'] : null; $this->container['reimbursement_lines'] = isset($data['reimbursement_lines']) ? $data['reimbursement_lines'] : null; $this->container['leave_lines'] = isset($data['leave_lines']) ? $data['leave_lines'] : null; + $this->container['paid_leave_earnings_lines'] = isset($data['paid_leave_earnings_lines']) ? $data['paid_leave_earnings_lines'] : null; } /** @@ -459,6 +465,33 @@ public function setLeaveLines($leave_lines) } + + /** + * Gets paid_leave_earnings_lines + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PaidLeaveEarningsLine[]|null + */ + public function getPaidLeaveEarningsLines() + { + return $this->container['paid_leave_earnings_lines']; + } + + /** + * Sets paid_leave_earnings_lines + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollAu\PaidLeaveEarningsLine[]|null $paid_leave_earnings_lines paid_leave_earnings_lines + * + * @return $this + */ + public function setPaidLeaveEarningsLines($paid_leave_earnings_lines) + { + + $this->container['paid_leave_earnings_lines'] = $paid_leave_earnings_lines; + + return $this; + } + + /** * Returns true if offset exists. False otherwise. * diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PaidLeaveEarningsLine.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PaidLeaveEarningsLine.php new file mode 100644 index 0000000..3336f8f --- /dev/null +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PaidLeaveEarningsLine.php @@ -0,0 +1,447 @@ + 'string', + 'amount' => 'double', + 'sgc_applied_leave_loading_amount' => 'double', + 'sgc_exempted_leave_loading_amount' => 'double', + 'reset_stp_categorisation' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'leave_type_id' => 'uuid', + 'amount' => 'double', + 'sgc_applied_leave_loading_amount' => 'double', + 'sgc_exempted_leave_loading_amount' => 'double', + 'reset_stp_categorisation' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'leave_type_id' => 'LeaveTypeID', + 'amount' => 'Amount', + 'sgc_applied_leave_loading_amount' => 'SGCAppliedLeaveLoadingAmount', + 'sgc_exempted_leave_loading_amount' => 'SGCExemptedLeaveLoadingAmount', + 'reset_stp_categorisation' => 'ResetSTPCategorisation' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'leave_type_id' => 'setLeaveTypeId', + 'amount' => 'setAmount', + 'sgc_applied_leave_loading_amount' => 'setSgcAppliedLeaveLoadingAmount', + 'sgc_exempted_leave_loading_amount' => 'setSgcExemptedLeaveLoadingAmount', + 'reset_stp_categorisation' => 'setResetStpCategorisation' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'leave_type_id' => 'getLeaveTypeId', + 'amount' => 'getAmount', + 'sgc_applied_leave_loading_amount' => 'getSgcAppliedLeaveLoadingAmount', + 'sgc_exempted_leave_loading_amount' => 'getSgcExemptedLeaveLoadingAmount', + 'reset_stp_categorisation' => 'getResetStpCategorisation' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['leave_type_id'] = isset($data['leave_type_id']) ? $data['leave_type_id'] : null; + $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; + $this->container['sgc_applied_leave_loading_amount'] = isset($data['sgc_applied_leave_loading_amount']) ? $data['sgc_applied_leave_loading_amount'] : null; + $this->container['sgc_exempted_leave_loading_amount'] = isset($data['sgc_exempted_leave_loading_amount']) ? $data['sgc_exempted_leave_loading_amount'] : null; + $this->container['reset_stp_categorisation'] = isset($data['reset_stp_categorisation']) ? $data['reset_stp_categorisation'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['leave_type_id'] === null) { + $invalidProperties[] = "'leave_type_id' can't be null"; + } + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets leave_type_id + * + * @return string + */ + public function getLeaveTypeId() + { + return $this->container['leave_type_id']; + } + + /** + * Sets leave_type_id + * + * @param string $leave_type_id Xero leave type identifier + * + * @return $this + */ + public function setLeaveTypeId($leave_type_id) + { + + $this->container['leave_type_id'] = $leave_type_id; + + return $this; + } + + + + /** + * Gets amount + * + * @return double + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param double $amount Paid leave amount + * + * @return $this + */ + public function setAmount($amount) + { + + $this->container['amount'] = $amount; + + return $this; + } + + + + /** + * Gets sgc_applied_leave_loading_amount + * + * @return double|null + */ + public function getSgcAppliedLeaveLoadingAmount() + { + return $this->container['sgc_applied_leave_loading_amount']; + } + + /** + * Sets sgc_applied_leave_loading_amount + * + * @param double|null $sgc_applied_leave_loading_amount The amount of leave loading applied for the leave type that is subject to Superannuation Guarantee Contributions. *Only applicable for Leave Types with Annual Leave Categories + * + * @return $this + */ + public function setSgcAppliedLeaveLoadingAmount($sgc_applied_leave_loading_amount) + { + + $this->container['sgc_applied_leave_loading_amount'] = $sgc_applied_leave_loading_amount; + + return $this; + } + + + + /** + * Gets sgc_exempted_leave_loading_amount + * + * @return double|null + */ + public function getSgcExemptedLeaveLoadingAmount() + { + return $this->container['sgc_exempted_leave_loading_amount']; + } + + /** + * Sets sgc_exempted_leave_loading_amount + * + * @param double|null $sgc_exempted_leave_loading_amount The amount of leave loading applied for the leave type that is exempt from Superannuation Guarantee Contributions. *Only applicable for Leave Types with Annual Leave Categories + * + * @return $this + */ + public function setSgcExemptedLeaveLoadingAmount($sgc_exempted_leave_loading_amount) + { + + $this->container['sgc_exempted_leave_loading_amount'] = $sgc_exempted_leave_loading_amount; + + return $this; + } + + + + /** + * Gets reset_stp_categorisation + * + * @return bool|null + */ + public function getResetStpCategorisation() + { + return $this->container['reset_stp_categorisation']; + } + + /** + * Sets reset_stp_categorisation + * + * @param bool|null $reset_stp_categorisation Reset the STP categorisations for the leave type. *Only applicable for Leave Types with Annual Leave Categories + * + * @return $this + */ + public function setResetStpCategorisation($reset_stp_categorisation) + { + + $this->container['reset_stp_categorisation'] = $reset_stp_categorisation; + + return $this; + } + + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + PayrollAuObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} + + diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayItem.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayItem.php index 42f872e..af6fc52 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayItem.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayItem.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayItems.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayItems.php index 8e6e2e8..221fa05 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayItems.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayItems.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return PayrollAuObjectSerializer::sanitizeForSerialization($this)->PayItems; + $sanitizedObject = PayrollAuObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['PayItems'] = $sanitizedObject->PayItems; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayOutType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayOutType.php new file mode 100644 index 0000000..c91b389 --- /dev/null +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayOutType.php @@ -0,0 +1,68 @@ +PayRuns; + $sanitizedObject = PayrollAuObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['PayRuns'] = $sanitizedObject->PayRuns; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayTemplate.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayTemplate.php index 6711457..a6ae906 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayTemplate.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayTemplate.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PaymentFrequencyType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PaymentFrequencyType.php index b19b496..7fbb1ea 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PaymentFrequencyType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PaymentFrequencyType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayrollCalendar.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayrollCalendar.php index e24e1a6..1674d79 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayrollCalendar.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayrollCalendar.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayrollCalendars.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayrollCalendars.php index 3843eab..1226ada 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayrollCalendars.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayrollCalendars.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return PayrollAuObjectSerializer::sanitizeForSerialization($this)->PayrollCalendars; + $sanitizedObject = PayrollAuObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['PayrollCalendars'] = $sanitizedObject->PayrollCalendars; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/Payslip.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/Payslip.php index 52b4407..aafb7e9 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/Payslip.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/Payslip.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayslipLines.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayslipLines.php index db01b26..b7ed140 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayslipLines.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayslipLines.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayslipObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayslipObject.php index 79376dc..2fb7e81 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayslipObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayslipObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayslipSummary.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayslipSummary.php index e7a4ef8..de1b0c5 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayslipSummary.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/PayslipSummary.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/Payslips.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/Payslips.php index c72f71e..65f5d09 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/Payslips.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/Payslips.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return PayrollAuObjectSerializer::sanitizeForSerialization($this)->Payslips; + $sanitizedObject = PayrollAuObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['Payslips'] = $sanitizedObject->Payslips; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/RateType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/RateType.php index 2664651..d6bfad1 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/RateType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/RateType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/ReimbursementLine.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/ReimbursementLine.php index 37a10d4..50deb11 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/ReimbursementLine.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/ReimbursementLine.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/ReimbursementLines.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/ReimbursementLines.php index 3cf3ece..28cc605 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/ReimbursementLines.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/ReimbursementLines.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -308,7 +308,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return PayrollAuObjectSerializer::sanitizeForSerialization($this)->ReimbursementLines; + $sanitizedObject = PayrollAuObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['ReimbursementLines'] = $sanitizedObject->ReimbursementLines; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/ReimbursementType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/ReimbursementType.php index aa2a6e5..fe10366 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/ReimbursementType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/ReimbursementType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/ResidencyStatus.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/ResidencyStatus.php index a11f9da..3e82223 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/ResidencyStatus.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/ResidencyStatus.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SeniorMaritalStatus.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SeniorMaritalStatus.php index 16133df..da59eb4 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SeniorMaritalStatus.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SeniorMaritalStatus.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/Settings.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/Settings.php index c619ace..f6438be 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/Settings.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/Settings.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SettingsObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SettingsObject.php index b09e11a..87f570d 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SettingsObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SettingsObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SettingsTrackingCategories.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SettingsTrackingCategories.php index 09d3e64..298d9b2 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SettingsTrackingCategories.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SettingsTrackingCategories.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SettingsTrackingCategoriesEmployeeGroups.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SettingsTrackingCategoriesEmployeeGroups.php index bd2401a..de30a1c 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SettingsTrackingCategoriesEmployeeGroups.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SettingsTrackingCategoriesEmployeeGroups.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SettingsTrackingCategoriesTimesheetCategories.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SettingsTrackingCategoriesTimesheetCategories.php index 2ab8e1b..90101ab 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SettingsTrackingCategoriesTimesheetCategories.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SettingsTrackingCategoriesTimesheetCategories.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/State.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/State.php index 874f661..049ec8c 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/State.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/State.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperFund.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperFund.php index e82cd7e..521a905 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperFund.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperFund.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperFundProduct.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperFundProduct.php index ec67f2b..f2ef569 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperFundProduct.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperFundProduct.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperFundProducts.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperFundProducts.php index f7bd4ef..e4bbcf4 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperFundProducts.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperFundProducts.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return PayrollAuObjectSerializer::sanitizeForSerialization($this)->SuperFundProducts; + $sanitizedObject = PayrollAuObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['SuperFundProducts'] = $sanitizedObject->SuperFundProducts; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperFundType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperFundType.php index c307c56..f87ace6 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperFundType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperFundType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperFunds.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperFunds.php index 1328b5b..4b3d3fd 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperFunds.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperFunds.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return PayrollAuObjectSerializer::sanitizeForSerialization($this)->SuperFunds; + $sanitizedObject = PayrollAuObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['SuperFunds'] = $sanitizedObject->SuperFunds; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperLine.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperLine.php index 5cad302..cc06129 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperLine.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperLine.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperMembership.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperMembership.php index e38fa7c..d268257 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperMembership.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperMembership.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperannuationCalculationType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperannuationCalculationType.php index 1908886..2143270 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperannuationCalculationType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperannuationCalculationType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperannuationContributionType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperannuationContributionType.php index 0bb6175..c4c9c21 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperannuationContributionType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperannuationContributionType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperannuationLine.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperannuationLine.php index fb84f63..a1f6ea7 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperannuationLine.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/SuperannuationLine.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/TFNExemptionType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/TFNExemptionType.php index a0bfa8b..911fa07 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/TFNExemptionType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/TFNExemptionType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/TaxDeclaration.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/TaxDeclaration.php index 6a16478..05490f3 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/TaxDeclaration.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/TaxDeclaration.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/TaxLine.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/TaxLine.php index e500e70..2aba124 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/TaxLine.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/TaxLine.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/TaxScaleType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/TaxScaleType.php index 5c65fa4..cc98349 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/TaxScaleType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/TaxScaleType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/Timesheet.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/Timesheet.php index 934103c..824f0df 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/Timesheet.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/Timesheet.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/TimesheetLine.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/TimesheetLine.php index 8dcad8b..d0222f8 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/TimesheetLine.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/TimesheetLine.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/TimesheetObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/TimesheetObject.php index 42f8645..79a19b1 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/TimesheetObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/TimesheetObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/TimesheetStatus.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/TimesheetStatus.php index 07106a0..822c57e 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/TimesheetStatus.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/TimesheetStatus.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/Timesheets.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/Timesheets.php index 6bab52e..59ec899 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/Timesheets.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/Timesheets.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -307,7 +307,16 @@ public function getIterator() #[\ReturnTypeWillChange] public function jsonSerialize() { - return PayrollAuObjectSerializer::sanitizeForSerialization($this)->Timesheets; + $sanitizedObject = PayrollAuObjectSerializer::sanitizeForSerialization($this); + $json = []; + if(isset($sanitizedObject->pagination)){ + $json['pagination'] = $sanitizedObject->pagination; + } + if(isset($sanitizedObject->warnings)){ + $json['warnings'] = $sanitizedObject->warnings; + } + $json['Timesheets'] = $sanitizedObject->Timesheets; + return $json; } /** diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/ValidationError.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/ValidationError.php index aa6fb37..e301142 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/ValidationError.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/ValidationError.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/WorkCondition.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/WorkCondition.php index 1f6b087..5b81cc6 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/WorkCondition.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/WorkCondition.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Account.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Account.php index 6cdc802..8003fda 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Account.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Account.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Accounts.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Accounts.php index 821c7e6..d3328e9 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Accounts.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Accounts.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Address.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Address.php index fd3b661..d0e77d1 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Address.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Address.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/BankAccount.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/BankAccount.php index 297c3ea..4bb05c0 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/BankAccount.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/BankAccount.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Benefit.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Benefit.php index 31494ad..482861f 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Benefit.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Benefit.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/CalendarType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/CalendarType.php index d1dd2cb..6c19c9f 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/CalendarType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/CalendarType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Deduction.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Deduction.php index 3a21a03..bfb6fda 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Deduction.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Deduction.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/DeductionLine.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/DeductionLine.php index 08dcdc7..0941bc6 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/DeductionLine.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/DeductionLine.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/DeductionObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/DeductionObject.php index a451502..bb57ac2 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/DeductionObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/DeductionObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Deductions.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Deductions.php index 8cc4c2c..1262eac 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Deductions.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Deductions.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsLine.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsLine.php index 6d3b10f..3fb1aeb 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsLine.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsLine.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsOrder.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsOrder.php index acf0532..b4373e5 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsOrder.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsOrder.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsOrderObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsOrderObject.php index dc59bf6..7d577e9 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsOrderObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsOrderObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsOrders.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsOrders.php index 4b33e48..0e1dd87 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsOrders.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsOrders.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsRate.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsRate.php index 8653897..30b8eb1 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsRate.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsRate.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsRateObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsRateObject.php index c2f40dd..4d6da55 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsRateObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsRateObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsRates.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsRates.php index 6849bf3..c8fcf52 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsRates.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsRates.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsTemplate.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsTemplate.php index 6b8d90e..3abf192 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsTemplate.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsTemplate.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsTemplateObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsTemplateObject.php index 5e1fedb..94cdc70 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsTemplateObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EarningsTemplateObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Employee.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Employee.php index ed2f066..f14d9ed 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Employee.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Employee.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -75,7 +75,10 @@ class Employee implements ModelInterface, ArrayAccess 'end_date' => '\DateTime', 'payroll_calendar_id' => 'string', 'updated_date_utc' => '\DateTime', - 'created_date_utc' => '\DateTime' + 'created_date_utc' => '\DateTime', + 'job_title' => 'string', + 'engagement_type' => 'string', + 'fixed_term_end_date' => '\DateTime' ]; /** @@ -97,7 +100,10 @@ class Employee implements ModelInterface, ArrayAccess 'end_date' => 'date', 'payroll_calendar_id' => 'uuid', 'updated_date_utc' => 'date-time', - 'created_date_utc' => 'date-time' + 'created_date_utc' => 'date-time', + 'job_title' => null, + 'engagement_type' => null, + 'fixed_term_end_date' => 'date' ]; /** @@ -140,7 +146,10 @@ public static function openAPIFormats() 'end_date' => 'endDate', 'payroll_calendar_id' => 'payrollCalendarID', 'updated_date_utc' => 'updatedDateUTC', - 'created_date_utc' => 'createdDateUTC' + 'created_date_utc' => 'createdDateUTC', + 'job_title' => 'jobTitle', + 'engagement_type' => 'engagementType', + 'fixed_term_end_date' => 'fixedTermEndDate' ]; /** @@ -162,7 +171,10 @@ public static function openAPIFormats() 'end_date' => 'setEndDate', 'payroll_calendar_id' => 'setPayrollCalendarId', 'updated_date_utc' => 'setUpdatedDateUtc', - 'created_date_utc' => 'setCreatedDateUtc' + 'created_date_utc' => 'setCreatedDateUtc', + 'job_title' => 'setJobTitle', + 'engagement_type' => 'setEngagementType', + 'fixed_term_end_date' => 'setFixedTermEndDate' ]; /** @@ -184,7 +196,10 @@ public static function openAPIFormats() 'end_date' => 'getEndDate', 'payroll_calendar_id' => 'getPayrollCalendarId', 'updated_date_utc' => 'getUpdatedDateUtc', - 'created_date_utc' => 'getCreatedDateUtc' + 'created_date_utc' => 'getCreatedDateUtc', + 'job_title' => 'getJobTitle', + 'engagement_type' => 'getEngagementType', + 'fixed_term_end_date' => 'getFixedTermEndDate' ]; /** @@ -276,6 +291,9 @@ public function __construct(array $data = null) $this->container['payroll_calendar_id'] = isset($data['payroll_calendar_id']) ? $data['payroll_calendar_id'] : null; $this->container['updated_date_utc'] = isset($data['updated_date_utc']) ? $data['updated_date_utc'] : null; $this->container['created_date_utc'] = isset($data['created_date_utc']) ? $data['created_date_utc'] : null; + $this->container['job_title'] = isset($data['job_title']) ? $data['job_title'] : null; + $this->container['engagement_type'] = isset($data['engagement_type']) ? $data['engagement_type'] : null; + $this->container['fixed_term_end_date'] = isset($data['fixed_term_end_date']) ? $data['fixed_term_end_date'] : null; } /** @@ -696,6 +714,87 @@ public function setCreatedDateUtc($created_date_utc) } + + /** + * Gets job_title + * + * @return string|null + */ + public function getJobTitle() + { + return $this->container['job_title']; + } + + /** + * Sets job_title + * + * @param string|null $job_title Employee's job title + * + * @return $this + */ + public function setJobTitle($job_title) + { + + $this->container['job_title'] = $job_title; + + return $this; + } + + + + /** + * Gets engagement_type + * + * @return string|null + */ + public function getEngagementType() + { + return $this->container['engagement_type']; + } + + /** + * Sets engagement_type + * + * @param string|null $engagement_type Engagement type of the employee + * + * @return $this + */ + public function setEngagementType($engagement_type) + { + + $this->container['engagement_type'] = $engagement_type; + + return $this; + } + + + + /** + * Gets fixed_term_end_date + * + * @return \DateTime|null + */ + public function getFixedTermEndDate() + { + return $this->container['fixed_term_end_date']; + } + + /** + * Sets fixed_term_end_date + * + * @param \DateTime|null $fixed_term_end_date End date for an employee with a fixed-term engagement type + * + * @return $this + */ + public function setFixedTermEndDate($fixed_term_end_date) + { + + $this->container['fixed_term_end_date'] = $fixed_term_end_date; + + return $this; + } + + /** * Returns true if offset exists. False otherwise. * diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeEarningsTemplates.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeEarningsTemplates.php index d6165bd..e41d8bb 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeEarningsTemplates.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeEarningsTemplates.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeave.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeave.php index 78c7ff7..d5e7d4c 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeave.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeave.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaveBalance.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaveBalance.php index 5f7ebf3..849e2cb 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaveBalance.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaveBalance.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaveBalances.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaveBalances.php index 72410ec..b4babf9 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaveBalances.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaveBalances.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaveObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaveObject.php index cc84de5..a5cf74e 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaveObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaveObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaveSetup.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaveSetup.php index d1b21c1..4f87e94 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaveSetup.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaveSetup.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -68,7 +68,9 @@ class EmployeeLeaveSetup implements ModelInterface, ArrayAccess 'negative_annual_leave_balance_paid_amount' => 'double', 'sick_leave_hours_to_accrue_annually' => 'double', 'sick_leave_maximum_hours_to_accrue' => 'double', - 'sick_leave_opening_balance' => 'double' + 'sick_leave_opening_balance' => 'double', + 'sick_leave_schedule_of_accrual' => 'string', + 'sick_leave_anniversary_date' => '\DateTime' ]; /** @@ -83,7 +85,9 @@ class EmployeeLeaveSetup implements ModelInterface, ArrayAccess 'negative_annual_leave_balance_paid_amount' => 'double', 'sick_leave_hours_to_accrue_annually' => 'double', 'sick_leave_maximum_hours_to_accrue' => 'double', - 'sick_leave_opening_balance' => 'double' + 'sick_leave_opening_balance' => 'double', + 'sick_leave_schedule_of_accrual' => null, + 'sick_leave_anniversary_date' => 'date' ]; /** @@ -119,7 +123,9 @@ public static function openAPIFormats() 'negative_annual_leave_balance_paid_amount' => 'negativeAnnualLeaveBalancePaidAmount', 'sick_leave_hours_to_accrue_annually' => 'sickLeaveHoursToAccrueAnnually', 'sick_leave_maximum_hours_to_accrue' => 'sickLeaveMaximumHoursToAccrue', - 'sick_leave_opening_balance' => 'sickLeaveOpeningBalance' + 'sick_leave_opening_balance' => 'sickLeaveOpeningBalance', + 'sick_leave_schedule_of_accrual' => 'SickLeaveScheduleOfAccrual', + 'sick_leave_anniversary_date' => 'SickLeaveAnniversaryDate' ]; /** @@ -134,7 +140,9 @@ public static function openAPIFormats() 'negative_annual_leave_balance_paid_amount' => 'setNegativeAnnualLeaveBalancePaidAmount', 'sick_leave_hours_to_accrue_annually' => 'setSickLeaveHoursToAccrueAnnually', 'sick_leave_maximum_hours_to_accrue' => 'setSickLeaveMaximumHoursToAccrue', - 'sick_leave_opening_balance' => 'setSickLeaveOpeningBalance' + 'sick_leave_opening_balance' => 'setSickLeaveOpeningBalance', + 'sick_leave_schedule_of_accrual' => 'setSickLeaveScheduleOfAccrual', + 'sick_leave_anniversary_date' => 'setSickLeaveAnniversaryDate' ]; /** @@ -149,7 +157,9 @@ public static function openAPIFormats() 'negative_annual_leave_balance_paid_amount' => 'getNegativeAnnualLeaveBalancePaidAmount', 'sick_leave_hours_to_accrue_annually' => 'getSickLeaveHoursToAccrueAnnually', 'sick_leave_maximum_hours_to_accrue' => 'getSickLeaveMaximumHoursToAccrue', - 'sick_leave_opening_balance' => 'getSickLeaveOpeningBalance' + 'sick_leave_opening_balance' => 'getSickLeaveOpeningBalance', + 'sick_leave_schedule_of_accrual' => 'getSickLeaveScheduleOfAccrual', + 'sick_leave_anniversary_date' => 'getSickLeaveAnniversaryDate' ]; /** @@ -219,6 +229,8 @@ public function __construct(array $data = null) $this->container['sick_leave_hours_to_accrue_annually'] = isset($data['sick_leave_hours_to_accrue_annually']) ? $data['sick_leave_hours_to_accrue_annually'] : null; $this->container['sick_leave_maximum_hours_to_accrue'] = isset($data['sick_leave_maximum_hours_to_accrue']) ? $data['sick_leave_maximum_hours_to_accrue'] : null; $this->container['sick_leave_opening_balance'] = isset($data['sick_leave_opening_balance']) ? $data['sick_leave_opening_balance'] : null; + $this->container['sick_leave_schedule_of_accrual'] = isset($data['sick_leave_schedule_of_accrual']) ? $data['sick_leave_schedule_of_accrual'] : null; + $this->container['sick_leave_anniversary_date'] = isset($data['sick_leave_anniversary_date']) ? $data['sick_leave_anniversary_date'] : null; } /** @@ -433,6 +445,60 @@ public function setSickLeaveOpeningBalance($sick_leave_opening_balance) } + + /** + * Gets sick_leave_schedule_of_accrual + * + * @return string|null + */ + public function getSickLeaveScheduleOfAccrual() + { + return $this->container['sick_leave_schedule_of_accrual']; + } + + /** + * Sets sick_leave_schedule_of_accrual + * + * @param string|null $sick_leave_schedule_of_accrual Set Schedule of Accrual Type for Sick Leave + * + * @return $this + */ + public function setSickLeaveScheduleOfAccrual($sick_leave_schedule_of_accrual) + { + + $this->container['sick_leave_schedule_of_accrual'] = $sick_leave_schedule_of_accrual; + + return $this; + } + + + + /** + * Gets sick_leave_anniversary_date + * + * @return \DateTime|null + */ + public function getSickLeaveAnniversaryDate() + { + return $this->container['sick_leave_anniversary_date']; + } + + /** + * Sets sick_leave_anniversary_date + * + * @param \DateTime|null $sick_leave_anniversary_date If Sick Leave Schedule of Accrual is \"OnAnniversaryDate\", this is the date when entitled to Sick Leave + * + * @return $this + */ + public function setSickLeaveAnniversaryDate($sick_leave_anniversary_date) + { + + $this->container['sick_leave_anniversary_date'] = $sick_leave_anniversary_date; + + return $this; + } + + /** * Returns true if offset exists. False otherwise. * diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaveSetupObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaveSetupObject.php index c4e4ad3..d2fd47d 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaveSetupObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaveSetupObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaveType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaveType.php index 028d007..1163e84 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaveType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaveType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -71,7 +71,8 @@ class EmployeeLeaveType implements ModelInterface, ArrayAccess 'percentage_of_gross_earnings' => 'double', 'include_holiday_pay_every_pay' => 'bool', 'show_annual_leave_in_advance' => 'bool', - 'annual_leave_total_amount_paid' => 'double' + 'annual_leave_total_amount_paid' => 'double', + 'schedule_of_accrual_date' => '\DateTime' ]; /** @@ -89,7 +90,8 @@ class EmployeeLeaveType implements ModelInterface, ArrayAccess 'percentage_of_gross_earnings' => 'double', 'include_holiday_pay_every_pay' => null, 'show_annual_leave_in_advance' => null, - 'annual_leave_total_amount_paid' => 'double' + 'annual_leave_total_amount_paid' => 'double', + 'schedule_of_accrual_date' => 'date' ]; /** @@ -128,7 +130,8 @@ public static function openAPIFormats() 'percentage_of_gross_earnings' => 'percentageOfGrossEarnings', 'include_holiday_pay_every_pay' => 'includeHolidayPayEveryPay', 'show_annual_leave_in_advance' => 'showAnnualLeaveInAdvance', - 'annual_leave_total_amount_paid' => 'annualLeaveTotalAmountPaid' + 'annual_leave_total_amount_paid' => 'annualLeaveTotalAmountPaid', + 'schedule_of_accrual_date' => 'scheduleOfAccrualDate' ]; /** @@ -146,7 +149,8 @@ public static function openAPIFormats() 'percentage_of_gross_earnings' => 'setPercentageOfGrossEarnings', 'include_holiday_pay_every_pay' => 'setIncludeHolidayPayEveryPay', 'show_annual_leave_in_advance' => 'setShowAnnualLeaveInAdvance', - 'annual_leave_total_amount_paid' => 'setAnnualLeaveTotalAmountPaid' + 'annual_leave_total_amount_paid' => 'setAnnualLeaveTotalAmountPaid', + 'schedule_of_accrual_date' => 'setScheduleOfAccrualDate' ]; /** @@ -164,7 +168,8 @@ public static function openAPIFormats() 'percentage_of_gross_earnings' => 'getPercentageOfGrossEarnings', 'include_holiday_pay_every_pay' => 'getIncludeHolidayPayEveryPay', 'show_annual_leave_in_advance' => 'getShowAnnualLeaveInAdvance', - 'annual_leave_total_amount_paid' => 'getAnnualLeaveTotalAmountPaid' + 'annual_leave_total_amount_paid' => 'getAnnualLeaveTotalAmountPaid', + 'schedule_of_accrual_date' => 'getScheduleOfAccrualDate' ]; /** @@ -256,6 +261,7 @@ public function __construct(array $data = null) $this->container['include_holiday_pay_every_pay'] = isset($data['include_holiday_pay_every_pay']) ? $data['include_holiday_pay_every_pay'] : null; $this->container['show_annual_leave_in_advance'] = isset($data['show_annual_leave_in_advance']) ? $data['show_annual_leave_in_advance'] : null; $this->container['annual_leave_total_amount_paid'] = isset($data['annual_leave_total_amount_paid']) ? $data['annual_leave_total_amount_paid'] : null; + $this->container['schedule_of_accrual_date'] = isset($data['schedule_of_accrual_date']) ? $data['schedule_of_accrual_date'] : null; } /** @@ -568,6 +574,33 @@ public function setAnnualLeaveTotalAmountPaid($annual_leave_total_amount_paid) } + + /** + * Gets schedule_of_accrual_date + * + * @return \DateTime|null + */ + public function getScheduleOfAccrualDate() + { + return $this->container['schedule_of_accrual_date']; + } + + /** + * Sets schedule_of_accrual_date + * + * @param \DateTime|null $schedule_of_accrual_date The date when an employee becomes entitled to their accrual. + * + * @return $this + */ + public function setScheduleOfAccrualDate($schedule_of_accrual_date) + { + + $this->container['schedule_of_accrual_date'] = $schedule_of_accrual_date; + + return $this; + } + + /** * Returns true if offset exists. False otherwise. * diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaveTypeObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaveTypeObject.php index 17157eb..9580c34 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaveTypeObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaveTypeObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaveTypes.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaveTypes.php index 5fd2c4e..f3b4570 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaveTypes.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaveTypes.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaves.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaves.php index 63bc004..2f0cd11 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaves.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeLeaves.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeObject.php index 089d2f1..5c1a6d4 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeOpeningBalance.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeOpeningBalance.php index e5dc66e..61f0e91 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeOpeningBalance.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeOpeningBalance.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeOpeningBalancesObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeOpeningBalancesObject.php index c979464..515149a 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeOpeningBalancesObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeOpeningBalancesObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeePayTemplate.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeePayTemplate.php index 93c923d..e11eafb 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeePayTemplate.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeePayTemplate.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeePayTemplateObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeePayTemplateObject.php index c4030f0..24ae94e 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeePayTemplateObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeePayTemplateObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeePayTemplates.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeePayTemplates.php index d9738fb..7845905 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeePayTemplates.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeePayTemplates.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeStatutoryLeaveBalance.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeStatutoryLeaveBalance.php index f35db64..6edcff0 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeStatutoryLeaveBalance.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeStatutoryLeaveBalance.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeStatutoryLeaveBalanceObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeStatutoryLeaveBalanceObject.php index 335e41e..5fea995 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeStatutoryLeaveBalanceObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeStatutoryLeaveBalanceObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeStatutoryLeaveSummary.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeStatutoryLeaveSummary.php index c7dd8a4..aa9f910 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeStatutoryLeaveSummary.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeStatutoryLeaveSummary.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeStatutoryLeavesSummaries.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeStatutoryLeavesSummaries.php index 1761cdb..c67247d 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeStatutoryLeavesSummaries.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeStatutoryLeavesSummaries.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeStatutorySickLeave.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeStatutorySickLeave.php index 0041427..b96fe30 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeStatutorySickLeave.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeStatutorySickLeave.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeStatutorySickLeaveObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeStatutorySickLeaveObject.php index ed66e18..f526ced 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeStatutorySickLeaveObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeStatutorySickLeaveObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeStatutorySickLeaves.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeStatutorySickLeaves.php index 257c51c..6b0a010 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeStatutorySickLeaves.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeStatutorySickLeaves.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeTax.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeTax.php index 7c0a97f..6bd52ed 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeTax.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeTax.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeTaxObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeTaxObject.php index 9014e4b..807309b 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeTaxObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeTaxObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeWorkingPattern.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeWorkingPattern.php new file mode 100644 index 0000000..c2440b9 --- /dev/null +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeWorkingPattern.php @@ -0,0 +1,348 @@ + 'string', + 'effective_from' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'payee_working_pattern_id' => 'uuid', + 'effective_from' => 'date' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'payee_working_pattern_id' => 'payeeWorkingPatternID', + 'effective_from' => 'effectiveFrom' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'payee_working_pattern_id' => 'setPayeeWorkingPatternId', + 'effective_from' => 'setEffectiveFrom' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'payee_working_pattern_id' => 'getPayeeWorkingPatternId', + 'effective_from' => 'getEffectiveFrom' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['payee_working_pattern_id'] = isset($data['payee_working_pattern_id']) ? $data['payee_working_pattern_id'] : null; + $this->container['effective_from'] = isset($data['effective_from']) ? $data['effective_from'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['payee_working_pattern_id'] === null) { + $invalidProperties[] = "'payee_working_pattern_id' can't be null"; + } + if ($this->container['effective_from'] === null) { + $invalidProperties[] = "'effective_from' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payee_working_pattern_id + * + * @return string + */ + public function getPayeeWorkingPatternId() + { + return $this->container['payee_working_pattern_id']; + } + + /** + * Sets payee_working_pattern_id + * + * @param string $payee_working_pattern_id The Xero identifier for for Employee working pattern + * + * @return $this + */ + public function setPayeeWorkingPatternId($payee_working_pattern_id) + { + + $this->container['payee_working_pattern_id'] = $payee_working_pattern_id; + + return $this; + } + + + + /** + * Gets effective_from + * + * @return \DateTime + */ + public function getEffectiveFrom() + { + return $this->container['effective_from']; + } + + /** + * Sets effective_from + * + * @param \DateTime $effective_from The effective date of the corresponding salary and wages + * + * @return $this + */ + public function setEffectiveFrom($effective_from) + { + + $this->container['effective_from'] = $effective_from; + + return $this; + } + + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + PayrollNzObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} + + diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeWorkingPatternWithWorkingWeeks.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeWorkingPatternWithWorkingWeeks.php new file mode 100644 index 0000000..f388bc9 --- /dev/null +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeWorkingPatternWithWorkingWeeks.php @@ -0,0 +1,381 @@ + 'string', + 'effective_from' => '\DateTime', + 'working_weeks' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\WorkingWeek[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'payee_working_pattern_id' => 'uuid', + 'effective_from' => 'date', + 'working_weeks' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'payee_working_pattern_id' => 'payeeWorkingPatternID', + 'effective_from' => 'effectiveFrom', + 'working_weeks' => 'workingWeeks' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'payee_working_pattern_id' => 'setPayeeWorkingPatternId', + 'effective_from' => 'setEffectiveFrom', + 'working_weeks' => 'setWorkingWeeks' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'payee_working_pattern_id' => 'getPayeeWorkingPatternId', + 'effective_from' => 'getEffectiveFrom', + 'working_weeks' => 'getWorkingWeeks' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['payee_working_pattern_id'] = isset($data['payee_working_pattern_id']) ? $data['payee_working_pattern_id'] : null; + $this->container['effective_from'] = isset($data['effective_from']) ? $data['effective_from'] : null; + $this->container['working_weeks'] = isset($data['working_weeks']) ? $data['working_weeks'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['payee_working_pattern_id'] === null) { + $invalidProperties[] = "'payee_working_pattern_id' can't be null"; + } + if ($this->container['effective_from'] === null) { + $invalidProperties[] = "'effective_from' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets payee_working_pattern_id + * + * @return string + */ + public function getPayeeWorkingPatternId() + { + return $this->container['payee_working_pattern_id']; + } + + /** + * Sets payee_working_pattern_id + * + * @param string $payee_working_pattern_id The Xero identifier for for Employee working pattern + * + * @return $this + */ + public function setPayeeWorkingPatternId($payee_working_pattern_id) + { + + $this->container['payee_working_pattern_id'] = $payee_working_pattern_id; + + return $this; + } + + + + /** + * Gets effective_from + * + * @return \DateTime + */ + public function getEffectiveFrom() + { + return $this->container['effective_from']; + } + + /** + * Sets effective_from + * + * @param \DateTime $effective_from The effective date of the corresponding salary and wages + * + * @return $this + */ + public function setEffectiveFrom($effective_from) + { + + $this->container['effective_from'] = $effective_from; + + return $this; + } + + + + /** + * Gets working_weeks + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\WorkingWeek[]|null + */ + public function getWorkingWeeks() + { + return $this->container['working_weeks']; + } + + /** + * Sets working_weeks + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\WorkingWeek[]|null $working_weeks working_weeks + * + * @return $this + */ + public function setWorkingWeeks($working_weeks) + { + + $this->container['working_weeks'] = $working_weeks; + + return $this; + } + + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + PayrollNzObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} + + diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeWorkingPatternWithWorkingWeeksObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeWorkingPatternWithWorkingWeeksObject.php new file mode 100644 index 0000000..36c06b6 --- /dev/null +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeWorkingPatternWithWorkingWeeksObject.php @@ -0,0 +1,375 @@ + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Pagination', + 'problem' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem', + 'payee_working_pattern' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPatternWithWorkingWeeks' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'pagination' => null, + 'problem' => null, + 'payee_working_pattern' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'pagination' => 'pagination', + 'problem' => 'problem', + 'payee_working_pattern' => 'payeeWorkingPattern' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'pagination' => 'setPagination', + 'problem' => 'setProblem', + 'payee_working_pattern' => 'setPayeeWorkingPattern' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'pagination' => 'getPagination', + 'problem' => 'getProblem', + 'payee_working_pattern' => 'getPayeeWorkingPattern' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['pagination'] = isset($data['pagination']) ? $data['pagination'] : null; + $this->container['problem'] = isset($data['problem']) ? $data['problem'] : null; + $this->container['payee_working_pattern'] = isset($data['payee_working_pattern']) ? $data['payee_working_pattern'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets pagination + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Pagination|null + */ + public function getPagination() + { + return $this->container['pagination']; + } + + /** + * Sets pagination + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Pagination|null $pagination pagination + * + * @return $this + */ + public function setPagination($pagination) + { + + $this->container['pagination'] = $pagination; + + return $this; + } + + + + /** + * Gets problem + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem|null + */ + public function getProblem() + { + return $this->container['problem']; + } + + /** + * Sets problem + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem|null $problem problem + * + * @return $this + */ + public function setProblem($problem) + { + + $this->container['problem'] = $problem; + + return $this; + } + + + + /** + * Gets payee_working_pattern + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPatternWithWorkingWeeks|null + */ + public function getPayeeWorkingPattern() + { + return $this->container['payee_working_pattern']; + } + + /** + * Sets payee_working_pattern + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPatternWithWorkingWeeks|null $payee_working_pattern payee_working_pattern + * + * @return $this + */ + public function setPayeeWorkingPattern($payee_working_pattern) + { + + $this->container['payee_working_pattern'] = $payee_working_pattern; + + return $this; + } + + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + PayrollNzObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} + + diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeWorkingPatternWithWorkingWeeksRequest.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeWorkingPatternWithWorkingWeeksRequest.php new file mode 100644 index 0000000..db507e5 --- /dev/null +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeWorkingPatternWithWorkingWeeksRequest.php @@ -0,0 +1,348 @@ + '\DateTime', + 'working_weeks' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\WorkingWeek[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'effective_from' => 'date', + 'working_weeks' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'effective_from' => 'effectiveFrom', + 'working_weeks' => 'workingWeeks' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'effective_from' => 'setEffectiveFrom', + 'working_weeks' => 'setWorkingWeeks' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'effective_from' => 'getEffectiveFrom', + 'working_weeks' => 'getWorkingWeeks' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['effective_from'] = isset($data['effective_from']) ? $data['effective_from'] : null; + $this->container['working_weeks'] = isset($data['working_weeks']) ? $data['working_weeks'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['effective_from'] === null) { + $invalidProperties[] = "'effective_from' can't be null"; + } + if ($this->container['working_weeks'] === null) { + $invalidProperties[] = "'working_weeks' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets effective_from + * + * @return \DateTime + */ + public function getEffectiveFrom() + { + return $this->container['effective_from']; + } + + /** + * Sets effective_from + * + * @param \DateTime $effective_from The effective date of the corresponding salary and wages + * + * @return $this + */ + public function setEffectiveFrom($effective_from) + { + + $this->container['effective_from'] = $effective_from; + + return $this; + } + + + + /** + * Gets working_weeks + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\WorkingWeek[] + */ + public function getWorkingWeeks() + { + return $this->container['working_weeks']; + } + + /** + * Sets working_weeks + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\WorkingWeek[] $working_weeks working_weeks + * + * @return $this + */ + public function setWorkingWeeks($working_weeks) + { + + $this->container['working_weeks'] = $working_weeks; + + return $this; + } + + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + PayrollNzObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} + + diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeWorkingPatternsObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeWorkingPatternsObject.php new file mode 100644 index 0000000..40d05d4 --- /dev/null +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmployeeWorkingPatternsObject.php @@ -0,0 +1,375 @@ + '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Pagination', + 'problem' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem', + 'payee_working_patterns' => '\Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPattern[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'pagination' => null, + 'problem' => null, + 'payee_working_patterns' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'pagination' => 'pagination', + 'problem' => 'problem', + 'payee_working_patterns' => 'payeeWorkingPatterns' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'pagination' => 'setPagination', + 'problem' => 'setProblem', + 'payee_working_patterns' => 'setPayeeWorkingPatterns' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'pagination' => 'getPagination', + 'problem' => 'getProblem', + 'payee_working_patterns' => 'getPayeeWorkingPatterns' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['pagination'] = isset($data['pagination']) ? $data['pagination'] : null; + $this->container['problem'] = isset($data['problem']) ? $data['problem'] : null; + $this->container['payee_working_patterns'] = isset($data['payee_working_patterns']) ? $data['payee_working_patterns'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets pagination + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Pagination|null + */ + public function getPagination() + { + return $this->container['pagination']; + } + + /** + * Sets pagination + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Pagination|null $pagination pagination + * + * @return $this + */ + public function setPagination($pagination) + { + + $this->container['pagination'] = $pagination; + + return $this; + } + + + + /** + * Gets problem + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem|null + */ + public function getProblem() + { + return $this->container['problem']; + } + + /** + * Sets problem + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\Problem|null $problem problem + * + * @return $this + */ + public function setProblem($problem) + { + + $this->container['problem'] = $problem; + + return $this; + } + + + + /** + * Gets payee_working_patterns + * + * @return \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPattern[]|null + */ + public function getPayeeWorkingPatterns() + { + return $this->container['payee_working_patterns']; + } + + /** + * Sets payee_working_patterns + * + * @param \Automattic\WooCommerce\Xero\Vendor\XeroAPI\XeroPHP\Models\PayrollNz\EmployeeWorkingPattern[]|null $payee_working_patterns payee_working_patterns + * + * @return $this + */ + public function setPayeeWorkingPatterns($payee_working_patterns) + { + + $this->container['payee_working_patterns'] = $payee_working_patterns; + + return $this; + } + + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + PayrollNzObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} + + diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Employees.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Employees.php index cb66b71..b5e6e81 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Employees.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Employees.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Employment.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Employment.php index 520be10..e578dca 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Employment.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Employment.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -64,7 +64,9 @@ class Employment implements ModelInterface, ArrayAccess protected static $openAPITypes = [ 'payroll_calendar_id' => 'string', 'pay_run_calendar_id' => 'string', - 'start_date' => '\DateTime' + 'start_date' => '\DateTime', + 'engagement_type' => 'string', + 'fixed_term_end_date' => '\DateTime' ]; /** @@ -75,7 +77,9 @@ class Employment implements ModelInterface, ArrayAccess protected static $openAPIFormats = [ 'payroll_calendar_id' => 'uuid', 'pay_run_calendar_id' => 'uuid', - 'start_date' => 'date' + 'start_date' => 'date', + 'engagement_type' => null, + 'fixed_term_end_date' => 'date' ]; /** @@ -107,7 +111,9 @@ public static function openAPIFormats() protected static $attributeMap = [ 'payroll_calendar_id' => 'payrollCalendarID', 'pay_run_calendar_id' => 'payRunCalendarID', - 'start_date' => 'startDate' + 'start_date' => 'startDate', + 'engagement_type' => 'engagementType', + 'fixed_term_end_date' => 'fixedTermEndDate' ]; /** @@ -118,7 +124,9 @@ public static function openAPIFormats() protected static $setters = [ 'payroll_calendar_id' => 'setPayrollCalendarId', 'pay_run_calendar_id' => 'setPayRunCalendarId', - 'start_date' => 'setStartDate' + 'start_date' => 'setStartDate', + 'engagement_type' => 'setEngagementType', + 'fixed_term_end_date' => 'setFixedTermEndDate' ]; /** @@ -129,7 +137,9 @@ public static function openAPIFormats() protected static $getters = [ 'payroll_calendar_id' => 'getPayrollCalendarId', 'pay_run_calendar_id' => 'getPayRunCalendarId', - 'start_date' => 'getStartDate' + 'start_date' => 'getStartDate', + 'engagement_type' => 'getEngagementType', + 'fixed_term_end_date' => 'getFixedTermEndDate' ]; /** @@ -195,6 +205,8 @@ public function __construct(array $data = null) $this->container['payroll_calendar_id'] = isset($data['payroll_calendar_id']) ? $data['payroll_calendar_id'] : null; $this->container['pay_run_calendar_id'] = isset($data['pay_run_calendar_id']) ? $data['pay_run_calendar_id'] : null; $this->container['start_date'] = isset($data['start_date']) ? $data['start_date'] : null; + $this->container['engagement_type'] = isset($data['engagement_type']) ? $data['engagement_type'] : null; + $this->container['fixed_term_end_date'] = isset($data['fixed_term_end_date']) ? $data['fixed_term_end_date'] : null; } /** @@ -301,6 +313,60 @@ public function setStartDate($start_date) } + + /** + * Gets engagement_type + * + * @return string|null + */ + public function getEngagementType() + { + return $this->container['engagement_type']; + } + + /** + * Sets engagement_type + * + * @param string|null $engagement_type Engagement type of the employee + * + * @return $this + */ + public function setEngagementType($engagement_type) + { + + $this->container['engagement_type'] = $engagement_type; + + return $this; + } + + + + /** + * Gets fixed_term_end_date + * + * @return \DateTime|null + */ + public function getFixedTermEndDate() + { + return $this->container['fixed_term_end_date']; + } + + /** + * Sets fixed_term_end_date + * + * @param \DateTime|null $fixed_term_end_date End date for an employee with a fixed-term engagement type + * + * @return $this + */ + public function setFixedTermEndDate($fixed_term_end_date) + { + + $this->container['fixed_term_end_date'] = $fixed_term_end_date; + + return $this; + } + + /** * Returns true if offset exists. False otherwise. * diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmploymentObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmploymentObject.php index 07fd684..d788d47 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmploymentObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/EmploymentObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/GrossEarningsHistory.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/GrossEarningsHistory.php index 625b21c..8e98fc6 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/GrossEarningsHistory.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/GrossEarningsHistory.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/InvalidField.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/InvalidField.php index d332b8a..404c2c1 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/InvalidField.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/InvalidField.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/LeaveAccrualLine.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/LeaveAccrualLine.php index 13f7163..d0e9af2 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/LeaveAccrualLine.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/LeaveAccrualLine.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/LeaveEarningsLine.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/LeaveEarningsLine.php index 1586722..3585848 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/LeaveEarningsLine.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/LeaveEarningsLine.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/LeavePeriod.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/LeavePeriod.php index 2371e20..2f43bff 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/LeavePeriod.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/LeavePeriod.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/LeavePeriods.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/LeavePeriods.php index 0897242..d6e0a37 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/LeavePeriods.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/LeavePeriods.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/LeaveType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/LeaveType.php index 0f20f4e..253e6a1 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/LeaveType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/LeaveType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/LeaveTypeObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/LeaveTypeObject.php index e3bb451..7ba9b1b 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/LeaveTypeObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/LeaveTypeObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/LeaveTypes.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/LeaveTypes.php index 0e16496..9c324c7 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/LeaveTypes.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/LeaveTypes.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/ModelInterface.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/ModelInterface.php index 51b6ac3..54094a9 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/ModelInterface.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/ModelInterface.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Pagination.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Pagination.php index d279a4c..31ca328 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Pagination.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Pagination.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PayRun.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PayRun.php index 31f2383..05052dd 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PayRun.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PayRun.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PayRunCalendar.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PayRunCalendar.php index 22e40f0..4f2890b 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PayRunCalendar.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PayRunCalendar.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PayRunCalendarObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PayRunCalendarObject.php index 7724b4e..58cecf4 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PayRunCalendarObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PayRunCalendarObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PayRunCalendars.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PayRunCalendars.php index ad2120c..4ea6da1 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PayRunCalendars.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PayRunCalendars.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PayRunObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PayRunObject.php index aa5f369..610ebdf 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PayRunObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PayRunObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PayRuns.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PayRuns.php index 71b2e93..4a5efb4 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PayRuns.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PayRuns.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PaySlip.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PaySlip.php index eb072ce..1465698 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PaySlip.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PaySlip.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PaySlipObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PaySlipObject.php index 3811a4c..4a2917b 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PaySlipObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PaySlipObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PaySlips.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PaySlips.php index bd0e72b..2ae44ee 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PaySlips.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PaySlips.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PaymentLine.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PaymentLine.php index a0f11b5..bee1a10 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PaymentLine.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PaymentLine.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PaymentMethod.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PaymentMethod.php index f2a9666..4d4921e 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PaymentMethod.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PaymentMethod.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PaymentMethodObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PaymentMethodObject.php index 9b587ad..ff42d62 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PaymentMethodObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/PaymentMethodObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Problem.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Problem.php index 336fcc3..909a95b 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Problem.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Problem.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Reimbursement.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Reimbursement.php index 8715ade..141858d 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Reimbursement.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Reimbursement.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/ReimbursementLine.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/ReimbursementLine.php index a85837c..36bc36a 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/ReimbursementLine.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/ReimbursementLine.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/ReimbursementObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/ReimbursementObject.php index 9893146..a0b0539 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/ReimbursementObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/ReimbursementObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Reimbursements.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Reimbursements.php index 6ad6755..47481fb 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Reimbursements.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Reimbursements.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/SalaryAndWage.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/SalaryAndWage.php index c8e7ea6..98e7b6a 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/SalaryAndWage.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/SalaryAndWage.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -71,7 +71,8 @@ class SalaryAndWage implements ModelInterface, ArrayAccess 'effective_from' => '\DateTime', 'annual_salary' => 'double', 'status' => 'string', - 'payment_type' => 'string' + 'payment_type' => 'string', + 'work_pattern_type' => 'string' ]; /** @@ -89,7 +90,8 @@ class SalaryAndWage implements ModelInterface, ArrayAccess 'effective_from' => 'date', 'annual_salary' => 'double', 'status' => null, - 'payment_type' => null + 'payment_type' => null, + 'work_pattern_type' => null ]; /** @@ -128,7 +130,8 @@ public static function openAPIFormats() 'effective_from' => 'effectiveFrom', 'annual_salary' => 'annualSalary', 'status' => 'status', - 'payment_type' => 'paymentType' + 'payment_type' => 'paymentType', + 'work_pattern_type' => 'workPatternType' ]; /** @@ -146,7 +149,8 @@ public static function openAPIFormats() 'effective_from' => 'setEffectiveFrom', 'annual_salary' => 'setAnnualSalary', 'status' => 'setStatus', - 'payment_type' => 'setPaymentType' + 'payment_type' => 'setPaymentType', + 'work_pattern_type' => 'setWorkPatternType' ]; /** @@ -164,7 +168,8 @@ public static function openAPIFormats() 'effective_from' => 'getEffectiveFrom', 'annual_salary' => 'getAnnualSalary', 'status' => 'getStatus', - 'payment_type' => 'getPaymentType' + 'payment_type' => 'getPaymentType', + 'work_pattern_type' => 'getWorkPatternType' ]; /** @@ -213,6 +218,8 @@ public function getModelName() const STATUS_HISTORY = 'History'; const PAYMENT_TYPE_SALARY = 'Salary'; const PAYMENT_TYPE_HOURLY = 'Hourly'; + const WORK_PATTERN_TYPE_DAYS_AND_HOURS = 'DaysAndHours'; + const WORK_PATTERN_TYPE_REGULAR_WEEK = 'RegularWeek'; @@ -243,6 +250,19 @@ public function getPaymentTypeAllowableValues() ]; } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getWorkPatternTypeAllowableValues() + { + return [ + self::WORK_PATTERN_TYPE_DAYS_AND_HOURS, + self::WORK_PATTERN_TYPE_REGULAR_WEEK, + ]; + } + /** * Associative array for storing property values @@ -269,6 +289,7 @@ public function __construct(array $data = null) $this->container['annual_salary'] = isset($data['annual_salary']) ? $data['annual_salary'] : null; $this->container['status'] = isset($data['status']) ? $data['status'] : null; $this->container['payment_type'] = isset($data['payment_type']) ? $data['payment_type'] : null; + $this->container['work_pattern_type'] = isset($data['work_pattern_type']) ? $data['work_pattern_type'] : null; } /** @@ -317,6 +338,14 @@ public function listInvalidProperties() ); } + $allowedValues = $this->getWorkPatternTypeAllowableValues(); + if (!is_null($this->container['work_pattern_type']) && !in_array($this->container['work_pattern_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'work_pattern_type', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + return $invalidProperties; } @@ -619,6 +648,42 @@ public function setPaymentType($payment_type) } + + /** + * Gets work_pattern_type + * + * @return string|null + */ + public function getWorkPatternType() + { + return $this->container['work_pattern_type']; + } + + /** + * Sets work_pattern_type + * + * @param string|null $work_pattern_type The type of the Working Pattern of the corresponding salary and wages + * + * @return $this + */ + public function setWorkPatternType($work_pattern_type) + { + $allowedValues = $this->getWorkPatternTypeAllowableValues(); + if (!is_null($work_pattern_type) && !in_array($work_pattern_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'work_pattern_type', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + + $this->container['work_pattern_type'] = $work_pattern_type; + + return $this; + } + + /** * Returns true if offset exists. False otherwise. * diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/SalaryAndWageObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/SalaryAndWageObject.php index 4fff323..cee49c5 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/SalaryAndWageObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/SalaryAndWageObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/SalaryAndWages.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/SalaryAndWages.php index 6f6de03..2063e1d 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/SalaryAndWages.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/SalaryAndWages.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Settings.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Settings.php index 78335f8..bb88d7a 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Settings.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Settings.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/StatutoryDeduction.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/StatutoryDeduction.php index 141685d..59af830 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/StatutoryDeduction.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/StatutoryDeduction.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/StatutoryDeductionCategory.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/StatutoryDeductionCategory.php index 55e0fef..5b3c69f 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/StatutoryDeductionCategory.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/StatutoryDeductionCategory.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/StatutoryDeductionLine.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/StatutoryDeductionLine.php index 7770c1e..a65e65e 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/StatutoryDeductionLine.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/StatutoryDeductionLine.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/StatutoryDeductionObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/StatutoryDeductionObject.php index e4a6ec8..a47edff 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/StatutoryDeductionObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/StatutoryDeductionObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/StatutoryDeductions.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/StatutoryDeductions.php index 823b0e1..9a81bf1 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/StatutoryDeductions.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/StatutoryDeductions.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/SuperannuationLine.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/SuperannuationLine.php index e9f3e08..c49a7af 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/SuperannuationLine.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/SuperannuationLine.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/SuperannuationObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/SuperannuationObject.php index 414734b..32d8add 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/SuperannuationObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/SuperannuationObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Superannuations.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Superannuations.php index 26d2bb4..d653b5d 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Superannuations.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Superannuations.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TaxCode.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TaxCode.php index 76b1fbe..56080bf 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TaxCode.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TaxCode.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TaxLine.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TaxLine.php index 0df02a1..da3c612 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TaxLine.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TaxLine.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TaxSettings.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TaxSettings.php index 00770ec..9bd4605 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TaxSettings.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TaxSettings.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Timesheet.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Timesheet.php index e4ee4ed..9881082 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Timesheet.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Timesheet.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TimesheetEarningsLine.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TimesheetEarningsLine.php index e297f4d..d0f1f84 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TimesheetEarningsLine.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TimesheetEarningsLine.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TimesheetLine.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TimesheetLine.php index c3f8f34..afbaed9 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TimesheetLine.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TimesheetLine.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TimesheetLineObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TimesheetLineObject.php index 2f33f79..f991451 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TimesheetLineObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TimesheetLineObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TimesheetObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TimesheetObject.php index 54ff700..6a9f3f5 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TimesheetObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TimesheetObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Timesheets.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Timesheets.php index 48204c1..f3b53bd 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Timesheets.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/Timesheets.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TrackingCategories.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TrackingCategories.php index 07b2e88..6d0de8f 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TrackingCategories.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TrackingCategories.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TrackingCategory.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TrackingCategory.php index e51e8fd..aef7a8f 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TrackingCategory.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/TrackingCategory.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/WorkingWeek.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/WorkingWeek.php new file mode 100644 index 0000000..5a77831 --- /dev/null +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollNz/WorkingWeek.php @@ -0,0 +1,528 @@ + 'double', + 'tuesday' => 'double', + 'wednesday' => 'double', + 'thursday' => 'double', + 'friday' => 'double', + 'saturday' => 'double', + 'sunday' => 'double' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + 'monday' => 'double', + 'tuesday' => 'double', + 'wednesday' => 'double', + 'thursday' => 'double', + 'friday' => 'double', + 'saturday' => 'double', + 'sunday' => 'double' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'monday' => 'monday', + 'tuesday' => 'tuesday', + 'wednesday' => 'wednesday', + 'thursday' => 'thursday', + 'friday' => 'friday', + 'saturday' => 'saturday', + 'sunday' => 'sunday' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'monday' => 'setMonday', + 'tuesday' => 'setTuesday', + 'wednesday' => 'setWednesday', + 'thursday' => 'setThursday', + 'friday' => 'setFriday', + 'saturday' => 'setSaturday', + 'sunday' => 'setSunday' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'monday' => 'getMonday', + 'tuesday' => 'getTuesday', + 'wednesday' => 'getWednesday', + 'thursday' => 'getThursday', + 'friday' => 'getFriday', + 'saturday' => 'getSaturday', + 'sunday' => 'getSunday' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['monday'] = isset($data['monday']) ? $data['monday'] : null; + $this->container['tuesday'] = isset($data['tuesday']) ? $data['tuesday'] : null; + $this->container['wednesday'] = isset($data['wednesday']) ? $data['wednesday'] : null; + $this->container['thursday'] = isset($data['thursday']) ? $data['thursday'] : null; + $this->container['friday'] = isset($data['friday']) ? $data['friday'] : null; + $this->container['saturday'] = isset($data['saturday']) ? $data['saturday'] : null; + $this->container['sunday'] = isset($data['sunday']) ? $data['sunday'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['monday'] === null) { + $invalidProperties[] = "'monday' can't be null"; + } + if ($this->container['tuesday'] === null) { + $invalidProperties[] = "'tuesday' can't be null"; + } + if ($this->container['wednesday'] === null) { + $invalidProperties[] = "'wednesday' can't be null"; + } + if ($this->container['thursday'] === null) { + $invalidProperties[] = "'thursday' can't be null"; + } + if ($this->container['friday'] === null) { + $invalidProperties[] = "'friday' can't be null"; + } + if ($this->container['saturday'] === null) { + $invalidProperties[] = "'saturday' can't be null"; + } + if ($this->container['sunday'] === null) { + $invalidProperties[] = "'sunday' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets monday + * + * @return double + */ + public function getMonday() + { + return $this->container['monday']; + } + + /** + * Sets monday + * + * @param double $monday The number of hours worked on a Monday + * + * @return $this + */ + public function setMonday($monday) + { + + $this->container['monday'] = $monday; + + return $this; + } + + + + /** + * Gets tuesday + * + * @return double + */ + public function getTuesday() + { + return $this->container['tuesday']; + } + + /** + * Sets tuesday + * + * @param double $tuesday The number of hours worked on a Tuesday + * + * @return $this + */ + public function setTuesday($tuesday) + { + + $this->container['tuesday'] = $tuesday; + + return $this; + } + + + + /** + * Gets wednesday + * + * @return double + */ + public function getWednesday() + { + return $this->container['wednesday']; + } + + /** + * Sets wednesday + * + * @param double $wednesday The number of hours worked on a Wednesday + * + * @return $this + */ + public function setWednesday($wednesday) + { + + $this->container['wednesday'] = $wednesday; + + return $this; + } + + + + /** + * Gets thursday + * + * @return double + */ + public function getThursday() + { + return $this->container['thursday']; + } + + /** + * Sets thursday + * + * @param double $thursday The number of hours worked on a Thursday + * + * @return $this + */ + public function setThursday($thursday) + { + + $this->container['thursday'] = $thursday; + + return $this; + } + + + + /** + * Gets friday + * + * @return double + */ + public function getFriday() + { + return $this->container['friday']; + } + + /** + * Sets friday + * + * @param double $friday The number of hours worked on a Friday + * + * @return $this + */ + public function setFriday($friday) + { + + $this->container['friday'] = $friday; + + return $this; + } + + + + /** + * Gets saturday + * + * @return double + */ + public function getSaturday() + { + return $this->container['saturday']; + } + + /** + * Sets saturday + * + * @param double $saturday The number of hours worked on a Saturday + * + * @return $this + */ + public function setSaturday($saturday) + { + + $this->container['saturday'] = $saturday; + + return $this; + } + + + + /** + * Gets sunday + * + * @return double + */ + public function getSunday() + { + return $this->container['sunday']; + } + + /** + * Sets sunday + * + * @param double $sunday The number of hours worked on a Sunday + * + * @return $this + */ + public function setSunday($sunday) + { + + $this->container['sunday'] = $sunday; + + return $this; + } + + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + PayrollNzObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} + + diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Account.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Account.php index 95153ae..9349e6b 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Account.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Account.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Accounts.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Accounts.php index da9f691..f4526f5 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Accounts.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Accounts.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Address.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Address.php index 1140c0e..1cad4a7 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Address.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Address.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/BankAccount.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/BankAccount.php index ecabc67..cc90b62 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/BankAccount.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/BankAccount.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Benefit.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Benefit.php index 5b25b30..3f322a7 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Benefit.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Benefit.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/BenefitLine.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/BenefitLine.php index ef7308f..034768d 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/BenefitLine.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/BenefitLine.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/BenefitObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/BenefitObject.php index 390b7f7..545528d 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/BenefitObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/BenefitObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Benefits.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Benefits.php index e456262..cf1a720 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Benefits.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Benefits.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/CourtOrderLine.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/CourtOrderLine.php index 85b234a..536ff33 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/CourtOrderLine.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/CourtOrderLine.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Deduction.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Deduction.php index fef75a8..5254ae8 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Deduction.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Deduction.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/DeductionLine.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/DeductionLine.php index 742e34b..d6ca823 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/DeductionLine.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/DeductionLine.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/DeductionObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/DeductionObject.php index 87bcd02..e295e4d 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/DeductionObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/DeductionObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Deductions.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Deductions.php index 475d2b9..4ddf1cc 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Deductions.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Deductions.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EarningsLine.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EarningsLine.php index ed45ebc..cf5fe39 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EarningsLine.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EarningsLine.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EarningsOrder.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EarningsOrder.php index 37606d3..9f8692a 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EarningsOrder.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EarningsOrder.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EarningsOrderObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EarningsOrderObject.php index 76cbb98..e738a28 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EarningsOrderObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EarningsOrderObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EarningsOrders.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EarningsOrders.php index 7ae72d0..4942958 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EarningsOrders.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EarningsOrders.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EarningsRate.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EarningsRate.php index 656d580..74cb8bb 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EarningsRate.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EarningsRate.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EarningsRateObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EarningsRateObject.php index 0517b17..1271c36 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EarningsRateObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EarningsRateObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EarningsRates.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EarningsRates.php index d149e3a..8e4d0a1 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EarningsRates.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EarningsRates.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EarningsTemplate.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EarningsTemplate.php index 43e8998..5a9fcc1 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EarningsTemplate.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EarningsTemplate.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EarningsTemplateObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EarningsTemplateObject.php index 9722382..f4c767e 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EarningsTemplateObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EarningsTemplateObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Employee.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Employee.php index a113011..aa2b816 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Employee.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Employee.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeLeave.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeLeave.php index 523db4e..131c67e 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeLeave.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeLeave.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeLeaveBalance.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeLeaveBalance.php index f069208..5aa708f 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeLeaveBalance.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeLeaveBalance.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeLeaveBalances.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeLeaveBalances.php index 988b54b..1dcc072 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeLeaveBalances.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeLeaveBalances.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeLeaveObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeLeaveObject.php index 05a42fa..818dd45 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeLeaveObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeLeaveObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeLeaveType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeLeaveType.php index 4ba2a9e..476ab6e 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeLeaveType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeLeaveType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeLeaveTypeObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeLeaveTypeObject.php index a1067a1..f0df99a 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeLeaveTypeObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeLeaveTypeObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeLeaveTypes.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeLeaveTypes.php index 46b6187..6c32c4f 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeLeaveTypes.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeLeaveTypes.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeLeaves.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeLeaves.php index b7a64e0..528488b 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeLeaves.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeLeaves.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeObject.php index e3dfa64..98a207f 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeOpeningBalances.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeOpeningBalances.php index 731f69e..52138bc 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeOpeningBalances.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeOpeningBalances.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeOpeningBalancesObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeOpeningBalancesObject.php index 31fc80b..4857b6a 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeOpeningBalancesObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeOpeningBalancesObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeePayTemplate.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeePayTemplate.php index c039833..4370b7e 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeePayTemplate.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeePayTemplate.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeePayTemplateObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeePayTemplateObject.php index 886437d..76ea44d 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeePayTemplateObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeePayTemplateObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeePayTemplates.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeePayTemplates.php index 46798f0..53373a3 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeePayTemplates.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeePayTemplates.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeStatutoryLeaveBalance.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeStatutoryLeaveBalance.php index 9ca5d64..9d48274 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeStatutoryLeaveBalance.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeStatutoryLeaveBalance.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeStatutoryLeaveBalanceObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeStatutoryLeaveBalanceObject.php index 4e5023a..c831d66 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeStatutoryLeaveBalanceObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeStatutoryLeaveBalanceObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeStatutoryLeaveSummary.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeStatutoryLeaveSummary.php index 5454a59..c054899 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeStatutoryLeaveSummary.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeStatutoryLeaveSummary.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeStatutoryLeavesSummaries.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeStatutoryLeavesSummaries.php index 01b6aa3..d78bf2d 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeStatutoryLeavesSummaries.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeStatutoryLeavesSummaries.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeStatutorySickLeave.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeStatutorySickLeave.php index 60aac11..e2db186 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeStatutorySickLeave.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeStatutorySickLeave.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeStatutorySickLeaveObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeStatutorySickLeaveObject.php index 9294a57..91f5931 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeStatutorySickLeaveObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeStatutorySickLeaveObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeStatutorySickLeaves.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeStatutorySickLeaves.php index b35304d..5a70ff3 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeStatutorySickLeaves.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeStatutorySickLeaves.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeTax.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeTax.php index c0a40b9..703b836 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeTax.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeTax.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeTaxObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeTaxObject.php index c0a8201..065f25a 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeTaxObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmployeeTaxObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Employees.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Employees.php index 9da93b3..388b8c8 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Employees.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Employees.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Employment.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Employment.php index a47482b..94b062b 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Employment.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Employment.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmploymentObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmploymentObject.php index afbed64..f829a8e 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmploymentObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/EmploymentObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/InvalidField.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/InvalidField.php index af743b6..69d51e0 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/InvalidField.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/InvalidField.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/LeaveAccrualLine.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/LeaveAccrualLine.php index 1e1de3d..93e72f9 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/LeaveAccrualLine.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/LeaveAccrualLine.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/LeaveEarningsLine.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/LeaveEarningsLine.php index fe0c1ad..d611459 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/LeaveEarningsLine.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/LeaveEarningsLine.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/LeavePeriod.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/LeavePeriod.php index 338dafe..169e734 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/LeavePeriod.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/LeavePeriod.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/LeavePeriods.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/LeavePeriods.php index 2aed640..4008cd0 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/LeavePeriods.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/LeavePeriods.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/LeaveType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/LeaveType.php index b5c8379..60c5897 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/LeaveType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/LeaveType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/LeaveTypeObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/LeaveTypeObject.php index b4d59c8..ba7bc4a 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/LeaveTypeObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/LeaveTypeObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/LeaveTypes.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/LeaveTypes.php index 18fc2a2..dfd71fe 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/LeaveTypes.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/LeaveTypes.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/ModelInterface.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/ModelInterface.php index db2db1d..56f8582 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/ModelInterface.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/ModelInterface.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Pagination.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Pagination.php index 64ec5cc..298cf6f 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Pagination.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Pagination.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PayRun.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PayRun.php index 3d72bf9..4b49b59 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PayRun.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PayRun.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PayRunCalendar.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PayRunCalendar.php index ad3a19e..63d2465 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PayRunCalendar.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PayRunCalendar.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PayRunCalendarObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PayRunCalendarObject.php index 4d9ea5e..be10dfb 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PayRunCalendarObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PayRunCalendarObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PayRunCalendars.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PayRunCalendars.php index dab957e..8916fee 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PayRunCalendars.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PayRunCalendars.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PayRunObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PayRunObject.php index 20e2735..2f57352 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PayRunObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PayRunObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PayRuns.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PayRuns.php index 45f46ca..882f570 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PayRuns.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PayRuns.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PaymentLine.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PaymentLine.php index 669f15c..4b6e40f 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PaymentLine.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PaymentLine.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PaymentMethod.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PaymentMethod.php index e8be01a..68520a4 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PaymentMethod.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PaymentMethod.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PaymentMethodObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PaymentMethodObject.php index 9f4f212..cd30a7d 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PaymentMethodObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PaymentMethodObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Payslip.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Payslip.php index c359808..2b00754 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Payslip.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Payslip.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PayslipObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PayslipObject.php index d7f2937..59049b6 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PayslipObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/PayslipObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Payslips.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Payslips.php index d02941b..fe5444f 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Payslips.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Payslips.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Problem.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Problem.php index 27eff00..7b61cd8 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Problem.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Problem.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Reimbursement.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Reimbursement.php index dcd1de4..02f451c 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Reimbursement.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Reimbursement.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/ReimbursementLine.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/ReimbursementLine.php index 102547d..41f099a 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/ReimbursementLine.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/ReimbursementLine.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/ReimbursementObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/ReimbursementObject.php index 446adde..2b2109f 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/ReimbursementObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/ReimbursementObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Reimbursements.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Reimbursements.php index b1f41d4..908765c 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Reimbursements.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Reimbursements.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/SalaryAndWage.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/SalaryAndWage.php index 50bc483..f2fd1a9 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/SalaryAndWage.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/SalaryAndWage.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/SalaryAndWageObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/SalaryAndWageObject.php index a99a487..c9c34bc 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/SalaryAndWageObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/SalaryAndWageObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/SalaryAndWages.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/SalaryAndWages.php index 9cebe0a..acaa97a 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/SalaryAndWages.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/SalaryAndWages.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Settings.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Settings.php index d7c618f..948541c 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Settings.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Settings.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/StatutoryDeduction.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/StatutoryDeduction.php index 1b07dc0..3840d77 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/StatutoryDeduction.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/StatutoryDeduction.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/StatutoryDeductionCategory.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/StatutoryDeductionCategory.php index 4646eaa..9a49253 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/StatutoryDeductionCategory.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/StatutoryDeductionCategory.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/TaxLine.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/TaxLine.php index 9f258ee..228fc71 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/TaxLine.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/TaxLine.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Timesheet.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Timesheet.php index 9ff8316..7b76753 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Timesheet.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Timesheet.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/TimesheetEarningsLine.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/TimesheetEarningsLine.php index f8dbe22..17815da 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/TimesheetEarningsLine.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/TimesheetEarningsLine.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/TimesheetLine.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/TimesheetLine.php index 6af75b5..89c4b71 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/TimesheetLine.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/TimesheetLine.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/TimesheetLineObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/TimesheetLineObject.php index 8af78f3..b927a17 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/TimesheetLineObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/TimesheetLineObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/TimesheetObject.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/TimesheetObject.php index 589c856..f5e80fb 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/TimesheetObject.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/TimesheetObject.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Timesheets.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Timesheets.php index deca716..ce1bd46 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Timesheets.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/Timesheets.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/TrackingCategories.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/TrackingCategories.php index 949591c..9428693 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/TrackingCategories.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/TrackingCategories.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/TrackingCategory.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/TrackingCategory.php index 799a9c0..df1fb20 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/TrackingCategory.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/PayrollUk/TrackingCategory.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/Amount.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/Amount.php index b2a54e5..256dc3f 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/Amount.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/Amount.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/ChargeType.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/ChargeType.php index 9a2693b..2a38a4d 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/ChargeType.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/ChargeType.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/CurrencyCode.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/CurrencyCode.php index b1f0ca5..1d39595 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/CurrencyCode.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/CurrencyCode.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ @@ -212,7 +212,6 @@ class CurrencyCode const ZMW = 'ZMW'; const ZMK = 'ZMK'; const ZWD = 'ZWD'; - const EMPTY = ''; /** * Gets allowable values of the enum @@ -384,7 +383,6 @@ public static function getAllowableEnumValues() self::ZMW, self::ZMK, self::ZWD, - self::EMPTY, ]; } } diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/Error.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/Error.php index 048079c..c1fa43d 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/Error.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/Error.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/ModelInterface.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/ModelInterface.php index 89fa0af..c66d089 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/ModelInterface.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/ModelInterface.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/Pagination.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/Pagination.php index 44a13c1..330c049 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/Pagination.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/Pagination.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/Project.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/Project.php index adefa6e..3e9ee6b 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/Project.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/Project.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/ProjectCreateOrUpdate.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/ProjectCreateOrUpdate.php index f2dc345..6917b36 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/ProjectCreateOrUpdate.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/ProjectCreateOrUpdate.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/ProjectPatch.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/ProjectPatch.php index d72d7a5..6cd259a 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/ProjectPatch.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/ProjectPatch.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/ProjectStatus.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/ProjectStatus.php index 3bb349e..48da422 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/ProjectStatus.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/ProjectStatus.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/ProjectUser.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/ProjectUser.php index 2878af6..3fb3494 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/ProjectUser.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/ProjectUser.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/ProjectUsers.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/ProjectUsers.php index 5022b00..d9ecdb8 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/ProjectUsers.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/ProjectUsers.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/Projects.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/Projects.php index d404a2e..d9f6d95 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/Projects.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/Projects.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/Task.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/Task.php index 088f952..0e9cf82 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/Task.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/Task.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/TaskCreateOrUpdate.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/TaskCreateOrUpdate.php index 377b0d1..6c5f8dd 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/TaskCreateOrUpdate.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/TaskCreateOrUpdate.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/Tasks.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/Tasks.php index 91b20ec..68f649e 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/Tasks.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/Tasks.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/TimeEntries.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/TimeEntries.php index 1292d4b..40cdcba 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/TimeEntries.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/TimeEntries.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/TimeEntry.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/TimeEntry.php index 1532dd2..e9718da 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/TimeEntry.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/TimeEntry.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/TimeEntryCreateOrUpdate.php b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/TimeEntryCreateOrUpdate.php index 3e95e5d..fcd770e 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/TimeEntryCreateOrUpdate.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/Models/Project/TimeEntryCreateOrUpdate.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/PayrollAuObjectSerializer.php b/lib/packages/xeroapi/xero-php-oauth2/lib/PayrollAuObjectSerializer.php index e914db9..e894788 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/PayrollAuObjectSerializer.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/PayrollAuObjectSerializer.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/PayrollNzObjectSerializer.php b/lib/packages/xeroapi/xero-php-oauth2/lib/PayrollNzObjectSerializer.php index 540e26d..abadfdf 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/PayrollNzObjectSerializer.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/PayrollNzObjectSerializer.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/PayrollUkObjectSerializer.php b/lib/packages/xeroapi/xero-php-oauth2/lib/PayrollUkObjectSerializer.php index 8066da8..89cd5d0 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/PayrollUkObjectSerializer.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/PayrollUkObjectSerializer.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/ProjectObjectSerializer.php b/lib/packages/xeroapi/xero-php-oauth2/lib/ProjectObjectSerializer.php index a41a1e0..8423ad5 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/ProjectObjectSerializer.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/ProjectObjectSerializer.php @@ -10,7 +10,7 @@ * @link https://openapi-generator.tech * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/lib/packages/xeroapi/xero-php-oauth2/lib/StringUtil.php b/lib/packages/xeroapi/xero-php-oauth2/lib/StringUtil.php index 7d549b8..5d7f173 100644 --- a/lib/packages/xeroapi/xero-php-oauth2/lib/StringUtil.php +++ b/lib/packages/xeroapi/xero-php-oauth2/lib/StringUtil.php @@ -9,7 +9,7 @@ * @link * * @license MIT - * Modified by woocommerce on 19-August-2024 using Strauss. + * Modified by woocommerce on 14-October-2024 using Strauss. * @see https://github.com/BrianHenryIE/strauss */ diff --git a/readme.txt b/readme.txt index 55a0f57..ee2f149 100644 --- a/readme.txt +++ b/readme.txt @@ -8,79 +8,25 @@ == Configuring A Connection to Xero == - -Xero’s API uses 2 legged OAuth for validating all connections. There are two steps to setting up the connection between your WooCommerce shopping cart and your Xero account. First, you will need to generate a Self-signed Certificate (X509) for use with this module. Second, you will need to define your WooCommerce site as a Public Application and allow it to connect to your Xero account. Instructions for these steps are below. - - -Step 1. Generating a Private/Public Key pair - -(These instructions are referenced from the Xero Blog) - --- Windows users -- - -You can download OpenSSL for Windows here. - -http://www.slproweb.com/products/Win32OpenSSL.html - -To run the commands below, go tot he OpenSSL32 directory on your PS, and then change to the /bin directory. - -Note: You may need to open the command prompt with elevated status (Run as administrator) If the OpenSSL just recently installed, you might need to restart the computer - --- Mac users -- - -OpenSSL comes shipped with Mac OS X. - -See http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man1/openssl.1ssl.html for more info. - --- Using OpenSSL -- - -Use a command line prompt and the following commands to generate a private and public key pair. - -1. The following command will generate a private key file named "privatekey.pem" in the current directory - -openssl genrsa -out privatekey.pem 1024 - -2. This command uses the previously created private key file to create a public certificate to be used when setting up your private application in the next step. You will be asked to provide 7 pieces of information about your company that will be included in the certificate file: Country Name (2 letter code), State or Province Name (Full name), Locality (eg city), Organization Name (eg, company), Organizational Unit Name (eg, section), Common Name (eg, Your name), Email Address. -openssl req -newkey rsa:1024 -x509 -key privatekey.pem -out publickey.cer -days 365 -3. To verify the files were created correctly, verify the first line of each file. - -The private key will begin with the following line: - -—–BEGIN RSA PRIVATE KEY—– - -The public certificate will begin with the following line: - -—–BEGIN CERTIFICATE—– - -Step 2. Setup Up A Private Application in Xero - - * Login to your Xero account at http://login.xero.com - * Once logged in, go to the API area at http://api.xero.com - * You will be at a page titled "Xero Developer Centre" - * Verify your name is in the top right corner of the page - * Click on the "My Applications" tab - * Click the "Add Application" button - * Fill out the form with the following options: - * What type of application are you developing? Select "Private" - * Application Name: Enter the name of your WooCommerce site. - * Please select which organisation your application can access: Select which Xero company to access. The extension can only access one company at a time. - * X509 Public Key Certificate: Paste the certificate file you created in Step 1. above. Note: Certificate files begin with the text "—–BEGIN CERTIFICATE—–" - * Press Save and you will be taken to the Edit Application page with the note "Application Added" - * The Edit Application page will have a box titled "OAuth Credentials" showing the "Consumer Key" and the "Consumer Secret". These will be used in the next step – Configuring Xero for WooCommerce - +1. Sign up for a Xero account (https://www.xero.com/signup/developers/). +2. Go to https://developer.xero.com/app/manage (you’ll be prompted to log in to Xero first). +3. Click on “New App” to create a new application. +4. Fill out the required fields: + * App Name: WooCommerce + * Company or Application URL: Your website URL + * OAuth 2.0 Redirect URI: https://YOUR_WEBSITE_DOMAIN/wp-admin/admin.php?page=woocommerce_xero_oauth + * Check the box for “I have read and agree to the terms and conditions.” +5. Click on “Create App” to create the application. +6. Copy the “Client ID” and “Client Secret” from the Configuration tab and save them for later. +7. Go to WooCommerce > Xero. +8. Fill out the "Client ID" and "Client Secret" fields with the OAuth credentials we copied in Step 6. +9. Click on the "Save" button to save the configuration. +10. Click on the "Sign in with Xero" button to connect your WooCommerce store to Xero. +11. You will be redirected to Xero to authorize the connection. Follow the steps to authorize the connection. +12. After the connection is authorized, you will be redirected back to your WooCommerce store. == Configuring Xero for WooCommerce == --- Setup OAuth Credentials -- - * Login to your WordPress dashboard and go to WooCommerce > Xero to fill out the required configuration settings. - * Fill "Consumer Key" and "Consumer Secret" settings fields with the OAuth Credentials retrieved when registering your private application with Xero in the previous step. - --- Setup Certificate Files -- - * The Public/Private key pair created in Step 1. above need to be placed on your hosting account - * Use an FTP/SFTP program to create a directory named "xero-certs" at the same level as your public_html directory - * Place the two files into this directory - * Fill the "Private Key" and "Public Key" settings fields with the paths to these files. You may need to contact your web host to find the path for these files. - -- Setup Default Account Numbers -- The invoices and payments sent to Xero need to be associated with accounts in your company’s Chart of Accounts. Use the Account fields in the admin dashboard to specify the account number for each type of account. Note: The Tax Rate associated with the Xero account needs to match the tax rate setup in WooCommerce. diff --git a/woocommerce-xero.php b/woocommerce-xero.php index d5fdd33..71bf7fb 100644 --- a/woocommerce-xero.php +++ b/woocommerce-xero.php @@ -6,15 +6,15 @@ * Description: Integrates WooCommerce with the Xero accounting software. * Author: WooCommerce * Author URI: https://woocommerce.com/ - * Version: 1.8.9 + * Version: 1.9.0 * Text Domain: woocommerce-xero * Domain Path: /languages/ - * Requires at least: 6.4 + * Requires at least: 6.5 * Tested up to: 6.6 * Requires PHP: 7.4 * PHP tested up to: 8.3 - * WC tested up to: 9.2 - * WC requires at least: 9.0 + * WC tested up to: 9.4 + * WC requires at least: 9.2 * * Copyright 2019 WooCommerce * @@ -43,7 +43,7 @@ define( 'WC_XERO_ABSURL', plugin_dir_url( __FILE__ ) . '/' ); } -define( 'WC_XERO_VERSION', '1.8.9' ); // WRCS: DEFINED_VERSION. +define( 'WC_XERO_VERSION', '1.9.0' ); // WRCS: DEFINED_VERSION. // ActionScheduler group. define( 'WC_XERO_AS_GROUP', 'wc_xero' );