Esempio n. 1
0
        /// <summary>
        /// Sets whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is only supported for Google-managed users.
        /// Documentation https://developers.google.com/androidenterprise/v1/reference/devices/setState
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Androidenterprise service.</param>
        /// <param name="enterpriseId">The ID of the enterprise.</param>
        /// <param name="userId">The ID of the user.</param>
        /// <param name="deviceId">The ID of the device.</param>
        /// <param name="body">A valid Androidenterprise v1 body.</param>
        /// <returns>DeviceStateResponse</returns>
        public static DeviceState SetState(AndroidenterpriseService service, string enterpriseId, string userId, string deviceId, DeviceState body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (enterpriseId == null)
                {
                    throw new ArgumentNullException(enterpriseId);
                }
                if (userId == null)
                {
                    throw new ArgumentNullException(userId);
                }
                if (deviceId == null)
                {
                    throw new ArgumentNullException(deviceId);
                }

                // Make the request.
                return(service.Devices.SetState(body, enterpriseId, userId, deviceId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Devices.SetState failed.", ex);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Retrieves the IDs of the users who have been granted entitlements under the license.
        /// Documentation https://developers.google.com/androidenterprise/v1/reference/grouplicenseusers/list
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Androidenterprise service.</param>
        /// <param name="enterpriseId">The ID of the enterprise.</param>
        /// <param name="groupLicenseId">The ID of the product the group license is for, e.g. "app:com.google.android.gm".</param>
        /// <returns>GroupLicenseUsersListResponseResponse</returns>
        public static GroupLicenseUsersListResponse List(AndroidenterpriseService service, string enterpriseId, string groupLicenseId)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (enterpriseId == null)
                {
                    throw new ArgumentNullException(enterpriseId);
                }
                if (groupLicenseId == null)
                {
                    throw new ArgumentNullException(groupLicenseId);
                }

                // Make the request.
                return(service.Grouplicenseusers.List(enterpriseId, groupLicenseId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Grouplicenseusers.List failed.", ex);
            }
        }
        /// <summary>
        /// Establishes the binding between the EMM and an enterprise. This is now deprecated; use enroll instead.
        /// Documentation https://developers.google.com/androidenterprise/v1/reference/enterprises/insert
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Androidenterprise service.</param>
        /// <param name="token">The token provided by the enterprise to register the EMM.</param>
        /// <param name="body">A valid Androidenterprise v1 body.</param>
        /// <returns>EnterpriseResponse</returns>
        public static Enterprise Insert(AndroidenterpriseService service, string token, Enterprise body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (token == null)
                {
                    throw new ArgumentNullException(token);
                }

                // Make the request.
                return(service.Enterprises.Insert(body, token).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Enterprises.Insert failed.", ex);
            }
        }
        /// <summary>
        /// Updates a cluster.
        /// Documentation https://developers.google.com/androidenterprise/v1/reference/storelayoutclusters/update
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Androidenterprise service.</param>
        /// <param name="enterpriseId">The ID of the enterprise.</param>
        /// <param name="pageId">The ID of the page.</param>
        /// <param name="clusterId">The ID of the cluster.</param>
        /// <param name="body">A valid Androidenterprise v1 body.</param>
        /// <returns>StoreClusterResponse</returns>
        public static StoreCluster Update(AndroidenterpriseService service, string enterpriseId, string pageId, string clusterId, StoreCluster body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (enterpriseId == null)
                {
                    throw new ArgumentNullException(enterpriseId);
                }
                if (pageId == null)
                {
                    throw new ArgumentNullException(pageId);
                }
                if (clusterId == null)
                {
                    throw new ArgumentNullException(clusterId);
                }

                // Make the request.
                return(service.Storelayoutclusters.Update(body, enterpriseId, pageId, clusterId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Storelayoutclusters.Update failed.", ex);
            }
        }
        /// <summary>
        /// Returns a unique token to access an embeddable UI. To generate a web UI, pass the generated token into the managed Google Play javascript API. Each token may only be used to start one UI session. See the javascript API documentation for further information.
        /// Documentation https://developers.google.com/androidenterprise/v1/reference/enterprises/createWebToken
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Androidenterprise service.</param>
        /// <param name="enterpriseId">The ID of the enterprise.</param>
        /// <param name="body">A valid Androidenterprise v1 body.</param>
        /// <returns>AdministratorWebTokenResponse</returns>
        public static AdministratorWebToken CreateWebToken(AndroidenterpriseService service, string enterpriseId, AdministratorWebTokenSpec body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (enterpriseId == null)
                {
                    throw new ArgumentNullException(enterpriseId);
                }

                // Make the request.
                return(service.Enterprises.CreateWebToken(body, enterpriseId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Enterprises.CreateWebToken failed.", ex);
            }
        }
Esempio n. 6
0
        /// <summary>
        /// Requests to remove an app from a device. A call to get or list will still show the app as installed on the device until it is actually removed.
        /// Documentation https://developers.google.com/androidenterprise/v1/reference/installs/delete
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Androidenterprise service.</param>
        /// <param name="enterpriseId">The ID of the enterprise.</param>
        /// <param name="userId">The ID of the user.</param>
        /// <param name="deviceId">The Android ID of the device.</param>
        /// <param name="installId">The ID of the product represented by the install, e.g. "app:com.google.android.gm".</param>
        public static void Delete(AndroidenterpriseService service, string enterpriseId, string userId, string deviceId, string installId)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (enterpriseId == null)
                {
                    throw new ArgumentNullException(enterpriseId);
                }
                if (userId == null)
                {
                    throw new ArgumentNullException(userId);
                }
                if (deviceId == null)
                {
                    throw new ArgumentNullException(deviceId);
                }
                if (installId == null)
                {
                    throw new ArgumentNullException(installId);
                }

                // Make the request.
                service.Installs.Delete(enterpriseId, userId, deviceId, installId).Execute();
            }
            catch (Exception ex)
            {
                throw new Exception("Request Installs.Delete failed.", ex);
            }
        }
Esempio n. 7
0
        /// <summary>
        /// Retrieves the details of all apps installed on the specified device.
        /// Documentation https://developers.google.com/androidenterprise/v1/reference/installs/list
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Androidenterprise service.</param>
        /// <param name="enterpriseId">The ID of the enterprise.</param>
        /// <param name="userId">The ID of the user.</param>
        /// <param name="deviceId">The Android ID of the device.</param>
        /// <returns>InstallsListResponseResponse</returns>
        public static InstallsListResponse List(AndroidenterpriseService service, string enterpriseId, string userId, string deviceId)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (enterpriseId == null)
                {
                    throw new ArgumentNullException(enterpriseId);
                }
                if (userId == null)
                {
                    throw new ArgumentNullException(userId);
                }
                if (deviceId == null)
                {
                    throw new ArgumentNullException(deviceId);
                }

                // Make the request.
                return(service.Installs.List(enterpriseId, userId, deviceId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Installs.List failed.", ex);
            }
        }
Esempio n. 8
0
        /// <summary>
        /// Adds or updates a per-user managed configuration for an app for the specified user. This method supports patch semantics.
        /// Documentation https://developers.google.com/androidenterprise/v1/reference/managedconfigurationsforuser/patch
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Androidenterprise service.</param>
        /// <param name="enterpriseId">The ID of the enterprise.</param>
        /// <param name="userId">The ID of the user.</param>
        /// <param name="managedConfigurationForUserId">The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm".</param>
        /// <param name="body">A valid Androidenterprise v1 body.</param>
        /// <returns>ManagedConfigurationResponse</returns>
        public static ManagedConfiguration Patch(AndroidenterpriseService service, string enterpriseId, string userId, string managedConfigurationForUserId, ManagedConfiguration body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (enterpriseId == null)
                {
                    throw new ArgumentNullException(enterpriseId);
                }
                if (userId == null)
                {
                    throw new ArgumentNullException(userId);
                }
                if (managedConfigurationForUserId == null)
                {
                    throw new ArgumentNullException(managedConfigurationForUserId);
                }

                // Make the request.
                return(service.Managedconfigurationsforuser.Patch(body, enterpriseId, userId, managedConfigurationForUserId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Managedconfigurationsforuser.Patch failed.", ex);
            }
        }
        /// <summary>
        /// Sets the store layout for the enterprise. By default, storeLayoutType is set to "basic" and the basic store layout is enabled. The basic layout only contains apps approved by the admin, and that have been added to the available product set for a user (using the  setAvailableProductSet call). Apps on the page are sorted in order of their product ID value. If you create a custom store layout (by setting storeLayoutType = "custom" and setting a homepage), the basic store layout is disabled.
        /// Documentation https://developers.google.com/androidenterprise/v1/reference/enterprises/setStoreLayout
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Androidenterprise service.</param>
        /// <param name="enterpriseId">The ID of the enterprise.</param>
        /// <param name="body">A valid Androidenterprise v1 body.</param>
        /// <returns>StoreLayoutResponse</returns>
        public static StoreLayout SetStoreLayout(AndroidenterpriseService service, string enterpriseId, StoreLayout body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (enterpriseId == null)
                {
                    throw new ArgumentNullException(enterpriseId);
                }

                // Make the request.
                return(service.Enterprises.SetStoreLayout(body, enterpriseId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Enterprises.SetStoreLayout failed.", ex);
            }
        }
Esempio n. 10
0
        /// <summary>
        /// Removes a per-user managed configuration for an app for the specified user.
        /// Documentation https://developers.google.com/androidenterprise/v1/reference/managedconfigurationsforuser/delete
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Androidenterprise service.</param>
        /// <param name="enterpriseId">The ID of the enterprise.</param>
        /// <param name="userId">The ID of the user.</param>
        /// <param name="managedConfigurationForUserId">The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm".</param>
        public static void Delete(AndroidenterpriseService service, string enterpriseId, string userId, string managedConfigurationForUserId)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (enterpriseId == null)
                {
                    throw new ArgumentNullException(enterpriseId);
                }
                if (userId == null)
                {
                    throw new ArgumentNullException(userId);
                }
                if (managedConfigurationForUserId == null)
                {
                    throw new ArgumentNullException(managedConfigurationForUserId);
                }

                // Make the request.
                service.Managedconfigurationsforuser.Delete(enterpriseId, userId, managedConfigurationForUserId).Execute();
            }
            catch (Exception ex)
            {
                throw new Exception("Request Managedconfigurationsforuser.Delete failed.", ex);
            }
        }
Esempio n. 11
0
        /// <summary>
        /// Modifies the set of products that a user is entitled to access (referred to as whitelisted products). Only products that are approved or products that were previously approved (products with revoked approval) can be whitelisted.
        /// Documentation https://developers.google.com/androidenterprise/v1/reference/users/setAvailableProductSet
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Androidenterprise service.</param>
        /// <param name="enterpriseId">The ID of the enterprise.</param>
        /// <param name="userId">The ID of the user.</param>
        /// <param name="body">A valid Androidenterprise v1 body.</param>
        /// <returns>ProductSetResponse</returns>
        public static ProductSet SetAvailableProductSet(AndroidenterpriseService service, string enterpriseId, string userId, ProductSet body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (enterpriseId == null)
                {
                    throw new ArgumentNullException(enterpriseId);
                }
                if (userId == null)
                {
                    throw new ArgumentNullException(userId);
                }

                // Make the request.
                return(service.Users.SetAvailableProductSet(body, enterpriseId, userId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Users.SetAvailableProductSet failed.", ex);
            }
        }
        /// <summary>
        /// Approves the specified product and the relevant app permissions, if any. The maximum number of products that you can approve per enterprise customer is 1,000.To learn how to use managed Google Play to design and create a store layout to display approved products to your users, see Store Layout Design.
        /// Documentation https://developers.google.com/androidenterprise/v1/reference/products/approve
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Androidenterprise service.</param>
        /// <param name="enterpriseId">The ID of the enterprise.</param>
        /// <param name="productId">The ID of the product.</param>
        /// <param name="body">A valid Androidenterprise v1 body.</param>
        public static void Approve(AndroidenterpriseService service, string enterpriseId, string productId, ProductsApproveRequest body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (enterpriseId == null)
                {
                    throw new ArgumentNullException(enterpriseId);
                }
                if (productId == null)
                {
                    throw new ArgumentNullException(productId);
                }

                // Make the request.
                service.Products.Approve(body, enterpriseId, productId).Execute();
            }
            catch (Exception ex)
            {
                throw new Exception("Request Products.Approve failed.", ex);
            }
        }
Esempio n. 13
0
        /// <summary>
        /// Retrieves details of an Android app permission for display to an enterprise admin.
        /// Documentation https://developers.google.com/androidenterprise/v1/reference/permissions/get
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Androidenterprise service.</param>
        /// <param name="permissionId">The ID of the permission.</param>
        /// <param name="optional">Optional paramaters.</param>
        /// <returns>PermissionResponse</returns>
        public static Permission Get(AndroidenterpriseService service, string permissionId, PermissionsGetOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (permissionId == null)
                {
                    throw new ArgumentNullException(permissionId);
                }

                // Building the initial request.
                var request = service.Permissions.Get(permissionId);

                // Applying optional parameters to the request.
                request = (PermissionsResource.GetRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Permissions.Get failed.", ex);
            }
        }
        /// <summary>
        /// Retrieves the Android app permissions required by this app.
        /// Documentation https://developers.google.com/androidenterprise/v1/reference/products/getPermissions
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Androidenterprise service.</param>
        /// <param name="enterpriseId">The ID of the enterprise.</param>
        /// <param name="productId">The ID of the product.</param>
        /// <returns>ProductPermissionsResponse</returns>
        public static ProductPermissions GetPermissions(AndroidenterpriseService service, string enterpriseId, string productId)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (enterpriseId == null)
                {
                    throw new ArgumentNullException(enterpriseId);
                }
                if (productId == null)
                {
                    throw new ArgumentNullException(productId);
                }

                // Make the request.
                return(service.Products.GetPermissions(enterpriseId, productId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Products.GetPermissions failed.", ex);
            }
        }
        /// <summary>
        /// Retrieves the schema that defines the configurable properties for this product. All products have a schema, but this schema may be empty if no managed configurations have been defined. This schema can be used to populate a UI that allows an admin to configure the product. To apply a managed configuration based on the schema obtained using this API, see Managed Configurations through Play.
        /// Documentation https://developers.google.com/androidenterprise/v1/reference/products/getAppRestrictionsSchema
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Androidenterprise service.</param>
        /// <param name="enterpriseId">The ID of the enterprise.</param>
        /// <param name="productId">The ID of the product.</param>
        /// <param name="optional">Optional paramaters.</param>
        /// <returns>AppRestrictionsSchemaResponse</returns>
        public static AppRestrictionsSchema GetAppRestrictionsSchema(AndroidenterpriseService service, string enterpriseId, string productId, ProductsGetAppRestrictionsSchemaOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (enterpriseId == null)
                {
                    throw new ArgumentNullException(enterpriseId);
                }
                if (productId == null)
                {
                    throw new ArgumentNullException(productId);
                }

                // Building the initial request.
                var request = service.Products.GetAppRestrictionsSchema(enterpriseId, productId);

                // Applying optional parameters to the request.
                request = (ProductsResource.GetAppRestrictionsSchemaRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Products.GetAppRestrictionsSchema failed.", ex);
            }
        }
Esempio n. 16
0
        /// <summary>
        /// Generates an authentication token which the device policy client can use to provision the given EMM-managed user account on a device. The generated token is single-use and expires after a few minutes.This call only works with EMM-managed accounts.
        /// Documentation https://developers.google.com/androidenterprise/v1/reference/users/generateAuthenticationToken
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Androidenterprise service.</param>
        /// <param name="enterpriseId">The ID of the enterprise.</param>
        /// <param name="userId">The ID of the user.</param>
        /// <returns>AuthenticationTokenResponse</returns>
        public static AuthenticationToken GenerateAuthenticationToken(AndroidenterpriseService service, string enterpriseId, string userId)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (enterpriseId == null)
                {
                    throw new ArgumentNullException(enterpriseId);
                }
                if (userId == null)
                {
                    throw new ArgumentNullException(userId);
                }

                // Make the request.
                return(service.Users.GenerateAuthenticationToken(enterpriseId, userId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Users.GenerateAuthenticationToken failed.", ex);
            }
        }
Esempio n. 17
0
        /// <summary>
        /// Retrieves details of an entitlement.
        /// Documentation https://developers.google.com/androidenterprise/v1/reference/entitlements/get
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Androidenterprise service.</param>
        /// <param name="enterpriseId">The ID of the enterprise.</param>
        /// <param name="userId">The ID of the user.</param>
        /// <param name="entitlementId">The ID of the entitlement (a product ID), e.g. "app:com.google.android.gm".</param>
        /// <returns>EntitlementResponse</returns>
        public static Entitlement Get(AndroidenterpriseService service, string enterpriseId, string userId, string entitlementId)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (enterpriseId == null)
                {
                    throw new ArgumentNullException(enterpriseId);
                }
                if (userId == null)
                {
                    throw new ArgumentNullException(userId);
                }
                if (entitlementId == null)
                {
                    throw new ArgumentNullException(entitlementId);
                }

                // Make the request.
                return(service.Entitlements.Get(enterpriseId, userId, entitlementId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Entitlements.Get failed.", ex);
            }
        }
        /// <summary>
        /// Returns a service account and credentials. The service account can be bound to the enterprise by calling setAccount. The service account is unique to this enterprise and EMM, and will be deleted if the enterprise is unbound. The credentials contain private key data and are not stored server-side.This method can only be called after calling Enterprises.Enroll or Enterprises.CompleteSignup, and before Enterprises.SetAccount; at other times it will return an error.Subsequent calls after the first will generate a new, unique set of credentials, and invalidate the previously generated credentials.Once the service account is bound to the enterprise, it can be managed using the serviceAccountKeys resource.
        /// Documentation https://developers.google.com/androidenterprise/v1/reference/enterprises/getServiceAccount
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Androidenterprise service.</param>
        /// <param name="enterpriseId">The ID of the enterprise.</param>
        /// <param name="optional">Optional paramaters.</param>
        /// <returns>ServiceAccountResponse</returns>
        public static ServiceAccount GetServiceAccount(AndroidenterpriseService service, string enterpriseId, EnterprisesGetServiceAccountOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (enterpriseId == null)
                {
                    throw new ArgumentNullException(enterpriseId);
                }

                // Building the initial request.
                var request = service.Enterprises.GetServiceAccount(enterpriseId);

                // Applying optional parameters to the request.
                request = (EnterprisesResource.GetServiceAccountRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Enterprises.GetServiceAccount failed.", ex);
            }
        }
        /// <summary>
        /// Deletes a cluster.
        /// Documentation https://developers.google.com/androidenterprise/v1/reference/storelayoutclusters/delete
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Androidenterprise service.</param>
        /// <param name="enterpriseId">The ID of the enterprise.</param>
        /// <param name="pageId">The ID of the page.</param>
        /// <param name="clusterId">The ID of the cluster.</param>
        public static void Delete(AndroidenterpriseService service, string enterpriseId, string pageId, string clusterId)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (enterpriseId == null)
                {
                    throw new ArgumentNullException(enterpriseId);
                }
                if (pageId == null)
                {
                    throw new ArgumentNullException(pageId);
                }
                if (clusterId == null)
                {
                    throw new ArgumentNullException(clusterId);
                }

                // Make the request.
                service.Storelayoutclusters.Delete(enterpriseId, pageId, clusterId).Execute();
            }
            catch (Exception ex)
            {
                throw new Exception("Request Storelayoutclusters.Delete failed.", ex);
            }
        }
Esempio n. 20
0
        /// <summary>
        /// Lists all the per-user managed configurations for the specified user. Only the ID is set.
        /// Documentation https://developers.google.com/androidenterprise/v1/reference/managedconfigurationsforuser/list
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Androidenterprise service.</param>
        /// <param name="enterpriseId">The ID of the enterprise.</param>
        /// <param name="userId">The ID of the user.</param>
        /// <returns>ManagedConfigurationsForUserListResponseResponse</returns>
        public static ManagedConfigurationsForUserListResponse List(AndroidenterpriseService service, string enterpriseId, string userId)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (enterpriseId == null)
                {
                    throw new ArgumentNullException(enterpriseId);
                }
                if (userId == null)
                {
                    throw new ArgumentNullException(userId);
                }

                // Make the request.
                return(service.Managedconfigurationsforuser.List(enterpriseId, userId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Managedconfigurationsforuser.List failed.", ex);
            }
        }
Esempio n. 21
0
        /// <summary>
        /// Retrieves details of a store page.
        /// Documentation https://developers.google.com/androidenterprise/v1/reference/storelayoutpages/get
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Androidenterprise service.</param>
        /// <param name="enterpriseId">The ID of the enterprise.</param>
        /// <param name="pageId">The ID of the page.</param>
        /// <returns>StorePageResponse</returns>
        public static StorePage Get(AndroidenterpriseService service, string enterpriseId, string pageId)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (enterpriseId == null)
                {
                    throw new ArgumentNullException(enterpriseId);
                }
                if (pageId == null)
                {
                    throw new ArgumentNullException(pageId);
                }

                // Make the request.
                return(service.Storelayoutpages.Get(enterpriseId, pageId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Storelayoutpages.Get failed.", ex);
            }
        }
        /// <summary>
        /// Generates new credentials for the service account associated with this enterprise. The calling service account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount.Only the type of the key should be populated in the resource to be inserted.
        /// Documentation https://developers.google.com/androidenterprise/v1/reference/serviceaccountkeys/insert
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Androidenterprise service.</param>
        /// <param name="enterpriseId">The ID of the enterprise.</param>
        /// <param name="body">A valid Androidenterprise v1 body.</param>
        /// <returns>ServiceAccountKeyResponse</returns>
        public static ServiceAccountKey Insert(AndroidenterpriseService service, string enterpriseId, ServiceAccountKey body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (enterpriseId == null)
                {
                    throw new ArgumentNullException(enterpriseId);
                }

                // Make the request.
                return(service.Serviceaccountkeys.Insert(body, enterpriseId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Serviceaccountkeys.Insert failed.", ex);
            }
        }
        /// <summary>
        /// Removes and invalidates the specified credentials for the service account associated with this enterprise. The calling service account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount.
        /// Documentation https://developers.google.com/androidenterprise/v1/reference/serviceaccountkeys/delete
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Androidenterprise service.</param>
        /// <param name="enterpriseId">The ID of the enterprise.</param>
        /// <param name="keyId">The ID of the key.</param>
        public static void Delete(AndroidenterpriseService service, string enterpriseId, string keyId)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (enterpriseId == null)
                {
                    throw new ArgumentNullException(enterpriseId);
                }
                if (keyId == null)
                {
                    throw new ArgumentNullException(keyId);
                }

                // Make the request.
                service.Serviceaccountkeys.Delete(enterpriseId, keyId).Execute();
            }
            catch (Exception ex)
            {
                throw new Exception("Request Serviceaccountkeys.Delete failed.", ex);
            }
        }
