(ev: React.KeyboardEvent<HTMLElement | Autofill>): void => {
    const { disabled, allowFreeform, autoComplete } = this.props;
    const isOpen = this.state.isOpen;

    // We close the menu on key up only if ALL of the following are true:
    // - Most recent key down was alt or meta (command)
    // - The alt/meta key down was NOT followed by some other key (such as down/up arrow to
    //   expand/collapse the menu)
    // - We're not on a Mac (or iOS)
    // This is because on Windows, pressing alt moves focus to the application menu bar or similar,
    // closing any open context menus. There is not a similar behavior on Macs.
    const keyPressIsAltOrMetaAlone = this._lastKeyDownWasAltOrMeta && this._isAltOrMeta(ev);
    this._lastKeyDownWasAltOrMeta = false;
    const shouldHandleKey = keyPressIsAltOrMetaAlone && !(isMac() || isIOS());

    if (disabled) {
      this._handleInputWhenDisabled(ev);
      return;
    }

    switch (ev.which) {
      case KeyCodes.space:
        // If we are not allowing freeform and are not autoComplete
        // make space expand/collapse the comboBox
        // and allow the event to propagate
        if (!allowFreeform && autoComplete === 'off') {
          this._setOpenStateAndFocusOnClose(!isOpen, !!isOpen);
          return;
        }
        break;
      default:
        if (shouldHandleKey && isOpen) {
          this._setOpenStateAndFocusOnClose(!isOpen, true /* focusInputAfterClose */);
        }
        return;
    }

    ev.stopPropagation();
    ev.preventDefault();
  }


() => {
    if (this._shouldIgnoreMouseEvent()) {
      return;
    }

    // Ignore the event in persistMenu mode if the callout has
    // closed. This is to avoid clearing the visuals on item click.
    if (this.props.persistMenu && !this.state.isOpen) {
      return;
    }

    this.setState({
      currentPendingValueValidIndexOnHover: HoverStatus.clearAll
    });
  }


(): void => {
    const { disabled } = this.props;
    const { isOpen } = this.state;

    if (!disabled) {
      this._setOpenStateAndFocusOnClose(!isOpen, false /* focusInputAfterClose */);
      this.setState({ focused: true });
    }
  }


(): void => {
    const { disabled, allowFreeform } = this.props;

    if (allowFreeform && !disabled) {
      this.focus(this.state.isOpen || this._processingTouch);
    } else {
      this._onComboBoxClick();
    }
  }


() => void


() => {
    if (this._comboBoxWrapper.current && !('onpointerdown' in this._comboBoxWrapper)) {
      this._handleTouchAndPointerEvent();
    }
  }


(ev: PointerEvent): void => {
    if (ev.pointerType === 'touch') {
      this._handleTouchAndPointerEvent();

      ev.preventDefault();
      ev.stopImmediatePropagation();
    }
  }


() => {
      this._processingTouch = false;
      this._lastTouchTimeoutId = undefined;
    }


/**
 * Internal class that is used to wrap all ComboBox options.
 * This is used to customize when we want to rerender components,
 * so we don't rerender every option every time render is executed.
 */
class ComboBoxOptionWrapper extends React.Component<IComboBoxOptionWrapperProps, {}> {
  public render(): React.ReactNode {
    return this.props.render();
  }

  public shouldComponentUpdate(newProps: IComboBoxOptionWrapperProps): boolean {
    // The render function will always be different, so we ignore that prop
    return !shallowCompare({ ...this.props, render: undefined }, { ...newProps, render: undefined });
  }
}


export interface IComboBoxState {
  /** The open state */
  isOpen?: boolean;

  /** The currently selected indices */
  selectedIndices?: number[];

  /** The focused state of the comboBox */
  focused?: boolean;

  /** This value is used for the autocomplete hint value */
  suggestedDisplayValue?: string;

  /** The options currently available for the callout */
  currentOptions: IComboBoxOption[];

  /**
   * When taking input, this will store the index that the options input matches
   * (-1 if no input or match)
   */
  currentPendingValueValidIndex: number;

  /**
   * Stores the hovered over value in the dropdown
   * (used for styling the options without updating the input)
   */
  currentPendingValueValidIndexOnHover: number;

  /** When taking input, this will store the actual text that is being entered */
  currentPendingValue?: string;
}


interface IComboBoxOptionWrapperProps extends IComboBoxOption {
  /** True if the option is currently selected */
  isSelected: boolean;

  /**
   * A function that returns the children of the OptionWrapper. We pass this in as a function to ensure that
   * children methods don't get called unnecessarily if the component doesn't need to be updated. This leads
   * to a significant performance increase in ComboBoxes with many options and/or complex onRenderOption functions
   */
  render: () => JSX.Element;
}


enum SearchDirection {
  backward = -1,
  none = 0,
  forward = 1
}


enum HoverStatus {
  /** Used when the user was hovering and has since moused out of the menu items */
  clearAll = -2,
  /** Default "normal" state, when no hover has happened or a hover is in progress */
  default = -1
}


public render(): React.ReactNode {
    return this.props.render();
  }


public shouldComponentUpdate(newProps: IComboBoxOptionWrapperProps): boolean {
    // The render function will always be different, so we ignore that prop
    return !shallowCompare({ ...this.props, render: undefined }, { ...newProps, render: undefined });
  }


public componentDidMount(): void {
    if (this._comboBoxWrapper.current) {
      // hook up resolving the options if needed on focus
      this._events.on(this._comboBoxWrapper.current, 'focus', this._onResolveOptions, true);
      if ('onpointerdown' in this._comboBoxWrapper.current) {
        // For ComboBoxes, touching anywhere in the combo box should drop the dropdown, including the input element.
        // This gives more hit target space for touch environments. We're setting the onpointerdown here, because React
        // does not support Pointer events yet.
        this._events.on(this._comboBoxWrapper.current, 'pointerdown', this._onPointerDown, true);
      }
    }
  }


// tslint:disable-next-line function-name
public UNSAFE_componentWillReceiveProps(newProps: IComboBoxProps): void {
    // Update the selectedIndex and currentOptions state if
    // the selectedKey, value, or options have changed
    if (newProps.selectedKey !== this.props.selectedKey || newProps.text !== this.props.text || newProps.options !== this.props.options) {
      const selectedKeys: string[] | number[] = this._buildSelectedKeys(newProps.selectedKey);
      const indices: number[] = this._getSelectedIndices(newProps.options, selectedKeys);

      this.setState({
        selectedIndices: indices,
        currentOptions: newProps.options
      });
    }
  }


public componentDidUpdate(prevProps: IComboBoxProps, prevState: IComboBoxState) {
    const { allowFreeform, text, onMenuOpen, onMenuDismissed } = this.props;
    const { isOpen, focused, selectedIndices, currentPendingValueValidIndex } = this.state;

    // If we are newly open or are open and the pending valid index changed,
    // make sure the currently selected/pending option is scrolled into view
    if (isOpen && (!prevState.isOpen || prevState.currentPendingValueValidIndex !== currentPendingValueValidIndex)) {
      // Need this timeout so that the selectedElement ref is correctly updated
      this._async.setTimeout(() => this._scrollIntoView(), 0);
    }

    // if an action is taken that put focus in the ComboBox
    // and If we are open or we are just closed, shouldFocusAfterClose is set,
    // but we are not the activeElement set focus on the input
    if (
      focused &&
      (isOpen ||
        (prevState.isOpen &&
          !isOpen &&
          this._focusInputAfterClose &&
          this._autofill.current &&
          document.activeElement !== this._autofill.current.inputElement))
    ) {
      this.focus(undefined /*shouldOpenOnFocus*/, true /*useFocusAsync*/);
    }

    // If we should focusAfterClose AND
    //   just opened/closed the menu OR
    //   are focused AND
    //     updated the selectedIndex with the menu closed OR
    //     are not allowing freeform OR
    //     the value changed
    // we need to set selection
    if (
      this._focusInputAfterClose &&
      ((prevState.isOpen && !isOpen) ||
        (focused &&
          ((!isOpen &&
            !this.props.multiSelect &&
            prevState.selectedIndices &&
            selectedIndices &&
            prevState.selectedIndices[0] !== selectedIndices[0]) ||
            !allowFreeform ||
            text !== prevProps.text)))
    ) {
      this._select();
    }

    this._notifyPendingValueChanged(prevState);

    if (isOpen && !prevState.isOpen && onMenuOpen) {
      onMenuOpen();
    }

    if (!isOpen && prevState.isOpen && onMenuDismissed) {
      onMenuDismissed();
    }
  }


public componentWillUnmount(): void {
    super.componentWillUnmount();

    // remove the eventHanlder that was added in componentDidMount
    this._events.off(this._comboBoxWrapper.current);
  }


