Skip to content

Commit 4879bd3

Browse files
committed
Cosmetic changes for consistency with generator
1 parent 99fad3a commit 4879bd3

6 files changed

+184
-187
lines changed

provider/core_instance_resource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ func InstanceResource() *schema.Resource {
159159
},
160160
"metadata": {
161161
Type: schema.TypeMap,
162-
Elem: schema.TypeString,
163162
Optional: true,
164163
ForceNew: true,
164+
Elem: schema.TypeString,
165165
},
166166
"preserve_boot_volume": {
167167
Type: schema.TypeBool,

provider/core_security_list_resource.go

Lines changed: 144 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,78 @@ func (s *SecurityListResourceCrud) SetData() {
601601

602602
}
603603

604+
func mapToEgressSecurityRule(raw map[string]interface{}) oci_core.EgressSecurityRule {
605+
result := oci_core.EgressSecurityRule{}
606+
607+
if destination, ok := raw["destination"]; ok {
608+
tmp := destination.(string)
609+
result.Destination = &tmp
610+
}
611+
612+
if icmpOptions, ok := raw["icmp_options"]; ok {
613+
if tmpList := icmpOptions.([]interface{}); len(tmpList) > 0 {
614+
tmp := mapToIcmpOptions(tmpList[0].(map[string]interface{}))
615+
result.IcmpOptions = &tmp
616+
}
617+
}
618+
619+
if protocol, ok := raw["protocol"]; ok {
620+
tmp := protocol.(string)
621+
result.Protocol = &tmp
622+
}
623+
624+
if stateless, ok := raw["stateless"]; ok {
625+
tmp := stateless.(bool)
626+
result.IsStateless = &tmp
627+
}
628+
629+
if tcpOptions, ok := raw["tcp_options"]; ok {
630+
if tmpList := tcpOptions.([]interface{}); len(tmpList) > 0 {
631+
tmp := mapToTcpOptions(tmpList[0].(map[string]interface{}))
632+
result.TcpOptions = &tmp
633+
}
634+
}
635+
636+
if udpOptions, ok := raw["udp_options"]; ok {
637+
if tmpList := udpOptions.([]interface{}); len(tmpList) > 0 {
638+
tmp := mapToUdpOptions(tmpList[0].(map[string]interface{}))
639+
result.UdpOptions = &tmp
640+
}
641+
}
642+
643+
return result
644+
}
645+
646+
func EgressSecurityRuleToMap(obj oci_core.EgressSecurityRule) map[string]interface{} {
647+
result := map[string]interface{}{}
648+
649+
if obj.Destination != nil {
650+
result["destination"] = string(*obj.Destination)
651+
}
652+
653+
if obj.IcmpOptions != nil {
654+
result["icmp_options"] = []interface{}{IcmpOptionsToMap(obj.IcmpOptions)}
655+
}
656+
657+
if obj.Protocol != nil {
658+
result["protocol"] = string(*obj.Protocol)
659+
}
660+
661+
if obj.IsStateless != nil {
662+
result["stateless"] = bool(*obj.IsStateless)
663+
}
664+
665+
if obj.TcpOptions != nil {
666+
result["tcp_options"] = []interface{}{TcpOptionsToMap(obj.TcpOptions)}
667+
}
668+
669+
if obj.UdpOptions != nil {
670+
result["udp_options"] = []interface{}{UdpOptionsToMap(obj.UdpOptions)}
671+
}
672+
673+
return result
674+
}
675+
604676
func mapToIcmpOptions(raw map[string]interface{}) oci_core.IcmpOptions {
605677
result := oci_core.IcmpOptions{}
606678

@@ -635,6 +707,78 @@ func IcmpOptionsToMap(obj *oci_core.IcmpOptions) map[string]interface{} {
635707
return result
636708
}
637709

710+
func mapToIngressSecurityRule(raw map[string]interface{}) oci_core.IngressSecurityRule {
711+
result := oci_core.IngressSecurityRule{}
712+
713+
if icmpOptions, ok := raw["icmp_options"]; ok {
714+
if tmpList := icmpOptions.([]interface{}); len(tmpList) > 0 {
715+
tmp := mapToIcmpOptions(tmpList[0].(map[string]interface{}))
716+
result.IcmpOptions = &tmp
717+
}
718+
}
719+
720+
if protocol, ok := raw["protocol"]; ok {
721+
tmp := protocol.(string)
722+
result.Protocol = &tmp
723+
}
724+
725+
if source, ok := raw["source"]; ok {
726+
tmp := source.(string)
727+
result.Source = &tmp
728+
}
729+
730+
if stateless, ok := raw["stateless"]; ok {
731+
tmp := stateless.(bool)
732+
result.IsStateless = &tmp
733+
}
734+
735+
if tcpOptions, ok := raw["tcp_options"]; ok {
736+
if tmpList := tcpOptions.([]interface{}); len(tmpList) > 0 {
737+
tmp := mapToTcpOptions(tmpList[0].(map[string]interface{}))
738+
result.TcpOptions = &tmp
739+
}
740+
}
741+
742+
if udpOptions, ok := raw["udp_options"]; ok {
743+
if tmpList := udpOptions.([]interface{}); len(tmpList) > 0 {
744+
tmp := mapToUdpOptions(tmpList[0].(map[string]interface{}))
745+
result.UdpOptions = &tmp
746+
}
747+
}
748+
749+
return result
750+
}
751+
752+
func IngressSecurityRuleToMap(obj oci_core.IngressSecurityRule) map[string]interface{} {
753+
result := map[string]interface{}{}
754+
755+
if obj.IcmpOptions != nil {
756+
result["icmp_options"] = []interface{}{IcmpOptionsToMap(obj.IcmpOptions)}
757+
}
758+
759+
if obj.Protocol != nil {
760+
result["protocol"] = string(*obj.Protocol)
761+
}
762+
763+
if obj.Source != nil {
764+
result["source"] = string(*obj.Source)
765+
}
766+
767+
if obj.IsStateless != nil {
768+
result["stateless"] = bool(*obj.IsStateless)
769+
}
770+
771+
if obj.TcpOptions != nil {
772+
result["tcp_options"] = []interface{}{TcpOptionsToMap(obj.TcpOptions)}
773+
}
774+
775+
if obj.UdpOptions != nil {
776+
result["udp_options"] = []interface{}{UdpOptionsToMap(obj.UdpOptions)}
777+
}
778+
779+
return result
780+
}
781+
638782
func mapToPortRange(raw map[string]interface{}) oci_core.PortRange {
639783
result := oci_core.PortRange{}
640784

@@ -748,147 +892,3 @@ func UdpOptionsToMap(obj *oci_core.UdpOptions) map[string]interface{} {
748892

749893
return result
750894
}
751-
752-
func mapToEgressSecurityRule(raw map[string]interface{}) oci_core.EgressSecurityRule {
753-
result := oci_core.EgressSecurityRule{}
754-
755-
if destination, ok := raw["destination"]; ok {
756-
tmp := destination.(string)
757-
result.Destination = &tmp
758-
}
759-
760-
if icmpOptions, ok := raw["icmp_options"]; ok {
761-
if tmpList := icmpOptions.([]interface{}); len(tmpList) > 0 {
762-
tmp := mapToIcmpOptions(tmpList[0].(map[string]interface{}))
763-
result.IcmpOptions = &tmp
764-
}
765-
}
766-
767-
if protocol, ok := raw["protocol"]; ok {
768-
tmp := protocol.(string)
769-
result.Protocol = &tmp
770-
}
771-
772-
if stateless, ok := raw["stateless"]; ok {
773-
tmp := stateless.(bool)
774-
result.IsStateless = &tmp
775-
}
776-
777-
if tcpOptions, ok := raw["tcp_options"]; ok {
778-
if tmpList := tcpOptions.([]interface{}); len(tmpList) > 0 {
779-
tmp := mapToTcpOptions(tmpList[0].(map[string]interface{}))
780-
result.TcpOptions = &tmp
781-
}
782-
}
783-
784-
if udpOptions, ok := raw["udp_options"]; ok {
785-
if tmpList := udpOptions.([]interface{}); len(tmpList) > 0 {
786-
tmp := mapToUdpOptions(tmpList[0].(map[string]interface{}))
787-
result.UdpOptions = &tmp
788-
}
789-
}
790-
791-
return result
792-
}
793-
794-
func EgressSecurityRuleToMap(obj oci_core.EgressSecurityRule) map[string]interface{} {
795-
result := map[string]interface{}{}
796-
797-
if obj.Destination != nil {
798-
result["destination"] = string(*obj.Destination)
799-
}
800-
801-
if obj.IcmpOptions != nil {
802-
result["icmp_options"] = []interface{}{IcmpOptionsToMap(obj.IcmpOptions)}
803-
}
804-
805-
if obj.Protocol != nil {
806-
result["protocol"] = string(*obj.Protocol)
807-
}
808-
809-
if obj.IsStateless != nil {
810-
result["stateless"] = bool(*obj.IsStateless)
811-
}
812-
813-
if obj.TcpOptions != nil {
814-
result["tcp_options"] = []interface{}{TcpOptionsToMap(obj.TcpOptions)}
815-
}
816-
817-
if obj.UdpOptions != nil {
818-
result["udp_options"] = []interface{}{UdpOptionsToMap(obj.UdpOptions)}
819-
}
820-
821-
return result
822-
}
823-
824-
func mapToIngressSecurityRule(raw map[string]interface{}) oci_core.IngressSecurityRule {
825-
result := oci_core.IngressSecurityRule{}
826-
827-
if icmpOptions, ok := raw["icmp_options"]; ok {
828-
if tmpList := icmpOptions.([]interface{}); len(tmpList) > 0 {
829-
tmp := mapToIcmpOptions(tmpList[0].(map[string]interface{}))
830-
result.IcmpOptions = &tmp
831-
}
832-
}
833-
834-
if protocol, ok := raw["protocol"]; ok {
835-
tmp := protocol.(string)
836-
result.Protocol = &tmp
837-
}
838-
839-
if source, ok := raw["source"]; ok {
840-
tmp := source.(string)
841-
result.Source = &tmp
842-
}
843-
844-
if stateless, ok := raw["stateless"]; ok {
845-
tmp := stateless.(bool)
846-
result.IsStateless = &tmp
847-
}
848-
849-
if tcpOptions, ok := raw["tcp_options"]; ok {
850-
if tmpList := tcpOptions.([]interface{}); len(tmpList) > 0 {
851-
tmp := mapToTcpOptions(tmpList[0].(map[string]interface{}))
852-
result.TcpOptions = &tmp
853-
}
854-
}
855-
856-
if udpOptions, ok := raw["udp_options"]; ok {
857-
if tmpList := udpOptions.([]interface{}); len(tmpList) > 0 {
858-
tmp := mapToUdpOptions(tmpList[0].(map[string]interface{}))
859-
result.UdpOptions = &tmp
860-
}
861-
}
862-
863-
return result
864-
}
865-
866-
func IngressSecurityRuleToMap(obj oci_core.IngressSecurityRule) map[string]interface{} {
867-
result := map[string]interface{}{}
868-
869-
if obj.IcmpOptions != nil {
870-
result["icmp_options"] = []interface{}{IcmpOptionsToMap(obj.IcmpOptions)}
871-
}
872-
873-
if obj.Protocol != nil {
874-
result["protocol"] = string(*obj.Protocol)
875-
}
876-
877-
if obj.Source != nil {
878-
result["source"] = string(*obj.Source)
879-
}
880-
881-
if obj.IsStateless != nil {
882-
result["stateless"] = bool(*obj.IsStateless)
883-
}
884-
885-
if obj.TcpOptions != nil {
886-
result["tcp_options"] = []interface{}{TcpOptionsToMap(obj.TcpOptions)}
887-
}
888-
889-
if obj.UdpOptions != nil {
890-
result["udp_options"] = []interface{}{UdpOptionsToMap(obj.UdpOptions)}
891-
}
892-
893-
return result
894-
}

provider/database_db_system_resource.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -648,8 +648,8 @@ func mapToCreateDatabaseDetails(raw map[string]interface{}) oci_database.CreateD
648648
}
649649

650650
if dbWorkload, ok := raw["db_workload"]; ok {
651-
tmp := dbWorkload.(string)
652-
result.DbWorkload = oci_database.CreateDatabaseDetailsDbWorkloadEnum(tmp)
651+
tmp := oci_database.CreateDatabaseDetailsDbWorkloadEnum(dbWorkload.(string))
652+
result.DbWorkload = tmp
653653
}
654654

655655
if ncharacterSet, ok := raw["ncharacter_set"]; ok {

0 commit comments

Comments
 (0)