Esempio n. 24
0
        /// <summary>
        /// Adds or updates an entitlement to an app for a user.
        /// Documentation https://developers.google.com/androidenterprise/v1/reference/entitlements/update
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Androidenterprise service.</param>
        /// <param name="enterpriseId">The ID of the enterprise.</param>
        /// <param name="userId">The ID of the user.</param>
        /// <param name="entitlementId">The ID of the entitlement (a product ID), e.g. "app:com.google.android.gm".</param>
        /// <param name="body">A valid Androidenterprise v1 body.</param>
        /// <param name="optional">Optional paramaters.</param>
        /// <returns>EntitlementResponse</returns>
        public static Entitlement Update(AndroidenterpriseService service, string enterpriseId, string userId, string entitlementId, Entitlement body, EntitlementsUpdateOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (enterpriseId == null)
                {
                    throw new ArgumentNullException(enterpriseId);
                }
                if (userId == null)
                {
                    throw new ArgumentNullException(userId);
                }
                if (entitlementId == null)
                {
                    throw new ArgumentNullException(entitlementId);
                }

                // Building the initial request.
                var request = service.Entitlements.Update(body, enterpriseId, userId, entitlementId);

                // Applying optional parameters to the request.
                request = (EntitlementsResource.UpdateRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Entitlements.Update failed.", ex);
            }
        }
        /// <summary>
        /// Unenrolls an enterprise from the calling EMM.
        /// Documentation https://developers.google.com/androidenterprise/v1/reference/enterprises/unenroll
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Androidenterprise service.</param>
        /// <param name="enterpriseId">The ID of the enterprise.</param>
        public static void Unenroll(AndroidenterpriseService service, string enterpriseId)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (enterpriseId == null)
                {
                    throw new ArgumentNullException(enterpriseId);
                }

                // Make the request.
                service.Enterprises.Unenroll(enterpriseId).Execute();
            }
            catch (Exception ex)
            {
                throw new Exception("Request Enterprises.Unenroll failed.", ex);
            }
        }
        /// <summary>
        /// Returns the Android Device Policy config resource.
        /// Documentation https://developers.google.com/androidenterprise/v1/reference/enterprises/getAndroidDevicePolicyConfig
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Androidenterprise service.</param>
        /// <param name="enterpriseId">The ID of the enterprise.</param>
        /// <returns>AndroidDevicePolicyConfigResponse</returns>
        public static AndroidDevicePolicyConfig GetAndroidDevicePolicyConfig(AndroidenterpriseService service, string enterpriseId)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (enterpriseId == null)
                {
                    throw new ArgumentNullException(enterpriseId);
                }

                // Make the request.
                return(service.Enterprises.GetAndroidDevicePolicyConfig(enterpriseId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Enterprises.GetAndroidDevicePolicyConfig failed.", ex);
            }
        }
        /// <summary>
        /// Looks up an enterprise by domain name. This is only supported for enterprises created via the Google-initiated creation flow. Lookup of the id is not needed for enterprises created via the EMM-initiated flow since the EMM learns the enterprise ID in the callback specified in the Enterprises.generateSignupUrl call.
        /// Documentation https://developers.google.com/androidenterprise/v1/reference/enterprises/list
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Androidenterprise service.</param>
        /// <param name="domain">The exact primary domain name of the enterprise to look up.</param>
        /// <returns>EnterprisesListResponseResponse</returns>
        public static EnterprisesListResponse List(AndroidenterpriseService service, string domain)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (domain == null)
                {
                    throw new ArgumentNullException(domain);
                }

                // Make the request.
                return(service.Enterprises.List(domain).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Enterprises.List failed.", ex);
            }
        }