// Primary Render
public render(): JSX.Element {
    const id = this._id;
    const {
      className,
      label,
      disabled,
      ariaLabel,
      ariaDescribedBy,
      required,
      errorMessage,
      onRenderContainer = this._onRenderContainer,
      onRenderList = this._onRenderList,
      onRenderItem = this._onRenderItem,
      onRenderOption = this._onRenderOptionContent,
      allowFreeform,
      buttonIconProps,
      isButtonAriaHidden = true,
      styles: customStyles,
      theme,
      title,
      keytipProps,
      placeholder,
      tabIndex,
      autofill,
      persistMenu,
      iconButtonProps
    } = this.props;
    const { isOpen, focused, suggestedDisplayValue } = this.state;
    this._currentVisibleValue = this._getVisibleValue();

    const divProps = getNativeProps<React.HTMLAttributes<HTMLDivElement>>(this.props, divProperties, ['onChange', 'value']);

    const hasErrorMessage = errorMessage && errorMessage.length > 0 ? true : false;

    this._classNames = this.props.getClassNames
      ? this.props.getClassNames(theme!, !!isOpen, !!disabled, !!required, !!focused, !!allowFreeform, !!hasErrorMessage, className)
      : getClassNames(
          getStyles(theme!, customStyles),
          className!,
          !!isOpen,
          !!disabled,
          !!required,
          !!focused,
          !!allowFreeform,
          !!hasErrorMessage
        );

    return (
      <div {...divProps} ref={this._root} className={this._classNames.container}>
        {label && (
          <Label id={id + '-label'} disabled={disabled} required={required} htmlFor={id + '-input'}


// if the new value is empty, see if we have an exact match
// and then set the pending info
if (updatedValue


css(this


onRenderOption(item, this


if (onScrollToItem) {
      // Use the custom scroll handler
      onScrollToItem(
        currentPendingValueValidIndex >= 0 || currentPendingValue !== '' ? currentPendingValueValidIndex : this._getFirstSelectedIndex()
      );
    }


return (ev: any): void


if (selectedIndex


if (index


// update index to allow content to wrap
if (searchDirection


if (!onPendingValueChanged) {
      return;
    }


if (
      currentPendingValueValidIndexOnHover


// If we are disabled, close the menu (if needed)
// and eat all keystokes other than TAB or ESC
if (this


() => {
                        if (--numRemaining === 0) {
                            callback();
                        }
                    }


declare type Animation = import("../../Animations/animation").Animation;


/**
     * Return a string representation of the texture.
     * @returns the texture as a string
     */
public toString(): string {
        return this.name;
    }


/**
     * Get the class name of the texture.
     * @returns "BaseTexture"
     */
public getClassName(): string {
        return "BaseTexture";
    }


/**
     * Get the scene the texture belongs to.
     * @returns the scene or null if undefined
     */
public getScene(): Nullable<Scene> {
        return this._scene;
    }


/** @hidden */
protected _getEngine(): Nullable<ThinEngine> {
        return this._engine;
    }


/**
     * Checks if the texture has the same transform matrix than another texture
     * @param texture texture to check against
     * @returns true if the transforms are the same, else false
     */
public checkTransformsAreIdentical(texture: Nullable<BaseTexture>): boolean {
        return texture !== null;
    }


/**
     * Get the texture transform matrix used to offset tile the texture for istance.
     * @returns the transformation matrix
     */
public getTextureMatrix(): Matrix {
        return <Matrix>Matrix.IdentityReadOnly;
    }


/**
     * Get the texture reflection matrix used to rotate/transform the reflection.
     * @returns the reflection matrix
     */
public getReflectionTextureMatrix(): Matrix {
        return <Matrix>Matrix.IdentityReadOnly;
    }


/**
     * Get if the texture is ready to be consumed (either it is ready or it is not blocking)
     * @returns true if ready or not blocking
     */
public isReadyOrNotBlocking(): boolean {
        return !this.isBlocking || this.isReady();
    }


/**
     * Scales the texture if is `canRescale()`
     * @param ratio the resize factor we want to use to rescale
     */
public scale(ratio: number): void {
    }


/** @hidden */
public _getFromCache(url: Nullable<string>, noMipmap: boolean, sampling?: number, invertY?: boolean): Nullable<InternalTexture> {
        const engine = this._getEngine();
        if (!engine) {
            return null;
        }

        var texturesCache = engine.getLoadedTexturesCache();
        for (var index = 0; index < texturesCache.length; index++) {
            var texturesCacheEntry = texturesCache[index];

            if (invertY === undefined || invertY === texturesCacheEntry.invertY) {
                if (texturesCacheEntry.url === url && texturesCacheEntry.generateMipMaps === !noMipmap) {
                    if (!sampling || sampling === texturesCacheEntry.samplingMode) {
                        texturesCacheEntry.incrementReferences();
                        return texturesCacheEntry;
                    }
                }
            }
        }

        return null;
    }


/** @hidden */
public _rebuild(): void {

    }


/**
     * Clones the texture.
     * @returns the cloned texture
     */
public clone(): Nullable<BaseTexture> {
        return null;
    }


/**
     * Indicates that textures need to be re-calculated for all materials
     */
protected _markAllSubMeshesAsTexturesDirty() {
        let scene = this.getScene();

        if (!scene) {
            return;
        }

        scene.markAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag);
    }


/**
     * Reads the pixels stored in the webgl texture and returns them as an ArrayBuffer.
     * This will returns an RGBA array buffer containing either in values (0-255) or
     * float values (0-1) depending of the underlying buffer type.
     * @param faceIndex defines the face of the texture to read (in case of cube texture)
     * @param level defines the LOD level of the texture to read (in case of Mip Maps)
     * @param buffer defines a user defined buffer to fill with data (can be null)
     * @param flushRenderer true to flush the renderer from the pending commands before reading the pixels
     * @returns The Array buffer promise containing the pixels data.
     */
public readPixels(faceIndex = 0, level = 0, buffer: Nullable<ArrayBufferView> = null, flushRenderer = true): Nullable<Promise<ArrayBufferView>> {
        if (!this._texture) {
            return null;
        }

        var size = this.getSize();
        var width = size.width;
        var height = size.height;

        const engine = this._getEngine();
        if (!engine) {
            return null;
        }

        if (level != 0) {
            width = width / Math.pow(2, level);
            height = height / Math.pow(2, level);

            width = Math.round(width);
            height = Math.round(height);
        }

        try {
            if (this._texture.isCube) {
                return engine._readTexturePixels(this._texture, width, height, faceIndex, level, buffer, flushRenderer);
            }

            return engine._readTexturePixels(this._texture, width, height, -1, level, buffer, flushRenderer);
        } catch (e) {
            return null;
        }
    }


/**
     * Dispose the texture and release its associated resources.
     */
public dispose(): void {
        if (this._scene) {
            // Animations
            if (this._scene.stopAnimation) {
                this._scene.stopAnimation(this);
            }

            // Remove from scene
            this._scene._removePendingData(this);
            var index = this._scene.textures.indexOf(this);

            if (index >= 0) {
                this._scene.textures.splice(index, 1);
            }
            this._scene.onTextureRemovedObservable.notifyObservers(this);
            this._scene = null;
        }

        // Callback
        this.onDisposeObservable.notifyObservers(this);
        this.onDisposeObservable.clear();

        super.dispose();
    }


/**
     * Serialize the texture into a JSON representation that can be parsed later on.
     * @returns the JSON representation of the texture
     */
public serialize(): any {
        if (!this.name) {
            return null;
        }

        var serializationObject = SerializationHelper.Serialize(this);

        // Animations
        SerializationHelper.AppendSerializedAnimations(this, serializationObject);

        return serializationObject;
    }


/**
     * Helper function to be called back once a list of texture contains only ready textures.
     * @param textures Define the list of textures to wait for
     * @param callback Define the callback triggered once the entire list will be ready
     */
public static WhenAllReady(textures: BaseTexture[], callback: () => void): void {
        let numRemaining = textures.length;
        if (numRemaining === 0) {
            callback();
            return;
        }

        for (var i = 0; i < textures.length; i++) {
            var texture = textures[i];

            if (texture.isReady()) {
                if (--numRemaining === 0) {
                    callback();
                }
            }
            else {
                var onLoadObservable = (texture as any).onLoadObservable as Observable<BaseTexture>;

                if (onLoadObservable) {
                    onLoadObservable.addOnce(() => {
                        if (--numRemaining === 0) {
                            callback();
                        }
                    });
                }
            }
        }
    }


private static _isScene(sceneOrEngine: Scene | ThinEngine): sceneOrEngine is Scene {
        return sceneOrEngine.getClassName() === "Scene";
    }


(
    bytes: number | Long | string | null | undefined,
    units?: string | null | undefined
): string | null => {
    if (bytes === null || typeof bytes === 'undefined') return null;

    const num = Number(bytes);
    if (isNaN(num)) return null;

    const i = units ? UNITS.indexOf(units) : Math.floor(Math.log(num) / Math.log(BASE));
    if (i < 0) return null;

    return parseFloat((num / Math.pow(BASE, i)).toFixed(PRECISION)).toLocaleString() + ' ' + UNITS[i];
}


export class ProductRequest{
  category: string;
  constructor(category:string){ }
}


async (orgId: number) => {
  return await getBackendSrv().delete('/api/orgs/' + orgId);
}


async () => {
  return await getBackendSrv().get('/api/orgs');
}


() => {
  const navIndex = useSelector((state: StoreState) => state.navIndex);
  const navModel = getNavModel(navIndex, 'global-orgs');
  const [state, fetchOrgs] = useAsyncFn(async () => await getOrgs(), []);
  useEffect(() => {
    fetchOrgs();
  }, []);

  return (
    <Page navModel={navModel}>
      <Page.Contents>
        <>

            <LinkButton icon="plus" href="org/new">
              New org
            </LinkButton>

          {state.loading && 'Fetching organizations'}
          {state.error}
          {state.value && (
            <AdminOrgsTable
              orgs={state.value}
              onDelete={orgId


(state: StoreState) => state.navIndex


async () => await getOrgs()


() => {
    fetchOrgs();
  }


protected updated(changedProperties: PropertyValues) {
    super.updated(changedProperties);
    if (this.darkTheme) {
      document.body.style.backgroundColor = "#000";
      document.body.style.color = "#fff";
    } else {
      document.body.style.backgroundColor = "#fff";
      document.body.style.color = "#000";
    }
  }


toggleSetting(event: MouseEvent) {
    const composedPath = event.composedPath();
    const target = (composedPath[0] as unknown) as HTMLOrSVGElement;
    const { aspect } = target.dataset;
    if (aspect === "lumos") {
      this.lumos = !this.lumos;
    } else if (aspect === "darkTheme") {
      this.darkTheme = !this.darkTheme;
    } else {
      console.error("Invalid data-aspect input");
      return;
    }
  }


themeToggle() {
    return html`
      <div class="toggle-container">
        <label class="switch">
          <input
            type="checkbox"
            id="theme-switch"
            class="theme-switch"
            data-aspect="darkTheme"
            @click=${this.toggleSetting}
            ?checked=${this.darkTheme}
          />
          Dark Mode
        </label>
        <label class="switch">
          <input
            type="checkbox"
            class="lumos-switch"
            data-aspect="lumos"
            @click=${this.toggleSetting}
            ?checked=${this.lumos}
          />
          Lumos Theme
        </label>
      </div>
    `;
  }


export class CompaniesPageOptionsDto extends PageOptionsDto {}


() => {
  const [pokemons, setPokemons]: [ISimplePokemon[], (pokemons: ISimplePokemon[]) => void] = React.useState(defaultPokemons);

  const [loading, setLoading]: [boolean, (loading: boolean) => void] = React.useState<boolean>(true);

  const [error, setError]: [string, (error: string) => void] = React.useState("");

  React.useEffect(() => {
    PokemonsService.list()
      .then((response) => {
        setPokemons(response);
      })
      .catch(() => {
        setError('An error has occurred, try again later.');
      })
      .finally(() => {
        setLoading(false);
      });
  }, []);

  return (

Pokedex

        {pokemons.map((pokemon) => (

            <Link to={`pokemon/${pokemon.id}`}>
              <PokemonCard pokemon={pokemon} />
            </Link>


() => {
    PokemonsService.list()
      .then((response) => {
        setPokemons(response);
      })
      .catch(() => {
        setError('An error has occurred, try again later.');
      })
      .finally(() => {
        setLoading(false);
      });
  }


(response) => {
        setPokemons(response);
      }


() => {
        setError('An error has occurred, try again later.');
      }


() => {
        setLoading(false);
      }


(pokemon) => (
          <li key={pokemon.id}>
            <Link to


export class RequestMapper {
    public static for(request: HttpRequest, method: HttpRequestConfigurations): RequestInit {
        return {
            cache: request.cache,
            mode: request.mode,
            credentials: request.credentials,
            headers: request.headers,
            redirect: request.redirect,
            referrer: request.referrer,
            method: method,
            body: method !== HttpRequestConfigurations.GET ? JSON.stringify(request.body) : null
        };
    }
}


public static for(request: HttpRequest, method: HttpRequestConfigurations): RequestInit {
        return {
            cache: request.cache,
            mode: request.mode,
            credentials: request.credentials,
            headers: request.headers,
            redirect: request.redirect,
            referrer: request.referrer,
            method: method,
            body: method !== HttpRequestConfigurations.GET ? JSON.stringify(request.body) : null
        };
    }


(error: any): Promise<any> => {
            scope.snackBar.open(`Ocurrio un error. Revise la informacion introducida,
            si el problema persiste contacte al administrador.`, 'OK', {
                duration: 10000,
                extraClasses: 'error-snack'
            });
            return Promise.reject(error.message || error);
        }


@Injectable()
export class BaseService {
    protected http: Http;
    protected baseUrl: string;
    protected snackBar: MatSnackBar;

    constructor(
        injector: Injector
    ) {
        this.http = injector.get(Http);
        this.snackBar = injector.get(MatSnackBar);
    }

    getAll() {
        return this.http.get(this.baseUrl)
            .toPromise()
            .then(response => response.json())
            .catch(this.handleError(this));
    }

    getOne(id) {
        return this.http.get(`${this.baseUrl}/get/${id}`)
            .toPromise()
            .then(response => response.json())
            .catch(this.handleError(this));
    }

    create(baseData): Promise<any> {
        return this.http.post(this.baseUrl, baseData)
            .toPromise()
            .then(response => response.json())
            .catch(this.handleError(this));
    }

    update(baseData) {
        return this.http.put(this.baseUrl, baseData)
            .toPromise()
            .then(response => response.json())
            .catch(this.handleError(this));
    }

    delete(entityId: number) {
        return this.http.delete(`${this.baseUrl}/${entityId}`)
            .toPromise()
            .then(response => response.json())
            .catch(this.handleError(this));
    }

    protected handleError(scope: any) {
        return (error: any): Promise<any> => {
            scope.snackBar.open(`Ocurrio un error. Revise la informacion introducida,
            si el problema persiste contacte al administrador.`, 'OK', {
                duration: 10000,
                extraClasses: 'error-snack'
            });
            return Promise.reject(error.message || error);
        }
    }
}


getAll() {
        return this.http.get(this.baseUrl)
            .toPromise()
            .then(response => response.json())
            .catch(this.handleError(this));
    }


getOne(id) {
        return this.http.get(`${this.baseUrl}/get/${id}`)
            .toPromise()
            .then(response => response.json())
            .catch(this.handleError(this));
    }


create(baseData): Promise<any> {
        return this.http.post(this.baseUrl, baseData)
            .toPromise()
            .then(response => response.json())
            .catch(this.handleError(this));
    }


update(baseData) {
        return this.http.put(this.baseUrl, baseData)
            .toPromise()
            .then(response => response.json())
            .catch(this.handleError(this));
    }


delete(entityId: number) {
        return this.http.delete(`${this.baseUrl}/${entityId}`)
            .toPromise()
            .then(response => response.json())
            .catch(this.handleError(this));
    }


protected handleError(scope: any) {
        return (error: any): Promise<any> => {
            scope.snackBar.open(`Ocurrio un error. Revise la informacion introducida,
            si el problema persiste contacte al administrador.`, 'OK', {
                duration: 10000,
                extraClasses: 'error-snack'
            });
            return Promise.reject(error.message || error);
        }
    }


export class Message extends Component{

  protected template(): string {
    return ``;
  }

}


protected template(): string {
    return ``;
  }


(state: IRootState) => {
  return {
    locale: state.settings.locale,
    reduxState: state,
    strings: getStrings(state.settings.locale),
    themeName: state.settings.theme.localizedName,
    userConsentProvided: state.persistence.userConsentProvided,
    wholeTheme: getTheme(),
  };
}


(dispatch: Dispatch) => {
  return {
    setLocale: dispatchSetLocale(dispatch),
    setTheme: dispatchSetTheme(dispatch),
  };
}


export class MenuBarC extends React.Component<MenuBarOwnProps> {
  public render() {
    const combinedProps = this.props as CombinedProps;

    let items: ICommandBarItemProps[];
    let farItems = getCommonCommandItems(combinedProps);

    if (isOnPage("edit")) {
      const editorItems = getEditorCommandItems(combinedProps);
      items = editorItems.items;
      farItems = [...editorItems.farItems, ...farItems];
    } else if (isOnPage("play")) {
      const runnerItems = getRunnerCommandItems(combinedProps);
      items = runnerItems.items;
      farItems = [...runnerItems.farItems, ...farItems];
    } else {
      items = [];
    }

    return (
      <CommandBar
        ariaLabel={combinedProps.strings.TipNavigateCommandBar}
        items={items}
        farItems={farItems}
        styles={commandBarStyle}
      />
    );
  }
}


type MenuBarOwnProps = {};


type CombinedProps = MenuBarOwnProps & ReturnType<typeof mapStateToProps> & ReturnType<typeof mapDispatchToProps>;


public render() {
    const combinedProps = this.props as CombinedProps;

    let items: ICommandBarItemProps[];
    let farItems = getCommonCommandItems(combinedProps);

    if (isOnPage("edit")) {
      const editorItems = getEditorCommandItems(combinedProps);
      items = editorItems.items;
      farItems = [...editorItems.farItems, ...farItems];
    } else if (isOnPage("play")) {
      const runnerItems = getRunnerCommandItems(combinedProps);
      items = runnerItems.items;
      farItems = [...runnerItems.farItems, ...farItems];
    } else {
      items = [];
    }

    return (
      <CommandBar
        ariaLabel={combinedProps.strings.TipNavigateCommandBar}
        items={items}
        farItems={farItems}
        styles={commandBarStyle}
      />
    );
  }


// import { TimerProps } from './Timer';
export interface IProps {}


({ theme }) => theme.layout.breakpoints.lg


({ theme }) => theme.layout.spacing(4)


({ theme }) => theme.palette.secondary.main


({ theme }) => theme.palette.secondary.contrast


({ theme }) => theme.layout.borderRadius.small


({ theme }) => theme.palette.secondary.light


({ theme }) => css`
    margin-top: ${theme.layout.spacing(2)};
    padding: ${theme.layout.spacing(1)};
    border-radius: ${theme.layout.borderRadius.small};
    background-color: ${theme.palette.gray[100]};
  `


async (message: string): Promise<boolean> => {
  const answers = await enquirer.ask({
    name: 'yesno',
    type: 'confirm',
    message,
  })
  return answers.yesno
}


() => {
  const insets = useSafeAreaInsets();
  return useMemo(
    () =>
      StyleSheet.create({
        search: {
          width: Platform.deviceWidth - Platform.SizeScale(30),
          alignItems: 'flex-end',
        },
      }),
    [insets],
  );
}


() =>
      StyleSheet.create({
        search: {
          width: Platform.deviceWidth - Platform.SizeScale(30),
          alignItems: 'flex-end',
        },
      })


export interface IUploadedFile {
  // destination: string;
  // encoding: string;
  // fieldname: string;
  filename: string;
  // mimetype: string;
  originalname: string;
  // path: string;
  // size: number;
}


export class SQLRepository<T extends Mineable> implements IRepository<T> {
  constructor(public knex: Knex, protected tableName: string) {
  }

  async add(hash: string, item: T) {
    await this.knex
      .insert({
        hash,
        ...item,
      })
      .into(this.tableName);
  }

  async get(hash: string) {
    const item = await this.knex(this.tableName)
      .where('hash', hash)
      .first();

    if (!item) {
      throw new NotFound(hash, 'NotFound');
    }
    return item;
  }

  async isPresent(hash: string) {
    const item = await this.knex(this.tableName)
      .where('hash', hash)
      .first();

    return !!item;
  }

  async remove(hash: string) {
    const item = await this.get(hash);
    await this.knex(this.tableName)
      .delete()
      .where('hash', hash);
    return item;
  }

  async setState(hash: string, state: MineableState) {
    await this.knex(this.tableName)
      .where('hash', hash)
      .update('state', state);
  }

  async markAsPending(hash: string, transactionHash: string) {
    ensureProperTransactionHash(transactionHash);
    await this.knex(this.tableName)
      .where('hash', hash)
      .update('transactionHash', transactionHash)
      .update('state', 'Pending');
  }

  async markAsError(hash: string, error: string) {
    await this.knex(this.tableName)
      .where('hash', hash)
      .update('error', error)
      .update('state', 'Error');
  }
}


async add(hash: string, item: T) {
    await this.knex
      .insert({
        hash,
        ...item,
      })
      .into(this.tableName);
  }


async get(hash: string) {
    const item = await this.knex(this.tableName)
      .where('hash', hash)
      .first();

    if (!item) {
      throw new NotFound(hash, 'NotFound');
    }
    return item;
  }


async isPresent(hash: string) {
    const item = await this.knex(this.tableName)
      .where('hash', hash)
      .first();

    return !!item;
  }


async remove(hash: string) {
    const item = await this.get(hash);
    await this.knex(this.tableName)
      .delete()
      .where('hash', hash);
    return item;
  }


async setState(hash: string, state: MineableState) {
    await this.knex(this.tableName)
      .where('hash', hash)
      .update('state', state);
  }


async markAsPending(hash: string, transactionHash: string) {
    ensureProperTransactionHash(transactionHash);
    await this.knex(this.tableName)
      .where('hash', hash)
      .update('transactionHash', transactionHash)
      .update('state', 'Pending');
  }


async markAsError(hash: string, error: string) {
    await this.knex(this.tableName)
      .where('hash', hash)
      .update('error', error)
      .update('state', 'Error');
  }


() => {
  // Use mock service directly - account id is mock test id.
  const currentAccount = {
    id: 'test_id'
  }
  sessionStorage.setItem('CURRENT_ACCOUNT', JSON.stringify(currentAccount))
  sessionStorage.setItem('AUTH_API_URL', 'https://bcregistry-bcregistry-mock.apigee.net/mockTarget/auth/api/v1/')

  it('Get registering party from auth', async () => {
    const registeringParty:PartyIF = await getRegisteringPartyFromAuth()
    console.log(JSON.stringify(registeringParty))
    expect(registeringParty.businessName).toBeDefined()
    expect(registeringParty.address).toBeDefined()
    expect(registeringParty.address.street).toBeDefined()
    expect(registeringParty.address.city).toBeDefined()
    expect(registeringParty.address.region).toBeDefined()
    expect(registeringParty.address.postalCode).toBeDefined()
    expect(registeringParty.address.country).toBe('CA')
  })
}


async () => {
    const registeringParty:PartyIF = await getRegisteringPartyFromAuth()
    console.log(JSON.stringify(registeringParty))
    expect(registeringParty.businessName).toBeDefined()
    expect(registeringParty.address).toBeDefined()
    expect(registeringParty.address.street).toBeDefined()
    expect(registeringParty.address.city).toBeDefined()
    expect(registeringParty.address.region).toBeDefined()
    expect(registeringParty.address.postalCode).toBeDefined()
    expect(registeringParty.address.country).toBe('CA')
  }


(
  req: Request,
  res: Response,
  next: NextFunction
) => {
  readFile('./USERMANUAL.md', 'utf8', (err: Error, data: Buffer) => {
    if (err) {
      return res.send({ error: err })
    }
    res.send(data)
  })
}


(err: Error, data: Buffer) => {
    if (err) {
      return res.send({ error: err })
    }
    res.send(data)
  }


(md: markdownIt.MarkdownIt) => {
			md.use(katex);
		}


/** a example written in Preact */
export function PreactExample({ children }) {
  const title = 'Preact'
  const [count, setCount] = useState(0)
  const add = () => setCount((i) => i + 1)
  const subtract = () => setCount((i) => i - 1)

  return (
    <>

{title}

        <button onClick={subtract}>-</button>

{count}

        <button onClick={add}>+</button>

{children}

    </>
  )
}


() => setCount((i) => i + 1)


(i) => i + 1


() => setCount((i) => i - 1)


(i) => i - 1


export enum Type {
  LOG_OPERATION_ADD  = 'LOG_OPERATION_ADD',
  LOG_OPERATION_INIT = 'LOG_OPERATION_INIT'
}


(): ReactElement => {
  return (
    <SidebarSectionRow>
      <SidebarSectionColumn>
        <RotationInput />
      </SidebarSectionColumn>
    </SidebarSectionRow>
  );
}


() =>
      this.actions$.pipe(
        ofType(authLogin),
        withLatestFrom(this.store.pipe(select(selectCognitoUser))),
        tap(([ action, cognitoUser]) =>
          this.localStorageService.setItem(AUTH_KEY, { isAuthenticated: true , cognitoUser})
        )
      )


([ action, cognitoUser]) =>
          this.localStorageService.setItem(AUTH_KEY, { isAuthenticated: true , cognitoUser})


() =>
      this.actions$.pipe(
        ofType(authLogout),
        tap((action) => {
          if (action.redirect) {
            this.router.navigate(['']);
          }
          this.localStorageService.setItem(AUTH_KEY, {
            isAuthenticated: false
          });
          Auth.signOut();
        })
      )


(action) => {
          if (action.redirect) {
            this.router.navigate(['']);
          }
          this.localStorageService.setItem(AUTH_KEY, {
            isAuthenticated: false
          });
          Auth.signOut();
        }


() =>
      this.actions$.pipe(
        ofType(authRefresh),
        tap(() => {
          Auth.currentSession().then(
            session => {
              Auth.currentAuthenticatedUser().then(
                user => {
                  if (user && user.username){
                    this.store.dispatch(authLogin({cognitoUser: {username: user.username, idToken: user.signInUserSession.idToken.getJwtToken(), ...user.attributes}}));
                  } else {
                    this.store.dispatch(authLogout({redirect: false}));
                  }
                },
                err => this.store.dispatch(authLogout({redirect: false})))
            },
            err =>  {}
          )
        })
      )


() => {
          Auth.currentSession().then(
            session => {
              Auth.currentAuthenticatedUser().then(
                user => {
                  if (user && user.username){
                    this.store.dispatch(authLogin({cognitoUser: {username: user.username, idToken: user.signInUserSession.idToken.getJwtToken(), ...user.attributes}}));
                  } else {
                    this.store.dispatch(authLogout({redirect: false}));
                  }
                },
                err => this.store.dispatch(authLogout({redirect: false})))
            },
            err =>  {}
          )
        }


session => {
              Auth.currentAuthenticatedUser().then(
                user => {
                  if (user && user.username){
                    this.store.dispatch(authLogin({cognitoUser: {username: user.username, idToken: user.signInUserSession.idToken.getJwtToken(), ...user.attributes}}));
                  } else {
                    this.store.dispatch(authLogout({redirect: false}));
                  }
                },
                err => this.store.dispatch(authLogout({redirect: false})))
            }


user => {
                  if (user && user.username){
                    this.store.dispatch(authLogin({cognitoUser: {username: user.username, idToken: user.signInUserSession.idToken.getJwtToken(), ...user.attributes}}));
                  } else {
                    this.store.dispatch(authLogout({redirect: false}));
                  }
                }


err => this.store.dispatch(authLogout({redirect: false}))


err =>  {}


() =>
      this.actions$.pipe(
        ofType(authGoToAccount),
        withLatestFrom(this.store.pipe(select(selectCognitoUser))),
        tap(([action, user]) => {
          const navUrl = user['custom:usergroup'] === 'partener' ? '/puser' : '/duser';
          this.router.navigateByUrl(navUrl);
        })
      )


([action, user]) => {
          const navUrl = user['custom:usergroup'] === 'partener' ? '/puser' : '/duser';
          this.router.navigateByUrl(navUrl);
        }


@Injectable()
export class AuthEffects {
  constructor(
    private actions$: Actions,
    private localStorageService: LocalStorageService,
    private router: Router,
    private store: Store,
  ) {}

  login = createEffect(
    () =>
      this.actions$.pipe(
        ofType(authLogin),
        withLatestFrom(this.store.pipe(select(selectCognitoUser))),
        tap(([ action, cognitoUser]) =>
          this.localStorageService.setItem(AUTH_KEY, { isAuthenticated: true , cognitoUser})
        )
      ),
    { dispatch: false }
  );

  logout = createEffect(
    () =>
      this.actions$.pipe(
        ofType(authLogout),
        tap((action) => {
          if (action.redirect) {
            this.router.navigate(['']);
          }
          this.localStorageService.setItem(AUTH_KEY, {
            isAuthenticated: false
          });
          Auth.signOut();
        })
      ),
    { dispatch: false }
  );

  refresh = createEffect(
    () =>
      this.actions$.pipe(
        ofType(authRefresh),
        tap(() => {
          Auth.currentSession().then(
            session => {
              Auth.currentAuthenticatedUser().then(
                user => {
                  if (user && user.username){
                    this.store.dispatch(authLogin({cognitoUser: {username: user.username, idToken: user.signInUserSession.idToken.getJwtToken(), ...user.attributes}}));
                  } else {
                    this.store.dispatch(authLogout({redirect: false}));
                  }
                },
                err => this.store.dispatch(authLogout({redirect: false})))
            },
            err =>  {}
          )
        })
      ),
    { dispatch: false }
  );

  goToAccount = createEffect(
    () =>
      this.actions$.pipe(
        ofType(authGoToAccount),
        withLatestFrom(this.store.pipe(select(selectCognitoUser))),
        tap(([action, user]) => {
          const navUrl = user['custom:usergroup'] === 'partener' ? '/puser' : '/duser';
          this.router.navigateByUrl(navUrl);
        })
      ),
    { dispatch: false }
  );
}


/**
   *
Associates a customer gateway with a device and optionally, with a link. If you
   *             specify a link, it must be associated with the specified device.

   *
You can only associate customer gateways that are connected to a VPN attachment on a
   *             transit gateway. The transit gateway must be registered in your global network. When
   *             you register a transit gateway, customer gateways that are connected to the transit
   *             gateway are automatically included in the global network. To list customer gateways
   *             that are connected to a transit gateway, use the DescribeVpnConnections EC2 API and filter by
   *                 transit-gateway-id.

   *
You cannot associate a customer gateway with more than one device and link.

   */
public associateCustomerGateway(
    args: AssociateCustomerGatewayCommandInput,
    options?: __HttpHandlerOptions
  ): Promise<AssociateCustomerGatewayCommandOutput>;


public associateCustomerGateway(
    args: AssociateCustomerGatewayCommandInput,
    cb: (err: any, data?: AssociateCustomerGatewayCommandOutput) => void
  ): void;


public associateCustomerGateway(
    args: AssociateCustomerGatewayCommandInput,
    options: __HttpHandlerOptions,
    cb: (err: any, data?: AssociateCustomerGatewayCommandOutput) => void
  ): void;


public associateCustomerGateway(
    args: AssociateCustomerGatewayCommandInput,
    optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: AssociateCustomerGatewayCommandOutput) => void),
    cb?: (err: any, data?: AssociateCustomerGatewayCommandOutput) => void
  ): Promise<AssociateCustomerGatewayCommandOutput> | void {
    const command = new AssociateCustomerGatewayCommand(args);
    if (typeof optionsOrCb === "function") {
      this.send(command, optionsOrCb);
    } else if (typeof cb === "function") {
      if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
      this.send(command, optionsOrCb || {}, cb);
    } else {
      return this.send(command, optionsOrCb);
    }
  }


/**
   *
Associates a link to a device. A device can be associated to multiple links and a link can be associated to multiple devices. The device and link must be in the same global network and the same site.

   */
public associateLink(
    args: AssociateLinkCommandInput,
    options?: __HttpHandlerOptions
  ): Promise<AssociateLinkCommandOutput>;


public associateLink(
    args: AssociateLinkCommandInput,
    cb: (err: any, data?: AssociateLinkCommandOutput) => void
  ): void;


public associateLink(
    args: AssociateLinkCommandInput,
    options: __HttpHandlerOptions,
    cb: (err: any, data?: AssociateLinkCommandOutput) => void
  ): void;


public associateLink(
    args: AssociateLinkCommandInput,
    optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: AssociateLinkCommandOutput) => void),
    cb?: (err: any, data?: AssociateLinkCommandOutput) => void
  ): Promise<AssociateLinkCommandOutput> | void {
    const command = new AssociateLinkCommand(args);
    if (typeof optionsOrCb === "function") {
      this.send(command, optionsOrCb);
    } else if (typeof cb === "function") {
      if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
      this.send(command, optionsOrCb || {}, cb);
    } else {
      return this.send(command, optionsOrCb);
    }
  }


/**
   *
Associates a transit gateway Connect peer with a device, and optionally, with a link. If you
   *             specify a link, it must be associated with the specified device.

   *
You can only associate transit gateway Connect peers that have been created on a
   *             transit gateway that's registered in your global network.

   *
You cannot associate a transit gateway Connect peer with more than one device and link.

   */
public associateTransitGatewayConnectPeer(
    args: AssociateTransitGatewayConnectPeerCommandInput,
    options?: __HttpHandlerOptions
  ): Promise<AssociateTransitGatewayConnectPeerCommandOutput>;


public associateTransitGatewayConnectPeer(
    args: AssociateTransitGatewayConnectPeerCommandInput,
    cb: (err: any, data?: AssociateTransitGatewayConnectPeerCommandOutput) => void
  ): void;


public associateTransitGatewayConnectPeer(
    args: AssociateTransitGatewayConnectPeerCommandInput,
    options: __HttpHandlerOptions,
    cb: (err: any, data?: AssociateTransitGatewayConnectPeerCommandOutput) => void
  ): void;


public associateTransitGatewayConnectPeer(
    args: AssociateTransitGatewayConnectPeerCommandInput,
    optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: AssociateTransitGatewayConnectPeerCommandOutput) => void),
    cb?: (err: any, data?: AssociateTransitGatewayConnectPeerCommandOutput) => void
  ): Promise<AssociateTransitGatewayConnectPeerCommandOutput> | void {
    const command = new AssociateTransitGatewayConnectPeerCommand(args);
    if (typeof optionsOrCb === "function") {
      this.send(command, optionsOrCb);
    } else if (typeof cb === "function") {
      if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
      this.send(command, optionsOrCb || {}, cb);
    } else {
      return this.send(command, optionsOrCb);
    }
  }


/**
   *
Creates a connection between two devices. The devices can be a physical or virtual appliance that connects to a third-party appliance in a VPC, or a physical appliance that connects to another physical appliance in an on-premises network.

   */
public createConnection(
    args: CreateConnectionCommandInput,
    options?: __HttpHandlerOptions
  ): Promise<CreateConnectionCommandOutput>;


public createConnection(
    args: CreateConnectionCommandInput,
    cb: (err: any, data?: CreateConnectionCommandOutput) => void
  ): void;


public createConnection(
    args: CreateConnectionCommandInput,
    options: __HttpHandlerOptions,
    cb: (err: any, data?: CreateConnectionCommandOutput) => void
  ): void;


public createConnection(
    args: CreateConnectionCommandInput,
    optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: CreateConnectionCommandOutput) => void),
    cb?: (err: any, data?: CreateConnectionCommandOutput) => void
  ): Promise<CreateConnectionCommandOutput> | void {
    const command = new CreateConnectionCommand(args);
    if (typeof optionsOrCb === "function") {
      this.send(command, optionsOrCb);
    } else if (typeof cb === "function") {
      if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
      this.send(command, optionsOrCb || {}, cb);
    } else {
      return this.send(command, optionsOrCb);
    }
  }


/**
   *
Creates a new device in a global network. If you specify both a site ID and a
   *             location, the location of the site is used for visualization in the Network Manager console.

   */
public createDevice(
    args: CreateDeviceCommandInput,
    options?: __HttpHandlerOptions
  ): Promise<CreateDeviceCommandOutput>;


public createDevice(args: CreateDeviceCommandInput, cb: (err: any, data?: CreateDeviceCommandOutput) => void): void;


public createDevice(
    args: CreateDeviceCommandInput,
    options: __HttpHandlerOptions,
    cb: (err: any, data?: CreateDeviceCommandOutput) => void
  ): void;


public createDevice(
    args: CreateDeviceCommandInput,
    optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: CreateDeviceCommandOutput) => void),
    cb?: (err: any, data?: CreateDeviceCommandOutput) => void
  ): Promise<CreateDeviceCommandOutput> | void {
    const command = new CreateDeviceCommand(args);
    if (typeof optionsOrCb === "function") {
      this.send(command, optionsOrCb);
    } else if (typeof cb === "function") {
      if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
      this.send(command, optionsOrCb || {}, cb);
    } else {
      return this.send(command, optionsOrCb);
    }
  }


/**
   *
Creates a new, empty global network.

   */
public createGlobalNetwork(
    args: CreateGlobalNetworkCommandInput,
    options?: __HttpHandlerOptions
  ): Promise<CreateGlobalNetworkCommandOutput>;


public createGlobalNetwork(
    args: CreateGlobalNetworkCommandInput,
    cb: (err: any, data?: CreateGlobalNetworkCommandOutput) => void
  ): void;


public createGlobalNetwork(
    args: CreateGlobalNetworkCommandInput,
    options: __HttpHandlerOptions,
    cb: (err: any, data?: CreateGlobalNetworkCommandOutput) => void
  ): void;


public createGlobalNetwork(
    args: CreateGlobalNetworkCommandInput,
    optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: CreateGlobalNetworkCommandOutput) => void),
    cb?: (err: any, data?: CreateGlobalNetworkCommandOutput) => void
  ): Promise<CreateGlobalNetworkCommandOutput> | void {
    const command = new CreateGlobalNetworkCommand(args);
    if (typeof optionsOrCb === "function") {
      this.send(command, optionsOrCb);
    } else if (typeof cb === "function") {
      if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
      this.send(command, optionsOrCb || {}, cb);
    } else {
      return this.send(command, optionsOrCb);
    }
  }


/**
   *
Creates a new link for a specified site.

   */
public createLink(args: CreateLinkCommandInput, options?: __HttpHandlerOptions): Promise<CreateLinkCommandOutput>;


public createLink(args: CreateLinkCommandInput, cb: (err: any, data?: CreateLinkCommandOutput) => void): void;


public createLink(
    args: CreateLinkCommandInput,
    options: __HttpHandlerOptions,
    cb: (err: any, data?: CreateLinkCommandOutput) => void
  ): void;


public createLink(
    args: CreateLinkCommandInput,
    optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: CreateLinkCommandOutput) => void),
    cb?: (err: any, data?: CreateLinkCommandOutput) => void
  ): Promise<CreateLinkCommandOutput> | void {
    const command = new CreateLinkCommand(args);
    if (typeof optionsOrCb === "function") {
      this.send(command, optionsOrCb);
    } else if (typeof cb === "function") {
      if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
      this.send(command, optionsOrCb || {}, cb);
    } else {
      return this.send(command, optionsOrCb);
    }
  }


/**
   *
Creates a new site in a global network.

   */
public createSite(args: CreateSiteCommandInput, options?: __HttpHandlerOptions): Promise<CreateSiteCommandOutput>;


public createSite(args: CreateSiteCommandInput, cb: (err: any, data?: CreateSiteCommandOutput) => void): void;


public createSite(
    args: CreateSiteCommandInput,
    options: __HttpHandlerOptions,
    cb: (err: any, data?: CreateSiteCommandOutput) => void
  ): void;


public createSite(
    args: CreateSiteCommandInput,
    optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: CreateSiteCommandOutput) => void),
    cb?: (err: any, data?: CreateSiteCommandOutput) => void
  ): Promise<CreateSiteCommandOutput> | void {
    const command = new CreateSiteCommand(args);
    if (typeof optionsOrCb === "function") {
      this.send(command, optionsOrCb);
    } else if (typeof cb === "function") {
      if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
      this.send(command, optionsOrCb || {}, cb);
    } else {
      return this.send(command, optionsOrCb);
    }
  }


/**
   *
Deletes the specified connection in your global network.

   */
public deleteConnection(
    args: DeleteConnectionCommandInput,
    options?: __HttpHandlerOptions
  ): Promise<DeleteConnectionCommandOutput>;


public deleteConnection(
    args: DeleteConnectionCommandInput,
    cb: (err: any, data?: DeleteConnectionCommandOutput) => void
  ): void;


public deleteConnection(
    args: DeleteConnectionCommandInput,
    options: __HttpHandlerOptions,
    cb: (err: any, data?: DeleteConnectionCommandOutput) => void
  ): void;


public deleteConnection(
    args: DeleteConnectionCommandInput,
    optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: DeleteConnectionCommandOutput) => void),
    cb?: (err: any, data?: DeleteConnectionCommandOutput) => void
  ): Promise<DeleteConnectionCommandOutput> | void {
    const command = new DeleteConnectionCommand(args);
    if (typeof optionsOrCb === "function") {
      this.send(command, optionsOrCb);
    } else if (typeof cb === "function") {
      if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
      this.send(command, optionsOrCb || {}, cb);
    } else {
      return this.send(command, optionsOrCb);
    }
  }


/**
   *
Deletes an existing device. You must first disassociate the device from any links and
   *             customer gateways.

   */
public deleteDevice(
    args: DeleteDeviceCommandInput,
    options?: __HttpHandlerOptions
  ): Promise<DeleteDeviceCommandOutput>;


public deleteDevice(args: DeleteDeviceCommandInput, cb: (err: any, data?: DeleteDeviceCommandOutput) => void): void;


public deleteDevice(
    args: DeleteDeviceCommandInput,
    options: __HttpHandlerOptions,
    cb: (err: any, data?: DeleteDeviceCommandOutput) => void
  ): void;


public deleteDevice(
    args: DeleteDeviceCommandInput,
    optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: DeleteDeviceCommandOutput) => void),
    cb?: (err: any, data?: DeleteDeviceCommandOutput) => void
  ): Promise<DeleteDeviceCommandOutput> | void {
    const command = new DeleteDeviceCommand(args);
    if (typeof optionsOrCb === "function") {
      this.send(command, optionsOrCb);
    } else if (typeof cb === "function") {
      if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
      this.send(command, optionsOrCb || {}, cb);
    } else {
      return this.send(command, optionsOrCb);
    }
  }


/**
   *
Deletes an existing global network. You must first delete all global network objects
   *             (devices, links, and sites) and deregister all transit gateways.

   */
public deleteGlobalNetwork(
    args: DeleteGlobalNetworkCommandInput,
    options?: __HttpHandlerOptions
  ): Promise<DeleteGlobalNetworkCommandOutput>;


public deleteGlobalNetwork(
    args: DeleteGlobalNetworkCommandInput,
    cb: (err: any, data?: DeleteGlobalNetworkCommandOutput) => void
  ): void;


public deleteGlobalNetwork(
    args: DeleteGlobalNetworkCommandInput,
    options: __HttpHandlerOptions,
    cb: (err: any, data?: DeleteGlobalNetworkCommandOutput) => void
  ): void;


public deleteGlobalNetwork(
    args: DeleteGlobalNetworkCommandInput,
    optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: DeleteGlobalNetworkCommandOutput) => void),
    cb?: (err: any, data?: DeleteGlobalNetworkCommandOutput) => void
  ): Promise<DeleteGlobalNetworkCommandOutput> | void {
    const command = new DeleteGlobalNetworkCommand(args);
    if (typeof optionsOrCb === "function") {
      this.send(command, optionsOrCb);
    } else if (typeof cb === "function") {
      if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
      this.send(command, optionsOrCb || {}, cb);
    } else {
      return this.send(command, optionsOrCb);
    }
  }


