/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import r from"../GraphAddFieldIndexResult.js";import e from"../GraphAddNamedTypesResult.js";import t from"../GraphAddPropertyResult.js";import o from"../GraphDataModelSingletonOperationResult.js";import s from"../GraphDeleteFieldIndexResult.js";import n from"../GraphDeleteNamedTypeResult.js";import u from"../GraphDeletePropertyResult.js";import l from"../GraphUpdateNamedTypesResult.js";import d from"../GraphUpdatePropertyResult.js";import _ from"../GraphUpdateSearchIndexResult.js";import{wasmErrorToEsriError as c}from"./wasmUtils.js";function p(r,e){const t=[];for(let o=0;o<e;o++){const e=r.get_result_at(o);t.push({name:e.get_name(),error:c(e.get_error())})}return t}function a(r){const t=r.get_results_count(),o=r.get_entity_type_add_results_count(),s=r.get_relationship_type_add_results_count(),n=new e({resultsCount:t,results:p(r,t),decoderError:c(r.error),entityAddResultsCount:o,relationshipAddResultsCount:s});for(let e=0;e<o;e++){const t=r.get_entity_type_add_results_at(e),o=t.get_name(),s=t.get_error();n.entityAddResults.push({name:o,error:c(s)})}for(let e=0;e<s;e++){const t=r.get_relationship_type_add_results_at(e),o=t.get_name(),s=t.get_error();n.relationshipAddResults.push({name:o,error:c(s)})}return n}function i(r){const e=r.get_results_count();return new l({resultsCount:e,results:p(r,e),decoderError:c(r.error)})}function m(r){const e=r.get_results_count(),t=[];for(let s=0;s<r.get_warnings_count();s++){const e=c(r.get_warning_at(s));null!=e&&t.push(e)}const o=p(r,e);return new n({resultsCount:e,results:o,warnings:t,decoderError:c(r.error)})}function f(r){const e=r.get_results_count();return new t({resultsCount:e,results:p(r,e),decoderError:c(r.error)})}function g(r){const e=r.get_results_count();return new u({resultsCount:e,results:p(r,e),decoderError:c(r.error)})}function h(r){const e=r.get_results_count();return new d({resultsCount:e,results:p(r,e),decoderError:c(r.error)})}function w(r){const e=r.get_results_count();return new _({resultsCount:e,results:p(r,e),decoderError:c(r.error)})}function y(e){const t=e.get_results_count();return new r({resultsCount:t,results:p(e,t),decoderError:c(e.error)})}function R(r){const e=r.get_results_count();return new s({resultsCount:e,results:p(r,e),decoderError:c(r.error)})}function j(r){return new o({decoderError:c(r.error)})}export{f as decoderToAddGraphPropertiesResult,a as decoderToAddNamedTypesResult,g as decoderToDeleteGraphPropertiesResult,m as decoderToDeleteNamedTypeResult,y as decoderToGraphAddIndexResult,j as decoderToGraphDataModelSingletonOperationResult,R as decoderToGraphDeleteIndexResult,w as decoderToGraphUpdateSearchIndexResult,h as decoderToUpdateGraphPropertiesResult,i as decoderToUpdateNamedTypesResult};
