hi i have the answer to this in case anyone needs it:
DeliveryRuleRequestSchemeCondition deliveryRulesCondition = new DeliveryRuleRequestSchemeCondition()
.withParameters(
new RequestSchemeMatchConditionParameters()
.withMatchValues(
Arrays.asList(RequestSchemeMatchConditionParametersMatchValuesItem.HTTP)));
deliveryRulesCondition.validate();
UrlRedirectActionParameters deliveryRulesActionParameters = new UrlRedirectActionParameters()
.withRedirectType(RedirectType.TEMPORARY_REDIRECT).withDestinationProtocol(DestinationProtocol.HTTPS)
.withCustomHostname("");
UrlRedirectAction deliveryRulesAction = new UrlRedirectAction().withParameters(deliveryRulesActionParameters);
deliveryRulesAction.validate();
DeliveryRule cdnRrule = new DeliveryRule()
.withName("HTTP to HTTPS redirect policy rule")
.withOrder(1)
.withConditions(Arrays.asList(deliveryRulesCondition))
.withActions(Arrays.asList(deliveryRulesAction));
cdnRrule.validate();
EndpointUpdateParameters endpointUpdateParameters = new EndpointUpdateParameters()
.withDeliveryPolicy(new EndpointPropertiesUpdateParametersDeliveryPolicy()
.withRules(Arrays.asList(cdnRrule))
.withDescription("HTTP to HTTPS redirect policy"));
azureResourceManager.cdnProfiles()
.manager()
.serviceClient()
.getEndpoints()
.update(
resourceGroupName,
profileName,
endpointName,
endpointUpdateParameters);