/**
   *
Deletes an existing link. You must first disassociate the link from any devices and
   *             customer gateways.

   */
public deleteLink(args: DeleteLinkCommandInput, options?: __HttpHandlerOptions): Promise<DeleteLinkCommandOutput>;


public deleteLink(args: DeleteLinkCommandInput, cb: (err: any, data?: DeleteLinkCommandOutput) => void): void;


public deleteLink(
    args: DeleteLinkCommandInput,
    options: __HttpHandlerOptions,
    cb: (err: any, data?: DeleteLinkCommandOutput) => void
  ): void;


public deleteLink(
    args: DeleteLinkCommandInput,
    optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: DeleteLinkCommandOutput) => void),
    cb?: (err: any, data?: DeleteLinkCommandOutput) => void
  ): Promise<DeleteLinkCommandOutput> | void {
    const command = new DeleteLinkCommand(args);
    if (typeof optionsOrCb === "function") {
      this.send(command, optionsOrCb);
    } else if (typeof cb === "function") {
      if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
      this.send(command, optionsOrCb || {}, cb);
    } else {
      return this.send(command, optionsOrCb);
    }
  }


/**
   *
Deletes an existing site. The site cannot be associated with any device or link.

   */
public deleteSite(args: DeleteSiteCommandInput, options?: __HttpHandlerOptions): Promise<DeleteSiteCommandOutput>;


