示例#1
0
        /// <summary>
        /// Establishes the conversation.
        /// </summary>
        /// <param name="authorizer">The authorizer.</param>
        /// <param name="conversationId">The conversation identifier.</param>
        /// <param name="lastEventId">The last event identifier.</param>
        /// <param name="type">The type.</param>
        /// <returns></returns>
        public ApiResponse <IEnumerable <DirectActivityModel> > Get(IHubsterAuthorizer authorizer, Guid conversationId, long lastEventId, IntegrationType type)
        {
            var apiResponse = new ApiResponse <IEnumerable <DirectActivityModel> >();

            if (authorizer.EnsureLifespan(apiResponse) == false)
            {
                return(apiResponse);
            }

            var client      = new RestClient(_hostUrl);
            var restRequest = new RestRequest($"/api/v1/interactions/activities/{conversationId}", Method.GET)
            {
                Timeout = 20000
            };

            restRequest.AddHeader("Content-Type", "application/json");
            restRequest.AddHeader("Authorization", $"{authorizer.Token.TokenType} {authorizer.Token.AccessToken}");
            restRequest.AddHeader("Origin", _origin);

            restRequest.AddParameter("leid", lastEventId);
            restRequest.AddParameter("type", type.ToString());

            var restResponse = client.Execute(restRequest);

            apiResponse = ExtractResponse <IEnumerable <DirectActivityModel> >(restResponse);

            return(apiResponse);
        }
示例#2
0
        public SyncLog(string path, IntegrationType integrationType)
        {
            _logPath  = path;
            _fileName = string.Format("{0} Debug File - {1}{2}{3}.txt", integrationType.ToString(), DateTime.UtcNow.Month.ToString(), DateTime.UtcNow.Day.ToString(), DateTime.UtcNow.Year.ToString());

            if (!Directory.Exists(_logPath))
            {
                Directory.CreateDirectory(_logPath);
            }
        }
示例#3
0
 public static IProviderMetadata CreateProviderMetadata()
 {
     return(new ProviderMetadata
     {
         Id = ProviderId,
         ComponentName = CrawlerName,
         Name = ProviderName,
         Type = Type.ToString(),
         SupportsConfiguration = SupportsConfiguration,
         SupportsWebHooks = SupportsWebHooks,
         SupportsAutomaticWebhookCreation = SupportsAutomaticWebhookCreation,
         RequiresAppInstall = RequiresAppInstall,
         AppInstallUrl = AppInstallUrl,
         ReAuthEndpoint = ReAuthEndpoint,
         ComponentEmailDetails = ComponentEmailDetails
     });
 }