Esempio n. 28
0
        /// <summary>
        /// Requests to install the latest version of an app to a device. If the app is already installed, then it is updated to the latest version if necessary. This method supports patch semantics.
        /// Documentation https://developers.google.com/androidenterprise/v1/reference/installs/patch
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Androidenterprise service.</param>
        /// <param name="enterpriseId">The ID of the enterprise.</param>
        /// <param name="userId">The ID of the user.</param>
        /// <param name="deviceId">The Android ID of the device.</param>
        /// <param name="installId">The ID of the product represented by the install, e.g. "app:com.google.android.gm".</param>
        /// <param name="body">A valid Androidenterprise v1 body.</param>
        /// <returns>InstallResponse</returns>
        public static Install Patch(AndroidenterpriseService service, string enterpriseId, string userId, string deviceId, string installId, Install body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (enterpriseId == null)
                {
                    throw new ArgumentNullException(enterpriseId);
                }
                if (userId == null)
                {
                    throw new ArgumentNullException(userId);
                }
                if (deviceId == null)
                {
                    throw new ArgumentNullException(deviceId);
                }
                if (installId == null)
                {
                    throw new ArgumentNullException(installId);
                }

                // Make the request.
                return(service.Installs.Patch(body, enterpriseId, userId, deviceId, installId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Installs.Patch failed.", ex);
            }
        }
        /// <summary>
        /// Acknowledges notifications that were received from Enterprises.PullNotificationSet to prevent subsequent calls from returning the same notifications.
        /// Documentation https://developers.google.com/androidenterprise/v1/reference/enterprises/acknowledgeNotificationSet
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Androidenterprise service.</param>
        /// <param name="optional">Optional paramaters.</param>
        public static void AcknowledgeNotificationSet(AndroidenterpriseService service, EnterprisesAcknowledgeNotificationSetOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }

                // Building the initial request.
                var request = service.Enterprises.AcknowledgeNotificationSet();

                // Applying optional parameters to the request.
                request = (EnterprisesResource.AcknowledgeNotificationSetRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                request.Execute();
            }
            catch (Exception ex)
            {
                throw new Exception("Request Enterprises.AcknowledgeNotificationSet failed.", ex);
            }
        }
        /// <summary>
        /// Generates a sign-up URL.
        /// Documentation https://developers.google.com/androidenterprise/v1/reference/enterprises/generateSignupUrl
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Androidenterprise service.</param>
        /// <param name="optional">Optional paramaters.</param>
        /// <returns>SignupInfoResponse</returns>
        public static SignupInfo GenerateSignupUrl(AndroidenterpriseService service, EnterprisesGenerateSignupUrlOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }

                // Building the initial request.
                var request = service.Enterprises.GenerateSignupUrl();

                // Applying optional parameters to the request.
                request = (EnterprisesResource.GenerateSignupUrlRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Enterprises.GenerateSignupUrl failed.", ex);
            }
        }