public deleteSite(args: DeleteSiteCommandInput, cb: (err: any, data?: DeleteSiteCommandOutput) => void): void;


public deleteSite(
    args: DeleteSiteCommandInput,
    options: __HttpHandlerOptions,
    cb: (err: any, data?: DeleteSiteCommandOutput) => void
  ): void;


public deleteSite(
    args: DeleteSiteCommandInput,
    optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: DeleteSiteCommandOutput) => void),
    cb?: (err: any, data?: DeleteSiteCommandOutput) => void
  ): Promise<DeleteSiteCommandOutput> | void {
    const command = new DeleteSiteCommand(args);
    if (typeof optionsOrCb === "function") {
      this.send(command, optionsOrCb);
    } else if (typeof cb === "function") {
      if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
      this.send(command, optionsOrCb || {}, cb);
    } else {
      return this.send(command, optionsOrCb);
    }
  }


/**
   *
Deregisters a transit gateway from your global network. This action does not delete
   *             your transit gateway, or modify any of its attachments. This action removes any customer gateway associations.

   */
public deregisterTransitGateway(
    args: DeregisterTransitGatewayCommandInput,
    options?: __HttpHandlerOptions
  ): Promise<DeregisterTransitGatewayCommandOutput>;


public deregisterTransitGateway(
    args: DeregisterTransitGatewayCommandInput,
    cb: (err: any, data?: DeregisterTransitGatewayCommandOutput) => void
  ): void;