示例#4
0
        /// <summary>
        /// Generate the necessary parameters
        /// </summary>
        public List <KeyValuePair <string, string> > GetParams()
        {
            var p = new List <KeyValuePair <string, string> >();

            if (FriendlyName != null)
            {
                p.Add(new KeyValuePair <string, string>("FriendlyName", FriendlyName));
            }

            if (ChatServiceSid != null)
            {
                p.Add(new KeyValuePair <string, string>("ChatServiceSid", ChatServiceSid.ToString()));
            }

            if (ChannelType != null)
            {
                p.Add(new KeyValuePair <string, string>("ChannelType", ChannelType.ToString()));
            }

            if (ContactIdentity != null)
            {
                p.Add(new KeyValuePair <string, string>("ContactIdentity", ContactIdentity));
            }

            if (Enabled != null)
            {
                p.Add(new KeyValuePair <string, string>("Enabled", Enabled.Value.ToString().ToLower()));
            }

            if (IntegrationType != null)
            {
                p.Add(new KeyValuePair <string, string>("IntegrationType", IntegrationType.ToString()));
            }

            if (IntegrationFlowSid != null)
            {
                p.Add(new KeyValuePair <string, string>("Integration.FlowSid", IntegrationFlowSid.ToString()));
            }

            if (IntegrationUrl != null)
            {
                p.Add(new KeyValuePair <string, string>("Integration.Url", Serializers.Url(IntegrationUrl)));
            }

            if (IntegrationWorkspaceSid != null)
            {
                p.Add(new KeyValuePair <string, string>("Integration.WorkspaceSid", IntegrationWorkspaceSid.ToString()));
            }

            if (IntegrationWorkflowSid != null)
            {
                p.Add(new KeyValuePair <string, string>("Integration.WorkflowSid", IntegrationWorkflowSid.ToString()));
            }

            if (IntegrationChannel != null)
            {
                p.Add(new KeyValuePair <string, string>("Integration.Channel", IntegrationChannel));
            }

            if (IntegrationTimeout != null)
            {
                p.Add(new KeyValuePair <string, string>("Integration.Timeout", IntegrationTimeout.ToString()));
            }

            if (IntegrationPriority != null)
            {
                p.Add(new KeyValuePair <string, string>("Integration.Priority", IntegrationPriority.ToString()));
            }

            if (IntegrationCreationOnMessage != null)
            {
                p.Add(new KeyValuePair <string, string>("Integration.CreationOnMessage", IntegrationCreationOnMessage.Value.ToString().ToLower()));
            }

            if (LongLived != null)
            {
                p.Add(new KeyValuePair <string, string>("LongLived", LongLived.Value.ToString().ToLower()));
            }

            if (JanitorEnabled != null)
            {
                p.Add(new KeyValuePair <string, string>("JanitorEnabled", JanitorEnabled.Value.ToString().ToLower()));
            }

            if (IntegrationRetryCount != null)
            {
                p.Add(new KeyValuePair <string, string>("Integration.RetryCount", IntegrationRetryCount.ToString()));
            }

            return(p);
        }
	private static void DisplaySceneImport( ref float currentHeight, string title, string description, AGF_LevelLoader.LoadSceneMode mode, IntegrationType currentIntegrationType ){

		Rect thisRect = window.position;
		Color prevColor = GUI.color;
		
		// Title Text
		DisplayCenteredText( ref currentHeight, 15, title );
		
		// Description Text
		DisplayWordWrappedCenteredText( ref currentHeight, 11, description, 400.0f );
		
		float buttonWidth = 200.0f, buttonHeight = 20.0f;
		
		// step 1: instantiate integration prefab.
		GameObject agfIntegration = GameObject.Find ("AGF_Integration");
		
		EditorGUI.HelpBox( new Rect( 20.0f, currentHeight, thisRect.width - (20.0f * 2.0f), 20.0f ), "Step 1: Instantiate the integration prefab.", MessageType.Info );
		GUI.Toggle( new Rect( thisRect.width - 40.0f, currentHeight, 20.0f, 20.0f ), agfIntegration != null, "" );
		currentHeight += 30.0f;
		
		if ( agfIntegration != null ){
			GUI.color = Color.grey;
		}
			
		if ( GUI.Button ( new Rect( thisRect.width/2.0f - buttonWidth/2.0f, currentHeight, buttonWidth, buttonHeight ), "Instantiate Prefab" ) ){
			if ( GUI.color != Color.grey ){
				string path = "Assets/AGF_SceneLoader/AGF_Assets/Prefabs/AGF_Integration.prefab";
				GameObject integrationPrefab = (GameObject)MonoBehaviour.Instantiate( (GameObject)AssetDatabase.LoadAssetAtPath( path, typeof(GameObject) ) );
				integrationPrefab.name = "AGF_Integration";
			}
		}
		GUI.color = prevColor;
		currentHeight += 32.0f;
		
		// step 2: Assign the camera link.
		GameObject cameraManager = GameObject.Find ("AGF_CameraManager");
		bool isCameraConfigured = (cameraManager != null && IsCameraConfigured( cameraManager.GetComponent<AGF_CameraManager>().mainCamera ) );
		
		EditorGUI.HelpBox( new Rect( 20.0f, currentHeight, thisRect.width - (20.0f * 2.0f), 20.0f ), "Step 2: Ensure that the main camera is properly configured.", MessageType.Info );
		GUI.Toggle( new Rect( thisRect.width - 40.0f, currentHeight, 20.0f, 20.0f ), isCameraConfigured, "" );
		currentHeight += 30.0f;
		
		DisplayCameraConfiguration( ref currentHeight );
		// step 3: Load the scene
		if ( mode == AGF_LevelLoader.LoadSceneMode.All && currentIntegrationType == IntegrationType.Geovox){
			EditorGUI.HelpBox( new Rect( 20.0f, currentHeight, thisRect.width - (20.0f * 2.0f), 20.0f ), "Step 3: Load the Geovox scene. The integration prefab will be destroyed.", MessageType.Info );
			currentHeight += 30.0f;

			if ( GUI.Button ( new Rect( thisRect.width/2.0f - buttonWidth/2.0f, currentHeight, buttonWidth, buttonHeight ), "Load Geovox Scene" ) ){
					int returnCode = LoadGeovoxScene();
					if ( returnCode != AGF_ReturnCode.Success ){
					Debug.LogError(returnCode);
						HandleLoadSceneError( returnCode );
					}
			}
		} else if ( mode == AGF_LevelLoader.LoadSceneMode.CameraOnly ){
			string integrationPrefix = currentIntegrationType.ToString();

			EditorGUI.HelpBox( new Rect( 20.0f, currentHeight, thisRect.width - (20.0f * 2.0f), 30.0f ), "Step 3: Load the camera settings from an " + integrationPrefix +" scene. The integration prefab will be destroyed.", MessageType.Info );
			currentHeight += 40.0f;
			
			if ( isCameraConfigured == false ){
				GUI.color = Color.grey;
			}
			if ( GUI.Button ( new Rect( thisRect.width/2.0f - 250.0f/2.0f, currentHeight, 250.0f, buttonHeight ), "Load Camera Settings from " + integrationPrefix +" Scene" ) ){
				if ( GUI.color != Color.grey ){
					int returnCode = LoadCameraFromScene();
					if ( returnCode != AGF_ReturnCode.Success ){
						Debug.LogError(returnCode);
						HandleLoadSceneError( returnCode );
					}
				}
			}
		}
		GUI.color = prevColor;
		currentHeight += 32.0f;
	}