/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/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 c from"../GraphUpdateSearchIndexResult.js";import{wasmErrorToEsriError as _}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:_(e.get_error())})}return t}function i(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:_(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:_(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:_(s)})}return n}function a(r){const e=r.get_results_count();return new l({resultsCount:e,results:p(r,e),decoderError:_(r.error)})}function m(r){const e=r.get_results_count();return new n({resultsCount:e,results:p(r,e),decoderError:_(r.error)})}function f(r){const e=r.get_results_count();return new t({resultsCount:e,results:p(r,e),decoderError:_(r.error)})}function g(r){const e=r.get_results_count();return new u({resultsCount:e,results:p(r,e),decoderError:_(r.error)})}function h(r){const e=r.get_results_count();return new d({resultsCount:e,results:p(r,e),decoderError:_(r.error)})}function y(r){const e=r.get_results_count();return new c({resultsCount:e,results:p(r,e),decoderError:_(r.error)})}function R(e){const t=e.get_results_count();return new r({resultsCount:t,results:p(e,t),decoderError:_(e.error)})}function j(r){const e=r.get_results_count();return new s({resultsCount:e,results:p(r,e),decoderError:_(r.error)})}function w(r){return new o({decoderError:_(r.error)})}export{f as decoderToAddGraphPropertiesResult,i as decoderToAddNamedTypesResult,g as decoderToDeleteGraphPropertiesResult,m as decoderToDeleteNamedTypeResult,R as decoderToGraphAddIndexResult,w as decoderToGraphDataModelSingletonOperationResult,j as decoderToGraphDeleteIndexResult,y as decoderToGraphUpdateSearchIndexResult,h as decoderToUpdateGraphPropertiesResult,a as decoderToUpdateNamedTypesResult};