public deregisterTransitGateway(
    args: DeregisterTransitGatewayCommandInput,
    options: __HttpHandlerOptions,
    cb: (err: any, data?: DeregisterTransitGatewayCommandOutput) => void
  ): void;


public deregisterTransitGateway(
    args: DeregisterTransitGatewayCommandInput,
    optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: DeregisterTransitGatewayCommandOutput) => void),
    cb?: (err: any, data?: DeregisterTransitGatewayCommandOutput) => void
  ): Promise<DeregisterTransitGatewayCommandOutput> | void {
    const command = new DeregisterTransitGatewayCommand(args);
    if (typeof optionsOrCb === "function") {
      this.send(command, optionsOrCb);
    } else if (typeof cb === "function") {
      if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
      this.send(command, optionsOrCb || {}, cb);
    } else {
      return this.send(command, optionsOrCb);
    }
  }


/**
   *
Describes one or more global networks. By default, all global networks are
   *             described. To describe the objects in your global network, you must use the appropriate
   *                 Get* action. For example, to list the transit gateways in your global
   *             network, use GetTransitGatewayRegistrations.

   */
public describeGlobalNetworks(
    args: DescribeGlobalNetworksCommandInput,
    options?: __HttpHandlerOptions
  ): Promise<DescribeGlobalNetworksCommandOutput>;


