// DO NOT EDIT! This is an autogenerated file. All changes will be
// overwritten!

//	Copyright (c) 2023 Vidyo, Inc. All rights reserved.


using System;
using System.Runtime.InteropServices;
using System.Collections.Generic;

namespace VidyoClient
{
	public class ConnectorGoogleAnalyticsOptionsFactory
	{
		public static ConnectorGoogleAnalyticsOptions Create()
		{
			return new ConnectorGoogleAnalyticsOptions(IntPtr.Zero);
		}
		public static void Destroy(ConnectorGoogleAnalyticsOptions obj)
		{
		}
	}
	/// <summary>
	/// Represent the options for google analytics.
	/// </summary>
	public class ConnectorGoogleAnalyticsOptions {
#if __IOS__
		const string importLib = "__Internal";
#else
		const string importLib = "libVidyoClient";
#endif
		private IntPtr objPtr; // opaque VidyoConnectorGoogleAnalyticsOptions reference.
		public IntPtr GetObjectPtr() {
			IntPtr nId = MarshalPtrToUtf8.GetInstance().MarshalManagedToNative(id ?? string.Empty);
			IntPtr nKey = MarshalPtrToUtf8.GetInstance().MarshalManagedToNative(key ?? string.Empty);

			VidyoConnectorGoogleAnalyticsOptionsSetidNative(objPtr, nId);
			VidyoConnectorGoogleAnalyticsOptionsSetkeyNative(objPtr, nKey);

			Marshal.FreeHGlobal(nKey);
			Marshal.FreeHGlobal(nId);
			return objPtr;
		}
		[DllImport(importLib, CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr VidyoConnectorGoogleAnalyticsOptionsGetidNative(IntPtr obj);

		[DllImport(importLib, CallingConvention = CallingConvention.Cdecl)]
		private static extern void VidyoConnectorGoogleAnalyticsOptionsSetidNative(IntPtr obj, IntPtr id);

		[DllImport(importLib, CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr VidyoConnectorGoogleAnalyticsOptionsGetkeyNative(IntPtr obj);

		[DllImport(importLib, CallingConvention = CallingConvention.Cdecl)]
		private static extern void VidyoConnectorGoogleAnalyticsOptionsSetkeyNative(IntPtr obj, IntPtr key);

		[DllImport(importLib, CallingConvention = CallingConvention.Cdecl)]
		public static extern IntPtr VidyoConnectorGoogleAnalyticsOptionsConstructCopyNative(IntPtr obj);

		[DllImport(importLib, CallingConvention = CallingConvention.Cdecl)]
		public static extern IntPtr VidyoConnectorGoogleAnalyticsOptionsConstructDefaultNative();

		[DllImport(importLib, CallingConvention = CallingConvention.Cdecl)]
		public static extern void VidyoConnectorGoogleAnalyticsOptionsDestructNative(IntPtr obj);

		/// <summary>
		/// Represents the measurement is for google analytics service.
		/// </summary>
		public String id;
		/// <summary>
		/// Represents the configured API secret key for google analytics service.
		/// </summary>
		public String key;
		public ConnectorGoogleAnalyticsOptions(IntPtr obj){
			if(obj == IntPtr.Zero) {
				objPtr = VidyoConnectorGoogleAnalyticsOptionsConstructDefaultNative();
			}
			else {
				objPtr = VidyoConnectorGoogleAnalyticsOptionsConstructCopyNative(obj);
			}

			id = (string)MarshalPtrToUtf8.GetInstance().MarshalNativeToManaged(VidyoConnectorGoogleAnalyticsOptionsGetidNative(objPtr));
			key = (string)MarshalPtrToUtf8.GetInstance().MarshalNativeToManaged(VidyoConnectorGoogleAnalyticsOptionsGetkeyNative(objPtr));
		}
		~ConnectorGoogleAnalyticsOptions() {
			VidyoConnectorGoogleAnalyticsOptionsDestructNative(objPtr);
		 }
	};
}