public describeGlobalNetworks(
    args: DescribeGlobalNetworksCommandInput,
    cb: (err: any, data?: DescribeGlobalNetworksCommandOutput) => void
  ): void;


public describeGlobalNetworks(
    args: DescribeGlobalNetworksCommandInput,
    options: __HttpHandlerOptions,
    cb: (err: any, data?: DescribeGlobalNetworksCommandOutput) => void
  ): void;


public describeGlobalNetworks(
    args: DescribeGlobalNetworksCommandInput,
    optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: DescribeGlobalNetworksCommandOutput) => void),
    cb?: (err: any, data?: DescribeGlobalNetworksCommandOutput) => void
  ): Promise<DescribeGlobalNetworksCommandOutput> | void {
    const command = new DescribeGlobalNetworksCommand(args);
    if (typeof optionsOrCb === "function") {
      this.send(command, optionsOrCb);
    } else if (typeof cb === "function") {
      if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
      this.send(command, optionsOrCb || {}, cb);
    } else {
      return this.send(command, optionsOrCb);
    }
  }


/**
   *
Disassociates a customer gateway from a device and a link.

   */
public disassociateCustomerGateway(
    args: DisassociateCustomerGatewayCommandInput,
    options?: __HttpHandlerOptions
  ): Promise<DisassociateCustomerGatewayCommandOutput>;


public disassociateCustomerGateway(
    args: DisassociateCustomerGatewayCommandInput,
    cb: (err: any, data?: DisassociateCustomerGatewayCommandOutput) => void
  ): void;


public disassociateCustomerGateway(
    args: DisassociateCustomerGatewayCommandInput,
    options: __HttpHandlerOptions,
    cb: (err: any, data?: DisassociateCustomerGatewayCommandOutput) => void
  ): void;


public disassociateCustomerGateway(
    args: DisassociateCustomerGatewayCommandInput,
    optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: DisassociateCustomerGatewayCommandOutput) => void),
    cb?: (err: any, data?: DisassociateCustomerGatewayCommandOutput) => void
  ): Promise<DisassociateCustomerGatewayCommandOutput> | void {
    const command = new DisassociateCustomerGatewayCommand(args);
    if (typeof optionsOrCb === "function") {
      this.send(command, optionsOrCb);
    } else if (typeof cb === "function") {
      if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
      this.send(command, optionsOrCb || {}, cb);
    } else {
      return this.send(command, optionsOrCb);
    }
  }


/**
   *
Disassociates an existing device from a link. You must first disassociate any customer
   *             gateways that are associated with the link.

   */
public disassociateLink(
    args: DisassociateLinkCommandInput,
    options?: __HttpHandlerOptions
  ): Promise<DisassociateLinkCommandOutput>;


public disassociateLink(
    args: DisassociateLinkCommandInput,
    cb: (err: any, data?: DisassociateLinkCommandOutput) => void
  ): void;


public disassociateLink(
    args: DisassociateLinkCommandInput,
    options: __HttpHandlerOptions,
    cb: (err: any, data?: DisassociateLinkCommandOutput) => void
  ): void;


public disassociateLink(
    args: DisassociateLinkCommandInput,
    optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: DisassociateLinkCommandOutput) => void),
    cb?: (err: any, data?: DisassociateLinkCommandOutput) => void
  ): Promise<DisassociateLinkCommandOutput> | void {
    const command = new DisassociateLinkCommand(args);
    if (typeof optionsOrCb === "function") {
      this.send(command, optionsOrCb);
    } else if (typeof cb === "function") {
      if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
      this.send(command, optionsOrCb || {}, cb);
    } else {
      return this.send(command, optionsOrCb);
    }
  }


/**
   *
Disassociates a transit gateway Connect peer from a device and link.

   */
public disassociateTransitGatewayConnectPeer(
    args: DisassociateTransitGatewayConnectPeerCommandInput,
    options?: __HttpHandlerOptions
  ): Promise<DisassociateTransitGatewayConnectPeerCommandOutput>;


public disassociateTransitGatewayConnectPeer(
    args: DisassociateTransitGatewayConnectPeerCommandInput,
    cb: (err: any, data?: DisassociateTransitGatewayConnectPeerCommandOutput) => void
  ): void;


public disassociateTransitGatewayConnectPeer(
    args: DisassociateTransitGatewayConnectPeerCommandInput,
    options: __HttpHandlerOptions,
    cb: (err: any, data?: DisassociateTransitGatewayConnectPeerCommandOutput) => void
  ): void;


public disassociateTransitGatewayConnectPeer(
    args: DisassociateTransitGatewayConnectPeerCommandInput,
    optionsOrCb?:
      | __HttpHandlerOptions
      | ((err: any, data?: DisassociateTransitGatewayConnectPeerCommandOutput) => void),
    cb?: (err: any, data?: DisassociateTransitGatewayConnectPeerCommandOutput) => void
  ): Promise<DisassociateTransitGatewayConnectPeerCommandOutput> | void {
    const command = new DisassociateTransitGatewayConnectPeerCommand(args);
    if (typeof optionsOrCb === "function") {
      this.send(command, optionsOrCb);
    } else if (typeof cb === "function") {
      if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
      this.send(command, optionsOrCb || {}, cb);
    } else {
      return this.send(command, optionsOrCb);
    }
  }


/**
   *
Gets information about one or more of your connections in a global network.

   */
public getConnections(
    args: GetConnectionsCommandInput,
    options?: __HttpHandlerOptions
  ): Promise<GetConnectionsCommandOutput>;


public getConnections(
    args: GetConnectionsCommandInput,
    cb: (err: any, data?: GetConnectionsCommandOutput) => void
  ): void;


public getConnections(
    args: GetConnectionsCommandInput,
    options: __HttpHandlerOptions,
    cb: (err: any, data?: GetConnectionsCommandOutput) => void
  ): void;


public getConnections(
    args: GetConnectionsCommandInput,
    optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: GetConnectionsCommandOutput) => void),
    cb?: (err: any, data?: GetConnectionsCommandOutput) => void
  ): Promise<GetConnectionsCommandOutput> | void {
    const command = new GetConnectionsCommand(args);
    if (typeof optionsOrCb === "function") {
      this.send(command, optionsOrCb);
    } else if (typeof cb === "function") {
      if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
      this.send(command, optionsOrCb || {}, cb);
    } else {
      return this.send(command, optionsOrCb);
    }
  }


/**
   *
Gets the association information for customer gateways that are associated with
   *             devices and links in your global network.

   */
public getCustomerGatewayAssociations(
    args: GetCustomerGatewayAssociationsCommandInput,
    options?: __HttpHandlerOptions
  ): Promise<GetCustomerGatewayAssociationsCommandOutput>;


public getCustomerGatewayAssociations(
    args: GetCustomerGatewayAssociationsCommandInput,
    cb: (err: any, data?: GetCustomerGatewayAssociationsCommandOutput) => void
  ): void;


public getCustomerGatewayAssociations(
    args: GetCustomerGatewayAssociationsCommandInput,
    options: __HttpHandlerOptions,
    cb: (err: any, data?: GetCustomerGatewayAssociationsCommandOutput) => void
  ): void;


public getCustomerGatewayAssociations(
    args: GetCustomerGatewayAssociationsCommandInput,
    optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: GetCustomerGatewayAssociationsCommandOutput) => void),
    cb?: (err: any, data?: GetCustomerGatewayAssociationsCommandOutput) => void
  ): Promise<GetCustomerGatewayAssociationsCommandOutput> | void {
    const command = new GetCustomerGatewayAssociationsCommand(args);
    if (typeof optionsOrCb === "function") {
      this.send(command, optionsOrCb);
    } else if (typeof cb === "function") {
      if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
      this.send(command, optionsOrCb || {}, cb);
    } else {
      return this.send(command, optionsOrCb);
    }
  }


/**
   *
Gets information about one or more of your devices in a global network.

   */
public getDevices(args: GetDevicesCommandInput, options?: __HttpHandlerOptions): Promise<GetDevicesCommandOutput>;


public getDevices(args: GetDevicesCommandInput, cb: (err: any, data?: GetDevicesCommandOutput) => void): void;


public getDevices(
    args: GetDevicesCommandInput,
    options: __HttpHandlerOptions,
    cb: (err: any, data?: GetDevicesCommandOutput) => void
  ): void;


public getDevices(
    args: GetDevicesCommandInput,
    optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: GetDevicesCommandOutput) => void),
    cb?: (err: any, data?: GetDevicesCommandOutput) => void
  ): Promise<GetDevicesCommandOutput> | void {
    const command = new GetDevicesCommand(args);
    if (typeof optionsOrCb === "function") {
      this.send(command, optionsOrCb);
    } else if (typeof cb === "function") {
      if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
      this.send(command, optionsOrCb || {}, cb);
    } else {
      return this.send(command, optionsOrCb);
    }
  }


/**
   *
Gets the link associations for a device or a link. Either the device ID or the link ID
   *             must be specified.

   */
public getLinkAssociations(
    args: GetLinkAssociationsCommandInput,
    options?: __HttpHandlerOptions
  ): Promise<GetLinkAssociationsCommandOutput>;


public getLinkAssociations(
    args: GetLinkAssociationsCommandInput,
    cb: (err: any, data?: GetLinkAssociationsCommandOutput) => void
  ): void;


public getLinkAssociations(
    args: GetLinkAssociationsCommandInput,
    options: __HttpHandlerOptions,
    cb: (err: any, data?: GetLinkAssociationsCommandOutput) => void
  ): void;


public getLinkAssociations(
    args: GetLinkAssociationsCommandInput,
    optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: GetLinkAssociationsCommandOutput) => void),
    cb?: (err: any, data?: GetLinkAssociationsCommandOutput) => void
  ): Promise<GetLinkAssociationsCommandOutput> | void {
    const command = new GetLinkAssociationsCommand(args);
    if (typeof optionsOrCb === "function") {
      this.send(command, optionsOrCb);
    } else if (typeof cb === "function") {
      if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
      this.send(command, optionsOrCb || {}, cb);
    } else {
      return this.send(command, optionsOrCb);
    }
  }


/**
   *
Gets information about one or more links in a specified global network.

   *
If you specify the site ID, you cannot specify the type or provider in the same request. You can specify the type and provider in the same request.

   */
public getLinks(args: GetLinksCommandInput, options?: __HttpHandlerOptions): Promise<GetLinksCommandOutput>;


public getLinks(args: GetLinksCommandInput, cb: (err: any, data?: GetLinksCommandOutput) => void): void;


public getLinks(
    args: GetLinksCommandInput,
    options: __HttpHandlerOptions,
    cb: (err: any, data?: GetLinksCommandOutput) => void
  ): void;


public getLinks(
    args: GetLinksCommandInput,
    optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: GetLinksCommandOutput) => void),
    cb?: (err: any, data?: GetLinksCommandOutput) => void
  ): Promise<GetLinksCommandOutput> | void {
    const command = new GetLinksCommand(args);
    if (typeof optionsOrCb === "function") {
      this.send(command, optionsOrCb);
    } else if (typeof cb === "function") {
      if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
      this.send(command, optionsOrCb || {}, cb);
    } else {
      return this.send(command, optionsOrCb);
    }
  }


/**
   *
Gets information about one or more of your sites in a global network.

   */
public getSites(args: GetSitesCommandInput, options?: __HttpHandlerOptions): Promise<GetSitesCommandOutput>;


public getSites(args: GetSitesCommandInput, cb: (err: any, data?: GetSitesCommandOutput) => void): void;


public getSites(
    args: GetSitesCommandInput,
    options: __HttpHandlerOptions,
    cb: (err: any, data?: GetSitesCommandOutput) => void
  ): void;


public getSites(
    args: GetSitesCommandInput,
    optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: GetSitesCommandOutput) => void),
    cb?: (err: any, data?: GetSitesCommandOutput) => void
  ): Promise<GetSitesCommandOutput> | void {
    const command = new GetSitesCommand(args);
    if (typeof optionsOrCb === "function") {
      this.send(command, optionsOrCb);
    } else if (typeof cb === "function") {
      if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
      this.send(command, optionsOrCb || {}, cb);
    } else {
      return this.send(command, optionsOrCb);
    }
  }


/**
   *
Gets information about one or more of your transit gateway Connect peer associations in a global network.

   */
public getTransitGatewayConnectPeerAssociations(
    args: GetTransitGatewayConnectPeerAssociationsCommandInput,
    options?: __HttpHandlerOptions
  ): Promise<GetTransitGatewayConnectPeerAssociationsCommandOutput>;


public getTransitGatewayConnectPeerAssociations(
    args: GetTransitGatewayConnectPeerAssociationsCommandInput,
    cb: (err: any, data?: GetTransitGatewayConnectPeerAssociationsCommandOutput) => void
  ): void;


public getTransitGatewayConnectPeerAssociations(
    args: GetTransitGatewayConnectPeerAssociationsCommandInput,
    options: __HttpHandlerOptions,
    cb: (err: any, data?: GetTransitGatewayConnectPeerAssociationsCommandOutput) => void
  ): void;


public getTransitGatewayConnectPeerAssociations(
    args: GetTransitGatewayConnectPeerAssociationsCommandInput,
    optionsOrCb?:
      | __HttpHandlerOptions
      | ((err: any, data?: GetTransitGatewayConnectPeerAssociationsCommandOutput) => void),
    cb?: (err: any, data?: GetTransitGatewayConnectPeerAssociationsCommandOutput) => void
  ): Promise<GetTransitGatewayConnectPeerAssociationsCommandOutput> | void {
    const command = new GetTransitGatewayConnectPeerAssociationsCommand(args);
    if (typeof optionsOrCb === "function") {
      this.send(command, optionsOrCb);
    } else if (typeof cb === "function") {
      if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
      this.send(command, optionsOrCb || {}, cb);
    } else {
      return this.send(command, optionsOrCb);
    }
  }


/**
   *
Gets information about the transit gateway registrations in a specified
   *             global network.

   */
public getTransitGatewayRegistrations(
    args: GetTransitGatewayRegistrationsCommandInput,
    options?: __HttpHandlerOptions
  ): Promise<GetTransitGatewayRegistrationsCommandOutput>;


public getTransitGatewayRegistrations(
    args: GetTransitGatewayRegistrationsCommandInput,
    cb: (err: any, data?: GetTransitGatewayRegistrationsCommandOutput) => void
  ): void;


public getTransitGatewayRegistrations(
    args: GetTransitGatewayRegistrationsCommandInput,
    options: __HttpHandlerOptions,
    cb: (err: any, data?: GetTransitGatewayRegistrationsCommandOutput) => void
  ): void;


public getTransitGatewayRegistrations(
    args: GetTransitGatewayRegistrationsCommandInput,
    optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: GetTransitGatewayRegistrationsCommandOutput) => void),
    cb?: (err: any, data?: GetTransitGatewayRegistrationsCommandOutput) => void
  ): Promise<GetTransitGatewayRegistrationsCommandOutput> | void {
    const command = new GetTransitGatewayRegistrationsCommand(args);
    if (typeof optionsOrCb === "function") {
      this.send(command, optionsOrCb);
    } else if (typeof cb === "function") {
      if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
      this.send(command, optionsOrCb || {}, cb);
    } else {
      return this.send(command, optionsOrCb);
    }
  }


/**
   *
Lists the tags for a specified resource.

   */
public listTagsForResource(
    args: ListTagsForResourceCommandInput,
    options?: __HttpHandlerOptions
  ): Promise<ListTagsForResourceCommandOutput>;


public listTagsForResource(
    args: ListTagsForResourceCommandInput,
    cb: (err: any, data?: ListTagsForResourceCommandOutput) => void
  ): void;


public listTagsForResource(
    args: ListTagsForResourceCommandInput,
    options: __HttpHandlerOptions,
    cb: (err: any, data?: ListTagsForResourceCommandOutput) => void
  ): void;


public listTagsForResource(
    args: ListTagsForResourceCommandInput,
    optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ListTagsForResourceCommandOutput) => void),
    cb?: (err: any, data?: ListTagsForResourceCommandOutput) => void
  ): Promise<ListTagsForResourceCommandOutput> | void {
    const command = new ListTagsForResourceCommand(args);
    if (typeof optionsOrCb === "function") {
      this.send(command, optionsOrCb);
    } else if (typeof cb === "function") {
      if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
      this.send(command, optionsOrCb || {}, cb);
    } else {
      return this.send(command, optionsOrCb);
    }
  }


/**
   *
Registers a transit gateway in your global network. The transit gateway can be in any
   *             AWS Region, but it must be owned by the same AWS account that owns the global network.
   *             You cannot register a transit gateway in more than one global network.

   */
public registerTransitGateway(
    args: RegisterTransitGatewayCommandInput,
    options?: __HttpHandlerOptions
  ): Promise<RegisterTransitGatewayCommandOutput>;


public registerTransitGateway(
    args: RegisterTransitGatewayCommandInput,
    cb: (err: any, data?: RegisterTransitGatewayCommandOutput) => void
  ): void;


public registerTransitGateway(
    args: RegisterTransitGatewayCommandInput,
    options: __HttpHandlerOptions,
    cb: (err: any, data?: RegisterTransitGatewayCommandOutput) => void
  ): void;


public registerTransitGateway(
    args: RegisterTransitGatewayCommandInput,
    optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: RegisterTransitGatewayCommandOutput) => void),
    cb?: (err: any, data?: RegisterTransitGatewayCommandOutput) => void
  ): Promise<RegisterTransitGatewayCommandOutput> | void {
    const command = new RegisterTransitGatewayCommand(args);
    if (typeof optionsOrCb === "function") {
      this.send(command, optionsOrCb);
    } else if (typeof cb === "function") {
      if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
      this.send(command, optionsOrCb || {}, cb);
    } else {
      return this.send(command, optionsOrCb);
    }
  }


/**
   *
Tags a specified resource.

   */
public tagResource(args: TagResourceCommandInput, options?: __HttpHandlerOptions): Promise<TagResourceCommandOutput>;


public tagResource(args: TagResourceCommandInput, cb: (err: any, data?: TagResourceCommandOutput) => void): void;


public tagResource(
    args: TagResourceCommandInput,
    options: __HttpHandlerOptions,
    cb: (err: any, data?: TagResourceCommandOutput) => void
  ): void;


public tagResource(
    args: TagResourceCommandInput,
    optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: TagResourceCommandOutput) => void),
    cb?: (err: any, data?: TagResourceCommandOutput) => void
  ): Promise<TagResourceCommandOutput> | void {
    const command = new TagResourceCommand(args);
    if (typeof optionsOrCb === "function") {
      this.send(command, optionsOrCb);
    } else if (typeof cb === "function") {
      if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
      this.send(command, optionsOrCb || {}, cb);
    } else {
      return this.send(command, optionsOrCb);
    }
  }


/**
   *
Removes tags from a specified resource.

   */
public untagResource(
    args: UntagResourceCommandInput,
    options?: __HttpHandlerOptions
  ): Promise<UntagResourceCommandOutput>;


public untagResource(
    args: UntagResourceCommandInput,
    cb: (err: any, data?: UntagResourceCommandOutput) => void
  ): void;


public untagResource(
    args: UntagResourceCommandInput,
    options: __HttpHandlerOptions,
    cb: (err: any, data?: UntagResourceCommandOutput) => void
  ): void;


public untagResource(
    args: UntagResourceCommandInput,
    optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: UntagResourceCommandOutput) => void),
    cb?: (err: any, data?: UntagResourceCommandOutput) => void
  ): Promise<UntagResourceCommandOutput> | void {
    const command = new UntagResourceCommand(args);
    if (typeof optionsOrCb === "function") {
      this.send(command, optionsOrCb);
    } else if (typeof cb === "function") {
      if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
      this.send(command, optionsOrCb || {}, cb);
    } else {
      return this.send(command, optionsOrCb);
    }
  }


/**
   *
Updates the information for an existing connection. To remove information for any of the parameters,
   *             specify an empty string.

   */
public updateConnection(
    args: UpdateConnectionCommandInput,
    options?: __HttpHandlerOptions
  ): Promise<UpdateConnectionCommandOutput>;


public updateConnection(
    args: UpdateConnectionCommandInput,
    cb: (err: any, data?: UpdateConnectionCommandOutput) => void
  ): void;


public updateConnection(
    args: UpdateConnectionCommandInput,
    options: __HttpHandlerOptions,
    cb: (err: any, data?: UpdateConnectionCommandOutput) => void
  ): void;


public updateConnection(
    args: UpdateConnectionCommandInput,
    optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: UpdateConnectionCommandOutput) => void),
    cb?: (err: any, data?: UpdateConnectionCommandOutput) => void
  ): Promise<UpdateConnectionCommandOutput> | void {
    const command = new UpdateConnectionCommand(args);
    if (typeof optionsOrCb === "function") {
      this.send(command, optionsOrCb);
    } else if (typeof cb === "function") {
      if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
      this.send(command, optionsOrCb || {}, cb);
    } else {
      return this.send(command, optionsOrCb);
    }
  }


/**
   *
Updates the details for an existing device. To remove information for any of the
   *             parameters, specify an empty string.

   */
public updateDevice(
    args: UpdateDeviceCommandInput,
    options?: __HttpHandlerOptions
  ): Promise<UpdateDeviceCommandOutput>;


public updateDevice(args: UpdateDeviceCommandInput, cb: (err: any, data?: UpdateDeviceCommandOutput) => void): void;


public updateDevice(
    args: UpdateDeviceCommandInput,
    options: __HttpHandlerOptions,
    cb: (err: any, data?: UpdateDeviceCommandOutput) => void
  ): void;


public updateDevice(
    args: UpdateDeviceCommandInput,
    optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: UpdateDeviceCommandOutput) => void),
    cb?: (err: any, data?: UpdateDeviceCommandOutput) => void
  ): Promise<UpdateDeviceCommandOutput> | void {
    const command = new UpdateDeviceCommand(args);
    if (typeof optionsOrCb === "function") {
      this.send(command, optionsOrCb);
    } else if (typeof cb === "function") {
      if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
      this.send(command, optionsOrCb || {}, cb);
    } else {
      return this.send(command, optionsOrCb);
    }
  }


/**
   *
Updates an existing global network. To remove information for any of the parameters,
   *             specify an empty string.

   */
public updateGlobalNetwork(
    args: UpdateGlobalNetworkCommandInput,
    options?: __HttpHandlerOptions
  ): Promise<UpdateGlobalNetworkCommandOutput>;


public updateGlobalNetwork(
    args: UpdateGlobalNetworkCommandInput,
    cb: (err: any, data?: UpdateGlobalNetworkCommandOutput) => void
  ): void;


public updateGlobalNetwork(
    args: UpdateGlobalNetworkCommandInput,
    options: __HttpHandlerOptions,
    cb: (err: any, data?: UpdateGlobalNetworkCommandOutput) => void
  ): void;


public updateGlobalNetwork(
    args: UpdateGlobalNetworkCommandInput,
    optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: UpdateGlobalNetworkCommandOutput) => void),
    cb?: (err: any, data?: UpdateGlobalNetworkCommandOutput) => void
  ): Promise<UpdateGlobalNetworkCommandOutput> | void {
    const command = new UpdateGlobalNetworkCommand(args);
    if (typeof optionsOrCb === "function") {
      this.send(command, optionsOrCb);
    } else if (typeof cb === "function") {
      if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
      this.send(command, optionsOrCb || {}, cb);
    } else {
      return this.send(command, optionsOrCb);
    }
  }


/**
   *
Updates the details for an existing link. To remove information for any of the
   *             parameters, specify an empty string.

   */
public updateLink(args: UpdateLinkCommandInput, options?: __HttpHandlerOptions): Promise<UpdateLinkCommandOutput>;


public updateLink(args: UpdateLinkCommandInput, cb: (err: any, data?: UpdateLinkCommandOutput) => void): void;


public updateLink(
    args: UpdateLinkCommandInput,
    options: __HttpHandlerOptions,
    cb: (err: any, data?: UpdateLinkCommandOutput) => void
  ): void;


public updateLink(
    args: UpdateLinkCommandInput,
    optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: UpdateLinkCommandOutput) => void),
    cb?: (err: any, data?: UpdateLinkCommandOutput) => void
  ): Promise<UpdateLinkCommandOutput> | void {
    const command = new UpdateLinkCommand(args);
    if (typeof optionsOrCb === "function") {
      this.send(command, optionsOrCb);
    } else if (typeof cb === "function") {
      if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
      this.send(command, optionsOrCb || {}, cb);
    } else {
      return this.send(command, optionsOrCb);
    }
  }


/**
   *
Updates the information for an existing site. To remove information for any of the
   *             parameters, specify an empty string.

   */
public updateSite(args: UpdateSiteCommandInput, options?: __HttpHandlerOptions): Promise<UpdateSiteCommandOutput>;


public updateSite(args: UpdateSiteCommandInput, cb: (err: any, data?: UpdateSiteCommandOutput) => void): void;


public updateSite(
    args: UpdateSiteCommandInput,
    options: __HttpHandlerOptions,
    cb: (err: any, data?: UpdateSiteCommandOutput) => void
  ): void;


public updateSite(
    args: UpdateSiteCommandInput,
    optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: UpdateSiteCommandOutput) => void),
    cb?: (err: any, data?: UpdateSiteCommandOutput) => void
  ): Promise<UpdateSiteCommandOutput> | void {
    const command = new UpdateSiteCommand(args);
    if (typeof optionsOrCb === "function") {
      this.send(command, optionsOrCb);
    } else if (typeof cb === "function") {
      if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
      this.send(command, optionsOrCb || {}, cb);
    } else {
      return this.send(command, optionsOrCb);
    }
  }


/** Provides operations to manage the calendarView property of the microsoft.graph.calendar entity. */
export class CalendarViewRequestBuilder {
    /** The count property */
    public get count(): CountRequestBuilder {
        return new CountRequestBuilder(this.pathParameters, this.requestAdapter);
    }
    /** Path parameters for the request */
    private readonly pathParameters: Record<string, unknown>;
    /** The request adapter to use to execute the requests. */
    private readonly requestAdapter: RequestAdapter;
    /** Url template to use to build the URL for the current request builder */
    private readonly urlTemplate: string;
    /**
     * Instantiates a new CalendarViewRequestBuilder and sets the default values.
     * @param pathParameters The raw url or the Url template parameters for the request.
     * @param requestAdapter The request adapter to use to execute the requests.
     */
    public constructor(pathParameters: Record<string, unknown> | string | undefined, requestAdapter: RequestAdapter) {
        if(!pathParameters) throw new Error("pathParameters cannot be undefined");
        if(!requestAdapter) throw new Error("requestAdapter cannot be undefined");
        this.urlTemplate = "{+baseurl}/me/calendars/{calendar%2Did}/calendarView{?startDateTime,endDateTime,%24top,%24skip,%24filter,%24count,%24orderby,%24select}";
        const urlTplParams = getPathParameters(pathParameters);
        this.pathParameters = urlTplParams;
        this.requestAdapter = requestAdapter;
    };
    /**
     * The calendar view for the calendar. Navigation property. Read-only.
     * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
     * @returns a RequestInformation
     */
    public createGetRequestInformation(requestConfiguration?: CalendarViewRequestBuilderGetRequestConfiguration | undefined) : RequestInformation {
        const requestInfo = new RequestInformation();
        requestInfo.urlTemplate = this.urlTemplate;
        requestInfo.pathParameters = this.pathParameters;
        requestInfo.httpMethod = HttpMethod.GET;
        if (requestConfiguration) {
            requestInfo.addRequestHeaders(requestConfiguration.headers);
            requestInfo.setQueryStringParametersFromRawObject(requestConfiguration.queryParameters);
            requestInfo.addRequestOptions(requestConfiguration.options);
        }
        return requestInfo;
    };
    /**
     * Create new navigation property to calendarView for me
     * @param body
     * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
     * @returns a RequestInformation
     */
    public createPostRequestInformation(body: Event | undefined, requestConfiguration?: CalendarViewRequestBuilderPostRequestConfiguration | undefined) : RequestInformation {
        if(!body) throw new Error("body cannot be undefined");
        const requestInfo = new RequestInformation();
        requestInfo.urlTemplate = this.urlTemplate;
        requestInfo.pathParameters = this.pathParameters;
        requestInfo.httpMethod = HttpMethod.POST;
        if (requestConfiguration) {
            requestInfo.addRequestHeaders(requestConfiguration.headers);
            requestInfo.addRequestOptions(requestConfiguration.options);
        }
        requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body);
        return requestInfo;
    };
    /**
     * Provides operations to call the delta method.
     * @returns a deltaRequestBuilder
     */
    public delta() : DeltaRequestBuilder {
        return new DeltaRequestBuilder(this.pathParameters, this.requestAdapter);
    };
    /**
     * The calendar view for the calendar. Navigation property. Read-only.
     * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
     * @param responseHandler Response handler to use in place of the default response handling provided by the core service
     * @returns a Promise of EventCollectionResponse
     */
    public get(requestConfiguration?: CalendarViewRequestBuilderGetRequestConfiguration | undefined, responseHandler?: ResponseHandler | undefined) : Promise<EventCollectionResponse | undefined> {
        const requestInfo = this.createGetRequestInformation(
            requestConfiguration
        );
        const errorMapping: Record<string, ParsableFactory<Parsable>> = {
            "4XX": createODataErrorFromDiscriminatorValue,
            "5XX": createODataErrorFromDiscriminatorValue,
        };
        return this.requestAdapter?.sendAsync<EventCollectionResponse>(requestInfo, createEventCollectionResponseFromDiscriminatorValue, responseHandler, errorMapping) ?? Promise.reject(new Error('http core is null'));
    };
    /**
     * Create new navigation property to calendarView for me
     * @param body
     * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
     * @param responseHandler Response handler to use in place of the default response handling provided by the core service
     * @returns a Promise of Event
     */
    public post(body: Event | undefined, requestConfiguration?: CalendarViewRequestBuilderPostRequestConfiguration | undefined, responseHandler?: ResponseHandler | undefined) : Promise<Event | undefined> {
        if(!body) throw new Error("body cannot be undefined");
        const requestInfo = this.createPostRequestInformation(
            body, requestConfiguration
        );
        const errorMapping: Record<string, ParsableFactory<Parsable>> = {
            "4XX": createODataErrorFromDiscriminatorValue,
            "5XX": createODataErrorFromDiscriminatorValue,
        };
        return this.requestAdapter?.sendAsync<Event>(requestInfo, createEventFromDiscriminatorValue, responseHandler, errorMapping) ?? Promise.reject(new Error('http core is null'));
    };
}


/**
     * The calendar view for the calendar. Navigation property. Read-only.
     * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
     * @returns a RequestInformation
     */
public createGetRequestInformation(requestConfiguration?: CalendarViewRequestBuilderGetRequestConfiguration | undefined) : RequestInformation {
        const requestInfo = new RequestInformation();
        requestInfo.urlTemplate = this.urlTemplate;
        requestInfo.pathParameters = this.pathParameters;
        requestInfo.httpMethod = HttpMethod.GET;
        if (requestConfiguration) {
            requestInfo.addRequestHeaders(requestConfiguration.headers);
            requestInfo.setQueryStringParametersFromRawObject(requestConfiguration.queryParameters);
            requestInfo.addRequestOptions(requestConfiguration.options);
        }
        return requestInfo;
    }


/**
     * Create new navigation property to calendarView for me
     * @param body
     * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
     * @returns a RequestInformation
     */
public createPostRequestInformation(body: Event | undefined, requestConfiguration?: CalendarViewRequestBuilderPostRequestConfiguration | undefined) : RequestInformation {
        if(!body) throw new Error("body cannot be undefined");
        const requestInfo = new RequestInformation();
        requestInfo.urlTemplate = this.urlTemplate;
        requestInfo.pathParameters = this.pathParameters;
        requestInfo.httpMethod = HttpMethod.POST;
        if (requestConfiguration) {
            requestInfo.addRequestHeaders(requestConfiguration.headers);
            requestInfo.addRequestOptions(requestConfiguration.options);
        }
        requestInfo.setContentFromParsable(this.requestAdapter, "application/json", body);
        return requestInfo;
    }


/**
     * Provides operations to call the delta method.
     * @returns a deltaRequestBuilder
     */
public delta() : DeltaRequestBuilder {
        return new DeltaRequestBuilder(this.pathParameters, this.requestAdapter);
    }


/**
     * The calendar view for the calendar. Navigation property. Read-only.
     * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
     * @param responseHandler Response handler to use in place of the default response handling provided by the core service
     * @returns a Promise of EventCollectionResponse
     */
public get(requestConfiguration?: CalendarViewRequestBuilderGetRequestConfiguration | undefined, responseHandler?: ResponseHandler | undefined) : Promise<EventCollectionResponse | undefined> {
        const requestInfo = this.createGetRequestInformation(
            requestConfiguration
        );
        const errorMapping: Record<string, ParsableFactory<Parsable>> = {
            "4XX": createODataErrorFromDiscriminatorValue,
            "5XX": createODataErrorFromDiscriminatorValue,
        };
        return this.requestAdapter?.sendAsync<EventCollectionResponse>(requestInfo, createEventCollectionResponseFromDiscriminatorValue, responseHandler, errorMapping) ?? Promise.reject(new Error('http core is null'));
    }